aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1997-12-19 14:46:20 +0000
committerKarl Heuer1997-12-19 14:46:20 +0000
commit4d52438ece0e25eac120cf0d4a0a0bcaef26c5ff (patch)
tree9f6efed15178c26aabb7d773406315eaf7ff0ee6
parentd3f4ef3fda5033fc1fb3678182b3f3be1310a1b1 (diff)
downloademacs-4d52438ece0e25eac120cf0d4a0a0bcaef26c5ff.tar.gz
emacs-4d52438ece0e25eac120cf0d4a0a0bcaef26c5ff.zip
(widget-choose): Allow scrolling of large lists.
-rw-r--r--lisp/wid-edit.el32
1 files changed, 25 insertions, 7 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 0419d05472a..e2d1a7cdf03 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -290,17 +290,35 @@ minibuffer."
290 (error "None of the choices is currently meaningful")) 290 (error "None of the choices is currently meaningful"))
291 (define-key map [?\C-g] 'keyboard-quit) 291 (define-key map [?\C-g] 'keyboard-quit)
292 (define-key map [t] 'keyboard-quit) 292 (define-key map [t] 'keyboard-quit)
293 (define-key map [?\M-\C-v] 'scroll-other-window)
294 (define-key map [?\M--] 'negative-argument)
293 (setcdr map (nreverse (cdr map))) 295 (setcdr map (nreverse (cdr map)))
294 ;; Unread a SPC to lead to our new menu.
295 (setq unread-command-events (cons ?\ unread-command-events))
296 ;; Read a char with the menu, and return the result 296 ;; Read a char with the menu, and return the result
297 ;; that corresponds to it. 297 ;; that corresponds to it.
298 (save-window-excursion 298 (save-window-excursion
299 (display-buffer (get-buffer " widget-choose")) 299 (let ((buf (get-buffer " widget-choose")))
300 (let ((cursor-in-echo-area t)) 300 (display-buffer buf)
301 (setq value 301 (let ((cursor-in-echo-area t)
302 (lookup-key overriding-terminal-local-map 302 keys
303 (read-key-sequence title) t)))) 303 (char 0)
304 (arg 1))
305 (while (not (or (and (>= char ?0) (< char next-digit))
306 (eq value 'keyboard-quit)))
307 ;; Unread a SPC to lead to our new menu.
308 (setq unread-command-events (cons ?\ unread-command-events))
309 (setq keys (read-key-sequence title))
310 (setq value (lookup-key overriding-terminal-local-map keys t)
311 char (string-to-char (substring keys 1)))
312 (cond ((eq value 'scroll-other-window)
313 (let ((minibuffer-scroll-window (get-buffer-window buf)))
314 (if (> 0 arg)
315 (scroll-other-window-down (window-height minibuffer-scroll-window))
316 (scroll-other-window))
317 (setq arg 1)))
318 ((eq value 'negative-argument)
319 (setq arg -1))
320 (t
321 (setq arg 1)))))))
304 (when (eq value 'keyboard-quit) 322 (when (eq value 'keyboard-quit)
305 (error "Canceled")) 323 (error "Canceled"))
306 value)))) 324 value))))