bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#55338: Symbols with position are sometimes not symbols


From: Paul Eggert
Subject: bug#55338: Symbols with position are sometimes not symbols
Date: Mon, 9 May 2022 10:25:42 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1

While looking into another issue I saw the code added a few months ago for symbols with position, and noticed what looked to me to be a bug: although (read-positioning-symbols "xyz") returns a symbol, (symbolp (read-positioning-symbols "xyz")) returns nil.

It seems that symbols with positions are symbols only if symbols-with-pos-enabled is t; otherwise, they are not symbols. Unfortunately this leads to confusing behavior such as the above.

As I understand it, the symbols-with-pos-enabled variable is present for performance reasons only. If this understanding is correct, I suggest removing the variable and having symbols with positions always be symbols. This would avoid the confusion. I think this could be done without hurting CPU performance compared to the master branch when symbols-with-pos-enabled is nil; see attached patch, which is relative to master commit 6fc54786c3bb797068675d7eb7b500fb990bd04a. (The patch is incomplete, as src/comp.c would need to be updated to match, but that's merely turning the crank.)

Even if this patch is completed I have qualms about performance and correctness of symbols with positions. How about a new build-time flag --disable-symbols-with-pos that would disable the feature, for people who don't want performance degraded compared to Emacs 28, or who are unsure of the correctness implications of the new feature? That should be easy to add, and I can look into adding it unless there's objection.

Also, there should be a NEWS item about symbols with positions.

Attachment: 0001-Always-enable-symbols-with-position.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]