3 ms·
That's exactly how emacs works actually[1]. Getting the documentation on a function or variable contains a link to the file that defines it, which you can then
by andreareina 6y ago
That's exactly how emacs works actually[1]. Getting the documentation on a function or variable contains a link to the file that defines it, which you can then edit. If you eval the expression then all later uses of the function will have the new behavior, otherwise it'll take effect on next startup. I've done exactly this to backport some changes from future versions.
[1] http://prntscr.com/u6yfnp http://prntscr.com/u6yfnp
- frank2 6y agoYes, I really like how easy it is to view the definition (which might be written in Emacs Lisp or C) of any function callable from Emacs Lisp. (But I never edit any Emacs Lisp files that come with Emacs: sometimes though I will make sure such a file has been loaded, then override a function definition with one I wrote myself.)
- andreareina 6y agoYeah, overriding (or advising[1]) the function in init.el is probably the better thing to do if it's a long-term behavior change. In this case I knew that it would be right once I upgraded, so the dirty hack won the day haha. [1] https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html https://www.gnu.org/software/emacs/manual/html_node/elisp/Ad...