[Top][All Lists]

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

Re: `comment-start' is nil

From: Thorsten Jolitz
Subject: Re: `comment-start' is nil
Date: Wed, 12 Mar 2014 23:26:43 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

lee <address@hidden> writes:

> Hi,
> I´m using desktop-mode to restore the previous session when starting
> emacs.  For some buffers that are restored this way, I´m using a mode
> I´m working on.  This mode employs a function to search for a regex in
> particular buffers.  The regex involves `comment-start'.
> Unfortunately, at the time the function is running during start-up, the
> value of `comment-start' is nil.
>     (let ((end-marker (concat "^" comment-start 
> lsl-hi-lock-patterns-end-marker)))
>         (message "comment-start with %s is %s"
>          (buffer-name)
>          comment-start) ...)
> gives me messages like "comment-start with test-plane.fontify is nil".
> Calling the same function later works fine because `comment-start' isn´t
> nil anymore.
> Is it supposed to be like this, or is it a bug that `comment-start' is
> nil?
> I could work around it by setting `comment-start' to "# ", or by
> omitting it, when it´s nil, but if it´s a bug, it should rather be
> fixed ...

maybe call

| comment-normalize-vars is a compiled Lisp function in `newcomment.el'.
| (comment-normalize-vars &optional NOERROR)
| Check and set up variables needed by other commenting functions.
| All the `comment-*' commands call this function to set up various
| variables, like `comment-start', to ensure that the commenting
| functions work correctly.  Lisp callers of any other `comment-*'
| function should first call this function explicitly.

before using comment-start?


reply via email to

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