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

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

[solved] Re: To switch state of line not working


From: Jean Louis
Subject: [solved] Re: To switch state of line not working
Date: Tue, 15 Jun 2021 04:30:57 +0300
User-agent: Mutt/2.0.7+183 (3d24855) (2021-05-28)

Now it works... (づ。◕‿‿◕。)づ

(defun rcd-check ()
  (interactive)
  (let* ((start (line-beginning-position))
         (end (line-end-position))
         (line (buffer-substring start end))
         (check-in "[ ]")
         (check-out "[✔]")
         (check-in (list (regexp-quote check-in) check-in))
         (check-in-there (string-match (car check-in) line))
         (check-out (list (regexp-quote check-out) check-out))
         (check-out-there (string-match (cadr check-out) line)))
    (cond ((not (null check-in-there)) (replace-regexp (car check-in) (cadr 
check-out) nil start end))
          ((not (null check-out-there)) (replace-regexp (car check-out) (cadr 
check-in) nil start end))
          (t (message-box "Oh no! Could not replace without check box!" 
check-out)))))

 [ ] something

-- 
Jean

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

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

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