]> git.eshelyaron.com Git - emacs.git/commitdiff
(electric-buffer-list): Save point before
authorKarl Heuer <kwzh@gnu.org>
Mon, 17 Jul 1995 23:09:48 +0000 (23:09 +0000)
committerKarl Heuer <kwzh@gnu.org>
Mon, 17 Jul 1995 23:09:48 +0000 (23:09 +0000)
finding the first buffer line, and use that saved point to
determine the buffer to use, if it is a reasonable value.

lisp/ebuff-menu.el

index ecadc2c732221f890f5385cd7a99481b68ee1c9c..b77601215870aca41b8a8933a8ca419c89404177 100644 (file)
@@ -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