r_emacs | Unsorted

Telegram-канал r_emacs - /r/emacs

70

This channel is a feed for r/emacs. @r_channels @reddit2telegram

Subscribe to a channel

/r/emacs

Run Emacs in your browser with v86
https://play.emacsen.de/

https://redd.it/1rznu4l
@r_emacs

Читать полностью…

/r/emacs

repo-grep.el – update

A few additions since the original post:

\- Optional ripgrep backend for faster searches on large repositories

\- Configurable .gitignore handling when using rg

\- Optional separate grep buffers to keep previous results

\- In-buffer result filtering via repo-grep-filter

Now at v1.9.0. Available on MELPA.

https://github.com/BHFock/repo-grep

https://redd.it/1rz63on
@r_emacs

Читать полностью…

/r/emacs

Issue opening shells in tramp

When I connect to a remote server and try to open a shell there (either vterm or shell) I get the following error:

error: "Invalid format character: ‘%w’"
format-spec: Invalid format character: ‘%w’


Does anybody know what could be going on here? This is on GNU Emacs 30.2.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.51, cairo version 1.18.4) of 2026-03-20 which I just compiled from source and opening shell on remote servers used to work correctly.

https://redd.it/1ryw600
@r_emacs

Читать полностью…

/r/emacs

Emacs Elements channel is gone!

Hello everyone,

I remember an old post here where people were celebrating the return of Emacs Elements, the channel that had some amazing tutorials about Emacs. I just searched for it and found that the creator is gone and their YouTube channel deleted:
emacselements" rel="nofollow">https://www.youtube.com/@emacselements

All their old videos are gone, and so is their website:
https://emacselements.com/

P.S.: This is merely a satire to the post linked above, but I would like to shoutout emacs.tv for a list of emacs related videos.

https://redd.it/1rxuqpt
@r_emacs

Читать полностью…

/r/emacs

Long list of doubts - Configuration, Workflow and Lack of Consensus?

Hello, r/emacs,

If you answer and read it all, thank you in advance haha.

Long time vim and now, for a while as well, helix user.

I made the switch from nvim -> hx because I really love minimal config stuff, my ~/.config/helix/config.toml has 26 lines total.

I have some assumptions and some doubts here about emacs as I am to try it for a very very long time.

# Objective and packages I want to have (two, I think)

evil mode and a theme, for now, I think.

Would love to get some R, Python, C and LaTeX autocompletion as well, I assume this would be done via something like (setq r-mode t) as it is for evil?

# Directory? Single file?

Like nvim, there seems to be no consensus on how to structure a config?

I have seen a video of a guy using ~/.config/emacs/config.org, which, to my understanding, via org-babel-load-file just translates an org file (which, again, I assume would be similar to a .Rmd file or .ipynb file) to an emacs-lisp file to be loaded at startup and load needed packages.

Should I be doing this for the sake of documentation? Or should I have a ~/.emacs.d? ~/.emacs?

I have played around with it and as soon as I load emacs, the files or directories get poluted with code generated from the loading. Is this avoidable? I would like to have it cleaner, but if not its ok as well.

# Install packages via <M-x list-packages>

Before calling them in my config files, I should be installing them from list-packages, no? Do I have to add:

(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")))

anywhere? The packages seem to be already there, so... yeah? I don't need it right? I should just press I and X to install them?

# Package managers

For my needs, I would think package.el would be suffcient no? That same config.org guy used elpaca, which seems honestly overkill? I don't want to stay away from defaults

# Require vs use-package

This straight up I do not understand. As I read, one seems to be used for lazy loading of packages? I would only want to load R or C mode once I open either a .R or .c file, but does that coundt as "lazy loading"?

# Workflow questions about eshell and term

I develop R and C libraries at work.

My workflow usually is one terminal window for the compiler / language REPL / console, whatever and another one for editing code.

I have seen Mr. Tsoding just run gcc main.c from the tiny text buffer at the bottom and then ./a as well, do I need to call always <M-x term> or is there a shortcut for this / better way of developing in emacs?

# Keybinds

Honest answer, for those of you who came from vim related editors, did you switch to emacs native binds? I feel crazy always being in insert mode

# Honestly, thank you

For the help in advance, I really want to make the switch and this editor seems very cool.

https://redd.it/1ryggrw
@r_emacs

Читать полностью…

/r/emacs

I stopped restarting my Emacs config every year — this is what fixed it

I used to rebuild my Emacs config from scratch every year or so.

Same pattern every time:
- copy snippets from everywhere
- things work… until they don’t
- startup gets weird, state leaks, changes become risky
- eventually: delete everything and start over

I wanted something that would not collapse over time.

This is what I ended up with:
emacs.d

The core idea is simple:

- keep startup minimal and predictable (early-init.el)
- have a single bootstrap layer (init.el)
- move everything else into topical modules ("mixins")
- minimise hidden state and side effects
- treat system dependencies as part of the config (not afterthoughts)
- isolate private stuff (API keys, etc.) into encrypted modules

A lot of this direction clicked for me after reading Mastering Emacs and starting from an early version of the Bedrock config — it pushed me to think in terms of structure and long-term maintainability.

It’s not a distro, and not meant to be copy-pasted wholesale.

But if you’ve ever hit “config bankruptcy” and restarted from scratch,
this might give you a different way to structure things.

Happy to answer questions or go deeper on any part.

https://redd.it/1ryp5hv
@r_emacs

Читать полностью…

/r/emacs

embr.el - Emacs Browser - Emacs is the display server. Headless Firefox is the renderer.

https://redd.it/1ry1q5q
@r_emacs

Читать полностью…

/r/emacs

agent-shell 0.47 updates
https://redd.it/1rrs2dq
@r_emacs

Читать полностью…

/r/emacs

Emacs Internal Part 03: Tagged Pointers vs. C++ std::variant, Rust Enums, and LLVM RTTI

Hi r/emacs,

A few days ago, I shared some notes about how Emacs elegantly steals 3 bits from aligned C pointers for type tags. Thanks for all the gentle feedback on that second post. I finally put together the third part of my notes.

Since the last post was about Emacs's `Lisp_Object` and C macros, I naturally started wondering: how does this 40-year-old architecture compare to modern systems programming?

This post is just me quietly comparing Emacs's Tagged Pointers against the tools I see day-to-day as a compiler engineer. It’s fascinating to see the physical tradeoffs between Emacs's extreme memory density (packing everything into a single 64-bit word) and modern C++/Rust's prioritization of type safety over memory padding.

I briefly look at:

Tagged Union (CPP 17 std::variant)
Fat Pointer
Tagged Pointer
LLVM's Custom RTTI

If you enjoy looking at C++ memory layouts or how LLVM handles dynamic typing without standard vtables, you might find it a nice read:

Emacs Internal #03: Tagged Pointers vs. C++ std::variant, Rust Enums, and LLVM RTTI

Happy to hear if I misunderstood any of the C++ or LLVM semantics.

Have a good day!

https://redd.it/1rrptdd
@r_emacs

Читать полностью…

/r/emacs

New package for org templates, like obsidian

Hello guys, I made a package that allows you to define a template folder. You can define multiple folders and directories to organize your templates the way you prefer.

The package loads templates dynamically from these directories and converts them into capture templates automatically. This makes it easier to manage and reuse templates without having to manually define each one in your configuration.

Each file inside the selected directory can be used as a template, allowing you to organize templates by category or context (for example: notes, tasks, projects, etc.).

At the moment the package only supports org-roam, because this is my first Emacs package and I'm still learning. However, the code is simple and it should be easy to adapt it to work with vanilla org-capture as well. I will probably add this support soon.

I would love to receive feedback, suggestions, or ideas. I hope this package can help someone with a similar use case! :)

https://codeberg.org/niqc/org-dynamic-templates

I plan to create a mirror on my GitHub as well, but not for now.

example of a repo

custom variables to edit

example of templates folder

hook on create a new note

after select your template



https://redd.it/1rqu7ec
@r_emacs

Читать полностью…

/r/emacs

PIM: Move from markdown to org

I am currently using quite a bunch of markdown files as my PIM. I use headings, bold / italics, tables, and links to markdown files and reference images (yank-media is great). The markdown files all reside in a common root folder but are otherwise spread over directories. Each directory represents a "project".

I mange my personal TODOs simply using markdown TODOs - [ ] and rgreping over the directory root.


For many years I was an experienced org-user but stopped because it was growing on me. I couldn't find the sweetspot back then where org would be to much and tried to cram everything into org.

I think nowadys I know better. Is there a good way to convert markdown to org files and retain

- structure: headings
- items: bullets and numbering
- links, also to other local files
- tables
- image links

I would leave converting markdown - [ ] to org TODO my task.

https://redd.it/1rrk9en
@r_emacs

Читать полностью…

/r/emacs

Fortnightly Tips, Tricks, and Questions — 2026-03-10 / week 10

This is a thread for smaller, miscellaneous items that might not warrant a full post on their own.

The default sort is new to ensure that new items get attention.

If something gets upvoted and discussed a lot, consider following up with a post!

Search for previous "Tips, Tricks" Threads.

Fortnightly means once every two weeks. We will continue to monitor the mass of confusion resulting from dark corners of English.

https://redd.it/1rplhb1
@r_emacs

Читать полностью…

/r/emacs

Elisp cheat sheet

I have struggled with elisp but a pattern I have noticed is it's probably way more simple than I am making I out to be.
Seems like all you need is key words and parentheses. Is there a cheat sheet that has this?

https://redd.it/1rp3kmn
@r_emacs

Читать полностью…

/r/emacs

helm grep/locate live search issues with point snapping back

Hi everyone. I recently swapped from using helm-ag to use the default helm-do-grep-ag, which uses ripgrep by default, if you have it installed. Ripgrep is rapid, so why not?

I have noticed this odd behaviour in which the point (cursor) would snap back after the search was completed. I have spent some time to reliably reproduce the problem. So say that I want to search for "require use-package", but I typed in "require user", so then I would quickly tap backspace 5 times to go back to "require" and quickly type " use-package". After the search would complete the point would then snap back in between "require" and "use-package". Very annoying thing to be honest, cos there is no easy way to get the point back at the end of the search. So eventually I got used to just waiting for the results after corrections to avoid the snap back.

Last night I though: this is Emacs, surely there is a way to fix this. There is something that is causing it, since it wasn't there before when using helm-ag. Eventually, I figured out that pressing backspace runs a different function than the function used for backspace in say helm-M-x or helm-mini. Indeed the function that is ran for the long async operations (helm-do-grep-ag or helm-locate) when pressing backspace is helm-delete-backward-no-update and not helm-delete-char-backward (which is used in pretty much everything else in helm). Now, I do understand the reason why helm-delete-backward-no-update exists, it is there to prevent frequent computationally heavy calls when pressing backspace. However, it is supposed to wait 1s before refreshing. Not only does it fail to do so when you tap backspace too many times, but it also has this issue with not placing the point at the right place when the timer kicks in. So... the solution was to bind helm-delete-char-backward to the relevant key maps. It is snappy enough as it is anyway when using ripgrep or helm-locate.

The solution if you're not using general:

(with-eval-after-load 'helm-grep
(define-key helm-grep-map (kbd "DEL") #'helm-delete-char-backward)
(define-key helm-grep-map (kbd "<backspace>") #'helm-delete-char-backward)
(define-key helm-locate-map (kbd "DEL") #'helm-delete-char-backward)
(define-key helm-locate-map (kbd "<backspace>") #'helm-delete-char-backward))

If you're using general then you can do this:

(general-define-key
:keymaps '(helm-grep-map
helm-locate-map)
"DEL" 'helm-delete-char-backward
"<backspace>" 'helm-delete-char-backward)

PS.
I'd love to fix the buggy helm-delete-backward-no-update but unfortunately my elisp-fu is not good enough for it. If anyone knows how to fix it, then that would be awesome.

I hope that this minor fix helps someone. Take care of yourself out there fellow Emacsers!

PS 2.
You might want to set the input delay values to slightly higher than the default ones to avoid frequent calls to the underlying functions. E.g.:

(setq helm-grep-input-idle-delay 0.3
helm-input-idle-delay 0.1)



https://redd.it/1roz83i
@r_emacs

Читать полностью…

/r/emacs

First (?) hacked Emacs package
https://github.com/kubernetes-el/kubernetes-el/issues/383

https://redd.it/1rowm5i
@r_emacs

Читать полностью…

/r/emacs

GUI or Terminal, specifically for programming?

So people often say that GUI is better because of variable fontsizes, image rendering, etc. But what about specifically for programming?

I'm thinking, I will need a terminal emulator to run commands anyway, and my only two choices are either to run the terminal version of Emacs, or run a terminal emulator in Emacs. I've tried vterm, but it is nowhere as fast as WezTerm, so the terminal version of Emacs makes the most sense to me.

Besides the fringe and having to fiddle around in Emacs for workarounds against modifier keys being eaten, what am I truly losing by using the terminal version?

https://redd.it/1rzcb3n
@r_emacs

Читать полностью…

/r/emacs

What setup do you use for coding in python?

I'm fairly new to emacs, have been using it for a little under a month, and i'm also fairly new to coding. i decided last night that i wanted to learn python and i'm pretty unhappy with the default python mode from emacs. specifically the syntax highlighting. it doesn't have any of its own faces for coloring syntax, it just uses the default emacs faces so not only do things end up looking pretty monochrome, it also ends using the same colors for things that are pretty unrelated and that's quite confusing for me.

so i was wondering if there are any better alternatives.

https://redd.it/1rz2il5
@r_emacs

Читать полностью…

/r/emacs

Emacs lisp is a joy to work with

After I came to Emacs from Neovim, I started to use Doom Emacs and used very little of elisp and Emacs API to extend my experience. But over time, I started to mold Emacs more and more, so it would be more like existing tools that I used before.

It wasn't anything big. I wanted to use Emacs tab-bar mode to show workspaces instead of buffers, and to make them look the way tabs look in my Zellij setup, with correct behavior on opening, closing etc.

I also wanted to automate my existing pomodoro-based workflow. Org-pomodoro package did not expose the parts that I want. More specifically: action on notification. I want to jump to my hyprland workspace with emacs, switch to buffer with clocked item, and jump to its heading.

I tried to write my own system that use timer.el and org-clock. It was working great and it was actually fun. While writing it, I was reading org-pomodoro source code and realized that I can just use what I wrote to advice some of its functions to achieve desired functionality.

While elisp lacks static typing, I felt that it was still very productive, due to interactive nature of Emacs and documentation culture of Emacs community. Whenever I read the source code of emacs packages, it's well-documented and well-structured. You can test anything immediately and modify the state on the fly without restarting emacs.

It's all makes writing something slightly more complex than basic configuration so much easier than in Neovim. While you can query a lot of things in neovim with :h, it feels like Emacs is miles ahead in this area. I can query the state of emacs so easily, its keybinds, its api. The ability to jump to the source code from describe-variable or describe-function buffers feels amazing. I think that one can't do that in neovim? Maybe I am mistaken.

Also, while elisp is not a general purpose language, it feels like an amazing extension language. I also found it that it's easier to read elisp packages than lua neovim packages for me. Can't formulate exactly why.

Emacs is truly a gem.

https://redd.it/1rx68qa
@r_emacs

Читать полностью…

/r/emacs

emacs is really good for ascii-art
https://redd.it/1rxkwa6
@r_emacs

Читать полностью…

/r/emacs

newsflash.el I built a lightweight RSS news reader for Emacs with split-screen reading
https://redd.it/1ry5v1s
@r_emacs

Читать полностью…

/r/emacs

buffer-terminator.el - Safely Auto Terminate Emacs Buffers Automatically to Enhance Emacs' Performance and Reduce Clutter in the Buffer List [Release 1.2.1]
https://github.com/jamescherti/buffer-terminator.el

https://redd.it/1rycgah
@r_emacs

Читать полностью…

/r/emacs

The McPhee Method
https://jsomers.net/blog/the-mcphee-method

https://redd.it/1rqnb9a
@r_emacs

Читать полностью…

/r/emacs

Magit vs Lazygit

I am trying to decide which git interface to use. from the looks of it they have the same abilities and info. the trade off I am seeing is

Lazygit has cleaner looking interface with panels

Magit has less noise with using nested expandable sections.

Which one seems to work better or is it just simply a matter of mastering the tool you use?

is there a way to make magit show in tables or panels?

https://redd.it/1rrrfxq
@r_emacs

Читать полностью…

/r/emacs

Unfixable Relative Line Number Issue?!

https://preview.redd.it/m7vg1fbcshog1.png?width=478&amp;format=png&amp;auto=webp&amp;s=c63e74e57e193f713b6e9c579f10124b0895efeb

This is definitely a skill issue, but hoping to learn something here! It appears my relative line numbers are centered aligned or something which is very annoying as when they jump from one to two digits it moves the following line of text around slightly which makes it both confusing to understand indents and is also really hacky looking when moving the cursor (point?) around.

I have been slowly discovering more and more options which I've been adding hoping they force the column there on the side to be static but to no avail.

I was hoping someone could help! Here is the section of my configuration in question.

Thanks for taking a look!

https://redd.it/1rr8rb8
@r_emacs

Читать полностью…

/r/emacs

Nifty little modal editting implementation

I was poking around the github repo for selected.el, looking to the issues and config tips. If you are not tracking selected.el, it creates a temp keymap that's available when the region is active. In one of the posts, the author gave an example of how they made a modal-editting mode on top of selected.el, so you can have some short keybinds for transforming the region when it's active. Thought it was cool.


(use-package selected
:init (selected-global-mode 1)
:bind (:map selected-keymap
("q" . selected-off)
("u" . upcase-dwim)
("d" . downcase-dwim)
("w" . kill-ring-save)
("n" . next-line)
("p" . previous-line)
("f" . forward-char)
("b" . backward-char)
("F" . forward-word)
("B" . backward-word)
("a" . beginning-of-visual-line)
("e" . end-of-visual-line)
("{" . backward-paragraph)
("}" . forward-paragraph)
("(" . backward-sentence)
(")" . forward-sentence)
("s" . ctrlf-forward-fuzzy)
("r" . ctrlf-backward-fuzzy)
("" . scroll-down-line)
("" . scroll-up-line)
("M" . rectangle-mark-mode)
("R" . replace-rectangle)
("x" . exchange-point-and-mark)
))

https://redd.it/1rqykam
@r_emacs

Читать полностью…

/r/emacs

New futur version 1.2 (async programming a bit easier)

Disclaimer: I'm not the author. Stefan Monnier is the author. I'm just sharing the new futur v1.2 features

Promise-based async library: futur

Since version 1.2:

- futur-abort takes a second argument (the reason for the abortion).
- New function futur-funcall.
- futur-bind and futur-blocking-wait-to-get-result can now select
which errors they catch.
- New function futur-p.
- Preliminary support to run ELisp code in subproceses&sandboxes.
- Experimental futur-hacks-mode using the preliminary sandbox code.
- New var futur-use-threads to be able to force the use of timers.

https://redd.it/1rrdjaf
@r_emacs

Читать полностью…

/r/emacs

kubernetes.el got hacked - security practices?

When trying to upgrade to the latest elpaca version, I found out that kubernetes.el was compromised.

It's great being able to add several packages to extend your config (blindly in my particular case) but how do you protect yourself if any of them go evil? What are your practices regarding security?

EDIT: didn't notice this earlier post

https://redd.it/1rp6n10
@r_emacs

Читать полностью…

/r/emacs

Customizing Font-Lock in the Age of Tree-sitter
https://emacsredux.com/blog/2026/03/08/customizing-font-lock-in-the-age-of-tree-sitter/

https://redd.it/1rp270w
@r_emacs

Читать полностью…

/r/emacs

Was any information about the history lost when migrating from CVS to Git?

Looking at the git commit history, I see the logs start the time when they were using RCS.

There are several commits with the message "*** empty log message*** from around this time. Eventually they moved from RCS to CVS, and then finally to Git.

I am interested in some of the changes from 30 years ago, and I'm wondering if there might be some additional information in CVS that may have been missed when migrating to Git. I don't actually have any idea about CVS itself, but as I understand, files are tracked individually and they were then grouped together as a git commit.

I am not looking for structural information, but log messages only. Could any log messages from RCS or CVS may have been unintentionally discarded at the time when they migrated to Git or do they have reasonable confidence that everything that was possible to migrate has been done already?

https://redd.it/1roxqmp
@r_emacs

Читать полностью…

/r/emacs

Todays preachure from me, VC-mode

Today's word of wisdom is about Emacs vc-mode, which has the prefix C-x v and another letter based on what you wish to do. One I use daily is C-x v d, which opens a pannel which you may see stage status, branch, and some more information on what is tracked and not. C-x v v is also one that is frequently used, as it can add a file to be tracked and commit changes with one keybind, for the currently open buffer.

And as a extra, if you are in the general panel, or in a file you may open the log of the repository with C-x v L or L in the panel. This lets you browse, expand each commit and if you then press 'd' you can see the diff of the commit. In the diff you may as well press return and open the file at the time of the commit.

https://redd.it/1rotwq5
@r_emacs

Читать полностью…
Subscribe to a channel