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))
3
  • 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 1, 2022 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 1, 2022 at 18:42
  • Tho question is about how to pass a function name and a string as arguments to another function.
    – Dilna
    Jul 1, 2022 at 18:55

1 Answer 1

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.)

2
  • Shouldn't it be (concat (documentation a-function-name t)
    – Dilna
    Jul 1, 2022 at 20:11
  • 1
    Yes. I was just… uh… making sure that you were paying attention.
    – db48x
    Jul 1, 2022 at 20:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.