comparison lisp/buff-menu.el @ 69024:fef6008cad43

(list-buffers-noselect): Turn also "\n" into a strech spec so it doesn't display as "^J" on the header line when `Buffer-menu-use-header-line' is t.
author Juanma Barranquero <lekktu@gmail.com>
date Mon, 20 Feb 2006 00:56:31 +0000
parents 3bd95f4f2941
children b4e6091c2346 d1c5430c5bff
comparison
equal deleted inserted replaced
69023:f01603b6b4ae 69024:fef6008cad43
704 (Buffer-menu-make-sort-button "Mode" 4) mode-end 704 (Buffer-menu-make-sort-button "Mode" 4) mode-end
705 (Buffer-menu-make-sort-button "File" 5) "\n")) 705 (Buffer-menu-make-sort-button "File" 5) "\n"))
706 list desired-point) 706 list desired-point)
707 (when Buffer-menu-use-header-line 707 (when Buffer-menu-use-header-line
708 (let ((pos 0)) 708 (let ((pos 0))
709 ;; Turn spaces in the header into stretch specs so they work 709 ;; Turn whitespace chars in the header into stretch specs so
710 ;; regardless of the header-line face. 710 ;; they work regardless of the header-line face.
711 (while (string-match "[ \t]+" header pos) 711 (while (string-match "[ \t\n]+" header pos)
712 (setq pos (match-end 0)) 712 (setq pos (match-end 0))
713 (put-text-property (match-beginning 0) pos 'display 713 (put-text-property (match-beginning 0) pos 'display
714 ;; Assume fixed-size chars in the buffer. 714 ;; Assume fixed-size chars in the buffer.
715 (list 'space :align-to pos) 715 (list 'space :align-to pos)
716 header))) 716 header)))
724 (with-current-buffer (get-buffer-create "*Buffer List*") 724 (with-current-buffer (get-buffer-create "*Buffer List*")
725 (setq buffer-read-only nil) 725 (setq buffer-read-only nil)
726 (erase-buffer) 726 (erase-buffer)
727 (setq standard-output (current-buffer)) 727 (setq standard-output (current-buffer))
728 (unless Buffer-menu-use-header-line 728 (unless Buffer-menu-use-header-line
729 ;; Use U+2014 (EM DASH) to underline if possible, else U+002D (HYPHEN-MINUS)
729 (let ((underline (if (char-displayable-p ?—) ?— ?-))) 730 (let ((underline (if (char-displayable-p ?—) ?— ?-)))
730 (insert header 731 (insert header
731 (apply 'string 732 (apply 'string
732 (mapcar (lambda (c) 733 (mapcar (lambda (c)
733 (if (memq c '(?\n ?\s)) c underline)) 734 (if (memq c '(?\n ?\s)) c underline))