branch: externals/auctex commit 5d2829aed4b269ab84a5da1c9f8481fe4dd770b4 Author: Tassilo Horn <t...@gnu.org> Commit: Tassilo Horn <t...@gnu.org>
Remove old defadvices (patch by Stefan Monnier) * auctex.el.in: Require nadvice-0.3. * context.el (ConTeXt-add-environments): Unconditionally advise it with advice-add. * latex.el (LaTeX-add-bibliographies,LaTeX-add-environments): ditto. * tex-site.el.in (tex-site-unload-hook): ditto. * tex.el (hack-one-local-variable): ditto. --- auctex.el.in | 2 +- context.el | 5 +---- latex.el | 11 ++--------- tex-site.el.in | 18 +----------------- tex.el | 6 +----- 5 files changed, 6 insertions(+), 36 deletions(-) diff --git a/auctex.el.in b/auctex.el.in index 377c733913..014c0a2b8a 100644 --- a/auctex.el.in +++ b/auctex.el.in @@ -5,7 +5,7 @@ ;; URL: https://www.gnu.org/software/auctex/ ;; Maintainer: auctex-devel@gnu.org ;; Notifications-To: auctex-di...@gnu.org -;; Package-Requires: ((emacs "24.3")) +;; Package-Requires: ((emacs "24.3") (nadvice "0.3")) ;; Keywords: TeX LaTeX Texinfo ConTeXt docTeX preview-latex ;; This file is part of AUCTeX. diff --git a/context.el b/context.el index afdc42791e..2f5c57e8e8 100644 --- a/context.el +++ b/context.el @@ -639,10 +639,7 @@ for a label to be inserted after the sectioning command." (TeX-auto-add-type "environment" "ConTeXt") -(if (fboundp 'advice-add) ;Emacs≥24.4 (or ELPA package nadvice) - (advice-add 'ConTeXt-add-environments :after #'ConTeXt--invalidate-menu) - (defadvice ConTeXt-add-environments (after ConTeXt-invalidate-menu (&rest environments) activate) - (ConTeXt--invalidate-menu))) +(advice-add 'ConTeXt-add-environments :after #'ConTeXt--invalidate-menu) (defun ConTeXt--invalidate-menu (&rest _) "Mark the menu as being in need of a refresh." (setq ConTeXt-menu-changed t)) diff --git a/latex.el b/latex.el index a3d0a064cf..a8696f39c2 100644 --- a/latex.el +++ b/latex.el @@ -2038,11 +2038,7 @@ The value is actually the tail of the list of options given to PACKAGE." (add-hook 'TeX-auto-cleanup-hook #'LaTeX-auto-cleanup) -(if (fboundp 'advice-add) ;Emacs≥24.4 (or ELPA package nadvice) - (advice-add 'LaTeX-add-bibliographies :after #'TeX-run-style-hooks) - (defadvice LaTeX-add-bibliographies (after run-bib-style-hooks (&rest bibliographies) activate) - "Add BIBLIOGRAPHIES to the list of known bibliographies and style files." - (apply #'TeX-run-style-hooks bibliographies))) +(advice-add 'LaTeX-add-bibliographies :after #'TeX-run-style-hooks) ;;; Biber support @@ -6361,10 +6357,7 @@ corresponds to the variables `LaTeX-environment-menu-name' and (mapcar #'LaTeX-environment-modify-menu-entry (LaTeX-environment-list)))))))) -(if (fboundp 'advice-add) ;Emacs≥24.4 (or ELPA package nadvice) - (advice-add 'LaTeX-add-environments :after #'LaTeX--invalidate-menus) - (defadvice LaTeX-add-environments (after LaTeX-invalidate-environment-menu (&rest environments) activate) - (LaTeX--invalidate-menus))) +(advice-add 'LaTeX-add-environments :after #'LaTeX--invalidate-menus) (defun LaTeX--invalidate-menus (&rest _) "Mark the environment menus as being in need of a refresh." (setq LaTeX-environment-menu nil) diff --git a/tex-site.el.in b/tex-site.el.in index 558f78873e..dc779fcc1a 100644 --- a/tex-site.el.in +++ b/tex-site.el.in @@ -95,23 +95,7 @@ shared by all users of a site." (add-hook 'tex-site-unload-hook (lambda () - (if (fboundp 'advice-add) - (TeX-modes-set 'TeX-modes nil) - (let ((list after-load-alist)) - (while list - ;; Adapted copy of the definition of `assq-delete-all' - ;; from Emacs 21 as substitute for - ;; `(assq-delete-all'TeX-modes-set (car list))' which - ;; fails on non-list elements in Emacs 21. - (let* ((alist (car list)) - (tail alist) - (key #'TeX-modes-set)) - (while tail - (if (and (consp (car tail)) - (eq (car (car tail)) key)) - (setq alist (delq (car tail) alist))) - (setq tail (cdr tail)))) - (setq list (cdr list))))) + (TeX-modes-set 'TeX-modes nil) (setq load-path (delq TeX-lisp-directory load-path)))) (defun TeX-modes-set (var value &optional update) diff --git a/tex.el b/tex.el index e0947b73d3..ca4b8ad35b 100644 --- a/tex.el +++ b/tex.el @@ -746,11 +746,7 @@ emacs 24.1 and is then later run by emacs 24.5." (add-to-list 'Info-file-list-for-emacs (cons elt "AUCTeX")))) -(if (fboundp 'advice-add) ;Emacs≥24.4 (or ELPA package nadvice) - (advice-add 'hack-one-local-variable :after #'TeX--call-minor-mode) - (defadvice hack-one-local-variable (after TeX-hack-one-local-variable-after - activate) - (TeX--call-minor-mode (ad-get-arg 0) (ad-get-arg 1)))) +(advice-add 'hack-one-local-variable :after #'TeX--call-minor-mode) (defun TeX--call-minor-mode (var val &rest _) "Call minor mode function if minor mode variable is found." ;; Instead of checking for each mode explicitly `minor-mode-list' _______________________________________________ auctex-diffs mailing list auctex-di...@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-diffs