From debbugs-submit-bounces@debbugs.gnu.org Fri May 07 18:44:41 2021 Received: (at submit) by debbugs.gnu.org; 7 May 2021 22:44:41 +0000 Received: from localhost ([127.0.0.1]:46364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lf9D6-0004MY-VG for submit@debbugs.gnu.org; Fri, 07 May 2021 18:44:41 -0400 Received: from lists.gnu.org ([209.51.188.17]:55044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lf9D3-0004MS-W6 for submit@debbugs.gnu.org; Fri, 07 May 2021 18:44:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lf9D3-00089s-Nx for bug-gnu-emacs@gnu.org; Fri, 07 May 2021 18:44:37 -0400 Received: from venus.catern.com ([68.183.49.163]:48176) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lf9D0-00039s-W0 for bug-gnu-emacs@gnu.org; Fri, 07 May 2021 18:44:37 -0400 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=98.7.229.235; helo=localhost; envelope-from=sbaugh@catern.com; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=catern.com; s=mail; t=1620427473; bh=pHq4x09SimQtdMB2HV6Rx0H0OKMEbdFZd3FgAEiWrc4=; h=From:To:Subject:Date; b=iGCCZ/t4T89Xf9lYw85bZ0GD6RlreBendHBZRDmWiPs63WJ66Z8X6aZAADPWjwtgx w46G58eyuFiOTUfq1kcd8rZziqs0gpjBVmXqt0aNCu7StQ55cb72NxeUJHaZNhSPdP N//qpOUiZIglIblu4N8TCQfthGMrVP0CYkKz/rbo= Received: from localhost (cpe-98-7-229-235.nyc.res.rr.com [98.7.229.235]) by venus.catern.com (Postfix) with ESMTPSA id C884C2E9771 for ; Fri, 7 May 2021 22:44:33 +0000 (UTC) From: Spencer Baugh To: bug-gnu-emacs@gnu.org Subject: buffer_local_value and find_symbol_value duplicate functionality Date: Fri, 07 May 2021 18:44:33 -0400 Message-ID: <87im3up3ji.fsf@catern.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=68.183.49.163; envelope-from=sbaugh@catern.com; helo=venus.catern.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) find_symbol_value is described as: Find the value of a symbol, returning Qunbound if it's not bound. buffer_local_value does the same, except that it allows one to specify a buffer. Yet they both implement symbol lookup, without sharing code. And given that the comment above find_symbol_value says "Great care is required for this.", I'm guessing that one or both of them may have bugs that the other does not. Especially because buffer_local_value is simpler than find_symbol_value, despite doing an ostensibly more complicated job... How about unifying them into a single function? Would a patch doing that be accepted? Alternatively, maybe I'm missing some detail about why they're different? From debbugs-submit-bounces@debbugs.gnu.org Sat May 08 03:10:29 2021 Received: (at 48281) by debbugs.gnu.org; 8 May 2021 07:10:29 +0000 Received: from localhost ([127.0.0.1]:48511 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lfH6a-0000w8-QO for submit@debbugs.gnu.org; Sat, 08 May 2021 03:10:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lfH6Y-0000w2-Jo for 48281@debbugs.gnu.org; Sat, 08 May 2021 03:10:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53684) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfH6S-0006JP-IM; Sat, 08 May 2021 03:10:20 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1283 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfH6S-0004mr-4M; Sat, 08 May 2021 03:10:20 -0400 Date: Sat, 08 May 2021 10:10:17 +0300 Message-Id: <83r1ihaeg6.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh , Stefan Monnier In-Reply-To: <87im3up3ji.fsf@catern.com> (message from Spencer Baugh on Fri, 07 May 2021 18:44:33 -0400) Subject: Re: bug#48281: buffer_local_value and find_symbol_value duplicate functionality References: <87im3up3ji.fsf@catern.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48281 Cc: 48281@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Spencer Baugh > Date: Fri, 07 May 2021 18:44:33 -0400 > > > find_symbol_value is described as: > > Find the value of a symbol, returning Qunbound if it's not bound. > > buffer_local_value does the same, except that it allows one to specify a > buffer. > > Yet they both implement symbol lookup, without sharing code. And given > that the comment above find_symbol_value says "Great care is required > for this.", I'm guessing that one or both of them may have bugs that the > other does not. Especially because buffer_local_value is simpler than > find_symbol_value, despite doing an ostensibly more complicated job... > > How about unifying them into a single function? Would a patch doing > that be accepted? > > Alternatively, maybe I'm missing some detail about why they're > different? First, such discussion is better conducted on emacs-devel, not here, as some of the relevant people don't read the bug list. Adding Stefan, who made extensive changes to both functions some 10 years ago. More to the point, I'm not sure I understand how you intend to reconcile the differences in these two functions. They are similar, but not identical. What is the plan for dealing with the differences? Given that we can safely conflate the two implementations, I don't see why we won't want to do that. (The "great care" bit refers to the need to block quitting, btw, not to the code as a whole.) From debbugs-submit-bounces@debbugs.gnu.org Sat May 08 09:26:42 2021 Received: (at 48281) by debbugs.gnu.org; 8 May 2021 13:26:42 +0000 Received: from localhost ([127.0.0.1]:50305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lfMyg-0001HC-72 for submit@debbugs.gnu.org; Sat, 08 May 2021 09:26:42 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:28830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lfMye-0001H3-Aw for 48281@debbugs.gnu.org; Sat, 08 May 2021 09:26:40 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id B492C100201; Sat, 8 May 2021 09:26:34 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 3F0D31001F4; Sat, 8 May 2021 09:26:33 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1620480393; bh=0yRzmz0WCMTAqs2dF9uEZ24W21qb+16/NgzrNlyg2To=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=S19ApY6eCV79fIwaxk5WhD2GwP7jd4+Blqx2GCc3AF25SrQazfKtT93bBKlT1HSOe oFr2umvc5ySrHuj4FRP3MGwRCh9i8egSiyR5Hif1Aax1Syr1bCwGrTdN0OR1okIRKq Ztrpy59CwP47zf0YX/RIMuvNXLhq5Wz1dhR03kpz3CYWyk+Mt1yRMDk8eBIBsCgSZc +/pv8HJWeSSNDoYiYSRr9Nmyj2VsuTq0NYpT6EX7KC4WoaSiOeHydi2/OEFlppWUGV QEewYa389pIqA/wzJ8nPsG9m1dopcSfU9gAw0hOzO5fC7DBvTGM5qZjA6n7eaVxLDE QxoXIdK2hxPww== Received: from alfajor (76-10-140-76.dsl.teksavvy.com [76.10.140.76]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D8796120624; Sat, 8 May 2021 09:26:32 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#48281: buffer_local_value and find_symbol_value duplicate functionality Message-ID: References: <87im3up3ji.fsf@catern.com> <83r1ihaeg6.fsf@gnu.org> Date: Sat, 08 May 2021 09:26:31 -0400 In-Reply-To: <83r1ihaeg6.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 08 May 2021 10:10:17 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.024 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48281 Cc: 48281@debbugs.gnu.org, Spencer Baugh X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> find_symbol_value is described as: [...] >> buffer_local_value does the same, except that it allows one to specify a >> buffer. [...] >> How about unifying them into a single function? Would a patch doing >> that be accepted? Depends on the patch ;-) >> Alternatively, maybe I'm missing some detail about why they're >> different? When I reworked that code I was annoyed by that difference but I had enough other things to deal with that I didn't bother trying to reconcile the two functions. The thing that is important to know about those two functions is that `find_symbol_value` is performance-critical, whereas `buffer_local_value` is not. So any effort to unify the two should focus on not slowing down `find_symbol_value`. The fact that here are two functions is acceptable to me, but indeed the two code paths are uncomfortably different, so I'd welcome changes (including minor changes) to make them more similar, tho maybe the best we can do is add comments explaining why the two code paths give the same result. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 02 09:23:16 2022 Received: (at 48281) by debbugs.gnu.org; 2 Jul 2022 13:23:16 +0000 Received: from localhost ([127.0.0.1]:40193 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7d5g-0006iu-IP for submit@debbugs.gnu.org; Sat, 02 Jul 2022 09:23:16 -0400 Received: from quimby.gnus.org ([95.216.78.240]:38866) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7d5b-0006iU-Ns for 48281@debbugs.gnu.org; Sat, 02 Jul 2022 09:23:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=maA/CpXM6Fr3J2muk8BixIwqldD7/S3Lkpj+uL1y52w=; b=FstPC+qTAgXkq3K4ARLk0EJMoQ m7jxyvtyWm+NK65G6wGi2VvIzyZBo1fN5sCg4NidM7GLf3lyA3hqUFgE6GgyfaGMDkG0GB7vVdhUz w0WXEcWNLKZcM+0UmuFugTT8NM5VWSg9dXyhGpjgjo8uqUauNo+nlTyg1ttngkXdETXc=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o7d5Q-0002a4-0o; Sat, 02 Jul 2022 15:23:02 +0200 From: Lars Ingebrigtsen To: Stefan Monnier Subject: Re: bug#48281: buffer_local_value and find_symbol_value duplicate functionality In-Reply-To: (Stefan Monnier's message of "Sat, 08 May 2021 09:26:31 -0400") References: <87im3up3ji.fsf@catern.com> <83r1ihaeg6.fsf@gnu.org> X-Now-Playing: The Clash's _Sandinista!_: "The Call Up" Date: Sat, 02 Jul 2022 15:22:59 +0200 Message-ID: <8735fj1wek.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Monnier writes: > So any effort to unify the two should focus on not slowing down > `find_symbol_value`. The fact that here are two functions is acceptable > to me, but indeed the two code paths are uncomfortably dif [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48281 Cc: 48281@debbugs.gnu.org, Spencer Baugh , Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: > So any effort to unify the two should focus on not slowing down > `find_symbol_value`. The fact that here are two functions is acceptable > to me, but indeed the two code paths are uncomfortably different, so I'd > welcome changes (including minor changes) to make them more similar, tho > maybe the best we can do is add comments explaining why the two code > paths give the same result. I think the conclusion here is that it's not worth the added complexity to merge these two functions, so I've now added a comment about this instead. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 02 09:23:17 2022 Received: (at control) by debbugs.gnu.org; 2 Jul 2022 13:23:17 +0000 Received: from localhost ([127.0.0.1]:40195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7d5g-0006iw-Qz for submit@debbugs.gnu.org; Sat, 02 Jul 2022 09:23:16 -0400 Received: from quimby.gnus.org ([95.216.78.240]:38880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7d5e-0006iY-8q for control@debbugs.gnu.org; Sat, 02 Jul 2022 09:23:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=qqa7ipj/Qdj38BtQmErfypp6j8WRJ1vBWr8F9pjmIAU=; b=GH23QvgZC1jWU7/ZZFhitproQV kNx3yC16s9RmvuuftVHg6gmaaGMBwX3o206x6gG6ELzKTzzWp/jmomd6Tu88Sj1wUTZgvuyPAS3oT 8ng3YdQAmHzSX+PP1YFtUbdY3TSaGo0dbj1M6ne5zaiTwYHd+JK1sWBhqsIEQKDh9lZU=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o7d5W-0002aC-9K for control@debbugs.gnu.org; Sat, 02 Jul 2022 15:23:08 +0200 Date: Sat, 02 Jul 2022 15:23:04 +0200 Message-Id: <871qv31wef.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #48281 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 48281 wontfix close 48281 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 48281 wontfix close 48281 quit From unknown Sun Jul 27 09:34:22 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 31 Jul 2022 11:24:11 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator