all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: lee <lee@yun.yagibdah.de>
To: help-gnu-emacs@gnu.org
Subject: Re: `comment-start' is nil
Date: Sat, 15 Mar 2014 22:01:56 +0100	[thread overview]
Message-ID: <87eh23uqez.fsf@yun.yagibdah.de> (raw)
In-Reply-To: <87ob1ay59r.fsf@web.de> (Michael Heerdegen's message of "Thu, 13 Mar 2014 07:36:00 +0100")

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	other threads:[~2014-03-15 21:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-12 21:37 `comment-start' is nil lee
2014-03-12 21:56 ` Juanma Barranquero
2014-03-15 20:50   ` lee
2014-03-12 22:26 ` Thorsten Jolitz
2014-03-13  6:36 ` Michael Heerdegen
2014-03-15 21:01   ` lee [this message]
2014-03-16 17:18     ` Stefan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eh23uqez.fsf@yun.yagibdah.de \
    --to=lee@yun.yagibdah.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.