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

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

Re: Using comment characters for specific major modes


From: Jean Louis
Subject: Re: Using comment characters for specific major modes
Date: Sun, 6 Jun 2021 01:40:14 +0300
User-agent: Mutt/2.0.7+183 (3d24855) (2021-05-28)

* martin-kemp@brusseler.com <martin-kemp@brusseler.com> [2021-06-06 01:06]:
> I only want to change the first two, the rest remains the same
> 
> Suppose lena is 8


OK and how do you propose to change the function?

Instead:

(defun my-fancy-thing ()
  (interactive)
  (let* ((initial (completing-read "Comment: " '("1 ;;" "2 !!") nil t))
         (comment (substring initial 2))
         (lena 10)
         (string (make-string lena (string-to-char (substring initial 2)))))
    (insert (concat comment " " string))))

then:

(defun my-fancy-thing ()
  (interactive)
  (let* ((initial (completing-read "Comment: " '("1 ;;" "2 !!") nil t))
         (comment (substring initial 2))
         (lena 10)
         (string (make-string lena 59)))
    (insert (concat comment " " string))))

;; ;;;;;;;;;;

Adopt the function to your needs.



-- 
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]