Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Learn Emacs: use defadvice to modify functions (rawsyntax.com)
39 points by rawsyntax on June 22, 2011 | hide | past | favorite | 7 comments


Isn't it dangerous to change that function if some other command/library depends on the original behavior?

Why don't you just write my-zap-to-char like everyone else? :)


It's a little dangerous, but Emacs users have been making numbered backups automatically since before there was RCS. Since before there was GNU Emacs actually.


It's a risk yes, but I've been using it this way for about a year and encountered no problems.

I'm thinking of TIMTOWTDI, and that perhaps many people don't know about defadvice.


I also love hooks.


It is dangerous in theory, yeah. Much less so if you're a package like https://secure.wikimedia.org/wikipedia/en/wiki/Emacspeak which, while almost entirely defadvice from what I've heard, doesn't modify any existing state.


It is dangerous only if you change the function's interface.


Why? Its not like its a pure function. The change puts Emacs in a different state than with the original behavior...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: