aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2013-12-23 11:59:10 +0800
committerChong Yidong2013-12-23 11:59:10 +0800
commit8cd22a0818f3ed6832d4caa1883b32bab3107b54 (patch)
tree1c0922d3bd2e3ebd1fa17f05ca847f85bf7e6391
parentaec3bf9f49c8c0d0356a0e57f362bd0e23206e7d (diff)
downloademacs-8cd22a0818f3ed6832d4caa1883b32bab3107b54.tar.gz
emacs-8cd22a0818f3ed6832d4caa1883b32bab3107b54.zip
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.
-rw-r--r--doc/lispref/ChangeLog6
-rw-r--r--doc/lispref/keymaps.texi57
-rw-r--r--etc/NEWS4
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/calendar/todo-mode.el2
-rw-r--r--lisp/face-remap.el2
-rw-r--r--lisp/indent.el2
-rw-r--r--lisp/isearch.el2
-rw-r--r--lisp/kmacro.el8
-rw-r--r--lisp/minibuffer.el2
-rw-r--r--lisp/org/ChangeLog5
-rw-r--r--lisp/org/org.el2
-rw-r--r--lisp/progmodes/f90.el2
-rw-r--r--lisp/repeat.el2
-rw-r--r--lisp/simple.el2
-rw-r--r--lisp/subr.el48
16 files changed, 99 insertions, 61 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index dbe148dbcf8..aae5a1a6cc2 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,9 @@
12013-12-23 Chong Yidong <cyd@gnu.org>
2
3 * keymaps.texi (Controlling Active Maps): Renamed
4 set-temporary-overlay-map to set-transient map. Doc fixes.
5 (Searching Keymaps): The transient keymap takes precedence.
6
12013-12-23 Glenn Morris <rgm@gnu.org> 72013-12-23 Glenn Morris <rgm@gnu.org>
2 8
3 * loading.texi (How Programs Do Loading, Load Suffixes): 9 * loading.texi (How Programs Do Loading, Load Suffixes):
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi
index 855420a70c9..86e205cf14d 100644
--- a/doc/lispref/keymaps.texi
+++ b/doc/lispref/keymaps.texi
@@ -747,13 +747,13 @@ pseudo-Lisp description of the order and conditions for searching
747them: 747them:
748 748
749@lisp 749@lisp
750(or (cond 750(or (@var{find-in} @var{transient-map})
751 (cond
751 (overriding-terminal-local-map 752 (overriding-terminal-local-map
752 (@var{find-in} overriding-terminal-local-map)) 753 (@var{find-in} overriding-terminal-local-map))
753 (overriding-local-map 754 (overriding-local-map
754 (@var{find-in} overriding-local-map)) 755 (@var{find-in} overriding-local-map))
755 ((or (@var{find-in} (get-char-property (point) 'keymap)) 756 ((or (@var{find-in} (get-char-property (point) 'keymap))
756 (@var{find-in} @var{temp-map})
757 (@var{find-in-any} emulation-mode-map-alists) 757 (@var{find-in-any} emulation-mode-map-alists)
758 (@var{find-in-any} minor-mode-overriding-map-alist) 758 (@var{find-in-any} minor-mode-overriding-map-alist)
759 (@var{find-in-any} minor-mode-map-alist) 759 (@var{find-in-any} minor-mode-map-alist)
@@ -764,14 +764,17 @@ them:
764@end lisp 764@end lisp
765 765
766@noindent 766@noindent
767@var{find-in} and @var{find-in-any} are pseudo functions that search 767Here, @var{find-in} and @var{find-in-any} are pseudo functions that
768in one keymap and in an alist of keymaps, respectively. (Searching a 768search in one keymap and in an alist of keymaps, respectively.
769single keymap for a binding is called @dfn{key lookup}; see @ref{Key 769(Searching a single keymap for a binding is called @dfn{key lookup};
770Lookup}.) If the key sequence starts with a mouse event, that event's position 770see @ref{Key Lookup}.) @var{transient-map} is a pseudo variable that
771is used instead of point and the current buffer. Mouse events on an 771represents the effect of a @code{set-transient-map} call
772embedded string use non-@code{nil} text properties from that string 772(@pxref{Controlling Active Maps}).
773instead of the buffer. @var{temp-map} is a pseudo variable that 773
774represents the effect of a @code{set-temporary-overlay-map} call. 774 In the above pseudo-code, if a key sequence starts with a mouse
775event, that event's position is used instead of point and the current
776buffer. Mouse events on an embedded string use non-@code{nil} text
777properties from that string instead of the buffer.
775 778
776 When a match is found (@pxref{Key Lookup}), if the binding in the 779 When a match is found (@pxref{Key Lookup}), if the binding in the
777keymap is a function, the search is over. However if the keymap entry 780keymap is a function, the search is over. However if the keymap entry
@@ -951,19 +954,27 @@ are used before @code{minor-mode-map-alist} and
951@code{minor-mode-overriding-map-alist}. 954@code{minor-mode-overriding-map-alist}.
952@end defvar 955@end defvar
953 956
954@defun set-temporary-overlay-map keymap &optional keep 957@cindex transient keymap
955This function adds @var{keymap} as a temporary keymap that takes 958@defun set-transient-map keymap &optional keep
956precedence over most other keymaps. It does not take precedence over 959This function adds @var{keymap} as a @dfn{transient} keymap, which
957the ``overriding'' maps (see above); and unlike them, if no match for 960takes precedence over other keymaps for one (or more) subsequent keys.
958a key is found in @var{keymap}, the search continues. 961
959 962Normally, @var{keymap} is used just once, to look up the very next
960Normally, @var{keymap} is used only once. If the optional argument 963key. If the optional argument @var{pred} is @code{t}, the map stays
961@var{pred} is @code{t}, the map stays active if a key from @var{keymap} 964active as long as the user types keys defined in @var{keymap}; when
962is used. @var{pred} can also be a function of no arguments: if it returns 965the user types a key that is not in @var{keymap}, the transient keymap
963non-@code{nil} then @var{keymap} stays active. 966is deactivated and normal key lookup continues for that key.
964 967
965For a pseudo-Lisp description of exactly how and when this keymap applies, 968The @var{pred} argument can also be a function. In that case, the
966@pxref{Searching Keymaps}. 969function is called with no arguments, prior to running each command,
970while @var{keymap} is active; it should return non-@code{nil} if
971@var{keymap} should stay active.
972
973The transient keymap takes precedence over the ``overriding'' maps
974(see above); and unlike them, if no match for a key is found in
975@var{keymap}, the key lookup process continues. For a pseudo-Lisp
976description of exactly how and when this keymap applies,
977@xref{Searching Keymaps}.
967@end defun 978@end defun
968 979
969@node Key Lookup 980@node Key Lookup
diff --git a/etc/NEWS b/etc/NEWS
index 9e694fbbdd0..0496e0d8778 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2149,8 +2149,8 @@ log, log10, sqrt, and mod.
2149 2149
2150** Miscellaneous new functions 2150** Miscellaneous new functions
2151 2151
2152*** `set-temporary-overlay-map' sets up a temporary keymap that 2152*** `set-transient-map' sets up a temporary keymap, active for one key
2153takes precedence over most other maps for a short while (normally one key). 2153(and optionally more). This keymap takes precedence over other maps.
2154 2154
2155*** `autoloadp' tests if its argument is an autoloaded object. 2155*** `autoloadp' tests if its argument is an autoloaded object.
2156 2156
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index fe564a9c8a2..06d2a8270a8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,17 @@
12013-12-23 Chong Yidong <cyd@gnu.org>
2
3 * subr.el (set-transient-map): Rename from
4 set-temporary-overlay-map. Doc fix.
5
6 * face-remap.el (text-scale-adjust):
7 * indent.el (indent-rigidly):
8 * kmacro.el (kmacro-call-macro):
9 * minibuffer.el (minibuffer-force-complete):
10 * repeat.el (repeat):
11 * simple.el (universal-argument--mode):
12 * calendar/todo-mode.el (todo-insert-item--next-param):
13 * progmodes/f90.el (f90-abbrev-start): Callers changed.
14
12013-12-22 Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com> 152013-12-22 Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com>
2 16
3 * net/eww.el (eww-tag-select): Add text-property to jump to next 17 * net/eww.el (eww-tag-select): Add text-property to jump to next
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index 055c97972a8..b230df1744b 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -5619,7 +5619,7 @@ already entered and those still available."
5619 (setq todo-insert-item--argsleft todo-insert-item--newargsleft)) 5619 (setq todo-insert-item--argsleft todo-insert-item--newargsleft))
5620 (when prompt (message "Enter a key (so far `%s'): %s" 5620 (when prompt (message "Enter a key (so far `%s'): %s"
5621 todo-insert-item--keys-so-far prompt)) 5621 todo-insert-item--keys-so-far prompt))
5622 (set-temporary-overlay-map map) 5622 (set-transient-map map)
5623 (setq todo-insert-item--argsleft argsleft))) 5623 (setq todo-insert-item--argsleft argsleft)))
5624 5624
5625;; ----------------------------------------------------------------------------- 5625;; -----------------------------------------------------------------------------
diff --git a/lisp/face-remap.el b/lisp/face-remap.el
index 75170237798..fb1d974e33e 100644
--- a/lisp/face-remap.el
+++ b/lisp/face-remap.el
@@ -326,7 +326,7 @@ a top-level keymap, `text-scale-increase' or
326 (text-scale-increase step) 326 (text-scale-increase step)
327 ;; (unless (zerop step) 327 ;; (unless (zerop step)
328 (message "Use +,-,0 for further adjustment") 328 (message "Use +,-,0 for further adjustment")
329 (set-temporary-overlay-map 329 (set-transient-map
330 (let ((map (make-sparse-keymap))) 330 (let ((map (make-sparse-keymap)))
331 (dolist (mods '(() (control))) 331 (dolist (mods '(() (control)))
332 (dolist (key '(?- ?+ ?= ?0)) ;; = is often unshifted +. 332 (dolist (key '(?- ?+ ?= ?0)) ;; = is often unshifted +.
diff --git a/lisp/indent.el b/lisp/indent.el
index d8bd765f559..b70414a850d 100644
--- a/lisp/indent.el
+++ b/lisp/indent.el
@@ -196,7 +196,7 @@ indentation by specifying a large negative ARG."
196 (progn 196 (progn
197 (message "Edit region indentation with <left>, <right>, <S-left> \ 197 (message "Edit region indentation with <left>, <right>, <S-left> \
198and <S-right>.") 198and <S-right>.")
199 (set-temporary-overlay-map indent-rigidly-map t)) 199 (set-transient-map indent-rigidly-map t))
200 (save-excursion 200 (save-excursion
201 (goto-char end) 201 (goto-char end)
202 (setq end (point-marker)) 202 (setq end (point-marker))
diff --git a/lisp/isearch.el b/lisp/isearch.el
index f222c8f59cd..360fabfa7f2 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2251,7 +2251,7 @@ before the command is executed globally with terminated Isearch."
2251 (main-event (aref key 0))) 2251 (main-event (aref key 0)))
2252 (cond 2252 (cond
2253 ;; Don't exit Isearch if we're in the middle of some 2253 ;; Don't exit Isearch if we're in the middle of some
2254 ;; set-temporary-overlay-map thingy like universal-argument--mode. 2254 ;; `set-transient-map' thingy like `universal-argument--mode'.
2255 ((not (eq overriding-terminal-local-map isearch--saved-overriding-local-map))) 2255 ((not (eq overriding-terminal-local-map isearch--saved-overriding-local-map)))
2256 ;; Don't exit Isearch for isearch key bindings. 2256 ;; Don't exit Isearch for isearch key bindings.
2257 ((commandp (lookup-key isearch-mode-map key nil))) 2257 ((commandp (lookup-key isearch-mode-map key nil)))
diff --git a/lisp/kmacro.el b/lisp/kmacro.el
index d20b54eba35..4f59c23996d 100644
--- a/lisp/kmacro.el
+++ b/lisp/kmacro.el
@@ -650,10 +650,10 @@ others, use \\[kmacro-name-last-macro]."
650 (if (and kmacro-call-repeat-with-arg 650 (if (and kmacro-call-repeat-with-arg
651 arg (> arg 1)) 651 arg (> arg 1))
652 (format " %d times" arg) ""))) 652 (format " %d times" arg) "")))
653 ;; Can't use the `keep-pred' arg because this overlay keymap needs to be 653 ;; Can't use the `keep-pred' arg because this overlay keymap
654 ;; removed during the next run of the kmacro (i.e. we need to add&remove 654 ;; needs to be removed during the next run of the kmacro
655 ;; this overlay-map at each repetition). 655 ;; (i.e. we must add and remove this map at each repetition).
656 (set-temporary-overlay-map 656 (set-transient-map
657 (let ((map (make-sparse-keymap))) 657 (let ((map (make-sparse-keymap)))
658 (define-key map (vector repeat-key) 658 (define-key map (vector repeat-key)
659 `(lambda () (interactive) 659 `(lambda () (interactive)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 178f87c768b..de8cfc5329c 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1222,7 +1222,7 @@ Repeated uses step through the possible completions."
1222 (interactive) 1222 (interactive)
1223 (let ((completion-extra-properties extra-prop)) 1223 (let ((completion-extra-properties extra-prop))
1224 (completion-in-region start (point) table pred))))) 1224 (completion-in-region start (point) table pred)))))
1225 (set-temporary-overlay-map 1225 (set-transient-map
1226 (let ((map (make-sparse-keymap))) 1226 (let ((map (make-sparse-keymap)))
1227 (define-key map [remap completion-at-point] cmd) 1227 (define-key map [remap completion-at-point] cmd)
1228 (define-key map (vector last-command-event) cmd) 1228 (define-key map (vector last-command-event) cmd)
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index fa9dc824c99..a3f8e358617 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,8 @@
12013-12-23 Chong Yidong <cyd@gnu.org>
2
3 * org.el (orgstruct-make-binding): Call set-transient-map instead
4 of old name set-temporary-overlay-map.
5
12013-12-06 Achim Gratz <Stromeko@Stromeko.DE> 62013-12-06 Achim Gratz <Stromeko@Stromeko.DE>
2 7
3 * org-crypt.el: Declare `epg-context´. 8 * org-crypt.el: Declare `epg-context´.
diff --git a/lisp/org/org.el b/lisp/org/org.el
index adaabebc6a5..79dbb9b0574 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -9062,7 +9062,7 @@ if `orgstruct-heading-prefix-regexp' is not empty."
9062 (key-description key)))))) 9062 (key-description key))))))
9063 thereis (key-binding key)))) 9063 thereis (key-binding key))))
9064 (if (keymapp binding) 9064 (if (keymapp binding)
9065 (set-temporary-overlay-map binding) 9065 (set-transient-map binding)
9066 (let ((func (or binding 9066 (let ((func (or binding
9067 (unless disable 9067 (unless disable
9068 'orgstruct-error)))) 9068 'orgstruct-error))))
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index 80f663360e4..269b0879278 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -2259,7 +2259,7 @@ Any other key combination is executed normally."
2259 (interactive "*") 2259 (interactive "*")
2260 (self-insert-command 1) 2260 (self-insert-command 1)
2261 (when abbrev-mode 2261 (when abbrev-mode
2262 (set-temporary-overlay-map 2262 (set-transient-map
2263 (let ((map (make-sparse-keymap))) 2263 (let ((map (make-sparse-keymap)))
2264 (define-key map [??] 'f90-abbrev-help) 2264 (define-key map [??] 'f90-abbrev-help)
2265 (define-key map (vector help-char) 'f90-abbrev-help) 2265 (define-key map (vector help-char) 'f90-abbrev-help)
diff --git a/lisp/repeat.el b/lisp/repeat.el
index 01defa66695..d1798f30d8c 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -278,7 +278,7 @@ recently executed command not bound to an input event\"."
278 (execute-kbd-macro last-repeatable-command)) 278 (execute-kbd-macro last-repeatable-command))
279 (call-interactively last-repeatable-command)))) 279 (call-interactively last-repeatable-command))))
280 (when repeat-repeat-char 280 (when repeat-repeat-char
281 (set-temporary-overlay-map 281 (set-transient-map
282 (let ((map (make-sparse-keymap))) 282 (let ((map (make-sparse-keymap)))
283 (define-key map (vector repeat-repeat-char) 283 (define-key map (vector repeat-repeat-char)
284 (if (null repeat-message-function) 'repeat 284 (if (null repeat-message-function) 'repeat
diff --git a/lisp/simple.el b/lisp/simple.el
index d6e61fd2095..a6543516a9c 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3321,7 +3321,7 @@ see other processes running on the system, use `list-system-processes'."
3321 "Keymap used while processing \\[universal-argument].") 3321 "Keymap used while processing \\[universal-argument].")
3322 3322
3323(defun universal-argument--mode () 3323(defun universal-argument--mode ()
3324 (set-temporary-overlay-map universal-argument-map)) 3324 (set-transient-map universal-argument-map))
3325 3325
3326(defun universal-argument () 3326(defun universal-argument ()
3327 "Begin a numeric argument for the following command. 3327 "Begin a numeric argument for the following command.
diff --git a/lisp/subr.el b/lisp/subr.el
index 2a2068ff295..ab2023bd544 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4266,33 +4266,35 @@ use `called-interactively-p'."
4266 (eq 'add-keymap-witness (nth 1 map)) 4266 (eq 'add-keymap-witness (nth 1 map))
4267 (set symbol tail))))) 4267 (set symbol tail)))))
4268 4268
4269(defun set-temporary-overlay-map (map &optional keep-pred on-exit) 4269(defun set-transient-map (map &optional keep-pred on-exit)
4270 "Set MAP as a temporary keymap taking precedence over most other keymaps. 4270 "Set MAP as a temporary keymap taking precedence over other keymaps.
4271Note that this does NOT take precedence over the \"overriding\" maps 4271Normally, MAP is used only once, to look up the very next key.
4272`overriding-terminal-local-map' and `overriding-local-map' (or the 4272However, if the optional argument KEEP-PRED is t, MAP stays
4273`keymap' text property). Unlike those maps, if no match for a key is 4273active if a key from MAP is used. KEEP-PRED can also be a
4274found in MAP, the normal key lookup sequence then continues. 4274function of no arguments: if it returns non-nil, then MAP stays
4275 4275active.
4276Normally, MAP is used only once. If the optional argument 4276
4277KEEP-PRED is t, MAP stays active if a key from MAP is used. 4277Optional arg ON-EXIT, if non-nil, specifies a function that is
4278KEEP-PRED can also be a function of no arguments: if it returns 4278called, with no arguments, after MAP is deactivated.
4279non-nil then MAP stays active. 4279
4280 4280Note that MAP will take precedence over the \"overriding\" maps
4281Optional ON-EXIT argument is a function that is called after the 4281`overriding-terminal-local-map' and `overriding-local-map' (and
4282deactivation of MAP." 4282over the `keymap' text property). Unlike those maps, if no match
4283 (let ((clearfun (make-symbol "clear-temporary-overlay-map"))) 4283for a key is found in MAP, Emacs continues the normal key lookup
4284sequence."
4285 (let ((clearfun (make-symbol "clear-transient-map")))
4284 ;; Don't use letrec, because equal (in add/remove-hook) would get trapped 4286 ;; Don't use letrec, because equal (in add/remove-hook) would get trapped
4285 ;; in a cycle. 4287 ;; in a cycle.
4286 (fset clearfun 4288 (fset clearfun
4287 (lambda () 4289 (lambda ()
4288 ;; FIXME: Handle the case of multiple temporary-overlay-maps 4290 ;; FIXME: Handle the case of multiple transient maps. For
4289 ;; E.g. if isearch and C-u both use temporary-overlay-maps, Then 4291 ;; example, if isearch and C-u both use transient maps,
4290 ;; the lifetime of the C-u should be nested within the isearch 4292 ;; then the lifetime of the C-u should be nested within
4291 ;; overlay, so the pre-command-hook of isearch should be 4293 ;; the isearch overlay, so the pre-command-hook of isearch
4292 ;; suspended during the C-u one so we don't exit isearch just 4294 ;; should be suspended during the C-u one so we don't exit
4293 ;; because we hit 1 after C-u and that 1 exits isearch whereas it 4295 ;; isearch just because we hit 1 after C-u and that 1
4294 ;; doesn't exit C-u. 4296 ;; exits isearch whereas it doesn't exit C-u.
4295 (with-demoted-errors "set-temporary-overlay-map PCH: %S" 4297 (with-demoted-errors "set-transient-map PCH: %S"
4296 (unless (cond ((null keep-pred) nil) 4298 (unless (cond ((null keep-pred) nil)
4297 ((eq t keep-pred) 4299 ((eq t keep-pred)
4298 (eq this-command 4300 (eq this-command