From 544b74707c47117e456fd551bfb8aab8b0cffa08 Mon Sep 17 00:00:00 2001 From: Ulrich Müller Date: Thu, 24 Aug 2023 19:10:12 +0200 Subject: Port to new advice functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * glep-mode.el (rst-classify-adornment, glep-ignore-preamble): Port from defadvice to advice-add. Signed-off-by: Ulrich Müller --- ChangeLog | 3 +++ glep-mode.el | 9 ++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index d13701a..4b4ba8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2023-08-24 Ulrich Müller + * 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 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. -- cgit v1.2.3-65-gdbad