0

Could the following command be put in a function that takes a function name (workbench) and a variable (workbench-usage) containing the usage string.

(put 'workbench 'function-documentation
     (concat (documentation 'workbench t) workbench-usage))
Dilna
  • 1
  • 3
  • 11
  • The question isn't clear. (And there's no "following command".) You seem to be posting essentially the same question over and over, circling around what you really mean to say/ask. Please consider posting a single, clear question and deleting the quasi-duplicates. Thx. – Drew Jul 01 '22 at 16:13
  • Thought one needs to ask a different question for a different thing, rather than continuing in comments? Just using the same code. – Dilna Jul 01 '22 at 18:42
  • Tho question is about how to pass a function name and a string as arguments to another function. – Dilna Jul 01 '22 at 18:55

1 Answers1

0

Th[e] question is about how to pass a function name and a string as arguments to another function.

The same thing we do every night, Pinky:

(defun append-to-documentation (a-function-name some-extra-documentation)
  (put a-function-name 'function-documentation
       (concat (documentation a-function-name t)
               some-extra-documentation)))

Then you could call it like this:

(append-to-documentation 'workbench "some extra documentation to be appended")

Easy.

This is not a very good kind of question, because it doesn’t really help anyone else; you can always replace any subexpression with a variable. (Well, there are some tricky situations with quoting that commonly trip people up.)

db48x
  • 17,977
  • 1
  • 22
  • 28