From: <dm...@dm...> - 2003-12-02 03:20:29
|
* we...@gm... [20031201T185739]: > I like it, though I'm somewhat confused as to the patch in for > erc.el, since it essentially removes the option for people to > customize the header-line without using erc-tabs. Is this correct, > or am I being dense? The two bits of code fight over updating `header-line-format', so it ends up looking silly. How about this patch to erc.el: -------------------------------- --- erc.el.~1.584.~ Mon Nov 10 08:00:21 2003 +++ erc.el Mon Dec 1 21:26:55 2003 @@ -6614,11 +6615,17 @@ (with-current-buffer buffer (setq mode-line-format (erc-prepare-mode-line-format erc-mode-line-format)) - (when (boundp 'header-line-format) - (if erc-header-line-format - (setq header-line-format - (erc-prepare-mode-line-format erc-header-line-format)) - (setq header-line-format nil))))) + (run-hooks 'erc-update-mode-line-hooks))) + +(defun erc-update-header-line () + "Update the header line of the current buffer." + (if erc-header-line-format + (setq header-line-format + (erc-prepare-mode-line-format erc-header-line-format)) + (setq header-line-format nil))) + +(when (boundp 'header-line-format) + (add-hook 'erc-update-mode-line-hooks 'erc-update-header-line)) (defun erc-update-mode-line (&optional buffer) "Update the mode line in one buffer BUFFER, if it is supplied, or -------------------------------- I'll add code to remove `erc-update-header-line' from `erc-update-mode-line-hooks' in the `erc-tab-mode' enable body (and add it again in the disable body). > In erc-tab.el, you could probably make use of ERC-BUFFER-LIST, > rather than rolling your own. That way, there's no need to maintain > the list of erc-like major modes in more than one place. Unless, of > course, you were unhappy with the fact that it doesn't consider dcc > chats to be erc buffers. I'll look at this and re-arrange the code as necessary. erc-track.el also has code that walks all buffers looking for erc (which is where this came from), so I'll hit that as well. > How about also adding a 'help-echo text property to the header-line, > to give some kind of "help", or perhaps, for the rest of the > header-line (excluding tabs), add a (wrapped) version of the header, > so that if one mouses over it, one can see the whole thing. > (Perhaps add this as a property to individual tabs, so that mousing > over a tab pops up something showing the current topic (say)). Your patch of a couple of days ago looks good - I'll incorporate it (in both places). > It would also be nice if the tabs could interact with something like > erc-track, so that, depending on channel activity, the text in them > was a different colour (e.g. red for activity, purple if ones nick > had been mentioned, etc...) It's my intention to avoid using erc-track.el when erc-tab.el does the same sort of stuff, so it's definitely on the list of things to do - the code isn't "finished" without it. A few days away, perhaps. Thanks for the feedback. |