diff options
| author | Karl Heuer | 1995-07-17 23:09:48 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-07-17 23:09:48 +0000 |
| commit | 69adebeb51104f53801e42b8444ae747a5241620 (patch) | |
| tree | 2f1741a564a43534b059406c8a540fc3fdc47c9b | |
| parent | 2ab6bb1432b504a0fbfcbe692740cf38b34d44b8 (diff) | |
| download | emacs-69adebeb51104f53801e42b8444ae747a5241620.tar.gz emacs-69adebeb51104f53801e42b8444ae747a5241620.zip | |
(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.
| -rw-r--r-- | lisp/ebuff-menu.el | 9 |
1 files changed, 7 insertions, 2 deletions
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. | |||
| 68 | ?\ ) | 68 | ?\ ) |
| 69 | (progn (setq unread-command-events nil) | 69 | (progn (setq unread-command-events nil) |
| 70 | (throw 'electric-buffer-menu-select nil))) | 70 | (throw 'electric-buffer-menu-select nil))) |
| 71 | (let ((first (progn (goto-char (point-min)) | 71 | (let ((start-point (point)) |
| 72 | (first (progn (goto-char (point-min)) | ||
| 72 | (forward-line 2) | 73 | (forward-line 2) |
| 73 | (point))) | 74 | (point))) |
| 74 | (last (progn (goto-char (point-max)) | 75 | (last (progn (goto-char (point-max)) |
| 75 | (forward-line -1) | 76 | (forward-line -1) |
| 76 | (point))) | 77 | (point))) |
| 77 | (goal-column 0)) | 78 | (goal-column 0)) |
| 78 | (goto-char first) | 79 | ;; Use start-point if it is meaningful. |
| 80 | (goto-char (if (or (< start-point first) | ||
| 81 | (> start-point last)) | ||
| 82 | first | ||
| 83 | start-point)) | ||
| 79 | (Electric-command-loop 'electric-buffer-menu-select | 84 | (Electric-command-loop 'electric-buffer-menu-select |
| 80 | nil | 85 | nil |
| 81 | t | 86 | t |