Search code examples
emacsdocstring

Modifying docstring slot of an existing Emacs Lisp function


For various reasons I've been forced to use Emacs git master for development. In this version I'm regularly getting lots of warnings in the form

No docstring slot for tags-lazy-completion-table
No docstring slot for etags--xref-backend
No docstring slot for gnus-intersection
No docstring slot for grep-compute-defaults
...

which often are so many that it slows down my interaction. Is it possible to set the docstring of a an already defined Emacs Lisp function without modifying its existing body definition?


Solution

  • Stefan has addressed your actual problem, but to answer the stated question:

    Is it possible to set the docstring of a an already defined Emacs Lisp function without modifying its existing body definition?

    Yes, you can, via the function-documentation symbol property.

    (put FUNCTIONSYMBOL 'function-documentation VALUE)
    

    In most cases VALUE would be a string.

    See:

    • C-hig (elisp)Documentation Basics
    • C-hig (elisp)Accessing Documentation