[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Improvement Suggestion: Faces in Buffer Menu (patch included)
From: |
Yong Lu |
Subject: |
Improvement Suggestion: Faces in Buffer Menu (patch included) |
Date: |
19 Nov 2001 23:14:40 +0800 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.50 |
Sorry, I just forgot to include the patch. Here it is.
*** buff-menu.el.orig Sun Nov 18 21:43:44 2001
--- buff-menu.el Sun Nov 18 23:20:46 2001
***************
*** 474,479 ****
--- 474,487 ----
(define-key ctl-x-map "\C-b" 'list-buffers)
+ (defcustom buff-menu-faces nil
+ "Association list to hold faces for displaying buffer names of
+ different modes. Keys are mode names; values are faces to use. If a
+ mode name does not appear, the default face is used instead."
+ :type '(alist
+ :key-type string
+ :value-type (plist :value-type string)))
+
(defun list-buffers (&optional files-only)
"Display a list of names of existing buffers.
The list is displayed in a buffer named `*Buffer List*'.
***************
*** 552,559 ****
;; This way we avoid problems with unusual buffer names.
(setq this-buffer-line-start
(+ this-buffer-line-start Buffer-menu-buffer-column))
! (let ((name-end (point)))
(indent-to 17 2)
(put-text-property this-buffer-line-start name-end
'buffer-name name)
(put-text-property this-buffer-line-start (point)
--- 560,571 ----
;; This way we avoid problems with unusual buffer names.
(setq this-buffer-line-start
(+ this-buffer-line-start Buffer-menu-buffer-column))
! (let ((name-end (point))
! (face (cdr (assoc this-buffer-mode-name buff-menu-faces))))
(indent-to 17 2)
+ (if face
+ (put-text-property this-buffer-mode-name name-end
+ 'face face))
(put-text-property this-buffer-line-start name-end
'buffer-name name)
(put-text-property this-buffer-line-start (point)