A thread of tips, tricks, and TILs for #emacs. ๐งต
@citizen428 RIP all unprepared themes
@sanityinc I use Modus themes, and they look quite nice with this setting enabled. But I'd assume that in the age of treesitter and eglot, most themes are at least somewhat prepared for this, no?
@citizen428 not at all, the new semantic faces were defined with a whole set of arbitrary colours, so I had to fix up my tomorrow themes to add these faces.
One of #Emacs greatest strengths is its built-in documentation system. The helpful package (https://github.com/Wilfred/helpful) makes it even better. Unless you really like `view-hello-file`, I think `C-h h` is a great binding for `helpful-at-point`.
@citizen428 helpful is overrated. builtin help has been extended enough in last couple of major releases
@mekeor Hm. Different people like different things. Isnโt that the point of Emacs?
@citizen428 i think i will start my Monday with compiling the latest emacs version.
@Drops Two links in case you're contemplating simplifying your config too:
https://www.masteringemacs.org/article/whats-new-in-emacs-311
https://sachachua.com/blog/2026/04/what-s-in-the-emacs-newcomers-presets-theme/
Very short #emacs tip for today: sometimes I miss Clojure's `->` and `->>` macros. I somehow missed that they actually exist as `thread-first` and `thread-last`.
@citizen428 The `dash` library contains aliases for both `->` & `->>` in addition to some more variants around them, adding even more cool features.
@mosu I know. But my current approach is bringing in as few packages as possible. That said, dash is already there as a dependency, so I could promote it to its own use-package directive.
Still looking at log files with tail -f? There's a better way to do this in #emacs:
1. Open the log file.
2. Make sure auto-revert-mode is enabled. Edit: or even better, auto-revert-tail-mode. Thanks @debacle!
3. If necessary, throw in a highlight-phrase so all previous AND future matches of a certain regex get a colored background. And yes, you can have several of those in different colors.
I wonder how well this works with huge, rapidly changing log files. I assume, that #Emacs opens and reads the complete file after every change?
There seems to be an "auto-revert-tail-mode" which should solve this potential efficiency issue.
@debacle Yup, fair. I do not use this for operational logs but for things like development server logs while I work on stuff. auto-revert-tail-mode seems appropriate here.
@citizen428
There's also the logview package that adds a logview-mode with font locking and interresting filter commands. I don't use it often, but it's nice ๐
@debacle
I guess `occur` could also be handy; I wonder if it would update automatically on revertโฆ
@6d03 I just tried, it did not automatically update.
In modes derived from special-mode (e.g., help or info buffers), q is bound to quit-window, which will bury the buffer but not kill it. Most of the time I DO want it to kill the buffer too, though, which can be achieved with C-u q.
Emacs 31.1 made this a lot easier by adding a variable called quit-window-kill-buffer:
@citizen428 Maybe I should read this manual again. The last time I did that is about 35 years ago, and it was Emacs 18.55 or so.
@citizen428 excellent. q means quit! Yes, realy
TIL that if you mark some files in a dired buffer, magit-dired-log will show you the commits that touched the marked files:
"In Dired, show log for all marked files or the directory if none are marked."
TIL that if you mark some files in a dired buffer, magit-dired-log will show you the commits that touched the marked files:
"In Dired, show log for all marked files or the directory if none are marked."
Quick tip: #Emacs 31 added a new setting `elisp-fontify-semantically`, which configures "[w]hether to highlight symbols according to their semantic meaning."
YMMV, but I think it's an improvement.