From: Ivan Shmakov <ivan@siamics.net>
To: 16111@debbugs.gnu.org
Subject: bug#16111: (erc-current-logfile buf) behavior differs to with-current-buffer buf
Date: Wed, 11 Dec 2013 13:41:18 +0000 [thread overview]
Message-ID: <874n6f4i9t.fsf@violet.siamics.net> (raw)
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.)
This may show no symptoms as long as erc-save-buffer-in-logs is
called in either of the buffers belonging to the same session,
but I’m in doubt that erc-log-save-all-buffers (which may run as
part of kill-emacs-hook) will behave sensible in general.
--
FSF associate member #7257
next reply other threads:[~2013-12-11 13:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-11 13:41 Ivan Shmakov [this message]
2015-12-27 21:01 ` bug#16111: (erc-current-logfile buf) behavior differs to with-current-buffer buf Lars Ingebrigtsen
2018-04-14 19:19 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874n6f4i9t.fsf@violet.siamics.net \
--to=ivan@siamics.net \
--cc=16111@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.