Browse Source

[Fix #1194] Restore the advise-commands macro

I didn't notice that it had other usages in the code when I deleted
it in the commit introducing super-save.
custom
Bozhidar Batsov 7 years ago
parent
commit
6811b60486
  1. 10
      core/prelude-editor.el

10
core/prelude-editor.el

@ -290,6 +290,16 @@
(if (<= (- end beg) prelude-yank-indent-threshold)
(indent-region beg end nil)))
(defmacro advise-commands (advice-name commands class &rest body)
"Apply advice named ADVICE-NAME to multiple COMMANDS.
The body of the advice is in BODY."
`(progn
,@(mapcar (lambda (command)
`(defadvice ,command (,class ,(intern (concat (symbol-name command) "-" advice-name)) activate)
,@body))
commands)))
(advise-commands "indent" (yank yank-pop) after
"If current mode is one of `prelude-yank-indent-modes',
indent yanked text (with prefix arg don't indent)."

Loading…
Cancel
Save