You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
(46) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(5) |
Feb
|
Mar
(6) |
Apr
(2) |
May
(25) |
Jun
(2) |
Jul
(1) |
Aug
(5) |
Sep
(4) |
Oct
(7) |
Nov
|
Dec
(18) |
2003 |
Jan
(8) |
Feb
(1) |
Mar
(2) |
Apr
(4) |
May
(14) |
Jun
(32) |
Jul
(15) |
Aug
(23) |
Sep
(23) |
Oct
(22) |
Nov
(27) |
Dec
(24) |
2004 |
Jan
(18) |
Feb
(38) |
Mar
(32) |
Apr
(18) |
May
(70) |
Jun
(1) |
Jul
(21) |
Aug
(19) |
Sep
(32) |
Oct
(11) |
Nov
(11) |
Dec
(19) |
2005 |
Jan
(48) |
Feb
(13) |
Mar
(19) |
Apr
(25) |
May
(4) |
Jun
(23) |
Jul
(8) |
Aug
(13) |
Sep
(12) |
Oct
(17) |
Nov
(4) |
Dec
(5) |
2006 |
Jan
(31) |
Feb
(30) |
Mar
(28) |
Apr
(11) |
May
(21) |
Jun
(7) |
Jul
(12) |
Aug
(5) |
Sep
(7) |
Oct
(24) |
Nov
(2) |
Dec
|
From: Gergely N. <alg...@bo...> - 2002-03-24 17:37:49
|
Hi! I have smallish, but pretty annoying problem. I set up erc to open a new buffer for each new /query, and when the other end of the query does a "/me foo", it doesn't appear in the query buffer, but in the server buffer. It's quite easy to reproduce: - (setq erc-auto-query t) - With another client: /query yourotherself - With the other client: /me foo The result of /me foo will appear in the server buffer. |
From: Doug A. <do...@la...> - 2002-03-22 19:17:46
|
I get this error a lot while running ERC in my XEmacs. Here's my XEmacs information: uname -a: Linux eeyore 2.4.17-rc1 #2 Sun Dec 16 17:50:34 EST 2001 i686 unknown ./configure '--with-sound=none,native' '--cflags=-O2 -g -Wall' '--with-x11' '--extra-verbose' '--with-site-lisp' '--statedir=/var/lib' '--infodir=/usr/share/info/xemacs-21.4.6' '--prefix=/usr' '--error-checking=none' '--debug=no' '--dynamic' '--without-postgresql' '--with-gpm=no' '--with-gtk' '--with-gnome' '--docdir=/usr/lib/xemacs-21.4.6/i386-debian-linux/gnome-mule/' '--with-mule' '--with-canna=no' '--with-wnn=no' '--with-xim=xlib' '--with-xfs' '--package-path=~/.xemacs:~/.xemacs/packages:~/.xemacs/xemacs-packages::/usr/share/xemacs21/packages:/usr/share/xemacs21/mule-packages:/usr/share/xemacs21/site-packages' 'i386-debian-linux' XEmacs 21.4.6 "Common Lisp" configured for `i386-debian-linux'. Compilation / Installation: Source code location: /home/dres/project/debian/current/xemacs21/xemacs-21.4.6 Installation prefix: /usr Operating system description file: `s/linux.h' Machine description file: `m/intel386.h' Compiler: gcc -O2 -g -Wall Relocating allocator for buffers: no GNU version of malloc: yes - Using Doug Lea's new malloc from the GNU C Library. Linking with `-Xlinker -znocombreloc'. - Consider configuring with --pdump. Window System: Using GTK menubars. Using GTK scrollbars. Using GTK dialog boxes. Using GTK native widgets. TTY: Compiling in support for ncurses. Images: Compiling in support for GIF images (builtin). Compiling in support for XPM images. Compiling in support for PNG images. Compiling in support for JPEG images. Compiling in support for TIFF images. Compiling in support for X-Face message headers. Sound: Compiling in support for sound (native). Databases: Compiling in support for Berkeley database. Compiling in support for LDAP. Internationalization: Compiling in support for Mule (multi-lingual Emacs). - Using XFontSet to provide bilingual menubar. Mail: Compiling in support for "dot-locking" mail spool file locking method. Other Features: Inhibiting IPv6 canonicalization at startup. Compiling in support for dynamic shared object modules. Here's the backtrace: Signaling: (void-variable erc-process) (eq proc erc-process) (or (not proc) (eq proc erc-process)) (and (or (not proc) (eq proc erc-process)) (let (...) (and target ...))) (if (and (or ... ...) (let ... ...)) (progn (setq res ...) (setq bufs nil))) (when (and (or ... ...) (let ... ...)) (setq res (current-buffer)) (setq bufs nil)) (while bufs (set-buffer (car bufs)) (setq bufs (cdr bufs)) (when (and ... ...) (setq res ...) (setq bufs nil))) (save-current-buffer (while bufs (set-buffer ...) (setq bufs ...) (when ... ... ...)) res) (let ((downcased-target ...) (bufs ...) res) (save-current-buffer (while bufs ... ... ...) res)) erc-get-buffer("AUTH" #<network connection "erc-irc.debian.org-6667" (6667 . "irc.debian.org") state:run>) (setq buffer (erc-get-buffer (if privp nick tgt) proc)) (if buffer nil (setq buffer (erc-get-buffer ... proc))) (unless buffer (setq buffer (erc-get-buffer ... proc))) (let* ((sndr ...) (nick ...) (login ...) (host ...) (msgp ...) (noticep ...) (privp ...) s buffer fnick) (unless buffer (setq buffer ...)) (when buffer (with-current-buffer buffer ... ...)) (cond (... ...) (t ... ...)) (when s (erc-display-message parsed nil buffer s))) (if (erc-ignored-user-p sspec) (message "ignored %s from %s to %s" cmd sspec tgt) (let* (... ... ... ... ... ... ... s buffer fnick) (unless buffer ...) (when buffer ...) (cond ... ...) (when s ...))) (let ((sspec ...) (cmd ...) (tgt ...) (msg ...)) (if (erc-ignored-user-p sspec) (message "ignored %s from %s to %s" cmd sspec tgt) (let* ... ... ... ... ...))) erc-server-PRIVMSG-or-NOTICE(#<network connection "erc-irc.debian.org-6667" (6667 . "irc.debian.org") state:run> ["NOTICE" "irc.debian.org" "AUTH" "*** Looking up your hostname..." nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]) run-hook-with-args-until-success(erc-server-PRIVMSG-or-NOTICE #<network connection "erc-irc.debian.org-6667" (6667 . "irc.debian.org") state:run> ["NOTICE" "irc.debian.org" "AUTH" "*** Looking up your hostname..." nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]) (progn (run-hook-with-args-until-success hook proc msg) nil) (if (and hook (symbol-value hook)) (progn (run-hook-with-args-until-success hook proc msg) nil) (run-hook-with-args-until-success (quote erc-default-server-hook) proc msg) nil) (let* ((hook-name ...) (hook ...)) (if (and hook ...) (progn ... nil) (run-hook-with-args-until-success ... proc msg) nil) (with-current-buffer (erc-server-buffer) (run-hook-with-args ... ...))) (let ((posn ...) (msg ...) (n 2)) (aset msg 1 (if ... erc-session-server ...)) (aset msg 0 (let* ... ... ...)) (while (and posn ...) (aset msg n ...) (setq n ...)) (if posn (aset msg n ...)) (let* (... ...) (if ... ... ... nil) (with-current-buffer ... ...))) (progn (let (... ... ...) (aset msg 1 ...) (aset msg 0 ...) (while ... ... ...) (if posn ...) (let* ... ... ...))) (unwind-protect (progn (let ... ... ... ... ... ...)) (store-match-data match-data)) (let ((match-data ...)) (unwind-protect (progn ...) (store-match-data match-data))) (save-match-data (let (... ... ...) (aset msg 1 ...) (aset msg 0 ...) (while ... ... ...) (if posn ...) (let* ... ... ...))) erc-parse-line-from-server(#<network connection "erc-irc.debian.org-6667" (6667 . "irc.debian.org") state:run> "NOTICE AUTH :*** Looking up your hostname...") (lambda (line) (erc-parse-line-from-server proc line))("NOTICE AUTH :*** Looking up your hostname...") mapc-internal((lambda (line) (erc-parse-line-from-server proc line)) ("NOTICE AUTH :*** Looking up your hostname...")) mapc((lambda (line) (erc-parse-line-from-server proc line)) ("NOTICE AUTH :*** Looking up your hostname...")) (save-current-buffer (set-buffer (process-buffer proc)) (mapc (lambda ... ...) (erc-split-multiline string))) (with-current-buffer (process-buffer proc) (mapc (lambda ... ...) (erc-split-multiline string))) erc-process-filter(#<network connection "erc-irc.debian.org-6667" (6667 . "irc.debian.org") state:run> "NOTICE AUTH :*** Looking up your hostname... \n") -- (__) Doug Alcorn - Unix/Linux/Web Developing oo / PGP 02B3 1E26 BCF2 9AAF 93F1 61D7 450C B264 3E63 D543 |_/ mailto:do...@la... http://www.lathi.net |
From: Mario L. <ml...@de...> - 2002-03-05 22:37:23
|
Arto Jantunen <vi...@de...> writes: > I look forward to hearing your comments of this. cvs up and test the way it currently works. I took a completely different approach though. P.s. thanks alex -- CYa, Mario <ml...@de...> |
From: Arto J. <vi...@de...> - 2002-03-03 17:14:58
|
(defun erc-make-mode-line-buffer-name (buffer) (let* ((map (make-sparse-keymap)) (name2 (buffer-name buffer)) (num (string-match "-" name2))) (setq name (if num (concat (substring name2 0 2) (substring name2 num (+ num 2))) (substring name2 0 3))) (define-key map (vector 'mode-line 'mouse-2) `(lambda (e) (interactive "e") (save-selected-window (select-window (posn-window (event-start e))) (switch-to-buffer ,buffer)))) (put-text-property 0 (length name) 'local-map map name) name)) I look forward to hearing your comments of this. -- Arto Jantunen |
From: Mario L. <ml...@de...> - 2002-01-30 13:45:45
|
Andras BALI <dr...@bi...> writes: > Would it be possible to be able to save timestamps in logs even when > timestamping is disabled in the buffers? I believe this is a good > idea, because in principle I really don't need timestamps, but logs > are for archiving - and it can be important to know when did the > events happen. Sounds good. > According to an IRC conversation with delYsid, this feature requires > two things to be implemented: > > 1. Make sure that *every* line of the ERC buffer has a timestamp > property -- it wasn't true for messages by me, but adding > > (put-text-property 0 (length s) `timestamp (current-time) s) > > around line #1760 seemed to help. Note that it adds the property > only to the message, not to the nick and it may be wrong with > actions different from channel text. I just had an idea. Maybe somewhere around erc-insert-hook, we can just add timestamping for ALL texts. This way we dont need to duplicate that timestamping code too much. I wanted to look at the erc-insert-hook situation anyway before 3.0, because currently we have a erc-insert-hook which has around 7 functions on it, and order is getting to get important. So this needs possibly some rewrite. Ill look at that. > 2. Write a function that saves the erc buffer line by line and > extracts the timestamp for each line from the properties, converts > it to human-readable form and adds it. Is anyone who uses logging alot interested in implementing such a function? It isnt terrible hard after all. > My lisp knowledge is unfortunately way too rough to be able to code > anything usable, hence is the subject. Any help would be appreciated. -- CYa, Mario <ml...@de...> |
From: Andras B. <dr...@bi...> - 2002-01-27 20:53:23
|
Hi. Would it be possible to be able to save timestamps in logs even when timestamping is disabled in the buffers? I believe this is a good idea, because in principle I really don't need timestamps, but logs are for archiving - and it can be important to know when did the events happen. According to an IRC conversation with delYsid, this feature requires two things to be implemented: 1. Make sure that *every* line of the ERC buffer has a timestamp property -- it wasn't true for messages by me, but adding (put-text-property 0 (length s) `timestamp (current-time) s) around line #1760 seemed to help. Note that it adds the property only to the message, not to the nick and it may be wrong with actions different from channel text. 2. Write a function that saves the erc buffer line by line and extracts the timestamp for each line from the properties, converts it to human-readable form and adds it. My lisp knowledge is unfortunately way too rough to be able to code anything usable, hence is the subject. Any help would be appreciated. Thanks, -- BALI, Andra's GPG keyID: 78560E1C dr...@bi... ba...@de... and...@st... |
From: Ivo T. <iv...@o2...> - 2002-01-08 20:46:45
|
Adam Duck wrote: > I went to the server buffer and did a "C-x C-m p" > `set-buffer-process-coding-system' here on my XEmacs. Yes, that works a little bit. The annoying ESC - b and ESC - A are still there; but at least it's UTF-8 inbetween. Ivo -- Mein Gott, Henry! Hinter dir! Der Mobster von Loch Ness! - Nichtlustig |
From: Adam D. <du...@in...> - 2002-01-08 18:21:23
|
Pj4+Pj4gIkl2byIgPT0gSXZvIFRpbW1lcm1hbnMgPGl2b0BvMncubmw+IHdyaXRlczoNDQoN DQogICAgSXZvPiBJIGhhdmUgYmVlbiBwbGF5aW5nIHdpdGggdGhpbmdzIGxpa2UgKHdpdGgg bXVsZS11Y3MpOiAoc2V0cQ0NCiAgICBJdm8+IGRlZmF1bHQtZW5hYmxlLW11bHRpYnl0ZS1j aGFyYWN0ZXJzIHQpIGFuZCAoc2V0cQ0NCiAgICBJdm8+IGRlZmF1bHQtcHJvY2Vzcy1jb2Rp bmctc3lzdGVtICd1dGYtOC11bml4KSBidXQgaXQgZG9lc24ndA0NCiAgICBJdm8+IGNoYW5n ZSBtdWNoLg0NCg0NCldlbGwsIEkgZG9uJ3Qga25vdyBpZiB0aGlzIGhlbHBzIHlvdSwgYnV0 IEkndmUgYmVlbiBzdWNjZXNzZnVsbHkgYWJsZQ0NCnNvIHNlbmQgSmFwYW5lc2UgY2hhcmFj dGVycyB0aHJvdWdoIElSQy4NDQpJIHdlbnQgdG8gdGhlIHNlcnZlciBidWZmZXIgYW5kIGRp ZCBhICJDLXggQy1tIHAiDQ0KYHNldC1idWZmZXItcHJvY2Vzcy1jb2Rpbmctc3lzdGVtJyBo ZXJlIG9uIG15IFhFbWFjcy4gU28sIHRoaXMgc2hvdWxkDQ0KYmUgcG9zc2libGUgd2l0aCBV VEYtOCBhbHNvOyBidXQgSSBjYW4ndCB0ZWxsIC0gWEVtYWNzIGNhbid0IGRvIHRoaXMNDQpy aWdodCBub3cuDQ0KDQ0KQnllLiBBZGFtLg0NCi0tIA0NCiBBZGFtIER1Y2sgKGR1Y2tAY3Mu dW5pLWZyYW5rZnVydC5kZSkNDQogQm9ja2VuaGVpbWVyIExhbmRzdHIuIDEzNSAvIFppLiAy MTENDQogNjAzMjUgRnJhbmtmdXJ0L01haW4NDQpfX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fXw0NCg0NCllvdSBjYW4gbmV2ZXIgdGVsbCB3aGljaCB3YXkgdGhlIHRy YWluIHdlbnQgYnkgbG9va2luZyBhdCB0aGUgdHJhY2su |
From: Ivo T. <iv...@o2...> - 2002-01-08 11:56:27
|
Hi, Is it possible to control the way emacs (or ERC) sends out special characters? If I insert a Euro sign, for example, with Compose C =; it will show up on a channel as `ESC - b € ESC - A'. Needless to say, this is very annoying to people, so I would rather have emacs do this in pure UTF-8. I have been playing with things like (with mule-ucs): (setq default-enable-multibyte-characters t) and (setq default-process-coding-system 'utf-8-unix) but it doesn't change much. TIA for any hints.. Ivo -- Pooky, you sure know how to spoil a good bad mood! -- Garfield |
From: Gergely N. <alg...@bo...> - 2001-12-15 18:47:58
|
Hi! While playing with (erc-send-paragraph), I noticed that even though ERC sends the paragraph to the server, it does not appear. My other problem is, that when erc-save-buffer-in-logs is called upon parting a channel, most of the buffer-local variables seem to be gone. For example, using the filename generating function at the end of this mail, when I part a channel on OPN, the logs get saved to ~/.erc/logs/2001/12/irc.openprojects.net/irc.openprojects.net.txt (as opposed to ~/.erc/logs/2001/12/irc.openprojects.net/#pfft.txt), so at least target is nil.. I'm looking at the sources, trying to figure out what to do, but wouldn't mind if someone else could fix it soonish :) The mentioned function is this: (defun mhp-generate-erc-log-file-name (buffer target nick server port) "Save logs in LOGDIR/year/month/server/target.txt." (let ((log-dir (concat erc-log-channels-directory (format-time-string "/%Y/%m/" (current-time)) server "/"))) (if (not (file-directory-p log-dir)) (make-directory log-dir t)) (concat log-dir (if target target server) ".txt"))) |
From: Romain F. <ro...@or...> - 2001-12-02 14:49:10
|
Hi, I'm using channel tracking to see if there has been activity in hidden channels, and here's a bug I found: I often idle on both #emacs and #emacs-fr, and sometimes the tracking gets confused, and I see a [-fr] in the modeline where the name of the active channels is usually displayed. And of course, there's no such channel, so I have to toggle tracking two times to make it go away. It's annoying. Another small bug is that if there are two active channels, say #emacs and #debian, the modeline shows [#emacs,#debian]. Now if I switch to #emacs, it shows [,#debian] which does not really make sense. Maybe the tracking part needs a small rewrite. :) Cheers, Romain (aka ore). =2D-=20 Romain FRANCOISE <ro...@or...> http://www.orebokech.com/ |
From: Andreas F. <as...@vo...> - 2001-11-29 12:15:16
|
Today, Mario Lang <ml...@ho...> wrote: > I read through the code, and it appreas that the problem lies in > (erc-current-nick). ERC saves the nickname information in the server > buffer. So if you kill that, erc-logfile-name-long will have > trouble to determine a nickname. > > What do you think of making the log save procedure automatic on quit? > And add an option to also kill buffers on /leave and /quit? There are buffer-local variables erc-session-{server,port,user-full-name}. Why not make another one, erc-session-nick? And, while we're at it, erc-session-finger-host, etc (-: -- Andreas Fuchs, <as...@ac...>, as...@ja..., antifuchs |
From: Mario L. <ml...@ho...> - 2001-11-29 11:24:35
|
Gergely Nagy <alg...@bo...> writes: > Yet another buglet I found is that if I try to save a channel buffer > after I killed the main server buffer, I get an error saying > `selecting deleted buffer'. It's quite unfortunate, since I tend to > leave IRC in a hurry, and C-c C-l, C-x k k (kill-current-buffer) all > the buffers I encounter, and often the server buffers are not the > last.. I read through the code, and it appreas that the problem lies in (erc-current-nick). ERC saves the nickname information in the server buffer. So if you kill that, erc-logfile-name-long will have trouble to determine a nickname. What do you think of making the log save procedure automatic on quit? And add an option to also kill buffers on /leave and /quit? Isn't exactly a fix :), but it is a solution... -- CYa, Mario <ml...@de...> Homepage(s): http://delysid.org | http://piss.at/ |
From: Gergely N. <alg...@bo...> - 2001-11-28 22:06:06
|
Greetings! Yet another buglet I found is that if I try to save a channel buffer after I killed the main server buffer, I get an error saying `selecting deleted buffer'. It's quite unfortunate, since I tend to leave IRC in a hurry, and C-c C-l, C-x k k (kill-current-buffer) all the buffers I encounter, and often the server buffers are not the last.. I'll look into this tomorrow, hoping I can find a fix.. Cheers, -- Gergely Nagy \ mhp/|8] |
From: Mario L. <ml...@ho...> - 2001-11-28 20:00:46
|
Hmm,, This list can only be incomplete... And I could hit me for having so bad changelogs :(. If anyone misses something really cool here, please reply. * New buffer naming scheme, buffers now have names like #emacs and #emacs<2> instead of #emacs!nick@irc-server. You can freely rename them now, without breaking anything. * New customizable mode-line and header-line support. Look at erc-mode-line-format, erc-header-line-format. and erc-prepare-mode-line-format * Now you get the announced server name in the modeline. * Completely new server message parsing, mimicking zenirc's ...server-*-hooks * See defgroup erc-server-hooks * Split up in several files. * erc-complete is now autoloaded the first time you use TAB * erc-ring is not loaded by default, although I am unsure that this should stay that way. * erc-bbdb.el: Thanks to andreas fuchs who had the basic idea and some code to start from, we now have bbdb support in erc. You can add bbdb entries through /whois, and pop up people records when they join. * erc-speedbar.el: Very first version. Eventually should replace the info buffers once when it does everything :INFO buffers do currently. -- CYa, Mario <ml...@de...> Homepage(s): http://delysid.org | http://piss.at/ This is a scsi driver, scraes the shit out of me, therefore I tapdanced and wrote a unix clone around it (C) by linus -- Somewhere in the kernel tree CYa, Mario <ml...@de...> Homepage(s): http://delysid.org | http://piss.at/ COMPASS [for the CDC-6000 series] is the sort of assembler one expects from a corporation whose president codes in octal. -- J.N. Gray |
From: Gergely N. <alg...@bo...> - 2001-11-28 18:18:59
|
Greetings! In erc.el 1.152, when erc-truncate-buffer-on-save is nil, when saving the buffer, erc will skip the first (length erc-prompt) chars, because erc-last-saved-position was set to (point-max), which was after the erc prompt. However, when typing stuff in, the prompt will get replaced by the channel trafic, this resulting logs like this: [2001-11-28] <mhp> foo ERC> -11-28] <mhp> bar So, I changed the way the end point is calculated to subtract the necessary value from (point-max), making the logs nicer: [2001-11-28] <mhp> foo [2001-11-28] <mhp> bar The patch is attached below, comments and friends are welcome. (I'm not entirely sure this is the correct fix, but it appears to work for me) --- erc.el Tue Nov 27 20:24:48 2001 +++ erc.el-mhp Wed Nov 28 13:39:20 2001 @@ -5299,13 +5299,15 @@ (when (and erc-log-channels erc-log-channels-directory (erc-directory-writable-p erc-log-channels-directory)) - (append-to-file erc-last-saved-position (point-max) file) + (append-to-file erc-last-saved-position (- (point-max) + (+ 1 (length + erc-prompt))) file) (if erc-truncate-buffer-on-save (progn (erase-buffer) (setq erc-last-saved-position (point-max)) (erc-display-prompt)) - (setq erc-last-saved-position (point-max))) + (setq erc-last-saved-position (- (point-max) (+ 1 (length erc-prompt))))) (goto-char (point-max))) (set-buffer-modified-p nil) (setq buffer-file-name file))) |
From: Alex S. <al...@gn...> - 2001-11-26 18:31:27
|
Mario Lang <ml...@ho...> writes: > So, for now, if you pop up a completion buffer, close > it again with TAB, and everything is fine. > But, we certainly should investigate if we can put in some > safeguards to prevent false-usage even more. > Any suggestions? We could store the window-configuration and the frame, and only restore the saved window-configuration when the selected-frame is the same as the saved frame. Does that seem right? Alex. -- http://www.emacswiki.org/ |
From: Mario L. <ml...@ho...> - 2001-11-26 17:32:22
|
Gergely Nagy <alg...@bo...> writes: > Hello again! > > Attached below is the very latest version of the antifuchs+mhp > patch. The only change between the previous one and this is that I > modified erc-mode to set the initial filename of the buffer using my > customise function. I also changed erc-save-buffer-in-logs to set the > filename too, albeit this might not be necessary. > > Anyway, let the patch speak for itself: > Below are some comments. Any suggestions/ideas. Anyone already fallen int hose pits? > --- erc.el.orig Sat Nov 24 02:24:25 2001 > +++ erc.el Sun Nov 25 00:28:40 2001 > @@ -291,6 +291,21 @@ > :group 'erc > :type 'boolean) > > +(defcustom erc-public-away-p nil > + "Let others know you are back when you are no longer marked away. > +This happens in this form: > +* <nick> is back (gone for <time>) > + > +Many consider it impolite to do so automatically." > + :group 'erc > + :type 'boolean) > + > +(defcustom erc-away-nickname nil > + "The nickname to take when you are marked as being away." > + :group 'erc > + :type '(choice (const nil) > + string)) > + > (defcustom erc-play-sound t > "*Play sound on SOUND ctcp requests (used in ICQ chat)" > :group 'erc > @@ -437,6 +452,31 @@ > :group 'erc > :type 'boolean) > > +(defvar erc-last-saved-position 1 > + "The position in which appears last in the log file for the channel > +buffer") > + > +(make-variable-buffer-local 'erc-last-saved-position) > + > +(defvar erc-log-insert-log-on-open t > + "Insert the log file contentents into the buffer if the log file exists") > + > +(defcustom erc-truncate-buffer-on-save nil > + "Truncate any ERC (channel, query, server) buffer when it is saved. > +When nil, no buffer is ever truncated. Nonetheless, only the relevant > +part of the buffer will be saved.") > + > +(defcustom erc-generate-log-file-name-function 'erc-generate-log-file-name-default hmm, maybe the default function should save the filename in the expanded form, like #name!nick@host:port, because the buffers have short names now, and therefore, logfiles cant be really destinguished from each other in case of multiserver usage? > + "A function name to generate a log filename. The function must take > +four arguments: BUFFER, TARGET, NICK and SERVER. BUFFER is the buffer The code uses five arguments. > +to be saved, TARGET is the name of the channel, or the target of the > +query, NICK is the current nick, and SERVER is the server the buffer > +is on." > + :group 'erc > + :type '(choice (const 'erc-generate-log-file-name-default) > + (const 'erc-generate-log-file-name-old) > + (function))) > + > (defvar erc-grab-buffer-name "*erc-grab*" > "The name of the buffer created by `erc-grab-region'.") > [...] > @@ -2867,6 +2912,14 @@ > :group 'erc > :type 'boolean) > > +(defcustom erc-query-on-unjoined-chan-privmsg t Uggh, I'd really like to find a better name :-). Any suggestions? > + "If non-nil create query buffer on receiving any PRIVMSG at all, > +including PRIVMSGs directed to channels. If you are using an IRC > +bouncer, such as dircproxy, to keep a log of channels when you are > +disconnected, you should set this option to t." See below. > + :group 'erc > + :type 'boolean) > + > (defcustom erc-minibuffer-notice nil > "If non-nil, ERC will print notices in the minibuffer in case the > session buffer isn't visible." > @@ -3170,12 +3223,18 @@ > > (defun erc-auto-query (proc parsed) > "Put this on `erc-server-PRIVMSG-hook'." > - (let ((nick (car (erc-parse-user (aref parsed 1)))) > - (target (aref parsed 2))) > + (let* ((nick (car (erc-parse-user (aref parsed 1)))) > + (target (aref parsed 2)) > + (query (if (not erc-query-on-unjoined-chan-privmsg) > + nick > + (if (string= target (erc-current-nick)) > + nick > + target)))) > (and erc-auto-query > - (string= target (erc-current-nick)) > - (not (erc-get-buffer nick proc)) > - (erc-cmd-query nick)))) > + (or erc-query-on-unjoined-chan-privmsg > + (string= target (erc-current-nick))) > + (not (erc-get-buffer query proc)) > + (erc-cmd-query query)))) I am not sure, but shouldn't we issue a /name #channel, and perhaps /topic #channel somewhere in here? At least from reading that, I think that the info buffers would get screwed in some way? > > ;;; PRIVMSG and NOTICE > [...] > @@ -5181,6 +5248,16 @@ > (buffer-enable-undo)) > (set-buffer ob))) > > +(defun erc-generate-log-file-name-default (buffer target nick server port) > + "Default log filename generator." > + (concat erc-log-channels-directory "/" (buffer-name buffer) ".txt")) See above. The default would mean we can get files like #emacs<4>.txt #channel!nick@server:port.ext should be more convinient? > +(defun erc-generate-log-file-name-old (buffer target nick server port) > + "Old-style (#channel!nick@server.txt) log filename generator" > + (concat erc-log-channels-directory "/" target "!" nick "@" server > + ":" (message (cond ((stringp port) port) > + ((numberp port) > + (number-to-string port)))) ".txt")) > + > (defun erc-save-buffer-in-logs (&optional buffer) > "When the logs are enabled, that is `erc-log-channels' is non-nil > and `erc-log-channels-directory' is a valid directory, appends the [...] Yup! Very cool ideas, thanks for the contributions! I just wanted to check for comments about what I thought while reading the patch before I aplly it. If anyone has an extended version from the above already, go for it and check it in, we can work from there in cvs... -- CYa, Mario <ml...@de...> Homepage(s): http://delysid.org | http://piss.at/ Nature, to be commanded, must be obeyed. -- Francis Bacon |
From: Gergely N. <alg...@bo...> - 2001-11-26 17:04:25
|
Hi! To summarise it all, Andreas Fuchs' changes were these: * Disable the public-away stuff by default (cust: erc-public-away-p) * Make away nickname customizeable (cust: erc-away-nickname) By away nickname, I mean the nick you change to when you're away, say: antifuchs -> antigone * Logfile behavior: don't truncate the buffer when saving the logfile any more. Also, insert the logfile contents into the newly created query/channel buffer (see below) (cust: erc-insert-log-on-open, erc-truncate-buffer-on-save) * Bad bouncer behaviour. Some bouncers (i.e. dircproxy) stay on the channel and send you a log of what happened when you re-connect. The messages you missed went into the server buffer, now erc opens a new query window to the channel (cust: erc-query-on-unjoined-chan-privmsg) Mine were: * Customisable log-filename generation (cust: erc-generate-log-filename-function) * Deferred buffer-name setting. Instead of setting it in erc-mode, we set it in erc, when all the information the log-filename generator functions might need are all set up. This should play nicely with the automatic inclusion of previous logs. * Made erc-log-insert-log-on-open customisable Please note that with the deferred buffer-name setting I might have broken erc-generate-log-file-name-default.. And now, the more interesting part, the patch (against vanilla 1.148): --- erc.el.orig Sat Nov 24 02:24:25 2001 +++ erc.el Mon Nov 26 17:47:05 2001 @@ -117,7 +117,6 @@ (set sym (funcall val)) (set sym val)))) - (defvar erc-password nil "ERC password to use in authentication (not necessary)") (defcustom erc-prompt-for-password t @@ -291,6 +290,21 @@ :group 'erc :type 'boolean) +(defcustom erc-public-away-p nil + "Let others know you are back when you are no longer marked away. +This happens in this form: +* <nick> is back (gone for <time>) + +Many consider it impolite to do so automatically." + :group 'erc + :type 'boolean) + +(defcustom erc-away-nickname nil + "The nickname to take when you are marked as being away." + :group 'erc + :type '(choice (const nil) + string)) + (defcustom erc-play-sound t "*Play sound on SOUND ctcp requests (used in ICQ chat)" :group 'erc @@ -437,6 +451,31 @@ :group 'erc :type 'boolean) +(defvar erc-last-saved-position 1 + "The position in which appears last in the log file for the channel +buffer") + +(defcustom erc-log-insert-log-on-open t + "Insert the log file contentents into the buffer if the log file exists" + :group 'erc + :type 'boolean) + +(defcustom erc-truncate-buffer-on-save nil + "Truncate any ERC (channel, query, server) buffer when it is saved. +When nil, no buffer is ever truncated. Nonetheless, only the relevant +part of the buffer will be saved.") + +(defcustom erc-generate-log-file-name-function 'erc-generate-log-file-name-default + "A function name to generate a log filename. The function must take +four arguments: BUFFER, TARGET, NICK and SERVER. BUFFER is the buffer +to be saved, TARGET is the name of the channel, or the target of the +query, NICK is the current nick, and SERVER is the server the buffer +is on." + :group 'erc + :type '(choice (const erc-generate-log-file-name-default) + (const erc-generate-log-file-name-old) + (symbol))) + (defvar erc-grab-buffer-name "*erc-grab*" "The name of the buffer created by `erc-grab-region'.") @@ -829,21 +868,10 @@ (set (make-local-variable 'next-line-add-newlines) nil)) (make-variable-buffer-local 'paragraph-separate) (make-variable-buffer-local 'paragraph-start) + (make-variable-buffer-local 'erc-last-saved-position) (setq paragraph-separate (concat "\C-l\\|\\(^" (regexp-quote erc-prompt) "\\)")) (setq paragraph-start (concat "\\(" (regexp-quote erc-prompt) "\\)")) - ;; Saving log file on exit - (when erc-log-channels-directory - (auto-save-mode -1) - (setq buffer-offer-save t - buffer-file-name (concat erc-log-channels-directory "/" - (buffer-name buffer) ".txt")) - (if (boundp 'local-write-file-hooks) - (setq local-write-file-hooks - '(erc-save-buffer-in-logs)) ;Emacs >=19 - (make-local-variable 'write-file-hooks) - (setq write-file-hooks ;Emacs 18 - '(erc-save-buffer-in-logs)))) ;; Run the mode hooks (run-hooks 'erc-mode-hook)) @@ -1115,6 +1143,24 @@ (when erc-log-p (get-buffer-create (concat "*ERC-DEBUG: " server "*")))) + ;; Saving log file on exit + (when erc-log-channels-directory + (auto-save-mode -1) + (setq buffer-offer-save t + buffer-file-name (funcall erc-generate-log-file-name-function + buffer (erc-default-target) + (erc-current-nick) erc-session-server + erc-session-port)) + (if (boundp 'local-write-file-hooks) + (setq local-write-file-hooks + '(erc-save-buffer-in-logs)) ;Emacs >=19 + (make-local-variable 'write-file-hooks) + (setq write-file-hooks ;Emacs 18 + '(erc-save-buffer-in-logs))) + (when erc-log-insert-log-on-open + (ignore-errors (insert-file-contents buffer-file-name))) + (setq erc-last-saved-position (point-max))) + (erc-determine-parameters server port nick full-name) (if connect (erc-connect)) (erc-update-mode-line) @@ -1557,7 +1603,7 @@ `(timestamp ,(current-time))) (add-text-properties insert-position (point) '(point-entered erc-echo-timestamp)) - (setq insert-end-position (point))) + (setq insert-end-position (point))) ;; really restore old point. ;; run insertion hook, with point at restored location (erc-chain-hook-with-args 'erc-insert-hook insert-position insert-end-position))))) @@ -2867,6 +2913,14 @@ :group 'erc :type 'boolean) +(defcustom erc-query-on-unjoined-chan-privmsg t + "If non-nil create query buffer on receiving any PRIVMSG at all, +including PRIVMSGs directed to channels. If you are using an IRC +bouncer, such as dircproxy, to keep a log of channels when you are +disconnected, you should set this option to t." + :group 'erc + :type 'boolean) + (defcustom erc-minibuffer-notice nil "If non-nil, ERC will print notices in the minibuffer in case the session buffer isn't visible." @@ -3170,12 +3224,18 @@ (defun erc-auto-query (proc parsed) "Put this on `erc-server-PRIVMSG-hook'." - (let ((nick (car (erc-parse-user (aref parsed 1)))) - (target (aref parsed 2))) + (let* ((nick (car (erc-parse-user (aref parsed 1)))) + (target (aref parsed 2)) + (query (if (not erc-query-on-unjoined-chan-privmsg) + nick + (if (string= target (erc-current-nick)) + nick + target)))) (and erc-auto-query - (string= target (erc-current-nick)) - (not (erc-get-buffer nick proc)) - (erc-cmd-query nick)))) + (or erc-query-on-unjoined-chan-privmsg + (string= target (erc-current-nick))) + (not (erc-get-buffer query proc)) + (erc-cmd-query query)))) ;;; PRIVMSG and NOTICE @@ -3902,6 +3962,11 @@ (let ((sessionbuf (process-buffer proc))) (when sessionbuf (with-current-buffer sessionbuf + (when erc-away-nickname + (erc-log (format "erc-process-away: away-nick: %s, away-p: %s" erc-away-nickname away-p)) + (erc-cmd-nick (if away-p + erc-away-nickname + erc-nick))) (cond (away-p (setq away (current-time))) @@ -3912,6 +3977,7 @@ (setq away nil) (save-excursion (set-buffer erc-active-buffer) + (when erc-public-away-p (erc-send-action (erc-default-target) (if away-time @@ -3919,7 +3985,7 @@ (erc-sec-to-time (erc-time-diff (erc-emacs-time-to-erc-time away-time) (erc-current-time)))) - "is back")))))))) + "is back"))))))))) (erc-update-mode-line))) ;;;; List of channel members handling @@ -5169,7 +5235,9 @@ (let ((ob (current-buffer))) (if (and buffer (get-buffer buffer)) (set-buffer (get-buffer buffer))) - (when (> (point-max) (+ size 512)) + (when (and + erc-truncate-buffer-on-save + (> (point-max) (+ size 512))) (buffer-disable-undo) (if (and erc-log-channels erc-log-channels-directory @@ -5181,6 +5249,17 @@ (buffer-enable-undo)) (set-buffer ob))) +(defun erc-generate-log-file-name-default (buffer target nick server port) + "Default log filename generator." + (concat erc-log-channels-directory "/" (buffer-name buffer) ".txt")) +(defun erc-generate-log-file-name-old (buffer target nick server port) + "Old-style (#channel!nick@server.txt) log filename generator" + (concat erc-log-channels-directory "/" (if target (concat target "!")) + nick "@" server ":" (message (cond ((stringp port) port) + ((numberp port) + (number-to-string + port)))) ".txt")) + (defun erc-save-buffer-in-logs (&optional buffer) "When the logs are enabled, that is `erc-log-channels' is non-nil and `erc-log-channels-directory' is a valid directory, appends the @@ -5192,16 +5271,20 @@ automatically." (interactive) (if (not buffer) (setq buffer (current-buffer))) - (let ((file buffer-file-name)) + (let ((file (funcall erc-generate-log-file-name-function + buffer (erc-default-target) (erc-current-nick) + erc-session-server erc-session-port))) (setq buffer-file-name nil) (when (and erc-log-channels erc-log-channels-directory (erc-directory-writable-p erc-log-channels-directory)) - (append-to-file (point-min) (point-max) - (concat erc-log-channels-directory - "/" (buffer-name buffer) ".txt")) + (append-to-file erc-last-saved-position (point-max) file) + (if erc-truncate-buffer-on-save + (progn (erase-buffer) - (erc-display-prompt) + (setq erc-last-saved-position (point-max)) + (erc-display-prompt)) + (setq erc-last-saved-position (point-max))) (goto-char (point-max))) (set-buffer-modified-p nil) (setq buffer-file-name file))) |
From: Mario L. <ml...@ho...> - 2001-11-26 09:25:16
|
Gergely Nagy <alg...@bo...> writes: > Greetings! > > I was experiencing problems with tab completion: sometimes, I got > transferred to a different buffer, or some random location in the > current buffer. A few minutes ago, I figured out how I can reliably > reproduce this behaviour: on one channel, there were two nicks > starting with the same letter, so f<tab>, erc pops up a completion > window. Now, I switch to another frame, and on another channel, I do > o<tab>. And bingo! I get back to the previous frame, where the > completion window had disappeared. > > By looking at erc-completion.el, I suspect the bug may be in > try-complete-erc-nick-restore or try-complete-erc-nick. Those two > fiddle with "*Completions*". > > I'm quite confident it's try-complete-erc-nick. However, I don't have > a fix yet.. Yow, I somehow thought that this could be a problem. Current answer is, "Its not a bug, its a feature" Here comes the explanation. The erc completion code does a trick to be able to restore window configuration when using completion. Imagine you use multiple windows in one frame to have several channels on screen. Now, in the old code, when you used TAB to complete, the completion window poped up and removed one of your windows from the screen. This made TAB quite unusable when using multiple windows, because you always had to manually restore the windows buffer, say, C-x o C-x b ... What the restore code does is the following: It saves the window configuration when the *Completion* Buffer pops up, and when you type TAB again, it restores that saved configuration, therefore removes the *Completion* window again, and you get your old configuration. So, for now, if you pop up a completion buffer, close it again with TAB, and everything is fine. But, we certainly should investigate if we can put in some safeguards to prevent false-usage even more. Any suggestions? -- CYa, Mario <ml...@de...> Homepage(s): http://delysid.org | http://piss.at/ |
From: Adam D. <du...@in...> - 2001-11-25 12:55:41
|
V2VsbCwgSSdtIHVzaW5nIEVSQyB0aGUgd2hvbGUgZGF5IGFuZCB0aGVyZSBpcyBhIGJ1ZyB3 aGljaCByZWFsbHkNDQphbm5veXMgbWU6IGVhY2ggdGltZSBfSV8gLSBpdCdzIG9ubHkgbXkg dGV4dCAtIHNlbmQgYSBsaW5lIHRvIElSQyBhDQ0KbmV3bGluZSBhcHBlYXJzIGJldHdlZW4g dGhlIHRleHQgSSBzYWlkIGFuZCAnZXJjLXByb21wdCcuIEl0J3MgYmVjYXVzZQ0NCm9mIGVy Yy1maWxsLiBTb21laG93IGl0IGdldHMgdGhlIHdyb25nIGBpbnNlcnQtZW5kLXBvc2l0aW9u JyBvcg0NCnNvbWV0aGluZyBsaWtlIHRoYXQuIEknbSBzb3JyeSBidXQgSSBjYW5ub3Qgc2F5 IHdoYXQgcmVhbGx5IGNhdXNlcw0NCnRoaXMgYnVnLiBJJ3ZlIHRyaWVkIHRoZSBmb2xsb3dp bmc6DQ0KDQ0KIC0gcmVtb3ZpbmcgdGhlIGFwcHJvcHJpYXRlICIob3Blbi1saW5lIDEpIiBm cm9tDQ0KICAgYGVyYy1zZW5kLWN1cnJlbnQtbGluZScNDQogICB0aGlzIGJyZWFrcyBpdCBm b3Igb3RoZXIgbWVzc2FnZXMNDQogLSBzZXR0aW5nICIoZmlsbC1yZWdpb24gc3RhcnQgZW5k IHQgdCkiIGluIGBlcmMtZmlsbC12YXJpYWJsZScgdG8NDQogICAiKGZpbGwtcmVnaW9uIHN0 YXJ0IGVuZCB0IHQgdCkiDQ0KICAgVGhpcyBvbmx5IHNvbHZlZCBpdCBmb3IgdGhlIHZhcmlh YmxlIGZ1bmN0aW9uIGFuZCBub3QgZm9yIHRoZQ0NCiAgIHN0YXRpYyBvbmUgYWx0aG91Z2gg aXQgYWxzbyB1c2VzIGBlcmMtZmlsbC12YXJpYWJsZScNDQogLSByZW1vdmluZyBhbnkgXG4g YXQgdGhlIGVuZCBvZiB0aGUgc3RyaW5nDQ0KICAgZGlkbid0IHdvcmsgZWl0aGVyDQ0KDQ0K U28gbm93LCBJIGhhdmUganVzdCBzZXQNDQotCShsZXQgKChpbnNlcnQtZW5kLXBvc2l0aW9u IChwb2ludCkpKQ0NCisJKGxldCAoKGluc2VydC1lbmQtcG9zaXRpb24gKDErIChwb2ludCkp KSkNDQppbiBgZXJjLXNlbmQtY3VycmVudC1saW5lJw0NCmFuZCBpdCB3b3JrcyBmb3IgYm90 aCBmdW5jdGlvbnMuIEkga25vdyB0aGF0IHRoaXMgaXNuJ3QgdGhlIHJpZ2h0DQ0Kc29sdXRp b24gZm9yIHRoaXMgcHJvYmxlbSBiZWNhdXNlIGl0IG11c3QgaGF2ZSB0byBkbyBzb21ldGhp bmcgd2l0aA0NCnRoZSBzdHJpbmcgcGFzc2VkIHRvIGBlcmMtc2VuZC1jdXJyZW50LWxpbmUn IG9yIHRoZSB3YXkgWEVtYWNzIGluc2VydHMNDQp0ZXh0cyAtIHdoaWNoIHNob3VsZCBiZSBh bGwgdGhlIHNhbWUsIGJ1dCBzb21laG93IGlzbid0Lg0NCkFueXdheSwgaXQgZG9lc24ndCBi cmVhayBhbnl0aGluZyBpbiBFbWFjcyBzbyBjb3VsZCBzb21lb25lIHBsZWFzZQ0NCmFwcGx5 IHRoaXMgcGF0Y2g/IEkgZG9uJ3Qga25vdyBpZiB5b3UndmUgZXZlciBzZWVuIGFueXRoaW5n IGxpa2UgdGhpcw0NCmJ1dCBpdCByZWFsbHkgbWFkZSBtZSBzY3JlYW0gdGhlIGxhc3QgMiBk YXlzIGV2ZXJ5IHRpbWUgSSBzYXcgYQ0NCm5ld2xpbmUgOikuDQ0KDQ0KQW5vdGhlciBxdWVz dGlvbjogYXJlIHRoZXJlIE5PIFhFbWFjcy11c2VycyBpbiB0aGlzIG1haWxpbmctbGlzdCBh dA0NCmFsbD8gRG9uJ3QgdGhleSBzZWUgdGhlIHNhbWUgYnVnPyBGb3IgbWUgaXQgaGFwcGVu cyBpbiBib3RoDQ0KWEVtYWNzLTIxLjQuMyBhbmQgMjEuNWIzLg0NCg0NCk5leHQgaXMgdGhl IGRpZmYuIFBsZWFzZSBkb24ndCByZWx5IG9uIHRoaXMgb25lIGJlY2F1c2UgSSBjYW4ndCBk aWZmDQ0KYWdhaW5zdCBlcmMuZWwgc29tZWhvdy4gSXQgcHV0cyBtYW55IGxpbmVzIG91dCBh bmQgaW4gdGhhdCBJIGRpZG4ndA0NCmFsdGVyLCBzbyBJIGhhZCB0byBtYW51YWxseSBzdHJp cCBpdCBmcm9tIHRoaXMuDQ0KDQ0KSW5kZXg6IGVyYy5lbA0NCj09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NDQpS Q1MgZmlsZTogL2N2c3Jvb3QvZXJjL2VyYy9lcmMuZWwsdg0NCnJldHJpZXZpbmcgcmV2aXNp b24gMS4xNDgNDQpkaWZmIC11IC1yMS4xNDggZXJjLmVsDQ0KLS0tIGVyYy5lbAkyMDAxLzEx LzIzIDIwOjQ3OjE4CTEuMTQ4DQ0KKysrIGVyYy5lbAkyMDAxLzExLzI1IDEyOjI2OjA4DQ0K IAkoaW5zZXJ0IChpZiBlcmMtdW5jb250cm9sLWlucHV0LWxpbmUNDQogCQkgICAgKGVyYy1p bnRlcnByZXQtY29udHJvbHMgcykNDQogCQkgIHMpKQ0NCi0JKGxldCAoKGluc2VydC1lbmQt cG9zaXRpb24gKHBvaW50KSkpDQ0KKwkobGV0ICgoaW5zZXJ0LWVuZC1wb3NpdGlvbiAoMSsg KHBvaW50KSkpKQ0NCiAJICAoZ290by1jaGFyIChwb2ludC1tYXgpKQ0NCiAJICAob3Blbi1s aW5lIDEpDQ0KIAkgIChnb3RvLWNoYXIgKHBvaW50LW1heCkpDQ0KLQ0NCi0NDQoNDQotLSAN DQogQWRhbSBEdWNrIChkdWNrQGNzLnVuaS1mcmFua2Z1cnQuZGUpDQ0KIEJvY2tlbmhlaW1l ciBMYW5kc3RyLiAxMzUgLyBaaS4gMjExDQ0KIDYwMzI1IEZyYW5rZnVydC9NYWluDQ0KX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18NDQoNDQpJZiBpdCB3b3Jrcywg dGVhciBpdCBhcGFydCBhbmQgZmluZCBvdXQgd2h5IQ== |
From: Gergely N. <alg...@bo...> - 2001-11-25 04:03:35
|
Hello again! Attached below is the very latest version of the antifuchs+mhp patch. The only change between the previous one and this is that I modified erc-mode to set the initial filename of the buffer using my customise function. I also changed erc-save-buffer-in-logs to set the filename too, albeit this might not be necessary. Anyway, let the patch speak for itself: --- erc.el.orig Sat Nov 24 02:24:25 2001 +++ erc.el Sun Nov 25 00:28:40 2001 @@ -291,6 +291,21 @@ :group 'erc :type 'boolean) +(defcustom erc-public-away-p nil + "Let others know you are back when you are no longer marked away. +This happens in this form: +* <nick> is back (gone for <time>) + +Many consider it impolite to do so automatically." + :group 'erc + :type 'boolean) + +(defcustom erc-away-nickname nil + "The nickname to take when you are marked as being away." + :group 'erc + :type '(choice (const nil) + string)) + (defcustom erc-play-sound t "*Play sound on SOUND ctcp requests (used in ICQ chat)" :group 'erc @@ -437,6 +452,31 @@ :group 'erc :type 'boolean) +(defvar erc-last-saved-position 1 + "The position in which appears last in the log file for the channel +buffer") + +(make-variable-buffer-local 'erc-last-saved-position) + +(defvar erc-log-insert-log-on-open t + "Insert the log file contentents into the buffer if the log file exists") + +(defcustom erc-truncate-buffer-on-save nil + "Truncate any ERC (channel, query, server) buffer when it is saved. +When nil, no buffer is ever truncated. Nonetheless, only the relevant +part of the buffer will be saved.") + +(defcustom erc-generate-log-file-name-function 'erc-generate-log-file-name-default + "A function name to generate a log filename. The function must take +four arguments: BUFFER, TARGET, NICK and SERVER. BUFFER is the buffer +to be saved, TARGET is the name of the channel, or the target of the +query, NICK is the current nick, and SERVER is the server the buffer +is on." + :group 'erc + :type '(choice (const 'erc-generate-log-file-name-default) + (const 'erc-generate-log-file-name-old) + (function))) + (defvar erc-grab-buffer-name "*erc-grab*" "The name of the buffer created by `erc-grab-region'.") @@ -836,14 +876,19 @@ (when erc-log-channels-directory (auto-save-mode -1) (setq buffer-offer-save t - buffer-file-name (concat erc-log-channels-directory "/" - (buffer-name buffer) ".txt")) + buffer-file-name (funcall erc-generate-log-file-name-function + buffer (erc-default-target) + (erc-current-nick) erc-session-server + erc-session-port)) (if (boundp 'local-write-file-hooks) (setq local-write-file-hooks '(erc-save-buffer-in-logs)) ;Emacs >=19 (make-local-variable 'write-file-hooks) (setq write-file-hooks ;Emacs 18 - '(erc-save-buffer-in-logs)))) + '(erc-save-buffer-in-logs))) + (when erc-log-insert-log-on-open + (ignore-errors (insert-file-contents buffer-file-name))) + (setq erc-last-saved-position (point-max))) ;; Run the mode hooks (run-hooks 'erc-mode-hook)) @@ -1557,7 +1602,7 @@ `(timestamp ,(current-time))) (add-text-properties insert-position (point) '(point-entered erc-echo-timestamp)) - (setq insert-end-position (point))) + (setq insert-end-position (point))) ;; really restore old point. ;; run insertion hook, with point at restored location (erc-chain-hook-with-args 'erc-insert-hook insert-position insert-end-position))))) @@ -2867,6 +2912,14 @@ :group 'erc :type 'boolean) +(defcustom erc-query-on-unjoined-chan-privmsg t + "If non-nil create query buffer on receiving any PRIVMSG at all, +including PRIVMSGs directed to channels. If you are using an IRC +bouncer, such as dircproxy, to keep a log of channels when you are +disconnected, you should set this option to t." + :group 'erc + :type 'boolean) + (defcustom erc-minibuffer-notice nil "If non-nil, ERC will print notices in the minibuffer in case the session buffer isn't visible." @@ -3170,12 +3223,18 @@ (defun erc-auto-query (proc parsed) "Put this on `erc-server-PRIVMSG-hook'." - (let ((nick (car (erc-parse-user (aref parsed 1)))) - (target (aref parsed 2))) + (let* ((nick (car (erc-parse-user (aref parsed 1)))) + (target (aref parsed 2)) + (query (if (not erc-query-on-unjoined-chan-privmsg) + nick + (if (string= target (erc-current-nick)) + nick + target)))) (and erc-auto-query - (string= target (erc-current-nick)) - (not (erc-get-buffer nick proc)) - (erc-cmd-query nick)))) + (or erc-query-on-unjoined-chan-privmsg + (string= target (erc-current-nick))) + (not (erc-get-buffer query proc)) + (erc-cmd-query query)))) ;;; PRIVMSG and NOTICE @@ -3902,6 +3961,11 @@ (let ((sessionbuf (process-buffer proc))) (when sessionbuf (with-current-buffer sessionbuf + (when erc-away-nickname + (erc-log (format "erc-process-away: away-nick: %s, away-p: %s" erc-away-nickname away-p)) + (erc-cmd-nick (if away-p + erc-away-nickname + erc-nick))) (cond (away-p (setq away (current-time))) @@ -3912,6 +3976,7 @@ (setq away nil) (save-excursion (set-buffer erc-active-buffer) + (when erc-public-away-p (erc-send-action (erc-default-target) (if away-time @@ -3919,7 +3984,7 @@ (erc-sec-to-time (erc-time-diff (erc-emacs-time-to-erc-time away-time) (erc-current-time)))) - "is back")))))))) + "is back"))))))))) (erc-update-mode-line))) ;;;; List of channel members handling @@ -5169,7 +5234,9 @@ (let ((ob (current-buffer))) (if (and buffer (get-buffer buffer)) (set-buffer (get-buffer buffer))) - (when (> (point-max) (+ size 512)) + (when (and + erc-truncate-buffer-on-save + (> (point-max) (+ size 512))) (buffer-disable-undo) (if (and erc-log-channels erc-log-channels-directory @@ -5181,6 +5248,16 @@ (buffer-enable-undo)) (set-buffer ob))) +(defun erc-generate-log-file-name-default (buffer target nick server port) + "Default log filename generator." + (concat erc-log-channels-directory "/" (buffer-name buffer) ".txt")) +(defun erc-generate-log-file-name-old (buffer target nick server port) + "Old-style (#channel!nick@server.txt) log filename generator" + (concat erc-log-channels-directory "/" target "!" nick "@" server + ":" (message (cond ((stringp port) port) + ((numberp port) + (number-to-string port)))) ".txt")) + (defun erc-save-buffer-in-logs (&optional buffer) "When the logs are enabled, that is `erc-log-channels' is non-nil and `erc-log-channels-directory' is a valid directory, appends the @@ -5192,16 +5269,20 @@ automatically." (interactive) (if (not buffer) (setq buffer (current-buffer))) - (let ((file buffer-file-name)) + (let ((file (funcall erc-generate-log-file-name-function + buffer (erc-default-target) (erc-current-nick) + erc-session-server erc-session-port))) (setq buffer-file-name nil) (when (and erc-log-channels erc-log-channels-directory (erc-directory-writable-p erc-log-channels-directory)) - (append-to-file (point-min) (point-max) - (concat erc-log-channels-directory - "/" (buffer-name buffer) ".txt")) + (append-to-file erc-last-saved-position (point-max) file) + (if erc-truncate-buffer-on-save + (progn (erase-buffer) - (erc-display-prompt) + (setq erc-last-saved-position (point-max)) + (erc-display-prompt)) + (setq erc-last-saved-position (point-max))) (goto-char (point-max))) (set-buffer-modified-p nil) (setq buffer-file-name file))) |
From: Gergely N. <alg...@bo...> - 2001-11-25 02:31:11
|
Greetings! I was experiencing problems with tab completion: sometimes, I got transferred to a different buffer, or some random location in the current buffer. A few minutes ago, I figured out how I can reliably reproduce this behaviour: on one channel, there were two nicks starting with the same letter, so f<tab>, erc pops up a completion window. Now, I switch to another frame, and on another channel, I do o<tab>. And bingo! I get back to the previous frame, where the completion window had disappeared. By looking at erc-completion.el, I suspect the bug may be in try-complete-erc-nick-restore or try-complete-erc-nick. Those two fiddle with "*Completions*". I'm quite confident it's try-complete-erc-nick. However, I don't have a fix yet.. |
From: Gergely N. <alg...@bo...> - 2001-11-24 20:08:26
|
Greetings! Attached below is my latest patch (which includes antifuchs' patch too), which fixes an annoying buglet in erc-generate-log-file-name-old: if the port argument was an integer, the concat failed. It also fixes a typo, noticed by delYsid. I'm using these for a few hours now, and most of the changes appear to work nicely. Comments anyone? --- erc.el.orig Sat Nov 24 02:24:25 2001 +++ erc.el Sat Nov 24 20:58:56 2001 @@ -291,6 +291,21 @@ :group 'erc :type 'boolean) +(defcustom erc-public-away-p nil + "Let others know you are back when you are no longer marked away. +This happens in this form: +* <nick> is back (gone for <time>) + +Many consider it impolite to do so automatically." + :group 'erc + :type 'boolean) + +(defcustom erc-away-nickname nil + "The nickname to take when you are marked as being away." + :group 'erc + :type '(choice (const nil) + string)) + (defcustom erc-play-sound t "*Play sound on SOUND ctcp requests (used in ICQ chat)" :group 'erc @@ -437,6 +452,31 @@ :group 'erc :type 'boolean) +(defvar erc-last-saved-position 1 + "The position in which appears last in the log file for the channel +buffer") + +(make-variable-buffer-local 'erc-last-saved-position) + +(defvar erc-log-insert-log-on-open t + "Insert the log file contentents into the buffer if the log file exists") + +(defcustom erc-truncate-buffer-on-save nil + "Truncate any ERC (channel, query, server) buffer when it is saved. +When nil, no buffer is ever truncated. Nonetheless, only the relevant +part of the buffer will be saved.") + +(defcustom erc-generate-log-file-name-function 'erc-generate-log-file-name-default + "A function name to generate a log filename. The function must take +four arguments: BUFFER, TARGET, NICK and SERVER. BUFFER is the buffer +to be saved, TARGET is the name of the channel, or the target of the +query, NICK is the current nick, and SERVER is the server the buffer +is on." + :group 'erc + :type '(choice (const 'erc-generate-log-file-name-default) + (const 'erc-generate-log-file-name-old) + (function-item))) + (defvar erc-grab-buffer-name "*erc-grab*" "The name of the buffer created by `erc-grab-region'.") @@ -843,7 +883,10 @@ '(erc-save-buffer-in-logs)) ;Emacs >=19 (make-local-variable 'write-file-hooks) (setq write-file-hooks ;Emacs 18 - '(erc-save-buffer-in-logs)))) + '(erc-save-buffer-in-logs))) + (when erc-log-insert-log-on-open + (ignore-errors (insert-file-contents buffer-file-name))) + (setq erc-last-saved-position (point-max))) ;; Run the mode hooks (run-hooks 'erc-mode-hook)) @@ -1557,7 +1600,7 @@ `(timestamp ,(current-time))) (add-text-properties insert-position (point) '(point-entered erc-echo-timestamp)) - (setq insert-end-position (point))) + (setq insert-end-position (point))) ;; really restore old point. ;; run insertion hook, with point at restored location (erc-chain-hook-with-args 'erc-insert-hook insert-position insert-end-position))))) @@ -2867,6 +2910,14 @@ :group 'erc :type 'boolean) +(defcustom erc-query-on-unjoined-chan-privmsg t + "If non-nil create query buffer on receiving any PRIVMSG at all, +including PRIVMSGs directed to channels. If you are using an IRC +bouncer, such as dircproxy, to keep a log of channels when you are +disconnected, you should set this option to t." + :group 'erc + :type 'boolean) + (defcustom erc-minibuffer-notice nil "If non-nil, ERC will print notices in the minibuffer in case the session buffer isn't visible." @@ -3170,12 +3221,18 @@ (defun erc-auto-query (proc parsed) "Put this on `erc-server-PRIVMSG-hook'." - (let ((nick (car (erc-parse-user (aref parsed 1)))) - (target (aref parsed 2))) + (let* ((nick (car (erc-parse-user (aref parsed 1)))) + (target (aref parsed 2)) + (query (if (not erc-query-on-unjoined-chan-privmsg) + nick + (if (string= target (erc-current-nick)) + nick + target)))) (and erc-auto-query - (string= target (erc-current-nick)) - (not (erc-get-buffer nick proc)) - (erc-cmd-query nick)))) + (or erc-query-on-unjoined-chan-privmsg + (string= target (erc-current-nick))) + (not (erc-get-buffer query proc)) + (erc-cmd-query query)))) ;;; PRIVMSG and NOTICE @@ -3902,6 +3959,11 @@ (let ((sessionbuf (process-buffer proc))) (when sessionbuf (with-current-buffer sessionbuf + (when erc-away-nickname + (erc-log (format "erc-process-away: away-nick: %s, away-p: %s" erc-away-nickname away-p)) + (erc-cmd-nick (if away-p + erc-away-nickname + erc-nick))) (cond (away-p (setq away (current-time))) @@ -3912,6 +3974,7 @@ (setq away nil) (save-excursion (set-buffer erc-active-buffer) + (when erc-public-away-p (erc-send-action (erc-default-target) (if away-time @@ -3919,7 +3982,7 @@ (erc-sec-to-time (erc-time-diff (erc-emacs-time-to-erc-time away-time) (erc-current-time)))) - "is back")))))))) + "is back"))))))))) (erc-update-mode-line))) ;;;; List of channel members handling @@ -5169,7 +5232,9 @@ (let ((ob (current-buffer))) (if (and buffer (get-buffer buffer)) (set-buffer (get-buffer buffer))) - (when (> (point-max) (+ size 512)) + (when (and + erc-truncate-buffer-on-save + (> (point-max) (+ size 512))) (buffer-disable-undo) (if (and erc-log-channels erc-log-channels-directory @@ -5181,6 +5246,16 @@ (buffer-enable-undo)) (set-buffer ob))) +(defun erc-generate-log-file-name-default (buffer target nick server port) + "Default log filename generator." + (concat erc-log-channels-directory "/" (buffer-name buffer) ".txt")) +(defun erc-generate-log-file-name-old (buffer target nick server port) + "Old-style (#channel!nick@server.txt) log filename generator" + (concat erc-log-channels-directory "/" target "!" nick "@" server + ":" (message (cond ((stringp port) port) + ((numberp port) + (number-to-string port)))) ".txt")) + (defun erc-save-buffer-in-logs (&optional buffer) "When the logs are enabled, that is `erc-log-channels' is non-nil and `erc-log-channels-directory' is a valid directory, appends the @@ -5197,11 +5272,16 @@ (when (and erc-log-channels erc-log-channels-directory (erc-directory-writable-p erc-log-channels-directory)) - (append-to-file (point-min) (point-max) - (concat erc-log-channels-directory - "/" (buffer-name buffer) ".txt")) + (append-to-file erc-last-saved-position (point-max) + (funcall erc-generate-log-file-name-function + buffer (erc-default-target) (erc-current-nick) + erc-session-server erc-session-port)) + (if erc-truncate-buffer-on-save + (progn (erase-buffer) - (erc-display-prompt) + (setq erc-last-saved-position (point-max)) + (erc-display-prompt)) + (setq erc-last-saved-position (point-max))) (goto-char (point-max))) (set-buffer-modified-p nil) (setq buffer-file-name file))) |
From: Gergely N. <alg...@bo...> - 2001-11-24 16:56:13
|
> --- erc.el.orig Sat Nov 24 17:08:30 2001 > +++ erc.el Sat Nov 24 17:28:10 2001 > @@ -6,6 +6,7 @@ > ;; Contributors: Sergey Berezin (ser...@cs...), > ;; Mario Lang (ml...@de...), > ;; Alex Schroeder (al...@gn...) > +;; Gergely Nagy (alg...@mi...) I don't think I contributed that much to justify my inclusion in that list.. if someone wants to add me there, the address should be alg...@de.... BTW, there is a slight problem with my original patch, which I didn't test with antifuchs' version: when I get disconnected, I can't save the logs with C-c C-l, because one or more of the variables/functions I use is undefined (something about a deleted buffer). However, the message disappeared fast. I'll try to memorize it next time my ISP decides I'm better put offline. |