all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Ivan Shmakov <ivan@siamics.net>
Cc: 16111@debbugs.gnu.org
Subject: bug#16111: (erc-current-logfile buf) behavior differs to with-current-buffer buf
Date: Sun, 27 Dec 2015 22:01:20 +0100	[thread overview]
Message-ID: <87si2na9nj.fsf@gnus.org> (raw)
In-Reply-To: <874n6f4i9t.fsf@violet.siamics.net> (Ivan Shmakov's message of "Wed, 11 Dec 2013 13:41:18 +0000")

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	other threads:[~2015-12-27 21:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 13:41 bug#16111: (erc-current-logfile buf) behavior differs to with-current-buffer buf Ivan Shmakov
2015-12-27 21:01 ` Lars Ingebrigtsen [this message]
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=87si2na9nj.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=16111@debbugs.gnu.org \
    --cc=ivan@siamics.net \
    /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.