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

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

Re: imenu fails in mode without comment-start-skip defined


From: Stefan Monnier
Subject: Re: imenu fails in mode without comment-start-skip defined
Date: Sat, 20 Nov 2004 21:50:07 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

> Is this enough to do the job?  I would think so; if no comment syntax
> is defined, it assumes the line is not in a comment.

> Perhaps comment-beginning should do this.  What do you think?

The general idea in newcomment.el is that if you want to use the functions,
you should first call comment-normalize-vars and you should only do that if
you indeed know there should be comment stuff.

So I think it's better to put the test for "should we check for comments" in
the imenu package rather than in comment-beginning.  Maybe newcomment.el
should provide a function "comment-syntax-defined-p" for imenu.el (and
other packages) to use.

> !             (if (setq cs (and comment-start-skip
> !                               (save-match-data (comment-beginning))))

But a mode might set comment-start only, and let comment-initialize-vars set
comment-start-skip for it.


        Stefan




reply via email to

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