unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Elisp command calling (describe-function) interactively
@ 2022-10-23  4:44 Heime via Users list for the GNU Emacs text editor
  2022-10-23 17:02 ` Heime via Users list for the GNU Emacs text editor
  2022-10-24  0:35 ` Emanuel Berg
  0 siblings, 2 replies; 5+ messages in thread
From: Heime via Users list for the GNU Emacs text editor @ 2022-10-23  4:44 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

Is it possible to call inside an elisp function the interactive version of (describe-function)?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Elisp command calling (describe-function) interactively
  2022-10-23  4:44 Elisp command calling (describe-function) interactively Heime via Users list for the GNU Emacs text editor
@ 2022-10-23 17:02 ` Heime via Users list for the GNU Emacs text editor
  2022-10-24 13:24   ` Jean Louis
  2022-10-24  0:35 ` Emanuel Berg
  1 sibling, 1 reply; 5+ messages in thread
From: Heime via Users list for the GNU Emacs text editor @ 2022-10-23 17:02 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

Started with using completing-read for inputting the function name, but does not

look that the use of completing-read is appropriate, because completing-read only

accepts completion from a predefined list.

(defun ehelp (actm)
  "Describe emacs help commands."

  (interactive
   (list
    (let* ( (cseq '("variable" "function")) )
      (completing-read "Emacs_help: " cseq nil t "function"))))

  (pcase actm
    ("function"
        (describe-function (completing-read "function: " nil nil nil)))
    (_ (message "TODO"))) )

------- Original Message -------
On Sunday, October 23rd, 2022 at 4:44 AM, Heime <heimeborgia@protonmail.com> wrote:

> Is it possible to call inside an elisp function the interactive version of (describe-function)?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Elisp command calling (describe-function) interactively
  2022-10-23  4:44 Elisp command calling (describe-function) interactively Heime via Users list for the GNU Emacs text editor
  2022-10-23 17:02 ` Heime via Users list for the GNU Emacs text editor
@ 2022-10-24  0:35 ` Emanuel Berg
  1 sibling, 0 replies; 5+ messages in thread
From: Emanuel Berg @ 2022-10-24  0:35 UTC (permalink / raw)
  To: help-gnu-emacs

Heime via Users list for the GNU Emacs text editor wrote:

> Is it possible to call inside an elisp function the
> interactive version of (describe-function)?

`call-interactively' but often it's not a good thing to do ...

That whole division is trouble IMO, but it is what it is, so
what one can do is use is sensibly at least ...

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Elisp command calling (describe-function) interactively
@ 2022-10-24  1:29 Drew Adams
  0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2022-10-24  1:29 UTC (permalink / raw)
  To: Heime, 'Help-Gnu-Emacs (help-gnu-emacs@gnu.org)'

[-- Attachment #1: Type: text/plain, Size: 145 bytes --]

> Is it possible to call inside an elisp function the interactive version of
> (describe-function)?

https://emacs.stackexchange.com/q/74227

[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 12556 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Elisp command calling (describe-function) interactively
  2022-10-23 17:02 ` Heime via Users list for the GNU Emacs text editor
@ 2022-10-24 13:24   ` Jean Louis
  0 siblings, 0 replies; 5+ messages in thread
From: Jean Louis @ 2022-10-24 13:24 UTC (permalink / raw)
  To: Heime; +Cc: Heime via Users list for the GNU Emacs text editor

* Heime via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> [2022-10-24 09:38]:
> Started with using completing-read for inputting the function name, but does not
> 
> look that the use of completing-read is appropriate, because completing-read only
> 
> accepts completion from a predefined list.

(completing-read PROMPT COLLECTION &optional PREDICATE REQUIRE-MATCH
INITIAL-INPUT HIST DEF INHERIT-INPUT-METHOD)

Read a string in the minibuffer, with completion.
PROMPT is a string to prompt with; normally it ends in a colon and a space.
COLLECTION can be a list of strings, an alist, an obarray or a hash table.
COLLECTION can also be a function to do the completion itself.

Function need not be predefined, function may run with some
dynamically generated data.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-24 13:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-23  4:44 Elisp command calling (describe-function) interactively Heime via Users list for the GNU Emacs text editor
2022-10-23 17:02 ` Heime via Users list for the GNU Emacs text editor
2022-10-24 13:24   ` Jean Louis
2022-10-24  0:35 ` Emanuel Berg
  -- strict thread matches above, loose matches on Subject: below --
2022-10-24  1:29 Drew Adams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).