[emacs-berlin] org-insert-link DWIM
jman
emacs-berlin at city17.xyz
Sat Aug 9 08:38:09 UTC 2025
Hello everyone!
I don't usually repost Emacs tips I read around but this one was for me a game-changer.
When I add a link to an org file I usually do:
1- copy che link from somewhere else
2- edit che org file, select a region, org-insert-link (C-c C-l)
3- yank the text (C-y), RET, RET
I've never realized the power of a "DWIM" (Do What I Mean) version:
https://xenodium.com/emacs-dwim-do-what-i-mean
With the snippet of code at the end of the blog post and binding that to `org-insert-link`:
(keymap-set org-mode-map "C-c C-l" 'my/org-insert-link-dwim)
The text gets automatically yanked (which is IMO the logical thing you want to happen when editing a
link!). And since I do this a lot, automating step 3 is for me a massive improvement.
That devilish snippet does even more! :)
I'd love to investigate a generic version that works for any text-mode.
Hope it helps!
Cheers,
More information about the emacs-berlin
mailing list