[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] master 52cc9a5: Reimplement inline functions in ERC wi
From: |
Stefan Monnier |
Subject: |
Re: [Emacs-diffs] master 52cc9a5: Reimplement inline functions in ERC with define-inline. |
Date: |
Sun, 26 Nov 2017 15:23:33 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
>> > -(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