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

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

Re: `comment-start' is nil


From: lee
Subject: Re: `comment-start' is nil
Date: Sat, 15 Mar 2014 22:01:56 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Michael Heerdegen <michael_heerdegen@web.de> writes:

> lee <lee@yun.yagibdah.de> writes:
>
>>  This mode employs a function to search for a regex in particular
>> buffers.  The regex involves `comment-start'.
>
> If you want to rely on `comment-start', AFAIK you must wait until the
> major mode of the buffer has been initialized, because `comment-start'
> is set by the major mode.

Is is advisable to call `comment-normalize-vars' before using
`comment-start' as Thorsten suggests?  Maybe it`s not a good idea not to
wait until the major mode is up?

But then:


,----
| comment-start is a variable defined in `newcomment.el'.
| Its value is "> "
| Local in buffer *unsent wide reply to Michael Heerdegen on 
help-gnu-emacs@gnu.org*; global value is "# "
| 
|   This variable is safe as a file local variable if its value
|   satisfies the predicate `string-or-null-p'.
| 
| Documentation:
| String to insert to start a new comment, or nil if no comment syntax.
`----


Perhaps a major mode is supposed to set this variable (before trying to
use it)?

So far, I am assuming '# ' when it`s nil.  I`m now noticing that this
might not be the right thing to do because nil is used to indicate that
there is no comment syntax.

So what does one do?  Set it when it`s a major mode and otherwise rely
on that it is not nil --- or nil when there is no comment syntax ---
before it`s being used?

Arbitrary files seem to use the global default, though.  Under what
circumstances is there no comment syntax?


-- 
Knowledge is volatile and fluid.  Software is power.



reply via email to

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