When Elfeed, an RSS-reading extension for Emacs, is set up and functional, it is easy to browse the items. The two main views are the list of items from all feeds (named “elfeed-search”) and a single item (named “elfeed-entry”). In both views, the y
key is bound to copy the link of the current item. But how to copy the headline?
Emacs: Return bookmark name based on current buffer filename
Sometimes questions arise: Is the current buffer bookmarked? If yes, what is the name of the bookmark? This is useful to know when bookmarking the same file again at a new cursor position with the same bookmark name.
Continue reading “Emacs: Return bookmark name based on current buffer filename”
Emacs: Fix M-. without a hassle
M-. (i.e. the Alt dot key combination in Emacs) does xref-find-definitions
which only works if you have set up something called a tags table which is incomprehensible and a hassle and therefore unacceptable. It is much easier to use describe-function
or describe-symbol
, which open up *Help* pages in Emacs.
Emacs Dired: View (and edit) file contents without opening a file
Some files open fast, others slower. It may depend on the file viewer too. But in Emacs Dired it is possible to extract file contents without opening the file. The inbuilt function for it is insert-file-contents
.
Continue reading “Emacs Dired: View (and edit) file contents without opening a file”
Rebookmark in Emacs
When working on a file from start to finish over a lifetime in Emacs, for example as in translating a lengthy text, it is good to keep the file bookmarked at the end of every day, because Emacs’ bookmarks save the cursor location. This way, whenever opening the file from bookmarks again to continue with it, it opens where it had been left off.
Continue reading “Rebookmark in Emacs”Emacs: Electric undesirables
In my Emacs config I have enabled only electric-pair-mode
to speed up some quotes and parens. Either this or something else also enables electric-indent-mode
which produces weird cursor behaviour in Org lists, particularly when I disagree that I am in a list, so I have ended up suppressing electric-indent-mode
explicitly by setting M-x customize-option RET electric-indent-mode
off.
The best buffers list in Emacs: bs-show
How about triggering a popup list of buffers with a keybind, finding your preferred next buffer to go to with arrow keys, and launching it with Enter, which at the same time dismisses the popup list of buffers? This is how bs-show
behaves in Emacs.
Two hooks for Emacs Occur
Occur is the best search function in Emacs. It
- Lists search results from the entire buffer (not just from the cursor forward or from the cursor backward)
- Lists the results in a separate buffer (so you are not unnecessarily moving away from your current location in the original buffer to find a wanted search result)
- Provides line numbers for matched results
Emacs: Build a keychain with repeatable keys
A keychain includes a prefix key (or prefix keybind) and then more keys to launch a command. This is different from a keybind to launch a command. In a keychain, the keys are pressed in sequence, prefix first and then something else to complete the keychain, whereas in a keybind they are pressed at once.
Continue reading “Emacs: Build a keychain with repeatable keys”
Emacs: Copy this line
Emacs tends to mark from point (cursor) towards either end of the element. If you want a function that marks or copies the entire element from beginning to end, you often have to build them yourself.
Continue reading “Emacs: Copy this line”