all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 48281@debbugs.gnu.org, Spencer Baugh <sbaugh@catern.com>
Subject: bug#48281: buffer_local_value and find_symbol_value duplicate functionality
Date: Sat, 08 May 2021 09:26:31 -0400	[thread overview]
Message-ID: <jwvzgx55pl7.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83r1ihaeg6.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 08 May 2021 10:10:17 +0300")

>> 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






  reply	other threads:[~2021-05-08 13:26 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
2021-05-08 13:26   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
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=jwvzgx55pl7.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=48281@debbugs.gnu.org \
    --cc=eliz@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.