Subject: bug#48281: buffer_local_value and find_symbol_value duplicate functionality

From: Stefan Monnier <[email-masked]>
Date: Sat, 08 May 2021 09:26:31 -0400

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