diff --git a/README.org b/README.org index 8b7a531..bbd9a95 100644 --- a/README.org +++ b/README.org @@ -353,6 +353,24 @@ However, in order to improve visibility, it relies on: "My face to show a here-document.")) #+end_src +** [[info:elisp#Advising Functions][Advising Functions (info)]] + +#+caption[Tools for advising functions]: +#+caption: Tools for advising functions. +#+name: lst:advising-tools +#+begin_src emacs-lisp + (with-eval-after-load 'emacs + (defun toggle-advice (symbol where function &optional props) + "Toggle between states after `advice-remove' and `advice-add'." + (let ((how "%s `%s' advice `%s' %s `%s'")) + (if (advice-member-p function symbol) + (progn + (message how "Removal of" where function "from" symbol) + (advice-remove symbol function)) + (message how "Addition of" where function "to" symbol) + (advice-add symbol where function props))))) +#+end_src + ** [[info:emacs#Dired][Dired: directory editor as file manager (info)]] :PROPERTIES: :CUSTOM_ID: sec:file-manager @@ -1336,16 +1354,6 @@ corrects this by advising to override ~TeX-brace-count-line~ with (forward-char) t)))))) count))) - (defun toggle-advice (symbol where function &optional props) - "Toggle between states after `advice-remove' and `advice-add'." - (let ((how "%s `%s' advice `%s' %s `%s'")) - (if (advice-member-p function symbol) - (progn - (message how "Removal of" where function "from" symbol) - (advice-remove symbol function)) - (message how "Addition of" where function "to" symbol) - (advice-add symbol where function props)))) - (defun toggle-TeX-brace-count-line-override () "Toggle `TeX-brace-count-line-override' advice." (interactive)