changeset 49050:8b38bac9826a

(Buffer-menu-execute): Fix for effect of header line.
author Dave Love <fx@gnu.org>
date Sun, 05 Jan 2003 23:14:59 +0000
parents 6953cce6f3c8
children b9aa52500a06
files lisp/buff-menu.el
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/buff-menu.el	Sun Jan 05 23:14:20 2003 +0000
+++ b/lisp/buff-menu.el	Sun Jan 05 23:14:59 2003 +0000
@@ -332,7 +332,8 @@
   (interactive)
   (save-excursion
     (goto-char (point-min))
-    (forward-line 1)
+    (unless Buffer-menu-use-header-line
+      (forward-line 1))
     (while (re-search-forward "^..S" nil t)
       (let ((modp nil))
 	(save-excursion
@@ -344,10 +345,11 @@
 	  (insert (if modp ?* ? ))))))
   (save-excursion
     (goto-char (point-min))
-    (forward-line 1)
+    (unless Buffer-menu-use-header-line
+      (forward-line 1))
     (let ((buff-menu-buffer (current-buffer))
 	  (buffer-read-only nil))
-      (while (search-forward "\nD" nil t)
+      (while (re-search-forward "^D" nil t)
 	(forward-char -1)
 	(let ((buf (Buffer-menu-buffer nil)))
 	  (or (eq buf nil)
@@ -357,7 +359,8 @@
 	    (progn (delete-char 1)
 		   (insert ? ))
 	  (delete-region (point) (progn (forward-line 1) (point)))
-	    (forward-char -1)))))))
+	    (unless (bobp)
+	      (forward-char -1))))))))
 
 (defun Buffer-menu-select ()
   "Select this line's buffer; also display buffers marked with `>'.
@@ -551,6 +554,7 @@
   (let* ((old-buffer (current-buffer))
 	 (standard-output standard-output)
 	 (mode-end (make-string (- Buffer-menu-mode-width 2) ? ))
+	 ;; Fixme: This is wrong for left-hand scroll-bars.
 	 (header (concat "CRM " (Buffer-menu-buffer+size "Buffer" "Size")
 			 "  Mode" mode-end "File\n"))
 	 list desired-point name file mode)