diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | ebuild-mode.el | 9 |
2 files changed, 8 insertions, 5 deletions
@@ -1,5 +1,9 @@ 2023-09-16 Ulrich Müller <ulm@gentoo.org> + * ebuild-mode.el (sh-must-be-shell-mode): Test if the function is + defined at compile time. This should only be the case for Emacs + versions where defadvice is unobsolete. + * glep-mode.el (rst-classify-adornment) (glep-mode-ignore-preamble): Use :before-while instead of :around as advice combinator. diff --git a/ebuild-mode.el b/ebuild-mode.el index d49c931..416758d 100644 --- a/ebuild-mode.el +++ b/ebuild-mode.el @@ -901,12 +901,11 @@ in a Gentoo profile." ["Insert package.mask tag line" ebuild-mode-insert-tag-line] ["Customize ebuild-mode" (customize-group 'ebuild)])) -(if (fboundp 'sh-must-be-shell-mode) +(if (eval-when-compile (fboundp 'sh-must-be-shell-mode)) ;; make TAB key work - (defun sh-must-be-shell-mode () - "Signal an error if not in Shell-script mode." - (unless (derived-mode-p 'sh-mode) - (error "This buffer is not in Shell-script mode")))) + (defadvice sh-must-be-shell-mode + (around ebuild-mode-sh-must-be-shell-mode activate) + (unless (derived-mode-p 'sh-mode) ad-do-it))) ;;;###autoload (add-to-list 'auto-mode-alist '("\\.\\(ebuild\\|eclass\\)\\'" . ebuild-mode)) |