From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 52cc9a5: Reimplement inline functions in ERC with define-inline. Date: Sun, 26 Nov 2017 15:23:33 -0500 Message-ID: References: <20171118134153.7341.67271@vcs0.savannah.gnu.org> <20171118134155.1BE4320416@vcs0.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1511727837 16353 195.159.176.226 (26 Nov 2017 20:23:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 26 Nov 2017 20:23:57 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: "emacs-devel@gnu.org" To: Vibhav Pant Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 26 21:23:53 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJ3Sp-0003Nj-Le for ged-emacs-devel@m.gmane.org; Sun, 26 Nov 2017 21:23:43 +0100 Original-Received: from localhost ([::1]:57902 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJ3Sx-00089W-32 for ged-emacs-devel@m.gmane.org; Sun, 26 Nov 2017 15:23:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJ3Sm-00089P-5Y for emacs-devel@gnu.org; Sun, 26 Nov 2017 15:23:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJ3Sj-0005JM-1x for emacs-devel@gnu.org; Sun, 26 Nov 2017 15:23:40 -0500 Original-Received: from pmta11.teksavvy.com ([76.10.157.34]:51971) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1eJ3Si-0005JC-RM for emacs-devel@gnu.org; Sun, 26 Nov 2017 15:23:36 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2FsCABlIhta/7GPSC1aHAEBAQQBAQoBA?= =?us-ascii?q?YM8gVSDW4VYlCiCEZhqChOFKAKEXkMUAQEBAQEBAQEBA2gohSEGeRALDScSFBg?= =?us-ascii?q?xLooHqGghAopZAQsBJYM6ggeDPoMrhQaGDgWTCo88oQAohzKWOoE6NiOBUDIaC?= =?us-ascii?q?DCCY4JQHRmBbCOKdQEBAQ?= X-IPAS-Result: =?us-ascii?q?A2FsCABlIhta/7GPSC1aHAEBAQQBAQoBAYM8gVSDW4VYlCi?= =?us-ascii?q?CEZhqChOFKAKEXkMUAQEBAQEBAQEBA2gohSEGeRALDScSFBgxLooHqGghAopZA?= =?us-ascii?q?QsBJYM6ggeDPoMrhQaGDgWTCo88oQAohzKWOoE6NiOBUDIaCDCCY4JQHRmBbCO?= =?us-ascii?q?KdQEBAQ?= X-IronPort-AV: E=Sophos;i="5.44,460,1505793600"; d="scan'208";a="10377143" Original-Received: from unknown (HELO fmsmemgm.homelinux.net) ([45.72.143.177]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Nov 2017 15:23:34 -0500 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id B6D1FAE0BC; Sun, 26 Nov 2017 15:23:33 -0500 (EST) In-Reply-To: (Vibhav Pant's message of "Sun, 26 Nov 2017 22:36:14 +0530") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 76.10.157.34 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:220471 Archived-At: >> > -(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