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

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

Re: Regexp with comment character of buffer


From: Yuri Khan
Subject: Re: Regexp with comment character of buffer
Date: Tue, 13 Aug 2024 00:11:59 +0700

On Mon, 12 Aug 2024 at 19:36, Heime <heimeborgia@protonmail.com> wrote:

> > > (let* ((comment-char (regexp-quote (string-trim comment-start)))
> > > (three-comment-chars (make-string 3 (string-to-char comment-char)))

> Is a string-trim required for comment-start ?

Required *for comment-start*? No. What does the docstring for
comment-start tell you?

    String to insert to start a new comment, or[…]

The space is there so that when the string is inserted, the user will
be able to start typing the comment text and it will be separated from
the delimiter.

    # comment in shell or Python
    ; comment in Elisp
    // comment in C++
    /* comment in C */
    <!-- comment in HTML -->


Required for *your use* of comment-start? Maybe.

Anyway, what’s your plan for modes whose comment-start is longer than
a single character after trimming the space?



reply via email to

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