emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r115889: * lisp/subr.el (set-transient-map): Fix nes


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r115889: * lisp/subr.el (set-transient-map): Fix nested case and docstring.
Date: Mon, 06 Jan 2014 19:29:44 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115889
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2014-01-06 14:29:39 -0500
message:
  * lisp/subr.el (set-transient-map): Fix nested case and docstring.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/subr.el                   subr.el-20091113204419-o5vbwnq5f7feedwu-151
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-01-06 11:15:42 +0000
+++ b/lisp/ChangeLog    2014-01-06 19:29:39 +0000
@@ -1,3 +1,7 @@
+2014-01-06  Stefan Monnier  <address@hidden>
+
+       * subr.el (set-transient-map): Fix nested case and docstring.
+
 2014-01-06  Tassilo Horn  <address@hidden>
 
        * textmodes/reftex-vars.el (reftex-label-alist-builtin): Add a
@@ -10,12 +14,10 @@
        * vc/log-view.el (log-view-beginning-of-defun): Rewrite to behave
        like `beginning-of-defun'.
        (log-view-end-of-defun,log-view-end-of-defun-1): Rename old
-       log-view-end-of-defun to log-view-end-of-defun-1. Replace
-       log-view-end-of-defun with wrapper that behaves like
-       `end-of-defun'.
+       log-view-end-of-defun to log-view-end-of-defun-1.  Replace
+       log-view-end-of-defun with wrapper that behaves like `end-of-defun'.
        (log-view-extract-comment): Call `log-view-current-entry' directly
-       instead of relying on broken `log-view-beginning-of-defun'
-       behavior.
+       instead of relying on broken `log-view-beginning-of-defun' behavior.
 
 2014-01-06  Paul Eggert  <address@hidden>
 

=== modified file 'lisp/subr.el'
--- a/lisp/subr.el      2014-01-01 07:43:34 +0000
+++ b/lisp/subr.el      2014-01-06 19:29:39 +0000
@@ -4280,29 +4280,33 @@
 Optional arg ON-EXIT, if non-nil, specifies a function that is
 called, with no arguments, after MAP is deactivated.
 
-Note that MAP will take precedence over the \"overriding\" maps
-`overriding-terminal-local-map' and `overriding-local-map' (and
-over the `keymap' text property).  Unlike those maps, if no match
-for a key is found in MAP, Emacs continues the normal key lookup
-sequence."
+This uses `overriding-terminal-local-map' which takes precedence over all other
+keymaps.  As usual, if no match for a key is found in MAP, the normal key
+lookup sequence then continues."
   (let ((clearfun (make-symbol "clear-transient-map")))
     ;; Don't use letrec, because equal (in add/remove-hook) would get trapped
     ;; in a cycle.
     (fset clearfun
           (lambda ()
-            ;; FIXME: Handle the case of multiple transient maps.  For
-            ;; example, if isearch and C-u both use transient maps,
-            ;; then the lifetime of the C-u should be nested within
-            ;; the isearch overlay, so the pre-command-hook of isearch
-            ;; should be suspended during the C-u one so we don't exit
-            ;; isearch just because we hit 1 after C-u and that 1
-            ;; exits isearch whereas it doesn't exit C-u.
             (with-demoted-errors "set-transient-map PCH: %S"
-              (unless (cond ((null keep-pred) nil)
-                            ((eq t keep-pred)
-                             (eq this-command
-                                 (lookup-key map (this-command-keys-vector))))
-                            (t (funcall keep-pred)))
+              (unless (cond
+                       ((not (eq map (cadr overriding-terminal-local-map)))
+                        ;; There's presumably some other transient-map in
+                        ;; effect.  Wait for that one to terminate before we
+                        ;; remove ourselves.
+                        ;; For example, if isearch and C-u both use transient
+                        ;; maps, then the lifetime of the C-u should be nested
+                        ;; within isearch's, so the pre-command-hook of
+                        ;; isearch should be suspended during the C-u one so
+                        ;; we don't exit isearch just because we hit 1 after
+                        ;; C-u and that 1 exits isearch whereas it doesn't
+                        ;; exit C-u.
+                        t)
+                       ((null keep-pred) nil)
+                       ((eq t keep-pred)
+                        (eq this-command
+                            (lookup-key map (this-command-keys-vector))))
+                       (t (funcall keep-pred)))
                 (internal-pop-keymap map 'overriding-terminal-local-map)
                 (remove-hook 'pre-command-hook clearfun)
                 (when on-exit (funcall on-exit))))))


reply via email to

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