]> git.eshelyaron.com Git - emacs.git/commitdiff
2007-06-14 Michael Kifer <kifer@cs.stonybrook.edu>
authorMichael Kifer <kifer@cs.stonybrook.edu>
Thu, 14 Jun 2007 18:10:46 +0000 (18:10 +0000)
committerMichael Kifer <kifer@cs.stonybrook.edu>
Thu, 14 Jun 2007 18:10:46 +0000 (18:10 +0000)
* viper.el (viper-describe-key-ad, viper-describe-key-briefly-ad):
different advices for Emacs and XEmacs. Compile them conditionally.
(viper-version): belated version change.

etc/ChangeLog
lisp/emulation/viper.el

index 49028bdf6912fe582485e237b2c624c25446236c..c5e2a60c53ec83b8e7261b8f41c0875b3d8d44b6 100644 (file)
@@ -1,3 +1,9 @@
+2007-06-14  Michael Kifer  <kifer@cs.stonybrook.edu>
+       
+       * viper.el (viper-describe-key-ad, viper-describe-key-briefly-ad):
+       different advices for Emacs and XEmacs. Compile them conditionally.
+       (viper-version): belated version change.
+       
 2007-06-14  Nick Roberts  <nickrob@snap.net.nz>
 
        * NEWS: Mention mouse highlighting in a GNU/Linux console.
index 3cc8974248c2b6fb136df807070419c815b6f55d..a42e7f1eb91dabf2a2c3f8afb334e8b7b7fd9143 100644 (file)
@@ -9,7 +9,7 @@
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Keywords: emulations
 
-(defconst viper-version "3.13.1 of October 23, 2006"
+(defconst viper-version "3.14 of June 14, 2007"
   "The current version of Viper")
 
 ;; This file is part of GNU Emacs.
@@ -1026,48 +1026,63 @@ It also can't undo some Viper settings."
       (setq global-mode-string
            (append '("" viper-mode-string) (cdr global-mode-string))))
 
-  (defadvice describe-key (before viper-describe-key-ad protect activate)
-    "Force to read key via `viper-read-key-sequence'."
-    (interactive (let (key)
-                  (setq key (viper-read-key-sequence
-                             "Describe key (or click or menu item): "))
-                  (list key
-                        (prefix-numeric-value current-prefix-arg)
-                        ;; If KEY is a down-event, read also the
-                        ;; corresponding up-event.
-                        (and (vectorp key)
-                             (let ((last-idx (1- (length key))))
-                               (and (eventp (aref key last-idx))
-                                    (memq 'down (event-modifiers
-                                                 (aref key last-idx)))))
-                             (or (and (eventp (aref key 0))
-                                      (memq 'down (event-modifiers
-                                                   (aref key 0)))
-                                      ;; For the C-down-mouse-2 popup
-                                      ;; menu, there is no subsequent up-event.
-                                      (= (length key) 1))
-                                 (and (> (length key) 1)
-                                      (eventp (aref key 1))
-                                      (memq 'down (event-modifiers (aref key 1)))))
-                             (read-event))))))
-
-  (defadvice describe-key-briefly
-    (before viper-describe-key-briefly-ad protect activate)
-    "Force to read key via `viper-read-key-sequence'."
-    (interactive (let (key)
-                  (setq key (viper-read-key-sequence
-                             "Describe key (or click or menu item): "))
-                  ;; If KEY is a down-event, read and discard the
-                  ;; corresponding up-event.
-                  (and (vectorp key)
-                       (let ((last-idx (1- (length key))))
-                         (and (eventp (aref key last-idx))
-                              (memq 'down (event-modifiers (aref key last-idx)))))
-                       (read-event))
-                  (list key
-                        (if current-prefix-arg
-                            (prefix-numeric-value current-prefix-arg))
-                        1))))
+  (viper-cond-compile-for-xemacs-or-emacs
+   ;; XEmacs
+   (defadvice describe-key (before viper-describe-key-ad protect activate)
+     "Force to read key via `viper-read-key-sequence'."
+     (interactive (list (viper-read-key-sequence "Describe key: "))))
+   ;; Emacs
+   (defadvice describe-key (before viper-describe-key-ad protect activate)
+     "Force to read key via `viper-read-key-sequence'."
+     (interactive (let (key)
+                   (setq key (viper-read-key-sequence
+                              "Describe key (or click or menu item): "))
+                   (list key
+                         (prefix-numeric-value current-prefix-arg)
+                         ;; If KEY is a down-event, read also the
+                         ;; corresponding up-event.
+                         (and (vectorp key)
+                              (let ((last-idx (1- (length key))))
+                                (and (eventp (aref key last-idx))
+                                     (memq 'down (event-modifiers
+                                                  (aref key last-idx)))))
+                              (or (and (eventp (aref key 0))
+                                       (memq 'down (event-modifiers
+                                                    (aref key 0)))
+                                       ;; For the C-down-mouse-2 popup menu,
+                                       ;; there is no subsequent up-event
+                                       (= (length key) 1))
+                                  (and (> (length key) 1)
+                                       (eventp (aref key 1))
+                                       (memq 'down (event-modifiers (aref key 1)))))
+                              (read-event))))))
+   ) ; viper-cond-compile-for-xemacs-or-emacs
+
+  (viper-cond-compile-for-xemacs-or-emacs
+   ;; XEmacs
+   (defadvice describe-key-briefly
+     (before viper-describe-key-briefly-ad protect activate)
+     "Force to read key via `viper-read-key-sequence'."
+     (interactive (list (viper-read-key-sequence "Describe key briefly: "))))
+   ;; Emacs
+   (defadvice describe-key-briefly
+     (before viper-describe-key-briefly-ad protect activate)
+     "Force to read key via `viper-read-key-sequence'."
+     (interactive (let (key)
+                   (setq key (viper-read-key-sequence
+                              "Describe key (or click or menu item): "))
+                   ;; If KEY is a down-event, read and discard the
+                   ;; corresponding up-event.
+                   (and (vectorp key)
+                        (let ((last-idx (1- (length key))))
+                          (and (eventp (aref key last-idx))
+                               (memq 'down (event-modifiers (aref key last-idx)))))
+                        (read-event))
+                   (list key
+                         (if current-prefix-arg
+                             (prefix-numeric-value current-prefix-arg))
+                         1))))
+   ) ;; viper-cond-compile-for-xemacs-or-emacs
 
   (defadvice find-file (before viper-add-suffix-advice activate)
     "Use `read-file-name' for reading arguments."