diff lisp/buff-menu.el @ 90054:f2ebccfa87d4

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-74 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-709 Update from CVS: src/indent.c (Fvertical_motion): Fix last change. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-710 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-715 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-74 Update from CVS
author Miles Bader <miles@gnu.org>
date Wed, 08 Dec 2004 05:02:30 +0000
parents b637c617432f 5049881e14d7
children fb79180b618d
line wrap: on
line diff
--- a/lisp/buff-menu.el	Mon Dec 06 12:38:25 2004 +0000
+++ b/lisp/buff-menu.el	Wed Dec 08 05:02:30 2004 +0000
@@ -1,4 +1,4 @@
-;;; buff-menu.el --- buffer menu main function and support functions
+;;; buff-menu.el --- buffer menu main function and support functions -*- coding:utf-8 -*-
 
 ;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 2000, 2001, 2002, 2003,
 ;;   2004  Free Software Foundation, Inc.
@@ -190,6 +190,8 @@
   (setq buffer-read-only t)
   (run-hooks 'buffer-menu-mode-hook))
 
+;; This function exists so we can make the doc string of Buffer-menu-mode
+;; look nice.
 (defun Buffer-menu-revert ()
   "Update the list of buffers."
   (interactive)
@@ -645,7 +647,7 @@
   (let* ((old-buffer (current-buffer))
 	 (standard-output standard-output)
 	 (mode-end (make-string (- Buffer-menu-mode-width 2) ? ))
-	 (header (concat " " (propertize "CRM " 'face 'fixed-pitch)
+	 (header (concat "CRM "
 			 (Buffer-menu-buffer+size
 			  (Buffer-menu-make-sort-button "Buffer" 2)
 			  (Buffer-menu-make-sort-button "Size" 3))
@@ -660,18 +662,28 @@
 	(while (string-match "[ \t]+" header pos)
 	  (setq pos (match-end 0))
 	  (put-text-property (match-beginning 0) pos 'display
-			     ;; Assume fixed-size chars
-			     (list 'space :align-to (1- pos))
-			     header))))
+			     ;; Assume fixed-size chars in the buffer.
+			     (list 'space :align-to pos)
+			     header)))
+      ;; Try to better align the one-char headers.
+      (put-text-property 0 3 'face 'fixed-pitch header)
+      ;; Add a "dummy" leading space to align the beginning of the header
+      ;; line with the beginning of the text (rather than with the left
+      ;; scrollbar or the left fringe).  –-Stef
+      (setq header (concat (propertize " " 'display '(space :align-to 0))
+			   header))
+      )
     (with-current-buffer (get-buffer-create "*Buffer List*")
       (setq buffer-read-only nil)
       (erase-buffer)
       (setq standard-output (current-buffer))
       (unless Buffer-menu-use-header-line
-	(insert header (propertize "---" 'face 'fixed-pitch) " ")
-	(insert (Buffer-menu-buffer+size "------" "----"))
-	(insert "  ----" mode-end "----\n")
-	(put-text-property 1 (point) 'intangible t))
+	(let ((underline (if (char-displayable-p ?—) ?— ?-)))
+	  (insert header
+		  (apply 'string
+			 (mapcar (lambda (c)
+				   (if (memq c '(?\n ?\ )) c underline))
+				 header)))))
       (if buffer-list
 	  (setq list buffer-list)
 	;; Collect info for every buffer we're interested in.