aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emulation
diff options
context:
space:
mode:
authorMiles Bader2007-04-11 00:17:47 +0000
committerMiles Bader2007-04-11 00:17:47 +0000
commit57cb2e6f261bb0aad81a9f7e6f3017b54adee068 (patch)
tree6ceb46f2e3bf08f16468d77f4fbfd201f637596a /lisp/emulation
parent3bd1d328e94787ac52ef6ba5dfec3b94ba23917a (diff)
parentc429815a6b9d271a57eed4956125f6bc89d1d72b (diff)
downloademacs-57cb2e6f261bb0aad81a9f7e6f3017b54adee068.tar.gz
emacs-57cb2e6f261bb0aad81a9f7e6f3017b54adee068.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 675-697) - Update from CVS - Merge from gnus--rel--5.10 - Release ERC 5.2. * gnus--rel--5.10 (patch 211-215) - Update from CVS - Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-189
Diffstat (limited to 'lisp/emulation')
-rw-r--r--lisp/emulation/viper.el40
1 files changed, 36 insertions, 4 deletions
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index ddd37b16cc2..67ec3660c65 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -1027,14 +1027,46 @@ It also can't undo some Viper settings."
1027 1027
1028 (defadvice describe-key (before viper-describe-key-ad protect activate) 1028 (defadvice describe-key (before viper-describe-key-ad protect activate)
1029 "Force to read key via `viper-read-key-sequence'." 1029 "Force to read key via `viper-read-key-sequence'."
1030 (interactive (list (viper-read-key-sequence "Describe key: ")) 1030 (interactive (let (key)
1031 )) 1031 (setq key (viper-read-key-sequence
1032 "Describe key (or click or menu item): "))
1033 (list key
1034 (prefix-numeric-value current-prefix-arg)
1035 ;; If KEY is a down-event, read also the
1036 ;; corresponding up-event.
1037 (and (vectorp key)
1038 (let ((last-idx (1- (length key))))
1039 (and (eventp (aref key last-idx))
1040 (memq 'down (event-modifiers
1041 (aref key last-idx)))))
1042 (or (and (eventp (aref key 0))
1043 (memq 'down (event-modifiers
1044 (aref key 0)))
1045 ;; For the C-down-mouse-2 popup
1046 ;; menu, there is no subsequent up-event.
1047 (= (length key) 1))
1048 (and (> (length key) 1)
1049 (eventp (aref key 1))
1050 (memq 'down (event-modifiers (aref key 1)))))
1051 (read-event))))))
1032 1052
1033 (defadvice describe-key-briefly 1053 (defadvice describe-key-briefly
1034 (before viper-describe-key-briefly-ad protect activate) 1054 (before viper-describe-key-briefly-ad protect activate)
1035 "Force to read key via `viper-read-key-sequence'." 1055 "Force to read key via `viper-read-key-sequence'."
1036 (interactive (list (viper-read-key-sequence "Describe key briefly: ")))) 1056 (interactive (let (key)
1037 1057 (setq key (viper-read-key-sequence
1058 "Describe key (or click or menu item): "))
1059 ;; If KEY is a down-event, read and discard the
1060 ;; corresponding up-event.
1061 (and (vectorp key)
1062 (let ((last-idx (1- (length key))))
1063 (and (eventp (aref key last-idx))
1064 (memq 'down (event-modifiers (aref key last-idx)))))
1065 (read-event))
1066 (list key
1067 (if current-prefix-arg
1068 (prefix-numeric-value current-prefix-arg))
1069 1))))
1038 1070
1039 (defadvice find-file (before viper-add-suffix-advice activate) 1071 (defadvice find-file (before viper-add-suffix-advice activate)
1040 "Use `read-file-name' for reading arguments." 1072 "Use `read-file-name' for reading arguments."