144
144
145
145
146
146
(defun python-insert-docstring--get-arguments-names-from-string (arguments-string )
147
- " Parse the argument names contained in ARGUMENTS-STRING and return them in a list."
147
+ " Parse the argument names and return them in a list.
148
+ Argument ARGUMENTS-STRING string containing the arguments."
148
149
(if (string-equal " " arguments-string)
149
150
nil
150
151
(let ((arguments (mapcar (lambda (string )
@@ -194,13 +195,15 @@ The user is asked for the description of each argument."
194
195
195
196
196
197
(defun python-insert-docstring--get-short-description-from-user (function-name )
197
- " Ask the user for the short description of the function with name FUNCTION-NAME."
198
+ " Ask the user for the short description of the function.
199
+ Argument FUNCTION-NAME name of the function."
198
200
(read-string (format " Enter the short description for the function '%s ': "
199
201
function-name)))
200
202
201
203
202
204
(defun python-insert-docstring--get-long-description-from-user (function-name )
203
- " Ask the user for the long description of the function with name FUNCTION-NAME."
205
+ " Ask the user for the long description of the function.
206
+ Argument FUNCTION-NAME name of the function."
204
207
(let ((description (read-string (format " Enter the long description for the function '%s ' (leave empty to omit it): "
205
208
function-name))))
206
209
(if (string-equal description " " )
@@ -271,7 +274,9 @@ If a string is empty, PREFIX doesn't get prepended."
271
274
272
275
273
276
(defun python-insert-docstring--google-docstring-arguments (arguments docstring-indentation )
274
- " Return the docstring lines about the ARGUMENTS with the given DOCSTRING-INDENTATION."
277
+ " Return the Args docstring lines.
278
+ Argument ARGUMENTS list of arguments.
279
+ Argument DOCSTRING-INDENTATION indentation string."
275
280
(let ((argument-indentation (concat docstring-indentation python-insert-docstring-default-indentation)))
276
281
(nconc (if arguments
277
282
(nconc (list " " )
@@ -295,7 +300,9 @@ Argument ARGUMENTS-DOCSTRING-INDENTATION intentation of the argument paragraph."
295
300
296
301
297
302
(defun python-insert-docstring--google-docstring-arguments-list (arguments arguments-docstring-indentation )
298
- " Return the docstring lines about the ARGUMENTS list with the given ARGUMENTS-DOCSTRING-INDENTATION."
303
+ " Return the lines where every argument is described.
304
+ Argument ARGUMENTS list of arguments.
305
+ Argument ARGUMENTS-DOCSTRING-INDENTATION indentation for the arguments lines."
299
306
(cl-reduce #'nconc
300
307
(mapcar (lambda (argument )
301
308
(python-insert-docstring--google-docstring-argument-description
@@ -343,7 +350,7 @@ Optional argument COLUMN-WIDTH maximum lenght of a line."
343
350
(defun python-insert-docstring--indentation-length (indentation-string &optional num-tab-chars )
344
351
" Compute the number of character in INDENTATION-STRING.
345
352
Tabs count according to their width.
346
- Optional argument NUM-TAB-CHARS number of spaces in a tabulation (default: `tab-width' )."
353
+ Optional argument NUM-TAB-CHARS spaces in a tabulation (default: `tab-width' )."
347
354
(cl-reduce #'+
348
355
(mapcar (lambda (char )
349
356
(if (char-equal char ?\t )
0 commit comments