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: Heime
Subject: Re: Regexp with comment character of buffer
Date: Mon, 12 Aug 2024 11:41:43 +0000





Sent with Proton Mail secure email.

On Monday, August 12th, 2024 at 11:03 PM, Yuri Khan <yuri.v.khan@gmail.com> 
wrote:

> On Mon, 12 Aug 2024 at 17:09, Heime heimeborgia@protonmail.com wrote:
> 
> > How can I change the regexp so that instead of the beginning ;;;
> > I use the comment character of the current buffer, replicated three
> > times ?
> > 
> > (let ( (heading-regexp "^;;;\\s-+\\([HM][[:digit:]]\\)\\s-")
> 
> 
> You’re asking a homework question so here are hints that I would give
> someone who is struggling with homework.
> 
> Do you already know how to get the comment character of the current buffer?

Have done the following.  Do I really need all this or are there better ways ?

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





reply via email to

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