Skip to content

Commit ddebe61

Browse files
committed
Improved some docstrings
1 parent 33f4a4d commit ddebe61

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

cabal-mode.el

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,7 @@ resulting buffer-content."
609609

610610

611611
(defmacro cabal-save-indentation (&rest funs)
612-
"Strip indentation from each line, execute FUNS and reinstate indentation
613-
so that the indentation of the FIRST LINE matches."
612+
"Strip indentation from each line, execute FUNS and reinstate indentation so that the indentation of the FIRST LINE matches."
614613
(let ((old-l1-indent (make-symbol "new-l1-indent"))
615614
(new-l1-indent (make-symbol "old-l1-indent")))
616615
`(let ( (,old-l1-indent (save-excursion
@@ -722,8 +721,10 @@ styles."
722721
(just-one-space))))))
723722

724723
(defmacro cabal-with-cs-list (&rest funs)
725-
"Format the buffer so that each line contains a list element.
726-
Respect the comma style."
724+
"Run FUNS with the current Cabal list temporarily reformatted.
725+
Each list element is placed on its own line while FUNS run. The
726+
original comma style (trailing or leading) is detected and restored
727+
afterwards."
727728
(let ((comma-style (make-symbol "comma-style")))
728729
`(let ((,comma-style
729730
(save-excursion
@@ -882,7 +883,8 @@ lexicographically, but ensures that the package \"base\" always comes first."
882883
(marked-line (goto-char marked-line)))))
883884

884885
(defmacro cabal-with-subsection-line (replace &rest forms)
885-
"Mark line, copy subsection data into a temporary buffer, save indentation
886+
"Apply FORMS on subsection at point.
887+
Mark line, copy subsection data into a temporary buffer, save indentation
886888
and execute FORMS at the marked line.
887889
888890
If REPLACE is non-nil the subsection data is replaced with the
@@ -1071,7 +1073,9 @@ Restart WRAP is t."
10711073
(nreverse results))))
10721074

10731075
(defun cabal-section-add-build-dependency (dependency &optional sort sec)
1074-
"Add a build DEPENDENCY to the build-depends section."
1076+
"Add a build DEPENDENCY to the build-depends key.
1077+
If SORT argument is given sort dependencies in section after update.
1078+
Adds said dependency to section SEC."
10751079
(let* ((section (or sec (cabal-section)))
10761080
(subsection (and section
10771081
(cabal-find-subsection section "build-depends"))))

0 commit comments

Comments
 (0)