summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2023-09-16 19:48:42 +0200
committerUlrich Müller <ulm@gentoo.org>2023-09-16 19:48:42 +0200
commit865cb930459c9fadfb1590d93fa6a44baf25b48b (patch)
treefa78016012b778185bb18d5c17d7e8217e5d6f5b
parentVersion 1.67 released (diff)
downloadebuild-mode-865cb930459c9fadfb1590d93fa6a44baf25b48b.tar.gz
ebuild-mode-865cb930459c9fadfb1590d93fa6a44baf25b48b.tar.bz2
ebuild-mode-865cb930459c9fadfb1590d93fa6a44baf25b48b.zip
Simplify advice function in glep-mode
* glep-mode.el (rst-classify-adornment) (glep-mode-ignore-preamble): Use :before-while instead of :around as advice combinator. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--ChangeLog6
-rw-r--r--glep-mode.el9
2 files changed, 10 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 690b25d..0052228 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-09-16 Ulrich Müller <ulm@gentoo.org>
+
+ * glep-mode.el (rst-classify-adornment)
+ (glep-mode-ignore-preamble): Use :before-while instead of :around
+ as advice combinator.
+
2023-09-12 Ulrich Müller <ulm@gentoo.org>
* Version 1.67 released.
diff --git a/glep-mode.el b/glep-mode.el
index c2817a0..9175c4e 100644
--- a/glep-mode.el
+++ b/glep-mode.el
@@ -160,13 +160,12 @@ to `font-lock-end'."
;; Prevent rst-mode from interpreting the "---" delimiter as section header.
;; *** FIXME *** This is incomplete and probably too brittle.
-(defun glep-ignore-preamble (oldfun adornment end &rest args)
+(defun glep-mode-ignore-preamble (_adornment end &rest _args)
"Ignore GLEP preamble in `rst-classify-adornment'."
- (if (not (and (eq major-mode 'glep-mode)
- (glep-mode-in-preamble-p end)))
- (apply oldfun adornment end args)))
+ (not (and (eq major-mode 'glep-mode)
+ (glep-mode-in-preamble-p end))))
-(advice-add 'rst-classify-adornment :around #'glep-ignore-preamble)
+(advice-add 'rst-classify-adornment :before-while #'glep-mode-ignore-preamble)
;;; Generate HTML from GLEP.