;; Copyright (C) 1985, 1986, 1994 Free Software Foundation, Inc.
;; Author: Richard Mlynarik <mly@ai.mit.edu>
+;; Maintainer: FSF
;; This file is part of GNU Emacs.
;; 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:
?\ )
(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
(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)
(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))
(message "Buffer %s does not exist!" bufnam)
(sit-for 4))))
+(provide 'ebuff-menu)
+
;;; ebuff-menu.el ends here