|
From: Brian P. <bp...@re...> - 2004-04-06 07:41:17
|
I had sent a message on this before (http://sourceforge.net/mailarchive/message.php?msg_id=7608111) outlining the motivation and general approach I took, but didn't hear anything back, nor does it seem to have been applied. This seems like it'd be useful; if there are no objections, could somebody please apply it? Index: erc-list.el =================================================================== RCS file: /cvsroot/erc/erc/erc-list.el,v retrieving revision 1.24 diff -r1.24 erc-list.el 32a33,35 > (require 'cl) > (unless (fboundp 'make-overlay) > (require 'overlay)) 48c51 < (defvar erc-chanlist-frame-parameters nil --- > (defcustom erc-chanlist-frame-parameters nil 51c54,56 < list.") --- > list." > :group 'erc > :type 'sexp) 58,77c63,88 < ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; < ;; Faces. There's really no good default value that we can set for the < ;; foreground color of these faces, since we don't know the user's color scheme. < ;; The user should modify these faces as desired. < ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; < < (make-face 'erc-chanlist-header-face) < (defvar erc-chanlist-header-face 'erc-chanlist-header-face) < (set-face-foreground 'erc-chanlist-header-face nil) < (set-face-background 'erc-chanlist-header-face nil) < < (make-face 'erc-chanlist-odd-line-face) < (defvar erc-chanlist-odd-line-face 'erc-chanlist-odd-line-face) < (set-face-foreground 'erc-chanlist-odd-line-face nil) < (set-face-background 'erc-chanlist-odd-line-face nil) < < (make-face 'erc-chanlist-even-line-face) < (defvar erc-chanlist-even-line-face 'erc-chanlist-even-line-face) < (set-face-foreground 'erc-chanlist-even-line-face nil) < (set-face-background 'erc-chanlist-even-line-face nil) --- > (defface erc-chanlist-header-face '((t (:bold t))) > "Face used for the headers in erc's channel list" > :group 'erc-faces) > > (defcustom erc-chanlist-header-face 'erc-chanlist-header-face > "*Face used for the headers in erc's channel list" > :group 'erc > :type 'face) > > (defface erc-chanlist-odd-line-face '((t (:inverse-video t))) > "Face used for the odd lines in erc's channel list" > :group 'erc-faces) > > (defcustom erc-chanlist-odd-line-face 'erc-chanlist-odd-line-face > "*Face used for the odd lines in erc's channel list" > :group 'erc > :type 'face) > > (defface erc-chanlist-even-line-face '((t (:inverse-video nil))) > "Face used for the event lines in erc's channel list" > :group 'erc-faces) > > (defcustom erc-chanlist-even-line-face 'erc-chanlist-even-line-face > "*Face used for the event lines in erc's channel list" > :group 'erc > :type 'face) 104,105c115,118 < (defvar erc-chanlist-mode-hook nil < "A hook run by erc-chanlist-mode.") --- > (defcustom erc-chanlist-mode-hook nil > "A hook run by erc-chanlist-mode." > :group 'erc > :type 'hook) 134c147,148 < (member-ignore-case (erc-network-name) erc-no-list-networks)) --- > (member* (erc-network-name) erc-no-list-networks > :test (lambda (a b) (equal (upcase a) (upcase b))))) 255,259d268 < ;; First, restore all channel lines to their normal faces. < (erc-prettify-channel-list) < < ;; Then, highlight the current line. < ;;(sleep-for 2) 262,263c271,277 < (when (looking-at erc-chanlist-channel-line-regexp) < (erc-chanlist-highlight-line))))) --- > (if (looking-at erc-chanlist-channel-line-regexp) > (erc-chanlist-highlight-line) > (erc-chanlist-dehighlight-line))))) > > (defvar erc-chanlist-highlight-overlay nil > "The overlay used for erc chanlist highlighting") > (make-variable-buffer-local 'erc-chanlist-highlight-overlay) 266a281,292 > (unless erc-chanlist-highlight-overlay > (setq erc-chanlist-highlight-overlay > (make-overlay (point-min) (point-min))) > ; Detach it from the buffer. > (delete-overlay erc-chanlist-highlight-overlay) > (overlay-put erc-chanlist-highlight-overlay 'face 'highlight) > ;; Expressly put it at a higher priority than the text > ;; properties used for faces later on. Gnu emacs promises that > ;; right now overlays are higher priority than text properties, > ;; but why take chances? > (overlay-put erc-chanlist-highlight-overlay 'priority 1)) > 268,269c294 < (let ((bol (point)) < (inhibit-read-only t)) --- > (let ((bol (point))) 271c296,300 < (add-text-properties bol (point) `(face highlight))))) --- > (move-overlay erc-chanlist-highlight-overlay bol (point))))) > > (defun erc-chanlist-dehighlight-line () > "Removes the line highlighting." > (delete-overlay erc-chanlist-highlight-overlay)) -- I'm awfully glad I'm a Beta, because I don't work so hard. |