emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r115702: Rename set-temporary-overlay-map -> set-tra


From: Chong Yidong
Subject: [Emacs-diffs] trunk r115702: Rename set-temporary-overlay-map -> set-transient-map
Date: Mon, 23 Dec 2013 03:59:55 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115702
revision-id: address@hidden
parent: address@hidden
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Mon 2013-12-23 11:59:10 +0800
message:
  Rename set-temporary-overlay-map -> set-transient-map
  
  * lisp/subr.el (set-transient-map): Rename from
  set-temporary-overlay-map.  Doc fix.
  
  * lisp/face-remap.el (text-scale-adjust):
  * lisp/indent.el (indent-rigidly):
  * lisp/kmacro.el (kmacro-call-macro):
  * lisp/minibuffer.el (minibuffer-force-complete):
  * lisp/repeat.el (repeat):
  * lisp/simple.el (universal-argument--mode):
  * lisp/calendar/todo-mode.el (todo-insert-item--next-param):
  * lisp/progmodes/f90.el (f90-abbrev-start): Callers changed.
  
  * lisp/org/org.el (orgstruct-make-binding): Call set-transient-map
  instead of old name set-temporary-overlay-map.
  
  * doc/lispref/keymaps.texi (Controlling Active Maps): Renamed
  set-temporary-overlay-map to set-transient map.  Doc fixes.
  (Searching Keymaps): The transient keymap takes precedence.
modified:
  doc/lispref/ChangeLog          changelog-20091113204419-o5vbwnq5f7feedwu-6155
  doc/lispref/keymaps.texi       
keymaps.texi-20091113204419-o5vbwnq5f7feedwu-6190
  etc/NEWS                       news-20100311060928-aoit31wvzf25yr1z-1
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/calendar/todo-mode.el     todos.el-20120911155047-0ytqo2nidwqquefa-1
  lisp/face-remap.el             
faceremap.el-20091113204419-o5vbwnq5f7feedwu-8674
  lisp/indent.el                 indent.el-20091113204419-o5vbwnq5f7feedwu-230
  lisp/isearch.el                isearch.el-20091113204419-o5vbwnq5f7feedwu-486
  lisp/kmacro.el                 kmacro.el-20091113204419-o5vbwnq5f7feedwu-2431
  lisp/minibuffer.el             
minibuffer.el-20091113204419-o5vbwnq5f7feedwu-8622
  lisp/org/ChangeLog             changelog-20091113204419-o5vbwnq5f7feedwu-8688
  lisp/org/org.el                org.el-20091113204419-o5vbwnq5f7feedwu-8617
  lisp/progmodes/f90.el          f90.el-20091113204419-o5vbwnq5f7feedwu-827
  lisp/repeat.el                 repeat.el-20091113204419-o5vbwnq5f7feedwu-1276
  lisp/simple.el                 simple.el-20091113204419-o5vbwnq5f7feedwu-403
  lisp/subr.el                   subr.el-20091113204419-o5vbwnq5f7feedwu-151
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog     2013-12-23 02:54:28 +0000
+++ b/doc/lispref/ChangeLog     2013-12-23 03:59:10 +0000
@@ -1,3 +1,9 @@
+2013-12-23  Chong Yidong  <address@hidden>
+
+       * keymaps.texi (Controlling Active Maps): Renamed
+       set-temporary-overlay-map to set-transient map.  Doc fixes.
+       (Searching Keymaps): The transient keymap takes precedence.
+
 2013-12-23  Glenn Morris  <address@hidden>
 
        * loading.texi (How Programs Do Loading, Load Suffixes):

=== modified file 'doc/lispref/keymaps.texi'
--- a/doc/lispref/keymaps.texi  2013-11-10 12:18:03 +0000
+++ b/doc/lispref/keymaps.texi  2013-12-23 03:59:10 +0000
@@ -747,13 +747,13 @@
 them:
 
 @lisp
-(or (cond
+(or (@var{find-in} @var{transient-map})
+    (cond
      (overriding-terminal-local-map
       (@var{find-in} overriding-terminal-local-map))
      (overriding-local-map
       (@var{find-in} overriding-local-map))
      ((or (@var{find-in} (get-char-property (point) 'keymap))
-          (@var{find-in} @var{temp-map})
           (@var{find-in-any} emulation-mode-map-alists)
           (@var{find-in-any} minor-mode-overriding-map-alist)
           (@var{find-in-any} minor-mode-map-alist)
@@ -764,14 +764,17 @@
 @end lisp
 
 @noindent
address@hidden and @var{find-in-any} are pseudo functions that search
-in one keymap and in an alist of keymaps, respectively.  (Searching a
-single keymap for a binding is called @dfn{key lookup}; see @ref{Key
-Lookup}.)  If the key sequence starts with a mouse event, that event's position
-is used instead of point and the current buffer.  Mouse events on an
-embedded string use address@hidden text properties from that string
-instead of the buffer.  @var{temp-map} is a pseudo variable that
-represents the effect of a @code{set-temporary-overlay-map} call.
+Here, @var{find-in} and @var{find-in-any} are pseudo functions that
+search in one keymap and in an alist of keymaps, respectively.
+(Searching a single keymap for a binding is called @dfn{key lookup};
+see @ref{Key Lookup}.)  @var{transient-map} is a pseudo variable that
+represents the effect of a @code{set-transient-map} call
+(@pxref{Controlling Active Maps}).
+
+  In the above pseudo-code, if a key sequence starts with a mouse
+event, that event's position is used instead of point and the current
+buffer.  Mouse events on an embedded string use address@hidden text
+properties from that string instead of the buffer.
 
   When a match is found (@pxref{Key Lookup}), if the binding in the
 keymap is a function, the search is over.  However if the keymap entry
@@ -951,19 +954,27 @@
 @code{minor-mode-overriding-map-alist}.
 @end defvar
 
address@hidden set-temporary-overlay-map keymap &optional keep
-This function adds @var{keymap} as a temporary keymap that takes
-precedence over most other keymaps.  It does not take precedence over
-the ``overriding'' maps (see above); and unlike them, if no match for
-a key is found in @var{keymap}, the search continues.
-
-Normally, @var{keymap} is used only once.  If the optional argument
address@hidden is @code{t}, the map stays active if a key from @var{keymap}
-is used.  @var{pred} can also be a function of no arguments: if it returns
address@hidden then @var{keymap} stays active.
-
-For a pseudo-Lisp description of exactly how and when this keymap applies,
address@hidden Keymaps}.
address@hidden transient keymap
address@hidden set-transient-map keymap &optional keep
+This function adds @var{keymap} as a @dfn{transient} keymap, which
+takes precedence over other keymaps for one (or more) subsequent keys.
+
+Normally, @var{keymap} is used just once, to look up the very next
+key.  If the optional argument @var{pred} is @code{t}, the map stays
+active as long as the user types keys defined in @var{keymap}; when
+the user types a key that is not in @var{keymap}, the transient keymap
+is deactivated and normal key lookup continues for that key.
+
+The @var{pred} argument can also be a function.  In that case, the
+function is called with no arguments, prior to running each command,
+while @var{keymap} is active; it should return address@hidden if
address@hidden should stay active.
+
+The transient keymap takes precedence over the ``overriding'' maps
+(see above); and unlike them, if no match for a key is found in
address@hidden, the key lookup process continues.  For a pseudo-Lisp
+description of exactly how and when this keymap applies,
address@hidden Keymaps}.
 @end defun
 
 @node Key Lookup

=== modified file 'etc/NEWS'
--- a/etc/NEWS  2013-12-22 23:19:42 +0000
+++ b/etc/NEWS  2013-12-23 03:59:10 +0000
@@ -2149,8 +2149,8 @@
 
 ** Miscellaneous new functions
 
-*** `set-temporary-overlay-map' sets up a temporary keymap that
-takes precedence over most other maps for a short while (normally one key).
+*** `set-transient-map' sets up a temporary keymap, active for one key
+(and optionally more).  This keymap takes precedence over other maps.
 
 *** `autoloadp' tests if its argument is an autoloaded object.
 

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-12-22 22:40:35 +0000
+++ b/lisp/ChangeLog    2013-12-23 03:59:10 +0000
@@ -1,3 +1,17 @@
+2013-12-23  Chong Yidong  <address@hidden>
+
+       * subr.el (set-transient-map): Rename from
+       set-temporary-overlay-map.  Doc fix.
+
+       * face-remap.el (text-scale-adjust):
+       * indent.el (indent-rigidly):
+       * kmacro.el (kmacro-call-macro):
+       * minibuffer.el (minibuffer-force-complete):
+       * repeat.el (repeat):
+       * simple.el (universal-argument--mode):
+       * calendar/todo-mode.el (todo-insert-item--next-param):
+       * progmodes/f90.el (f90-abbrev-start): Callers changed.
+
 2013-12-22  Kenjiro NAKAYAMA <address@hidden>
 
        * net/eww.el (eww-tag-select): Add text-property to jump to next

=== modified file 'lisp/calendar/todo-mode.el'
--- a/lisp/calendar/todo-mode.el        2013-12-20 17:21:12 +0000
+++ b/lisp/calendar/todo-mode.el        2013-12-23 03:59:10 +0000
@@ -5619,7 +5619,7 @@
       (setq todo-insert-item--argsleft todo-insert-item--newargsleft))
     (when prompt (message "Enter a key (so far `%s'): %s"
                          todo-insert-item--keys-so-far prompt))
-    (set-temporary-overlay-map map)
+    (set-transient-map map)
     (setq todo-insert-item--argsleft argsleft)))
 
 ;; 
-----------------------------------------------------------------------------

=== modified file 'lisp/face-remap.el'
--- a/lisp/face-remap.el        2013-10-13 05:17:42 +0000
+++ b/lisp/face-remap.el        2013-12-23 03:59:10 +0000
@@ -326,7 +326,7 @@
       (text-scale-increase step)
       ;; (unless (zerop step)
       (message "Use +,-,0 for further adjustment")
-      (set-temporary-overlay-map
+      (set-transient-map
        (let ((map (make-sparse-keymap)))
          (dolist (mods '(() (control)))
            (dolist (key '(?- ?+ ?= ?0)) ;; = is often unshifted +.

=== modified file 'lisp/indent.el'
--- a/lisp/indent.el    2013-12-21 08:37:08 +0000
+++ b/lisp/indent.el    2013-12-23 03:59:10 +0000
@@ -196,7 +196,7 @@
       (progn
         (message "Edit region indentation with <left>, <right>, <S-left> \
 and <S-right>.")
-        (set-temporary-overlay-map indent-rigidly-map t))
+        (set-transient-map indent-rigidly-map t))
     (save-excursion
       (goto-char end)
       (setq end (point-marker))

=== modified file 'lisp/isearch.el'
--- a/lisp/isearch.el   2013-12-19 22:12:12 +0000
+++ b/lisp/isearch.el   2013-12-23 03:59:10 +0000
@@ -2251,7 +2251,7 @@
         (main-event (aref key 0)))
     (cond
      ;; Don't exit Isearch if we're in the middle of some
-     ;; set-temporary-overlay-map thingy like universal-argument--mode.
+     ;; `set-transient-map' thingy like `universal-argument--mode'.
      ((not (eq overriding-terminal-local-map 
isearch--saved-overriding-local-map)))
      ;; Don't exit Isearch for isearch key bindings.
      ((commandp (lookup-key isearch-mode-map key nil)))

=== modified file 'lisp/kmacro.el'
--- a/lisp/kmacro.el    2013-09-23 02:58:02 +0000
+++ b/lisp/kmacro.el    2013-12-23 03:59:10 +0000
@@ -650,10 +650,10 @@
                 (if (and kmacro-call-repeat-with-arg
                          arg (> arg 1))
                     (format " %d times" arg) "")))
-      ;; Can't use the `keep-pred' arg because this overlay keymap needs to be
-      ;; removed during the next run of the kmacro (i.e. we need to add&remove
-      ;; this overlay-map at each repetition).
-      (set-temporary-overlay-map
+      ;; Can't use the `keep-pred' arg because this overlay keymap
+      ;; needs to be removed during the next run of the kmacro
+      ;; (i.e. we must add and remove this map at each repetition).
+      (set-transient-map
        (let ((map (make-sparse-keymap)))
          (define-key map (vector repeat-key)
            `(lambda () (interactive)

=== modified file 'lisp/minibuffer.el'
--- a/lisp/minibuffer.el        2013-12-06 00:48:52 +0000
+++ b/lisp/minibuffer.el        2013-12-23 03:59:10 +0000
@@ -1222,7 +1222,7 @@
                 (interactive)
                 (let ((completion-extra-properties extra-prop))
                   (completion-in-region start (point) table pred)))))
-        (set-temporary-overlay-map
+        (set-transient-map
          (let ((map (make-sparse-keymap)))
            (define-key map [remap completion-at-point] cmd)
            (define-key map (vector last-command-event) cmd)

=== modified file 'lisp/org/ChangeLog'
--- a/lisp/org/ChangeLog        2013-12-06 11:21:31 +0000
+++ b/lisp/org/ChangeLog        2013-12-23 03:59:10 +0000
@@ -1,3 +1,8 @@
+2013-12-23  Chong Yidong  <address@hidden>
+
+       * org.el (orgstruct-make-binding): Call set-transient-map instead
+       of old name set-temporary-overlay-map.
+
 2013-12-06  Achim Gratz  <address@hidden>
 
        * org-crypt.el: Declare `epg-context´.

=== modified file 'lisp/org/org.el'
--- a/lisp/org/org.el   2013-12-06 11:21:31 +0000
+++ b/lisp/org/org.el   2013-12-23 03:59:10 +0000
@@ -9062,7 +9062,7 @@
                                              (key-description key))))))
                              thereis (key-binding key))))
                  (if (keymapp binding)
-                     (set-temporary-overlay-map binding)
+                     (set-transient-map binding)
                    (let ((func (or binding
                                    (unless disable
                                      'orgstruct-error))))

=== modified file 'lisp/progmodes/f90.el'
--- a/lisp/progmodes/f90.el     2013-08-05 10:35:55 +0000
+++ b/lisp/progmodes/f90.el     2013-12-23 03:59:10 +0000
@@ -2259,7 +2259,7 @@
   (interactive "*")
   (self-insert-command 1)
   (when abbrev-mode
-    (set-temporary-overlay-map
+    (set-transient-map
      (let ((map (make-sparse-keymap)))
        (define-key map [??] 'f90-abbrev-help)
        (define-key map (vector help-char) 'f90-abbrev-help)

=== modified file 'lisp/repeat.el'
--- a/lisp/repeat.el    2013-01-01 09:11:05 +0000
+++ b/lisp/repeat.el    2013-12-23 03:59:10 +0000
@@ -278,7 +278,7 @@
               (execute-kbd-macro last-repeatable-command))
           (call-interactively last-repeatable-command))))
     (when repeat-repeat-char
-      (set-temporary-overlay-map
+      (set-transient-map
        (let ((map (make-sparse-keymap)))
          (define-key map (vector repeat-repeat-char)
            (if (null repeat-message-function) 'repeat

=== modified file 'lisp/simple.el'
--- a/lisp/simple.el    2013-12-21 22:55:59 +0000
+++ b/lisp/simple.el    2013-12-23 03:59:10 +0000
@@ -3321,7 +3321,7 @@
   "Keymap used while processing \\[universal-argument].")
 
 (defun universal-argument--mode ()
-  (set-temporary-overlay-map universal-argument-map))
+  (set-transient-map universal-argument-map))
 
 (defun universal-argument ()
   "Begin a numeric argument for the following command.

=== modified file 'lisp/subr.el'
--- a/lisp/subr.el      2013-12-20 19:55:56 +0000
+++ b/lisp/subr.el      2013-12-23 03:59:10 +0000
@@ -4266,33 +4266,35 @@
            (eq 'add-keymap-witness (nth 1 map))
            (set symbol tail)))))
 
-(defun set-temporary-overlay-map (map &optional keep-pred on-exit)
-  "Set MAP as a temporary keymap taking precedence over most other keymaps.
-Note that this does NOT take precedence over the \"overriding\" maps
-`overriding-terminal-local-map' and `overriding-local-map' (or the
-`keymap' text property).  Unlike those maps, if no match for a key is
-found in MAP, the normal key lookup sequence then continues.
-
-Normally, MAP is used only once.  If the optional argument
-KEEP-PRED is t, MAP stays active if a key from MAP is used.
-KEEP-PRED can also be a function of no arguments: if it returns
-non-nil then MAP stays active.
-
-Optional ON-EXIT argument is a function that is called after the
-deactivation of MAP."
-  (let ((clearfun (make-symbol "clear-temporary-overlay-map")))
+(defun set-transient-map (map &optional keep-pred on-exit)
+  "Set MAP as a temporary keymap taking precedence over other keymaps.
+Normally, MAP is used only once, to look up the very next key.
+However, if the optional argument KEEP-PRED is t, MAP stays
+active if a key from MAP is used.  KEEP-PRED can also be a
+function of no arguments: if it returns non-nil, then MAP stays
+active.
+
+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."
+  (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 temporary-overlay-maps
-            ;; E.g. if isearch and C-u both use temporary-overlay-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-temporary-overlay-map PCH: %S"
+            ;; 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


reply via email to

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