unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alexander Asteroth <alexander.asteroth@h-brs.de>
To: Robert Pluim <rpluim@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: elisp code to list interactive functions
Date: Thu, 04 Nov 2021 11:49:19 +0100	[thread overview]
Message-ID: <87sfwcmc0g.fsf@condor.l7> (raw)
In-Reply-To: <878ry4mf0u.fsf@gmail.com>

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

Perfect, that did what I wanted more precisely:

-----------------------
(require 'help-fns)
(require 'seq)

(defun aa/show-interactive-commands ()
  (interactive)
  (seq-sort-by #'length #'<
	       (all-completions ""
				#'help--symbol-completion-table  
				(lambda (f)
				  (commandp f)))))
-----------------------

Returns a list (sorted by size) of available interactive commands. I can
now make them known to i3 to integrate them on demand. Great!

Thanks,

        Alex


On Do, Nov 04 2021, 10:44:17, Robert Pluim wrote:

>>>>>> On Thu, 04 Nov 2021 09:08:26 +0100, Alexander Asteroth <alexander.asteroth@h-brs.de> said:
>
>     Alexander> Dear all,
>     Alexander> I don't know if I'm right here but I don't find a group that is devoted
>     Alexander> to elisp programming. I'm trying to write a little funtion that I can
>     Alexander> call from emacsclient to get a list of interactive functions
>     Alexander> available. The result shoud be a list of strings or just one string,
>     Alexander> more or less what the *Completions* buffer displays when pressing
>     Alexander> M-x followed by <TAB>. I'm sure there must be a very simple solution to
>     Alexander> this but somehow I get lost in the code in simple.el on my search for
>     Alexander> it.
>
> You mean something like this?
>
> (all-completions ""
>                #'help--symbol-completion-table  
>                (lambda (f)
>                  (commandp f)))
>
> (that returns quite a few things)
>
> Robert


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 524 bytes --]

  reply	other threads:[~2021-11-04 10:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-04  8:08 elisp code to list interactive functions Alexander Asteroth
2021-11-04  9:43 ` Po Lu
2021-11-04  9:44 ` Robert Pluim
2021-11-04 10:49   ` Alexander Asteroth [this message]
2021-11-04 11:51   ` Philipp Stephani
2021-11-04 16:14     ` Alexander Asteroth
2021-11-04 17:07     ` Lars Ingebrigtsen
2021-11-04 17:32       ` Robert Pluim
2021-11-04 17:44       ` Andreas Schwab
2021-11-04 20:06       ` Stefan Monnier
2021-11-04 20:15         ` Lars Ingebrigtsen
2021-11-04 20:20           ` Stefan Monnier
2021-11-05  2:08             ` Lars Ingebrigtsen
2021-11-05  0:12           ` Po Lu
2021-11-04 19:34   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sfwcmc0g.fsf@condor.l7 \
    --to=alexander.asteroth@h-brs.de \
    --cc=emacs-devel@gnu.org \
    --cc=rpluim@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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