emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107447: Fix M-x in Viper mode.


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107447: Fix M-x in Viper mode.
Date: Mon, 27 Feb 2012 21:14:36 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107447
fixes bug(s): http://debbugs.gnu.org/9146
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Mon 2012-02-27 21:14:36 +0800
message:
  Fix M-x in Viper mode.
  
  * lisp/emulation/viper-cmd.el (viper-intercept-ESC-key): Fix
  key-binding lookup for ESC key.
modified:
  lisp/ChangeLog
  lisp/emulation/viper-cmd.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-02-27 03:20:00 +0000
+++ b/lisp/ChangeLog    2012-02-27 13:14:36 +0000
@@ -1,5 +1,8 @@
 2012-02-27  Chong Yidong  <address@hidden>
 
+       * emulation/viper-cmd.el (viper-intercept-ESC-key): Fix
+       key-binding lookup for ESC key (Bug#9146).
+
        * font-lock.el (font-lock-specified-p): Rename from
        font-lock-spec-present.  Callers changed.
 

=== modified file 'lisp/emulation/viper-cmd.el'
--- a/lisp/emulation/viper-cmd.el       2012-01-19 07:21:25 +0000
+++ b/lisp/emulation/viper-cmd.el       2012-02-27 13:14:36 +0000
@@ -1086,8 +1086,17 @@
 (defun viper-intercept-ESC-key ()
   "Function that implements ESC key in Viper emulation of Vi."
   (interactive)
-  (let ((cmd (or (key-binding (viper-envelop-ESC-key))
-                (lambda () (interactive) (error "Viper bell")))))
+  ;; `key-binding' needs to be called in a context where Viper's
+  ;; minor-mode map(s) have been temporarily disabled so the ESC
+  ;; binding to viper-intercept-ESC-key doesn't hide the binding we're
+  ;; looking for (Bug#9146):
+  (let* ((event (viper-envelop-ESC-key))
+        (cmd (cond ((equal event viper-ESC-key)
+                    'viper-intercept-ESC-key)
+                   ((let ((emulation-mode-map-alists nil))
+                      (key-binding event)))
+                   (t
+                    (error "Viper bell")))))
 
     ;; call the actual function to execute ESC (if no other symbols followed)
     ;; or the key bound to the ESC sequence (if the sequence was issued


reply via email to

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