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

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

Using comment characters for specific major modes


From: martin-kemp
Subject: Using comment characters for specific major modes
Date: Sun, 6 Jun 2021 01:47:29 +0200 (CEST)

Ok, let's try again.  I have a string "s" composed of repeating the character 
";" lena times.

At the front I want to prepend the major mode comment character twice, except 
for texinfo-mode.



Initially "s" is ";;;;;;;;" when lena is 8



Then I will insert in the buffer the following 



emacs-lisp-mode

;; ;;;;;;;;



f90-mode

!! ;;;;;;;;



fortran-mode

cc ;;;;;;;;



texinfo-mode

@c ;;;;;;;;



To remove the confusion, suppose the character for "s" is "*" of length lena



Then I want to print



emacs-lisp-mode

;; ********



f90-mode

!! ********



fortran-mode

cc ********



texinfo-mode

@c ********





From: Jean Louis <bugs@gnu.support>
To: martin-kemp@brusseler.com
Subject: Re: Using comment characters for specific major modes
Date: 06/06/2021 01:32:09 Europe/Paris
Cc: help-gnu-emacs@gnu.org

* martin-kemp@brusseler.com <martin-kemp@brusseler.com> [2021-06-06 02:21]:
> 
> That uses the command (comment-dwim ARG), but I got to get the comment 
> characters
> to append to the string "s".
> 
> 
> 
>   (setq-local s (concat ";; " (make-string lena ?\;)))
> 
> 
> 
> At least that was my plan.  You may know the proper way to do it
> though.

Describe it better, it is to me unclear what you need.


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/




reply via email to

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