Does SLIME have a hotkey for commenting a block of Lisp code in slime-mode?

I do not need to manually add semicolons to each line.

Specifications:

Aquamacs 2.1 (Emacs 23.2)

SLIME 2010-11-16

MacPorts CLISP 2.49

Mac OS X 10.6.4

MacBook Pro 5.1

+3
source share
2 answers

If the code block is a Lisp form, and you would like to comment on this form, you can use slime-insert-balanced-comments(I use M-x s-i-b-c, and SLIME automatically extends this command). To uncomment it, use slime-remove-balanced-comments( M-x s-r-b-c).

I found these commands very useful.

I also put the following file in the .emacs file:

;; Comment function
(defun comment-or-uncomment-this (&optional lines)
   (interactive "P")
   (if mark-active
      (if (< (mark) (point))
         (comment-or-uncomment-region (mark) (point))
         (comment-or-uncomment-region (point) (mark)))
      (comment-or-uncomment-region
         (line-beginning-position)
         (line-end-position lines))))

(global-set-key (kbd "C-;") 'comment-or-uncomment-this)

, .

UPD. , , , slime-insert/remove-balanced-comments paredit, C-; .

((blah|-blah)))))))

( | ), ) , , ( ). Paredit : s-exp, , s-exp. :

  ((blah-blah))
|)))))

C-;.

+4

Source: https://habr.com/ru/post/1775317/


All Articles