]> code.delx.au - gnu-emacs/blobdiff - lisp/ebuff-menu.el
(MIPS2): Comment out define.
[gnu-emacs] / lisp / ebuff-menu.el
index d9f1525d645cb4054f9cb6b5a8b7e67129a0d9ad..7e511cc4d5f3ac0ad7d07598ea5e8ae1d4e74f95 100644 (file)
@@ -1,10 +1,9 @@
 ;;; ebuff-menu.el --- electric-buffer-list mode
 
-;; Author: Richard Mlynarik <mly@ai.mit.edu>
-;; Last-Modified: 21 Dec 1991
-
 ;; Copyright (C) 1985, 1986 Free Software Foundation, Inc.
 
+;; Author: Richard Mlynarik <mly@ai.mit.edu>
+
 ;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
@@ -23,8 +22,9 @@
 
 ;;; Commentary:
 
-;; who says one can't have typeout windows in gnu emacs?
-;; like ^r select buffer from its emacs lunar or tmacs libraries.
+;; Who says one can't have typeout windows in GNU Emacs?   The entry
+;; point, `electric-buffer-list' works like ^r select buffer from the
+;; ITS Emacs lunar or tmacs libraries.
 
 ;;; Code:
 
@@ -64,8 +64,9 @@ Calls value of `electric-buffer-menu-mode-hook' on entry if non-nil.
            (setq select
                  (catch 'electric-buffer-menu-select
                    (message "<<< Press Space to bury the buffer list >>>")
-                   (if (= (setq unread-command-char (read-char)) ?\ )
-                       (progn (setq unread-command-char -1)
+                   (if (eq (setq unread-command-events (list (read-event)))
+                           ?\ )
+                       (progn (setq unread-command-events nil)
                               (throw 'electric-buffer-menu-select nil)))
                    (let ((first (progn (goto-char (point-min))
                                        (forward-line 2)
@@ -151,13 +152,13 @@ electric-buffer-menu-mode-hook if it is non-nil."
 (put 'Electric-buffer-menu-undefined 'suppress-keymap t)
 (if electric-buffer-menu-mode-map
     nil
-  (let ((map (make-keymap)))
-    (fillarray map 'Electric-buffer-menu-undefined)
-    (define-key map "\e" (make-keymap))
-    (fillarray (lookup-key map "\e") 'Electric-buffer-menu-undefined)
+  (let ((map (make-keymap)) (submap (make-keymap)))
+    (fillarray (car (cdr map)) 'Electric-buffer-menu-undefined)
+    (define-key map "\e" submap)
+    (fillarray (car (cdr submap)) 'Electric-buffer-menu-undefined)
     (define-key map "\C-z" 'suspend-emacs)
     (define-key map "v" 'Electric-buffer-menu-mode-view-buffer)
-    (define-key map "\C-h" 'Helper-help)
+    (define-key map (char-to-string help-char) 'Helper-help)
     (define-key map "?" 'Helper-describe-bindings)
     (define-key map "\C-c" nil)
     (define-key map "\C-c\C-c" 'Electric-buffer-menu-quit)
@@ -197,7 +198,7 @@ electric-buffer-menu-mode-hook if it is non-nil."
  
 (defun Electric-buffer-menu-exit ()
   (interactive)
-  (setq unread-command-char last-input-char)
+  (setq unread-command-events (listify-key-sequence (this-command-keys)))
   ;; for robustness
   (condition-case ()
       (throw 'electric-buffer-menu-select nil)
@@ -222,9 +223,9 @@ Does not execute select, save, or delete commands."
   (ding)
   (message (if (and (eq (key-binding "\C-c\C-c") 'Electric-buffer-menu-quit)
                    (eq (key-binding " ") 'Electric-buffer-menu-select)
-                   (eq (key-binding "\C-h") 'Helper-help)
+                   (eq (key-binding (char-to-string help-char)) 'Helper-help)
                    (eq (key-binding "?") 'Helper-describe-bindings))
-              "Type C-c C-c to exit, Space to select, C-h for help, ? for commands"
+              (substitute-command-keys "Type C-c C-c to exit, Space to select, \\[Helper-help] for help, ? for commands")
             (substitute-command-keys "\
 Type \\[Electric-buffer-menu-quit] to exit, \
 \\[Electric-buffer-menu-select] to select, \