Skip to content

Commit

Permalink
obsolete numpydoc-template-desc; use numpydoc-template-arg-desc.
Browse files Browse the repository at this point in the history
update news

version

README update
  • Loading branch information
douglasdavis committed May 23, 2021
1 parent 01c067e commit b8efad7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
9 changes: 8 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@ numpydoc.el NEWS -- history of user visible changes

* Unreleased

TBD

* 0.4 (May 23, 2021)

** Changes

TBD
*** Renamed numpydoc-template-desc to numpydoc-template-arg-desc
Marked the previous custom variable as obsolete. This change makes the
variable name consistent with the closely related variable
`numpydoc-template-type-desc`.

* 0.3.0 (May 10, 2021)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ See inside Emacs with <kbd>M-x customize-group RET numpydoc</kbd>
Template text that will be used as the long description if
<code>numpydoc-insertion-style</code> is <code>nil</code>.
</dd>
<dt>numpydoc-template-desc</dt>
<dt>numpydoc-template-arg-desc</dt>
<dd>
Template text that will be used for each function argument
description if <code>numpydoc-insertion-style</code> is
Expand Down
14 changes: 9 additions & 5 deletions numpydoc.el
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
;; Maintainer: Doug Davis <[email protected]>
;; URL: https://github.com/douglasdavis/numpydoc.el
;; SPDX-License-Identifier: GPL-3.0-or-later
;; Version: 0.3.0
;; Version: 0.4
;; Package-Requires: ((emacs "25.1") (s "1.12.0") (dash "2.18.0"))
;; Keywords: convenience

Expand Down Expand Up @@ -106,7 +106,11 @@ body has raise statements."
:group 'numpydoc
:type 'string)

(defcustom numpydoc-template-desc "FIXME: Add docs."
(define-obsolete-variable-alias
'numpydoc-template-desc 'numpydoc-template-arg-desc
"numpydoc 0.4")

(defcustom numpydoc-template-arg-desc "FIXME: Add docs."
"Template text for individual component descriptions.
This will be added for individual argument and return description
text, and below the Examples section."
Expand Down Expand Up @@ -385,7 +389,7 @@ This function assumes the cursor to be in the function body."
(defun numpydoc--insert-item-desc (indent element)
"Insert ELEMENT parameter description at level INDENT."
(let* ((tmpd (cond ((numpydoc--yas-p) numpydoc--yas-replace-pat)
(t numpydoc-template-desc)))
(t numpydoc-template-arg-desc)))
(desc (concat (make-string 4 ?\s)
(if (numpydoc--prompt-p)
(read-string (format "Description for %s: "
Expand All @@ -412,7 +416,7 @@ This function assumes the cursor to be in the function body."
(defun numpydoc--insert-return (indent fnret)
"Insert FNRET (return) description (if exists) at INDENT level."
(let ((tmpr (cond ((numpydoc--yas-p) numpydoc--yas-replace-pat)
(t numpydoc-template-desc))))
(t numpydoc-template-arg-desc))))
(when (and fnret (not (string= fnret "None")))
(insert "\n")
(numpydoc--insert indent
Expand Down Expand Up @@ -442,7 +446,7 @@ This function assumes the cursor to be in the function body."
(defun numpydoc--insert-examples (indent)
"Insert function examples block at INDENT level."
(let ((tmpd (cond ((numpydoc--yas-p) numpydoc--yas-replace-pat)
(t numpydoc-template-desc))))
(t numpydoc-template-arg-desc))))
(when numpydoc-insert-examples-block
(insert "\n")
(numpydoc--insert indent
Expand Down

0 comments on commit b8efad7

Please sign in to comment.