help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

User specified instructions for appending additional details to function


From: Heime
Subject: User specified instructions for appending additional details to function documentation
Date: Tue, 10 Dec 2024 19:07:05 +0000

I have the function company-launch to which I add the documentation via
keyword :documentation, appending the value of company-launch-qtr-doc.

I want to have a user defined switch for the user to decide whether he wants 
the further details provided by company-launch-qtr-doc or not.

What can be done about this?


(defvar company-launch-qtr-doc
  "Usage:

  This function is designed to accept its argument, ACTM-SEQR,
either as a single symbol or as a list of symbols.

   (company-launch 'go)
   (company-launch '(go))
   (company-launch '(nogo go))

But it explicitly avoids supporting multiple symbols passed in a
flat series.

For instance, the following would not work:

   (company-launch 'nogo 'go)

If multiple symbols are passed, they are interpreted as separate
arguments, which violates the function's signature (ACTM-SEQR)
and results in an error."

  "Usage of `company-launch'.")



(defun company-launch (actm-seqr)

  ;; =============================================================

  (:documentation
     (concat

       "Launch company-mode globally.

ACTM-SEQR  Action message sequencer.

 CASE 'go    Enable `company-mode' globally by calling
             `global-company-mode'.

      'nogo  Do not enable `company-mode'."

       company-launch-qtr-doc))

  ;; =============================================================

  (add-hook 'after-init-hook 'global-company-mode)
  (message "Something something."))






reply via email to

[Prev in Thread] Current Thread [Next in Thread]