-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 =pod C is emacs' way of letting you modify the behavoir of functions by wrapping them with before/after/around handlers. I don't usually have much use for it because there are better ways to customize things like properly asking the user for configuration (C<(if users-configuration (funcall users-configuration)))>), and I'm also not a big fan of globally changing behavior. I did finally find one case where advice helped me. I want emacs to use perl 5.10 when C-ing my Perl buffers. Unfortunately, C<"perl"> is hard-coded as the name of the interpreter in C: (defun flymake-perl-init () (let* ((temp-file (flymake-init-create-temp-buffer-copy 'flymake-create-temp-inplace)) (local-file (file-relative-name temp-file (file-name-directory buffer-file-name)))) (list "perl" (list "-wc " local-file)))) This won't do, since my Perl is actually in "/home/jon/perl/install/bin/perl" (and that's not in the path, because gdm doesn't look at my .bashrc when starting the GNOME session). Fortunately, advice comes to the rescue; it can muck with the original return value. So, I added this to my .emacs: (require 'flymake) (defadvice flymake-perl-init (after fix-flymake-perl-path) (setcar ad-return-value "/home/jon/perl/install/bin/perl")) (ad-activate 'flymake-perl-init) Now, whenever C is called, my little handler has a chance to change the return value. All I do is replace the C of the return value with my perl path... then everything else works normally. Like I said before, I don't usually condone messing with things globally, but in this case it's the perfect solution. The alternative would have been to cut-n-paste the whole function into my .emacs, and that's just not right. Emacs Lisp continues to amaze me. What I had written off a few years ago as a flawed and broken programming language (no static scoping without cl, no tail recursion) has turned out to be a joy to use. The same could not be said for other programming languages I've learned recently; including Java, Ruby, Erlang, and Haskell. All of those are neat, but there's no reason to use them. Perl does whatever they do. Emacs Lisp is like Perl to me now -- it makes most problems so easy to solve that I don't care about the little flaws in the langauge. I write some code, my problem is solved, and I move on to the next thing. It's interesting how these things go. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHcrfF2rw+dVvzZm0RAqqrAJ0V5Pkr/KHutx/UKvRbTA86qjcWrgCgmv+s 0dQ/vvUll5gF9s7r2JzUvgI= =kOSd -----END PGP SIGNATURE-----