From: Karl Heuer Date: Mon, 17 Jul 1995 23:09:48 +0000 (+0000) Subject: (electric-buffer-list): Save point before X-Git-Tag: emacs-19.34~3291 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=69adebeb51104f53801e42b8444ae747a5241620;p=emacs.git (electric-buffer-list): Save point before finding the first buffer line, and use that saved point to determine the buffer to use, if it is a reasonable value. --- diff --git a/lisp/ebuff-menu.el b/lisp/ebuff-menu.el index ecadc2c7322..b7760121587 100644 --- a/lisp/ebuff-menu.el +++ b/lisp/ebuff-menu.el @@ -68,14 +68,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