changeset 106007:68d36fa6dccb

(viper-set-hooks): Remove duplicate advice statements for vc-diff, emerge-quit, and rmail-cease-edit. If they are already loaded, eval-after-load will do the right thing.
author Glenn Morris <rgm@gnu.org>
date Sat, 14 Nov 2009 04:37:00 +0000
parents 88a813fffb40
children 38f236a275ca
files lisp/ChangeLog lisp/emulation/viper.el
diffstat 2 files changed, 9 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Nov 14 04:31:52 2009 +0000
+++ b/lisp/ChangeLog	Sat Nov 14 04:37:00 2009 +0000
@@ -1,5 +1,9 @@
 2009-11-14  Glenn Morris  <rgm@gnu.org>
 
+	* emulation/viper.el (viper-set-hooks): Remove duplicate advice
+	statements for vc-diff, emerge-quit, and rmail-cease-edit.
+	If they are already loaded, eval-after-load will do the right thing.
+
 	* speedbar.el (top-level): Remove unnecessary load of ange-ftp when
 	compiling.
 
--- a/lisp/emulation/viper.el	Sat Nov 14 04:31:52 2009 +0000
+++ b/lisp/emulation/viper.el	Sat Nov 14 04:37:00 2009 +0000
@@ -866,25 +866,17 @@
 	       ))
 
   ;; Tell vc-diff to put *vc* in Vi mode
-  (if (featurep 'vc)
-      (defadvice vc-diff (after viper-vc-ad activate)
-	"Force Vi state in VC diff buffer."
-	(viper-change-state-to-vi))
-    (eval-after-load
-     "vc"
-     '(defadvice vc-diff (after viper-vc-ad activate)
-	"Force Vi state in VC diff buffer."
-	(viper-change-state-to-vi))))
+  (eval-after-load
+      "vc"
+    '(defadvice vc-diff (after viper-vc-ad activate)
+       "Force Vi state in VC diff buffer."
+       (viper-change-state-to-vi)))
 
   (eval-after-load
    "emerge"
    '(defadvice emerge-quit (after viper-emerge-advice activate)
       "Run `viper-change-state-to-vi' after quitting emerge."
       (viper-change-state-to-vi)))
-  ;; In case Emerge was loaded before Viper.
-  (defadvice emerge-quit (after viper-emerge-advice activate)
-    "Run `viper-change-state-to-vi' after quitting emerge."
-    (viper-change-state-to-vi))
 
   ;; passwd.el sets up its own buffer, which turns up in Vi mode,
   ;; thus overriding the local map.  We don't need Vi mode here.
@@ -943,10 +935,6 @@
    '(defadvice rmail-cease-edit (after viper-rmail-advice activate)
       "Switch to Emacs state when done editing message."
       (viper-change-state-to-emacs)))
-  ;; In case RMAIL was loaded before Viper.
-  (defadvice rmail-cease-edit (after viper-rmail-advice activate)
-    "Switch to emacs state when done editing message."
-    (viper-change-state-to-emacs))
 
   ;; ISO accents
   ;; Need to do it after loading iso-acc, or else this loading will wipe out