|
6 | 6 | ;; Maintainer: Doug Davis <ddavis@ddavis.io>
|
7 | 7 | ;; URL: https://github.com/douglasdavis/numpydoc.el
|
8 | 8 | ;; SPDX-License-Identifier: GPL-3.0-or-later
|
9 |
| -;; Version: 0.8 |
| 9 | +;; Version: 0.9 |
10 | 10 | ;; Package-Requires: ((emacs "25.1") (s "1.12.0") (dash "2.18.0"))
|
11 | 11 | ;; Keywords: convenience
|
12 | 12 |
|
@@ -133,6 +133,13 @@ when generating a docstring."
|
133 | 133 | :group 'numpydoc
|
134 | 134 | :type '(repeat string))
|
135 | 135 |
|
| 136 | +(defcustom numpydoc-auto-fill-paragraphs t |
| 137 | + "Flag to control automatic paragraph filling. |
| 138 | +If set to t text that is inserted in a prompt will be automatically |
| 139 | +paragraph-filled." |
| 140 | + :group 'numpydoc |
| 141 | + :type 'boolean) |
| 142 | + |
136 | 143 | ;;; package implementation code.
|
137 | 144 |
|
138 | 145 | (cl-defstruct numpydoc--def
|
@@ -391,7 +398,8 @@ This function assumes the cursor to be in the function body."
|
391 | 398 | (unless (string-empty-p ld)
|
392 | 399 | (insert "\n")
|
393 | 400 | (numpydoc--insert indent ld)
|
394 |
| - (numpydoc--fill-last-insertion) |
| 401 | + (when numpydoc-auto-fill-paragraphs |
| 402 | + (numpydoc--fill-last-insertion)) |
395 | 403 | (insert "\n")))
|
396 | 404 | (insert "\n")
|
397 | 405 | (numpydoc--insert indent tmpl)
|
@@ -429,7 +437,8 @@ This function assumes the cursor to be in the function body."
|
429 | 437 | element))
|
430 | 438 | tmpd))))
|
431 | 439 | (numpydoc--insert indent desc)
|
432 |
| - (numpydoc--fill-last-insertion) |
| 440 | + (when numpydoc-auto-fill-paragraphs |
| 441 | + (numpydoc--fill-last-insertion)) |
433 | 442 | (insert "\n")))
|
434 | 443 |
|
435 | 444 | (defun numpydoc--insert-parameters (indent fnargs)
|
@@ -466,7 +475,8 @@ This function assumes the cursor to be in the function body."
|
466 | 475 | (if (numpydoc--prompt-p)
|
467 | 476 | (read-string "Description for return: ")
|
468 | 477 | tmpr)))
|
469 |
| - (numpydoc--fill-last-insertion) |
| 478 | + (when numpydoc-auto-fill-paragraphs |
| 479 | + (numpydoc--fill-last-insertion)) |
470 | 480 | (insert "\n"))))
|
471 | 481 |
|
472 | 482 | (defun numpydoc--insert-exceptions (indent fnexcepts)
|
|
0 commit comments