unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Shane Celis <shane.celis@gmail.com>
Cc: Guile Mailing List <guile-user@gnu.org>
Subject: Re: Emacsy: Context Sensitive Commands Design Question
Date: Fri, 30 Aug 2013 13:32:02 +0200	[thread overview]
Message-ID: <871u5b2z4d.fsf@gnu.org> (raw)
In-Reply-To: <877gf43pgw.fsf@tines.lan> (Mark H. Weaver's message of "Thu, 29 Aug 2013 22:02:55 -0400")

Mark H Weaver <mhw@netris.org> skribis:

> Shane Celis <shane.celis@gmail.com> writes:
>
>> 6. Tag commands as special procedures perhaps by adding something to
>> their procedure properties.  Implement a "command?" procedure.  Export
>> commands and procedures to the same module. Then just pluck the
>> commands out of all the procedures by using command?.
>
> This is closest to what Emacs does, and probably the best solution, IMO.  See
> <https://www.gnu.org/software/emacs/manual/html_node/elisp/Interactive-Call.html>
> which describes the 'commandp' predicate, whose definition is in eval.c.

I concur (Thien-Thi’s message shows how this can be achieved.)

So it’s a matter of extending Emacsy’s ‘define-interactive’ to add an
object property.

Then you could have a ‘fold-commands’ procedure that traverses all the
bindings of all the available modules (or a subset thereof), and
iterates on those that match ‘command?’.

Ludo’.



  reply	other threads:[~2013-08-30 11:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-29 20:57 Emacsy: Context Sensitive Commands Design Question Shane Celis
2013-08-30  0:26 ` Noah Lavine
2013-08-30  2:02 ` Mark H Weaver
2013-08-30 11:32   ` Ludovic Courtès [this message]
2013-08-30  7:32 ` Thien-Thi Nguyen

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/guile/

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

  git send-email \
    --in-reply-to=871u5b2z4d.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-user@gnu.org \
    --cc=shane.celis@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.
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).