emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 229/299: Advice instead of fset + redefine.


From: Stefan Monnier
Subject: [elpa] 229/299: Advice instead of fset + redefine.
Date: Sun, 02 Nov 2014 03:11:38 +0000

monnier pushed a commit to branch externals/auctex
in repository elpa.

commit 4a811e5c41833f3aea7b14b579db3f87c00d933e
Author: Tassilo Horn <address@hidden>
Date:   Tue Mar 11 10:49:41 2014 +0100

    Advice instead of fset + redefine.
    
    * context.el (ConTeXt-add-environments): Advice instead of
    renaming and redefining generated function.
    
    * latex.el (LaTeX-add-bibliographies): Advice instead of
    renaming and redefining generated function.
    (LaTeX-add-environments): Ditto.
---
 ChangeLog  |    6 ++++++
 context.el |    5 +----
 latex.el   |   10 ++--------
 3 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8ed8232..60569e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,13 @@
 2014-03-11  Tassilo Horn  <address@hidden>
 
+       * context.el (ConTeXt-add-environments): Advice instead of
+       renaming and redefining generated function.
+
        * latex.el (LaTeX-close-environment): Remove non-interactive
        `next-line' usage compile warning.
+       (LaTeX-add-bibliographies): Advice instead of renaming and
+       redefining generated function.
+       (LaTeX-add-environments): Ditto.
 
 2014-03-10  Tassilo Horn  <address@hidden>
 
diff --git a/context.el b/context.el
index 89fa9b0..ea333e5 100644
--- a/context.el
+++ b/context.el
@@ -599,11 +599,8 @@ inserted after the sectioning command."
 
 (TeX-auto-add-type "environment" "ConTeXt")
 
-(fset 'ConTeXt-add-environments-auto
-      (symbol-function 'ConTeXt-add-environments))
-(defun ConTeXt-add-environments (&rest environments)
+(defadvice ConTeXt-add-environments (after ConTeXt-invalidate-menu (&rest 
environments) activate)
   "Add ENVIRONMENTS to the list of known environments."
-  (apply 'ConTeXt-add-environments-auto environments)
   (setq ConTeXt-menu-changed t))
 
 ;; (defvar ConTeXt-environment-list ()
diff --git a/latex.el b/latex.el
index 0c0a298..2da1b24 100644
--- a/latex.el
+++ b/latex.el
@@ -1504,20 +1504,14 @@ The value is actually the tail of the list of options 
given to PACKAGE."
 
 (add-hook 'TeX-auto-cleanup-hook 'LaTeX-auto-cleanup)
 
-(fset 'LaTeX-add-bibliographies-auto
-      (symbol-function 'LaTeX-add-bibliographies))
-(defun LaTeX-add-bibliographies (&rest bibliographies)
+(defadvice LaTeX-add-bibliographies (after run-bib-style-hooks (&rest 
bibliographies) activate)
   "Add BIBLIOGRAPHIES to the list of known bibliographies and style files."
-  (apply 'LaTeX-add-bibliographies-auto bibliographies)
   (apply 'TeX-run-style-hooks bibliographies))
 
-(fset 'LaTeX-add-environments-auto
-      (symbol-function 'LaTeX-add-environments))
-(defun LaTeX-add-environments (&rest environments)
+(defadvice LaTeX-add-environments (after LaTeX-invalidate-environment-menu 
(&rest environments) activate)
   "Add ENVIRONMENTS to the list of known environments.
 Additionally invalidate the environment submenus to let them be
 regenerated by the respective menu filter."
-  (apply 'LaTeX-add-environments-auto environments)
   (setq LaTeX-environment-menu nil)
   (setq LaTeX-environment-modify-menu nil))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]