Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [doc-strings]

The tag has no usage guidance.

2
votes
2answers
106 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?
3
votes
2answers
175 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 ...
4
votes
1answer
476 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." (...
1
vote
1answer
57 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)
2
votes
1answer
53 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?
1
vote
1answer
85 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 ...
5
votes
2answers
65 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 ...
4
votes
1answer
363 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-...
0
votes
1answer
307 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, ...
3
votes
2answers
686 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. ...
9
votes
2answers
616 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 '...
3
votes
1answer
70 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: ...
4
votes
0answers
62 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?
8
votes
3answers
5k 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. ...
2
votes
0answers
81 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 ...
3
votes
2answers
65 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 ...
1
vote
0answers
64 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: /*...
10
votes
1answer
763 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 ...
9
votes
3answers
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 (...