From 814999bb320e6d5aaa9c8ff663b1933157129571 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Thu, 21 Nov 2019 23:28:41 +0000 Subject: New variables for comment prefixes. You can customize these according to mode if your Lisp has different style conventions from the Common Lisp and Scheme in my experience. --- paredit.el | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'paredit.el') diff --git a/paredit.el b/paredit.el index 477d616..fd9f038 100644 --- a/paredit.el +++ b/paredit.el @@ -1107,6 +1107,15 @@ If a list begins on the line after the point but ends on a different (defalias 'paredit-initialize-comment-dwim 'comment-normalize-vars) (comment-normalize-vars)) +(defvar paredit-comment-prefix-toplevel ";;; " + "String of prefix for top-level comments aligned at the left margin.") + +(defvar paredit-comment-prefix-code ";; " + "String of prefix for comments indented at the same depth as code.") + +(defvar paredit-comment-prefix-margin ";" + "String of prefix for comments on the same line as code in the margin.") + (defun paredit-comment-dwim (&optional argument) "Call the Lisp comment command you want (Do What I Mean). This is like `comment-dwim', but it is specialized for Lisp editing. @@ -1168,13 +1177,13 @@ This is expected to be called only in `paredit-comment-dwim'; do not (and indent (zerop indent)))) ;; Top-level comment (if code-after-p (save-excursion (newline))) - (insert ";;; ")) + (insert paredit-comment-prefix-toplevel)) ((or code-after-p (not code-before-p)) ;; Code comment (if code-before-p (newline-and-indent) (lisp-indent-line)) - (insert ";; ") + (insert paredit-comment-prefix-code) (if code-after-p (save-excursion (newline) @@ -1183,7 +1192,7 @@ This is expected to be called only in `paredit-comment-dwim'; do not (t ;; Margin comment (indent-to comment-column 1) ; 1 -> force one leading space - (insert ?\; ))))) + (insert paredit-comment-prefix-margin))))) ;;;; Character Deletion -- cgit v1.2.1