aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath1993-03-31 22:20:33 +0000
committerRoland McGrath1993-03-31 22:20:33 +0000
commit03329370c2fc00d94e446858d598c368df284284 (patch)
tree08b1e74fdc0faa45de967e2788d2de37f10a8368
parent6c416012fee343ed2454beb5803df157e3b66984 (diff)
downloademacs-03329370c2fc00d94e446858d598c368df284284.tar.gz
emacs-03329370c2fc00d94e446858d598c368df284284.zip
(map-y-or-n-p): Make bindings of user-defined keys be each a vector
containing the user's binding, rather than 'user. Check (vectorp DEF) and call the vector's elt, rather than checking (eq 'user DEF) and calling something completely random.
-rw-r--r--lisp/map-ynp.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/map-ynp.el b/lisp/map-ynp.el
index c3cce3abc07..22e9973cb01 100644
--- a/lisp/map-ynp.el
+++ b/lisp/map-ynp.el
@@ -80,11 +80,11 @@ Returns the number of actions taken."
80 action-alist ", ") 80 action-alist ", ")
81 " ") 81 " ")
82 "")) 82 ""))
83 ;; Make a map that defines all the user keys as `user'. 83 ;; Make a map that defines each user key as a vector containing
84 ;; its definition.
84 (map (cons 'keymap 85 (map (cons 'keymap
85 (append (mapcar (function 86 (append (mapcar (lambda (elt)
86 (lambda (elt) 87 (cons (car elt) (vector (nth 1 elt))))
87 (cons (car elt) 'user)))
88 action-alist) 88 action-alist)
89 query-replace-map))) 89 query-replace-map)))
90 (actions 0) 90 (actions 0)
@@ -175,9 +175,9 @@ the current %s and exit."
175 (setq next (` (lambda () 175 (setq next (` (lambda ()
176 (setq next '(, next)) 176 (setq next '(, next))
177 '(, elt))))) 177 '(, elt)))))
178 ((eq def 'user) 178 ((vectorp def)
179 ;; A user-defined key. 179 ;; A user-defined key.
180 (if (funcall (nth 1 tail) elt) ;Call its function. 180 (if (funcall (aref def 0) elt) ;Call its function.
181 ;; The function has eaten this object. 181 ;; The function has eaten this object.
182 (setq actions (1+ actions)) 182 (setq actions (1+ actions))
183 ;; Regurgitated; try again. 183 ;; Regurgitated; try again.