emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/tuareg 402649aaf0 2/3: Indent lines under @-tags by 2 spac


From: ELPA Syncer
Subject: [nongnu] elpa/tuareg 402649aaf0 2/3: Indent lines under @-tags by 2 spaces
Date: Tue, 4 Jan 2022 15:58:25 -0500 (EST)

branch: elpa/tuareg
commit 402649aaf024bfd614d033da7a131f0c191c660c
Author: Mattias EngdegÄrd <mattiase@acm.org>
Commit: Mattias EngdegÄrd <mattiase@acm.org>

    Indent lines under @-tags by 2 spaces
    
    ... instead of the original (1 + length of @-tag) spaces.
---
 tuareg-tests.el |  6 +++---
 tuareg.el       | 13 ++++++-------
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/tuareg-tests.el b/tuareg-tests.el
index 4130a8d7db..429199fed7 100644
--- a/tuareg-tests.el
+++ b/tuareg-tests.el
@@ -718,7 +718,7 @@ the original code."
                          "      beta\n"
                          "  \n"
                          "      gamma\n")))
-  ;; Indent to text after @-tags in doc comments.
+  ;; Indent text after @-tags in doc comments by 2 more spaces.
   (should (equal (tuareg-test--do-at-line
                   (concat "  (** alpha\n"
                           "        @param beta\n"
@@ -726,7 +726,7 @@ the original code."
                   2 #'indent-for-tab-command)
                  (concat "  (** alpha\n"
                          "        @param beta\n"
-                         "               gamma\n")))
+                         "          gamma\n")))
   ;; An @-tag starts a new paragraph.
   (should (equal (tuareg-test--do-at-line
                   (concat "  (** alpha\n"
@@ -799,7 +799,7 @@ the original code."
                           "      beta\n"
                           "       @param gamma delta epsilon\n"
                           "       @param zeta eta\n"
-                          "              theta iota\n")))
+                          "         theta iota\n")))
   )
 
 
diff --git a/tuareg.el b/tuareg.el
index 673a2e998f..4810054038 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -2920,11 +2920,10 @@ This function moves the point."
                (goto-char par-start)
                (let ((col
                       (if (and in-doc-comment
-                               (looking-at (rx "@" (+ (in "a-z")) symbol-end)))
-                          (progn
-                            ;; Indent after @tag. Is this excessive?
-                            (goto-char (match-end 0))
-                            (1+ (current-column)))
+                               (looking-at-p
+                                (rx "@" (+ (in "a-z")) symbol-end)))
+                          ;; Indent two spaces under @tag.
+                          (+ 2 (current-column))
                         (current-column))))
                  (make-string col ?\s)))))
         (fill-region-as-paragraph par-start par-end)))))
@@ -3175,8 +3174,8 @@ file outside _build? "))
                     (skip-chars-forward " \t")
                     (when (and in-doc-comment
                                (not tag-starts-line)
-                               (looking-at (rx "@" (+ (in "a-z")) " ")))
-                      (goto-char (match-end 0))))
+                               (looking-at-p (rx "@" (+ (in "a-z")) " ")))
+                      (forward-char 2)))
                   (current-column))))
            (indent-line-to indent-col)
            t))))



reply via email to

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