From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#48281: buffer_local_value and find_symbol_value duplicate functionality Date: Sat, 08 May 2021 09:26:31 -0400 Message-ID: References: <87im3up3ji.fsf@catern.com> <83r1ihaeg6.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8158"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 48281@debbugs.gnu.org, Spencer Baugh To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 08 15:27:23 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 1lfMzK-00021p-Fk for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 May 2021 15:27:22 +0200 Original-Received: from localhost ([::1]:58916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfMzJ-00029j-Fo for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 May 2021 09:27:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfMz1-0001s6-NQ for bug-gnu-emacs@gnu.org; Sat, 08 May 2021 09:27:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38768) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lfMz1-0004UX-GM for bug-gnu-emacs@gnu.org; Sat, 08 May 2021 09:27:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lfMz1-0001I4-DA for bug-gnu-emacs@gnu.org; Sat, 08 May 2021 09:27:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 May 2021 13:27:03 +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.16204804024914 (code B ref 48281); Sat, 08 May 2021 13:27:03 +0000 Original-Received: (at 48281) by debbugs.gnu.org; 8 May 2021 13:26:42 +0000 Original-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 Original-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 Original-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) Original-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== Original-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) In-Reply-To: <83r1ihaeg6.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 08 May 2021 10:10:17 +0300") 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:206015 Archived-At: >> 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