A thread of tips, tricks, and TILs for #emacs. ๐งต
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.
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."