bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#16111: (erc-current-logfile buf) behavior differs to with-current-bu


From: Lars Ingebrigtsen
Subject: bug#16111: (erc-current-logfile buf) behavior differs to with-current-buffer buf
Date: Sun, 27 Dec 2015 22:01:20 +0100
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.50 (gnu/linux)

Ivan Shmakov <ivan@siamics.net> writes:

> Package:  emacs
> Severity: minor
>
>       My guess is that the results of (erc-current-logfile buffer) and
>       (with-current-buffer buffer (erc-current-logfile)) were intended
>       to be the same.  However, as the function references the session
>       buffer-local variables (erc-session-server, erc-session-port,
>       and, indirectly, erc-server-current-nick and erc-server-process)
>       /without/ switching to the buffer given, the results are
>       somewhat undefined.
>
> (defun erc-current-logfile (&optional buffer)
>   "Return the logfile to use for BUFFER.
> If BUFFER is nil, the value of `current-buffer' is used.
> This is determined by `erc-generate-log-file-name-function'.
> The result is converted to lowercase, as IRC is case-insensitive"
>   (unless buffer (setq buffer (current-buffer)))
>   (let ((target (or (buffer-name buffer) (erc-default-target)))
>       (nick (erc-current-nick))
>       (server erc-session-server)
>       (port erc-session-port))
>     …))
>
>       (There, it may make sense to enclose the most part of the code
>       within a with-current-buffer form.)

Do you have a patch for this?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]