Questions tagged [doc-strings]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
33 views

Emacs 29 docstring single quote escaping rules, compiler level event?

I've seen the following warning from the Emacs 29 compiler: In s-format: s.el:614:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting) I haven't been ...
user avatar
  • 1,020
0 votes
0 answers
12 views

Non-filling of lines and paragraphs when using docstrings

I am having a problem with docstrings because everything is written as verbatim without paragraph or line filling. The following for instance puts Malicious and Functionalities on two separate lines. ...
user avatar
  • 359
0 votes
0 answers
18 views

put function-documentation fails inside own function

How is it that (put 'workbench 'function-documentation does not work inside (defun workbench? (setq workbench-usage "Usage Information.") (defun workbench (&optional prefix name mode) ...
user avatar
  • 359
0 votes
1 answer
33 views

Appending to function documentation

Can one append to a function documentation by calling some function or string in the documentation part? With the following I do not get anything from get. (defun myfunc "Brief description&...
user avatar
  • 359
2 votes
1 answer
25 views

Adding docstring outside function declaration

I have an emacs function with a long docstring. Could I make the docstring separate from the function, adding it before or after the function declaration? And is it possible to append to a docstring ...
user avatar
  • 359
4 votes
1 answer
85 views

What is \= in doc strings?

Bleeding edge Emacs is starting to complain about certain uses of ' in doc strings. I am trying to resolve these. As a typical example, in a doc string I might include an example: (defun my-mode-...
user avatar
2 votes
1 answer
20 views

Minor Mode / Description

I'm using a minor mode for my key bindings. But I want to set the documentation string dynamically. Instead of: (define-minor-mode mesys-mode "Text" ...) I want something like ...
user avatar
0 votes
1 answer
55 views

python-docstring-fill does not align properly

I am using python-docstring-fill (function of https://github.com/glyph/python-docstring-mode) to wrap Python docstrings. I observe that it does not align based the Python-way. It should be as: "&...
user avatar
  • 1,078
0 votes
1 answer
51 views

Docstring - quotes or semicolons?

In the documentation I only see mention of using semicolons for comments and docstrings, but in elisp-documents I regularly see functions documented in double-quotes, such as in org.el: (defun org-...
user avatar
  • 224
0 votes
0 answers
20 views

How can I ignore new-line docstring skeleton inserted for Python using sphinx-doc.el

I am using sphinx-doc.el to insert docstring skeleton for Python functions. It always inserts additional newline add the end of each docstring skeletion. Would it be possible to prevent it? When I ...
user avatar
  • 1,078
1 vote
2 answers
131 views

Evaluate docstring in macros

Macros like defun (or defmacro itself) have an optional docstring argument, but since they are macros and not functions, docstring isn't evaluated, but is taken as-is. I need the docstring to be ...
user avatar
  • 227
1 vote
0 answers
42 views

auto intendation on newline doesn't stay at same indentation for python docstring

Ubuntu 19.10 emacs 26.3 from system repos I do use elpy and evil-mode In general when I am editing python code, indentation works just fine. However, when I am editing doc-strings, when I type enter ...
user avatar
  • 345
2 votes
1 answer
114 views

(Company) Doc Buffer ignoring scroll-other-window

I'm trying to write my own backend for a certain tool language that has no repl. Hence, I thought it would be the best idea to parse the documentation and store it as a hash table (I'm open to other ...
user avatar
4 votes
2 answers
202 views

Disabling quote conversion in docstrings

(defun foo () "`bar'") The ASCII quotes in this docstring are displayed as typographical quotes by describe-function. Is it possible to have them displayed in their original form?
user avatar
  • 2,964
5 votes
2 answers
232 views

Change doc string summary of a function on the fly

Is it possible to change the first line of a docstring of a function, without editing the source code of this function? And if, how can I do this? Background: some packages come with a pretty useless ...
user avatar
  • 4,276
4 votes
1 answer
643 views

What is the logic behind the weird lisp docstring (left) indentation?

Why is the third line in this code indented "too much" to the left? It feels "off" to me. (defun hello-world nil "Greet the world. This function implements the canonical example program." (...
user avatar
1 vote
1 answer
165 views

\\{ in a doc string: what does it mean/do?

What does this backslash syntax mean? (defun elfeed-search-mode () "Major mode for listing elfeed feed entries. \\{elfeed-search-mode-map}" (interactive)
user avatar
2 votes
1 answer
1k views

`which-key` or similar, to show doc strings of commands bound to keys?

which-key package is very useful to show the list of command names. Could it (or any other package) also show the doc string of those commands?
user avatar
  • 969
1 vote
1 answer
192 views

How to evaluate a defun with square brackets in column 0 of its docstring?

I have problems running eval-defun for a defun when there is a square bracket [ in column 0 of its doc string. For example: (defun test () "Test function. [Some text]" (message "Hello")) When I ...
user avatar
4 votes
2 answers
96 views

How can I record where a function is defined if it's done indirectly?

I've got a few functions in api-wrap.el that I'll refer to as 'macro code', here simplified to clarify the question: function (generate-form prefix kind &rest args) returns an unevaluated form ...
user avatar
  • 6,691
5 votes
1 answer
675 views

display eldoc help info behind point

I have the following code to replace default eldoc display function: (defun my-eldoc-display-message-momentary (format-string &rest args) "Display eldoc message near point." (when format-...
user avatar
  • 1,788
0 votes
1 answer
387 views

How can I define the syntax of a C-defined function with with module_make_function?

I've tried #define DEFUN(lsym, csym, amin, amax, doc, data) \ bind_function (env, lsym, env->make_function(env, amin, amax, csym, doc, data)) DEFUN("libgit2-core-status", Flibgit2_status, 1, 1, ...
user avatar
  • 6,691
3 votes
2 answers
2k views

How can I disable indentation rules within docstrings in python-mode?

When writing within docstrings in python-mode, I'm only able to tab/indent deeper than the leading edge of the string. For example: def foo(): """ | | << the only places I can "tab" to. ...
user avatar
12 votes
2 answers
834 views

Is it possible to attach generated doc string to a lambda?

Emacs docs say that when doc string is put inside of lambda or defun it's “stored directly in the function object”. However, we can change docs of named functions like this: (put 'my-function-name '...
user avatar
  • 4,793
3 votes
1 answer
159 views

FORM vs BODY in documentation?

Recently I was trapped by void-variable error on eval-after-load. That is not first time I forget to quote args like: (eval-after-load 'sql '(progn ...)) because eval-after-load docs say: ...
user avatar
  • 3,150
4 votes
0 answers
114 views

"helm-documentation"? (search docstrings like apropos-documentation but with helm)

I just started using helm-apropos. It's great! Is there a helm equivalent for apropos-documentation or alternatively does helm-apropos have sources already available to narrow over docstrings?
user avatar
  • 6,894
11 votes
4 answers
9k views

Library for automatically inserting python docstring in Google style

I'm looking for an elisp package that automatically inserts Python docstring for a method. I found a package, which is very close to my purpose. But it's in reStructured text, not in Google style. ...
user avatar
  • 113
2 votes
0 answers
144 views

Optional docstring in defun

After taking a look at the definition of defun in byte-run.el, it seems that the macro does some very interesting things regarding checking for the existence of a docstring. First, it uses a declare ...
user avatar
3 votes
2 answers
109 views

How do I disambiguate mentions of a minor mode in a docstring?

The docstring of the following function doesn't make Emacs happy: (defun foo-all-the-bars () "Foo all the bars. Starts by fooing some bars by enabling `prettify-symbols-mode', then manually foos ...
user avatar
  • 3,724
1 vote
0 answers
75 views

Is there an existing function to add docstrings, relevant to the current major mode?

In emacs is there a function that I can invoke to add a docstring template based on the current major mode? eg: If I'm working on javascript, insert a javascript docstring template "here", like: /*...
user avatar
  • 245
13 votes
1 answer
1k views

How to retrieve docstrings from functions and variables?

I'm trying to write a function that will retrieve the docstrings from any sexps in a file that match (def.*). I'd want to both be able to retrieve any functions/macros, as well as any variables ...
user avatar
10 votes
3 answers
2k views

Is there a better way to handle multiline docstrings in elisp?

I hate the way that elisp (not sure if LISP in general) handles multiline docstrings. (defun foo () "This is a multi liner docstring" (do-stuff)) I sure do wish that I could do something like (...
user avatar