all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Spencer Baugh <sbaugh@catern.com>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 48281@debbugs.gnu.org
Subject: bug#48281: buffer_local_value and find_symbol_value duplicate functionality
Date: Sat, 08 May 2021 10:10:17 +0300	[thread overview]
Message-ID: <83r1ihaeg6.fsf@gnu.org> (raw)
In-Reply-To: <87im3up3ji.fsf@catern.com> (message from Spencer Baugh on Fri, 07 May 2021 18:44:33 -0400)

> From: Spencer Baugh <sbaugh@catern.com>
> 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.)





  reply	other threads:[~2021-05-08  7:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07 22:44 bug#48281: buffer_local_value and find_symbol_value duplicate functionality Spencer Baugh
2021-05-08  7:10 ` Eli Zaretskii [this message]
2021-05-08 13:26   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-02 13:22     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83r1ihaeg6.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=48281@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=sbaugh@catern.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.