Subject: Re: bug#14655: 24.3; (looking-at comment-start-skip) in newcomment.el

From: Thorsten Jolitz <[email-masked]>
Date: Tue, 18 Jun 2013 20:37:34 +0200

Drew Adams <[email-masked]> writes:

>> From the commentary of newcomment.el:
>> 
>> ;; Prior to calling any `comment-*' function, you should ensure that
>> ;; `comment-normalize-vars' is first called to set up the appropriate
>> ;; variables; except for the `comment-*' commands, which call
>> ;; `comment-normalize-vars' automatically as a subroutine.
>
> Yes.  I'm not sure what the "solution" is, but this seems to be a
> common gotcha.  Yes, someone coding with functions from the library
> should presumably read the file Commentary.  Still, we can perhaps do
> better, to try to get this info across.
>
> Mentioning it in doc string might help.  But perhaps there is a better
> idea.

I find it a bit strange that the library itself does not check the
variables before acting on them. Would something like this be too much
effort or too costly?

,-----------------------------------
| (if comment-start-skip
|    (looking-at comment-start-skip)
|   (comment-normalize-vars)
|   (looking-at comment-start-skip))
`-----------------------------------

Why pass the burden to the users, that then frequently pass it back to
the maintainers because they did not read the docstring. 

-- 
cheers,
Thorsten