reddit / emacs

echo-line-mode

haji-ali · 2022-08-10 13:06
I want to share this [small package](https://gist.github.com/haji-ali/0f3c2a17e3c4efc7ea4518088a7705b5) that I wrote based on [/u/nicolas-rougier](https://www.reddit.com/u/nicolas-rougier/)'s [code](https://gist.github.com/rougier/096323d35ae3af5c8d0740dbb297f3e5). It's a simple package that modifies messages so that additional text is appended and right-aligned. I use it to show information that I want to see regardless of the current buffer (in my case, current data/time, a notmuch email indicator and today's task statistics). ​ https://preview.redd.it/3u3ui7xfxvg91.png?width=495&format=png&auto=webp&s=0695895836722596efd543173adba170196b1de5 You can use it as follows to show the time for example. (require 'echo-line) ;; Enable `display-time-mode` to update the `display-time-string` (display-time-mode 1) ;; Optionally delete the time string from the mode-line (delete 'display-time-string global-mode-string) ;; Update the echo-line every time the display-time is updated (add-hook 'display-time-hook 'echo-line-update) ;; Set the echo-line format (setq echo-line-format '((:eval display-time-string))) ;; Show the echo-line immediately (echo-line-mode) The main changes from the original code is creating a global minor-mode, a slightly different way to right align text and other small checks to make sure that the messages are always displayed correctly.
[deleted] · 2022-08-14 23:36
[deleted]