[gnu.emacs] how to set function documentation

fr07+@andrew.cmu.edu (Frank Ritter) (02/17/89)

To follow up my request on changing a function's documentation,

1) One can ftp the gnu-emacs lisp manual from a.cs.uiuc.edu in pub/gnuemacs/elisp
using anonymous protocol (user anonymous, password is your id).  It is
big, do it at night.  I was able to ftp it easily enough, but before I
printed it out, printed manuals turned up in our doc room here.  Someone from
UI/UC and BBN both posted this to me.  Thanks.

2) Based on the manual, there doesn't appear to be an easy way to
change a function's documentation.  (But there is an easy way to
change a variable's documentation.)  I have found that you do it by
munging the function itself:

(setcar 
  ;; get a pointer to the doc string
  (nthcdr 2 (symbol-function 'fubar))  
  ;; make new doc string
  (concat (documentation 'fubar) new-fubar-documentation-string))


This is useful, for example, if you are adding features to a mode and
want the new features to appear when describe-mode is called.

Frank