diff options
author | Ulrich Müller <ulm@gentoo.org> | 2023-08-24 19:10:12 +0200 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2023-08-24 19:10:12 +0200 |
commit | 544b74707c47117e456fd551bfb8aab8b0cffa08 (patch) | |
tree | 19e07361b72272ab96cb1e788df91350c9893a36 | |
parent | Fix byte-compiler warning for glep-mode.el (diff) | |
download | ebuild-mode-544b74707c47117e456fd551bfb8aab8b0cffa08.tar.gz ebuild-mode-544b74707c47117e456fd551bfb8aab8b0cffa08.tar.bz2 ebuild-mode-544b74707c47117e456fd551bfb8aab8b0cffa08.zip |
Port to new advice functions
* glep-mode.el (rst-classify-adornment, glep-ignore-preamble):
Port from defadvice to advice-add.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | glep-mode.el | 9 |
2 files changed, 7 insertions, 5 deletions
@@ -1,5 +1,8 @@ 2023-08-24 Ulrich Müller <ulm@gentoo.org> + * glep-mode.el (rst-classify-adornment, glep-ignore-preamble): + Port from defadvice to advice-add. + * glep-mode.el (glep-mode-format-html): Move docstring to the top. 2023-08-20 Ulrich Müller <ulm@gentoo.org> diff --git a/glep-mode.el b/glep-mode.el index 200790c..09861c9 100644 --- a/glep-mode.el +++ b/glep-mode.el @@ -159,15 +159,14 @@ to `font-lock-end'." ret))) ;; Prevent rst-mode from interpreting the "---" delimiter as section header. -;; We cannot use advice-add because it did not exist in Emacs 23. ;; *** FIXME *** This is incomplete and probably too brittle. -(defadvice rst-classify-adornment (around glep-ignore-preamble) +(defun glep-ignore-preamble (oldfun adornment end &rest args) "Ignore GLEP preamble in `rst-classify-adornment'." (if (not (and (eq major-mode 'glep-mode) - (glep-mode-in-preamble-p (ad-get-arg 1)))) - ad-do-it)) + (glep-mode-in-preamble-p end))) + (apply oldfun adornment end args))) -(ad-activate 'rst-classify-adornment) +(advice-add 'rst-classify-adornment :around #'glep-ignore-preamble) ;;; Generate HTML from GLEP. |