Rename toggle-advice to advice-toggle

This commit is contained in:
Gerard Vermeulen 2022-10-27 00:58:29 +02:00
parent 87298ec39f
commit cb011d9e0d

View File

@ -606,7 +606,7 @@ president
#+name: lst:advising-tools
#+begin_src emacs-lisp
(with-eval-after-load 'emacs
(defun toggle-advice (symbol where function &optional props)
(defun advice-toggle (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)
@ -797,7 +797,7 @@ defined in this Org file.
;; Ensure defining the functions before documenting them.
(define-short-documentation-group init
"Advice"
(toggle-advice :no-manual t)
(advice-toggle :no-manual t)
(toggle-TeX-brace-count-line-override :no-manual t)
(toggle-engrave-faces-latex-face-apply-override :no-manual t)
(toggle-engrave-faces-latex-face-mapper-override :no-manual t)
@ -932,7 +932,7 @@ users from shooting themselves in the feet. Listing
(defun toggle-ilog-timer-function-after ()
"Toggle `ilog-timer-function' advice."
(interactive)
(toggle-advice 'ilog-timer-function :after #'ilog-ensure-ilog-buffer-window))
(advice-toggle 'ilog-timer-function :after #'ilog-ensure-ilog-buffer-window))
(toggle-ilog-timer-function-after))
#+end_src
@ -984,7 +984,7 @@ Listing [[lst:configure-keycast]] configures =keycast=.
(defun toggle-keycast-log-update-buffer-override ()
"Toggle `keycast-log-update-buffer' advice."
(interactive)
(toggle-advice 'keycast-log-update-buffer
(advice-toggle 'keycast-log-update-buffer
:override #'keycast-log-update-buffer-plain))
(toggle-keycast-log-update-buffer-override))
@ -1791,7 +1791,7 @@ in listing [[lst:configure-auctex]] corrects this by advising to override
(defun toggle-TeX-brace-count-line-override ()
"Toggle `TeX-brace-count-line-override' advice."
(interactive)
(toggle-advice 'TeX-brace-count-line :override #'TeX-brace-count-line-override))
(advice-toggle 'TeX-brace-count-line :override #'TeX-brace-count-line-override))
(toggle-TeX-brace-count-line-override))
#+end_src
@ -2035,7 +2035,7 @@ backward compatibility. See table [[tab:org-latex-class-tag-placeholder]] and ty
(defun toggle-org-babel-python-format-session-value-override ()
"Toggle `org-babel-python-format-session-value' advice."
(interactive)
(toggle-advice 'org-babel-python-format-session-value
(advice-toggle 'org-babel-python-format-session-value
:override #'org-babel-python-format-session-value-override))
(toggle-org-babel-python-format-session-value-override))
@ -2534,7 +2534,7 @@ listings below make* [[https://github.com/tecosaur/engrave-faces#readme][Engrave
(when bg "}") (when fg "}") (when st "}") (when bl "}") (when it "}"))))))
(with-eval-after-load 'emacs
(defun toggle-advice (symbol where function &optional props)
(defun advice-toggle (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)
@ -2547,7 +2547,7 @@ listings below make* [[https://github.com/tecosaur/engrave-faces#readme][Engrave
(defun toggle-engrave-faces-latex-face-apply-override ()
"Toggle `engrave-faces-latex-face-apply' advice."
(interactive)
(toggle-advice 'engrave-faces-latex-face-apply
(advice-toggle 'engrave-faces-latex-face-apply
:override #'engrave-faces-latex-face-apply-override))
(toggle-engrave-faces-latex-face-apply-override))
@ -2592,7 +2592,7 @@ listings below make* [[https://github.com/tecosaur/engrave-faces#readme][Engrave
(defun toggle-engrave-faces-latex-face-mapper-override ()
"Toggle `engrave-faces-latex-face-mapper' advice."
(interactive)
(toggle-advice 'engrave-faces-latex-face-mapper
(advice-toggle 'engrave-faces-latex-face-mapper
:override #'engrave-faces-latex-face-mapper-override))
(toggle-engrave-faces-latex-face-mapper-override))
@ -4971,7 +4971,7 @@ Listing [[lst:configure-browse-url]] configures =browse-url=.
(defun toggle-eww-display-pdf-around ()
"Toggle `eww-display-advice' advice."
(interactive)
(toggle-advice 'eww-display-pdf :around #'eww-display-pdf-as-binary))
(advice-toggle 'eww-display-pdf :around #'eww-display-pdf-as-binary))
(toggle-eww-display-pdf-around))
#+end_src