comparison lisp/ebuff-menu.el @ 12568:94ee086557db

(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.
author Karl Heuer <kwzh@gnu.org>
date Mon, 17 Jul 1995 23:09:48 +0000
parents 53f0ebe096f5
children 83f275dcd93a
comparison
equal deleted inserted replaced
12567:7318536fb256 12568:94ee086557db
66 (message "<<< Press Return to bury the buffer list >>>") 66 (message "<<< Press Return to bury the buffer list >>>")
67 (if (eq (setq unread-command-events (list (read-event))) 67 (if (eq (setq unread-command-events (list (read-event)))
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
82 'electric-buffer-menu-looper 87 'electric-buffer-menu-looper
83 (cons first last)))))) 88 (cons first last))))))