From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Vibhav Pant <vibhavp@gmail.com>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: [Emacs-diffs] master 52cc9a5: Reimplement inline functions in ERC with define-inline.
Date: Sun, 26 Nov 2017 15:23:33 -0500 [thread overview]
Message-ID: <jwvindwaixq.fsf-monnier+emacsdiffs@gnu.org> (raw)
In-Reply-To: <CA+T2Sh1+omNiZPuWNnpfwao+_ScHdFMfuTcNUT=D9=giXb9f+g@mail.gmail.com> (Vibhav Pant's message of "Sun, 26 Nov 2017 22:36:14 +0530")
>> > -(defsubst erc-get-server-user (nick)
>> > +(define-inline erc-get-server-user (nick)
>> > "Find the USER corresponding to NICK in the current server's
>> > `erc-server-users' hash table."
>> > - (erc-with-server-buffer
>> > - (gethash (erc-downcase nick) erc-server-users)))
>> > + (inline-quote (erc-with-server-buffer
>> > + (gethash (erc-downcase ,nick) erc-server-users))))
>> This will evaluate `nick` in another buffer than the caller's
>> current-buffer, so if the argument refers to buffer-local variables the
>> result may be different when inlined than it would be when not inlined.
> I'm not entirely sure on how to fix this. Would reverting to defsubst/defun be
> the only solution?
inline-letevals will do the trick (because you can put it outside of the
`erc-with-server-buffer`).
Stefan
prev parent reply other threads:[~2017-11-26 20:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20171118134153.7341.67271@vcs0.savannah.gnu.org>
[not found] ` <20171118134155.1BE4320416@vcs0.savannah.gnu.org>
2017-11-18 14:53 ` [Emacs-diffs] master 52cc9a5: Reimplement inline functions in ERC with define-inline Stefan Monnier
2017-11-18 15:16 ` Eli Zaretskii
2017-11-26 17:06 ` Vibhav Pant
2017-11-26 20:23 ` Stefan Monnier [this message]
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=jwvindwaixq.fsf-monnier+emacsdiffs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=vibhavp@gmail.com \
/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.