GNU bug report logs - #55338
Symbols with position are sometimes not symbols

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Mon, 9 May 2022 17:26:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: 55338 <at> debbugs.gnu.org
Cc: Alan Mackenzie <acm <at> muc.de>
Subject: bug#55338: Symbols with position are sometimes not symbols
Date: Mon, 9 May 2022 10:25:42 -0700
[Message part 1 (text/plain, inline)]
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.
[0001-Always-enable-symbols-with-position.patch (text/x-patch, attachment)]

This bug report was last modified 3 years and 34 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.