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

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

Re: Iinteractive function allowing multiple inputs


From: Jean Louis
Subject: Re: Iinteractive function allowing multiple inputs
Date: Tue, 10 Dec 2024 10:12:12 +0300
User-agent: Mutt/2.2.12 (2023-09-09)

* Heime <heimeborgia@protonmail.com> [2024-12-10 02:48]:
> Consider the following.  The value of company-backends should
> be a list.   Would (list (mapcar #'intern backends-seltr))
> give a list to the function argument?

(defun cbackends (actm-seqr)
  "Set value for `company-backends' for `company-mode'.
Allowing multiple selectors using comma-separated."
  (interactive
    (let* ( (cseq '("company-dabbrev" "company-dabbrev-code" "company-keywords"
                    "company-capf" "company-yasnippet" "company-files"))

            (backends-seltr
                (completing-read-multiple
                  "Backends Multi-Seltr (comma-separated): "
                  cseq nil t)))

      (list (mapcar #'intern backends-seltr))))

    ;; Convert selected backends to symbols and set them
    (setq company-backends actm-seqr) )

Well done!

So far I see the above function works well and sets `company-backends'. But I 
do not use `company', so I do not know if it was set correctly.

-- 
Jean Louis



reply via email to

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