From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#48281: buffer_local_value and find_symbol_value duplicate functionality Date: Sat, 08 May 2021 10:10:17 +0300 Message-ID: <83r1ihaeg6.fsf@gnu.org> References: <87im3up3ji.fsf@catern.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1494"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48281@debbugs.gnu.org To: Spencer Baugh , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 08 09:11:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lfH7G-0000D5-UI for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 May 2021 09:11:10 +0200 Original-Received: from localhost ([::1]:56268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfH7F-0003MV-4N for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 May 2021 03:11:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfH78-0003M7-Qh for bug-gnu-emacs@gnu.org; Sat, 08 May 2021 03:11:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36967) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lfH78-0006ky-Ik for bug-gnu-emacs@gnu.org; Sat, 08 May 2021 03:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lfH78-0000wN-Dy for bug-gnu-emacs@gnu.org; Sat, 08 May 2021 03:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 May 2021 07:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48281 X-GNU-PR-Package: emacs Original-Received: via spool by 48281-submit@debbugs.gnu.org id=B48281.16204578293608 (code B ref 48281); Sat, 08 May 2021 07:11:02 +0000 Original-Received: (at 48281) by debbugs.gnu.org; 8 May 2021 07:10:29 +0000 Original-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 Original-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 Original-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 Original-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 In-Reply-To: <87im3up3ji.fsf@catern.com> (message from Spencer Baugh on Fri, 07 May 2021 18:44:33 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:205987 Archived-At: > 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.)