summaryrefslogtreecommitdiff
path: root/paredit.el
diff options
context:
space:
mode:
authorTaylor R Campbell <campbell+paredit@mumble.net>2019-11-21 23:28:41 +0000
committerTaylor R Campbell <campbell+paredit@mumble.net>2019-11-21 23:28:41 +0000
commit814999bb320e6d5aaa9c8ff663b1933157129571 (patch)
tree8180c5299aaf83305fad88df872b708a6922db39 /paredit.el
parentb1c332a24a258028fd388d4a0b71052807691a1c (diff)
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.
Diffstat (limited to 'paredit.el')
-rw-r--r--paredit.el15
1 files changed, 12 insertions, 3 deletions
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