From: Mario L. <ml...@ho...> - 2001-11-12 10:00:15
|
Benjamin Drieu <bd...@ap...> writes: > Not really a patch but a code snippet that you might consider useful : > it allows to switch to the first active channel, according to > erc-modified-channel-string. Ahh, nice. I have an idea here, so I will just go and comment: Do you use Emacs in X/with mouse? Then the following would be even more useful: 1. Have a function like yours which takes an argument (the number of the entry). 2. Have a local-map in the global-mode-string where the ctracked channels are shown which makes every channel clickable. On click, the window where the mode-line belongs to switches buffer to that buffer. What do you think? > It works fine but it is not very satisfying since it only parse this > string instead of using a real channel list paradigm. Humpf, another > item in my todo list ;-) Someone should really rewrite channel tracking so that a list is used instead of string. Would make that function simpler, and most probably remove the leading-comma bug. > (defun erc-jump-to-first-active-channel () > "Jump to the first active channel." > (interactive) > (let* ((regexp "^ \\[,?\\(#?[^,]*\\)\\(,\\|]$\\)") > (result (string-match regexp erc-modified-channel-string)) > (begining (and result (match-beginning 1))) > (end (and result (match-end 1))) > (channel (and result (substring erc-modified-channel-string begining end)))) > (if channel > (switch-to-buffer (erc-get-buffer erc-session-server (downcase channel)))))) hmm, the last line needs to look like this for erc >1.107: (switch-to-buffer (erc-get-buffer channel))))) ahh, and it is flawed anyway, because channel tracking doesn't handle multiple servers yet. -- CYa, Mario <ml...@de...> Homepage(s): http://delysid.org | http://piss.at/ |