X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/ef946998620530419a5629bbda3549b36d586446..f52154007f41abe6857acab91e31ab4a7d18210d:/lisp/ebuff-menu.el diff --git a/lisp/ebuff-menu.el b/lisp/ebuff-menu.el index 4bc0749a02..bd3cfce96c 100644 --- a/lisp/ebuff-menu.el +++ b/lisp/ebuff-menu.el @@ -3,6 +3,7 @@ ;; Copyright (C) 1985, 1986, 1994 Free Software Foundation, Inc. ;; Author: Richard Mlynarik +;; Maintainer: FSF ;; This file is part of GNU Emacs. @@ -17,8 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. ;;; Commentary: @@ -68,14 +70,19 @@ Calls value of `electric-buffer-menu-mode-hook' on entry if non-nil. ?\ ) (progn (setq unread-command-events nil) (throw 'electric-buffer-menu-select nil))) - (let ((first (progn (goto-char (point-min)) + (let ((start-point (point)) + (first (progn (goto-char (point-min)) (forward-line 2) (point))) (last (progn (goto-char (point-max)) (forward-line -1) (point))) (goal-column 0)) - (goto-char first) + ;; Use start-point if it is meaningful. + (goto-char (if (or (< start-point first) + (> start-point last)) + first + start-point)) (Electric-command-loop 'electric-buffer-menu-select nil t @@ -152,10 +159,9 @@ 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)) (submap (make-keymap))) + (let ((map (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 "\e" nil) (define-key map "\C-z" 'suspend-emacs) (define-key map "v" 'Electric-buffer-menu-mode-view-buffer) (define-key map (char-to-string help-char) 'Helper-help) @@ -195,6 +201,7 @@ electric-buffer-menu-mode-hook if it is non-nil." (define-key map "\e\C-v" 'scroll-other-window) (define-key map "\e>" 'end-of-buffer) (define-key map "\e<" 'beginning-of-buffer) + (define-key map "\e\e" nil) (define-key map "\e\e\e" 'Electric-buffer-menu-quit) (define-key map [escape escape escape] 'Electric-buffer-menu-quit) (define-key map [mouse-2] 'Electric-buffer-menu-mouse-select) @@ -232,7 +239,8 @@ Does not execute select, save, or delete commands." (defun Electric-buffer-menu-undefined () (interactive) (ding) - (message (if (and (eq (key-binding "\C-c\C-c") 'Electric-buffer-menu-quit) + (message "%s" + (if (and (eq (key-binding "\C-c\C-c") 'Electric-buffer-menu-quit) (eq (key-binding " ") 'Electric-buffer-menu-select) (eq (key-binding (char-to-string help-char)) 'Helper-help) (eq (key-binding "?") 'Helper-describe-bindings)) @@ -254,4 +262,6 @@ Returns to Electric Buffer Menu when done." (message "Buffer %s does not exist!" bufnam) (sit-for 4)))) +(provide 'ebuff-menu) + ;;; ebuff-menu.el ends here