[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Imenu should avoid positions in comments/strings
From: |
Stefan Monnier |
Subject: |
Re: Imenu should avoid positions in comments/strings |
Date: |
28 Jul 2004 14:02:22 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
>> I think `imenu--generic-function' should use `syntax-ppss' to check
>> the position before adding to the index.
>>
>> It could be a good idea. I don't have time to work on it myself.
> It's probably at least as easy as fixing the doc strings, if someone
> wants to fix it. I don't have what I once did here, but I think it's
> basically a one-liner where a value is pushed onto `index-alist', i.e.
> (unless (save-match-data (syntax-ppss-context (syntax-ppss)))
> ...)
Except that this code might be executed long before the corresponding text
has been displayed, thus the syntax-table text-properties are not setup and
for several languages this implies that the result can be completely wrong.
Mabye it's not going to be an issue, but I'd rather not make such a change
now. Especially because this problem in imenu has existed for a very long
time and I see no indication that it got more severe over time.
Stefan