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 #+name: lst:advising-tools
#+begin_src emacs-lisp #+begin_src emacs-lisp
(with-eval-after-load 'emacs (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'." "Toggle between states after `advice-remove' and `advice-add'."
(let ((how "%s `%s' advice `%s' %s `%s'")) (let ((how "%s `%s' advice `%s' %s `%s'"))
(if (advice-member-p function symbol) (if (advice-member-p function symbol)
@ -797,7 +797,7 @@ defined in this Org file.
;; Ensure defining the functions before documenting them. ;; Ensure defining the functions before documenting them.
(define-short-documentation-group init (define-short-documentation-group init
"Advice" "Advice"
(toggle-advice :no-manual t) (advice-toggle :no-manual t)
(toggle-TeX-brace-count-line-override :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-apply-override :no-manual t)
(toggle-engrave-faces-latex-face-mapper-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 () (defun toggle-ilog-timer-function-after ()
"Toggle `ilog-timer-function' advice." "Toggle `ilog-timer-function' advice."
(interactive) (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)) (toggle-ilog-timer-function-after))
#+end_src #+end_src
@ -984,7 +984,7 @@ Listing [[lst:configure-keycast]] configures =keycast=.
(defun toggle-keycast-log-update-buffer-override () (defun toggle-keycast-log-update-buffer-override ()
"Toggle `keycast-log-update-buffer' advice." "Toggle `keycast-log-update-buffer' advice."
(interactive) (interactive)
(toggle-advice 'keycast-log-update-buffer (advice-toggle 'keycast-log-update-buffer
:override #'keycast-log-update-buffer-plain)) :override #'keycast-log-update-buffer-plain))
(toggle-keycast-log-update-buffer-override)) (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 () (defun toggle-TeX-brace-count-line-override ()
"Toggle `TeX-brace-count-line-override' advice." "Toggle `TeX-brace-count-line-override' advice."
(interactive) (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)) (toggle-TeX-brace-count-line-override))
#+end_src #+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 () (defun toggle-org-babel-python-format-session-value-override ()
"Toggle `org-babel-python-format-session-value' advice." "Toggle `org-babel-python-format-session-value' advice."
(interactive) (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)) :override #'org-babel-python-format-session-value-override))
(toggle-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 "}")))))) (when bg "}") (when fg "}") (when st "}") (when bl "}") (when it "}"))))))
(with-eval-after-load 'emacs (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'." "Toggle between states after `advice-remove' and `advice-add'."
(let ((how "%s `%s' advice `%s' %s `%s'")) (let ((how "%s `%s' advice `%s' %s `%s'"))
(if (advice-member-p function symbol) (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 () (defun toggle-engrave-faces-latex-face-apply-override ()
"Toggle `engrave-faces-latex-face-apply' advice." "Toggle `engrave-faces-latex-face-apply' advice."
(interactive) (interactive)
(toggle-advice 'engrave-faces-latex-face-apply (advice-toggle 'engrave-faces-latex-face-apply
:override #'engrave-faces-latex-face-apply-override)) :override #'engrave-faces-latex-face-apply-override))
(toggle-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 () (defun toggle-engrave-faces-latex-face-mapper-override ()
"Toggle `engrave-faces-latex-face-mapper' advice." "Toggle `engrave-faces-latex-face-mapper' advice."
(interactive) (interactive)
(toggle-advice 'engrave-faces-latex-face-mapper (advice-toggle 'engrave-faces-latex-face-mapper
:override #'engrave-faces-latex-face-mapper-override)) :override #'engrave-faces-latex-face-mapper-override))
(toggle-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 () (defun toggle-eww-display-pdf-around ()
"Toggle `eww-display-advice' advice." "Toggle `eww-display-advice' advice."
(interactive) (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)) (toggle-eww-display-pdf-around))
#+end_src #+end_src