advising-functions

Advising an emacs interactive function: before

蓝咒 提交于 2019-12-05 07:44:08
I want to before-advice some function, which uses interactive arguments, e.g. find-dired : (defadvice find-dired (before eab-find-dired activate) (message "before!") (setq find-args '("-iname '**'" . 10))) But emacs executes this advice only after find-dired interactive session and I can't setup find-args before. How to resolve the contradiction? Upd. Note that defadvice macro is deprecated . Trey Jackson artscan answered his own question with a workable answer, but it's a bit incomplete and misleading. This also involves 'interactive , which can be confusing in and of itself - in that it

How to force Emacs not to display buffer in a specific window?

佐手、 提交于 2019-11-28 16:44:55
My windows configuration looks like this: +----------+-----------+ | | | | | | | | | | | | | | | | +-----------+ | | | +----------+-----------+ And I use the lower right window for special displays (like help, completion etc.), but emacs insists on using that window when I call commands ( find-file-other-window , etc.) that use display-buffer , and resize that window as well. It's annoying... Is there a way that I can force emacs NOT to use that windows? I was thinking of advising display-buffer , but it's a function in c. Any thoughts on this? EDIT: Based heavily on Trey's answer, this is