Stefan Monnier writes: Relevant pieces retained alongside responses: >> 2. Re ad-return-value -- I've almost never had to explicitly set >> ad-return-value -- in around and after advice, I have always >> returned ad-return-value and have never hit issues --- perhaps >> because I've always wrappered my advice body in a let form -- This has never bitten emacspeak because I always leave the return value >> unmolested, and for safely always make sure that ad-return-value >> is the last form in the advice body so that functions or code that >> runs after the advice doesn't break because the original >> function's return value got dropped along the way >> not sure. What kind of breakages happen when returning >> ad-return-value vs explicitly setting ad-return-value at the end >> of the advice body? > > You typically need to set it when you want to do: > > (defadvice some-function (around my-advice activate) > (if (bla bla) > (cons 1 ad-do-it) > (do something else) > (and return some value))) > > which needs to be something like: > > (defadvice some-function (around my-advice activate) > (if (bla bla) > (progn ad-do-it > (push 1 ad-return-value)) > (do something else) > (setq ad-return-value (and return some value)))) > >> 3. I've avoided the complexity around preactivation vs >> activation etc by always saying (... pre act comp) in all my Avoid complexity here == "my little brain doesn't have to worry about it" --- all the calls to defadvice in emacspeak say "pre act comp" which means if it needs changing, I can change them all with a single line of perl or sed magic. >> advice forms > > Not sure in which sense this "avoided the complexity". > And most people reading your code won't know what it means, I'm afraid. > > > Stefan > > -- Thanks, --Raman(I Search, I Find, I Misplace, I Research) ♈ Id: kg:/m/0285kf1 🦮