summaryrefslogtreecommitdiff
path: root/lisp/face-remap.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2012-05-04 22:50:20 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2012-05-04 22:50:20 -0400
commitdf96ab1e0a29e4d178b1406ceacc70d5f9e5c2d6 (patch)
tree3508d5f0daa190d0bcbe3611a1e68eef06ee8605 /lisp/face-remap.el
parent5342bb062f39a387e9a770b3edef881ee4a72f17 (diff)
downloademacs-df96ab1e0a29e4d178b1406ceacc70d5f9e5c2d6.tar.gz
Use set-temporary-overlay-map.
* lisp/repeat.el: Use lexical-binding. (repeat-last-self-insert, repeat-num-input-keys-at-self-insert) (repeat-undo-count): Remove. (repeat): * lisp/progmodes/octave-mod.el (octave-abbrev-start): * lisp/progmodes/f90.el (f90-abbrev-start): * lisp/face-remap.el (text-scale-adjust): * lisp/kmacro.el (kmacro-call-macro): Use set-temporary-overlay-map.
Diffstat (limited to 'lisp/face-remap.el')
-rw-r--r--lisp/face-remap.el39
1 files changed, 21 insertions, 18 deletions
diff --git a/lisp/face-remap.el b/lisp/face-remap.el
index ca7a28328f9..46dad0fca3a 100644
--- a/lisp/face-remap.el
+++ b/lisp/face-remap.el
@@ -303,26 +303,29 @@ a top-level keymap, `text-scale-increase' or
`text-scale-decrease' may be more appropriate."
(interactive "p")
(let ((first t)
- (step t)
(ev last-command-event)
(echo-keystrokes nil))
- (while step
- (let ((base (event-basic-type ev)))
- (cond ((or (eq base ?+) (eq base ?=))
- (setq step inc))
- ((eq base ?-)
- (setq step (- inc)))
- ((eq base ?0)
- (setq step 0))
- (first
- (setq step inc))
- (t
- (setq step nil))))
- (when step
- (text-scale-increase step)
- (setq inc 1 first nil)
- (setq ev (read-event "+,-,0 for further adjustment: "))))
- (push ev unread-command-events)))
+ (let* ((base (event-basic-type ev))
+ (step
+ (pcase base
+ ((or `?+ `?=) inc)
+ (`?- (- inc))
+ (`?0 0)
+ (t inc))))
+ (text-scale-increase step)
+ ;; FIXME: do it after everu "iteration of the loop".
+ (message "+,-,0 for further adjustment: ")
+ (set-temporary-overlay-map
+ (let ((map (make-sparse-keymap)))
+ (dolist (mods '(() (control)))
+ (define-key map (vector (append mods '(?-))) 'text-scale-decrease)
+ (define-key map (vector (append mods '(?+))) 'text-scale-increase)
+ ;; = is unshifted + on most keyboards.
+ (define-key map (vector (append mods '(?=))) 'text-scale-increase)
+ (define-key map (vector (append mods '(?0)))
+ (lambda () (interactive) (text-scale-increase 0))))
+ map)
+ t))))
;; ----------------------------------------------------------------