unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Thien-Thi Nguyen <ttn@gnu.org>
To: Emanuel Berg <embe8573@student.uu.se>
Cc: help-gnu-emacs@gnu.org
Subject: Re: shell-CLI for Emacs
Date: Sat, 24 Aug 2013 02:37:25 +0200	[thread overview]
Message-ID: <87zjs7diuy.fsf@zigzag.favinet> (raw)
In-Reply-To: <87zjs8kozg.fsf@nl106-137-194.student.uu.se> (Emanuel Berg's message of "Sat, 24 Aug 2013 00:42:50 +0200")

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

() Emanuel Berg <embe8573@student.uu.se>
() Sat, 24 Aug 2013 00:42:50 +0200

   But that's getting tedious if it has to be done for a lot of
   functions...

Maybe you can play w/ ‘call-interactively’ and ‘unread-command-events’.
Split the line as before but instead of ‘apply’ing the command to the
args, push the args (character by character, in reverse order) onto
‘unread-command-events’, preceding each arg (set) with ‘C-j’ (newline).
Here's a test command:

 (defun zow (string symbol number)
   (interactive "sString: \nSSymbol: \nnNumber: ")
   (message "got: %S" (list string symbol number)))

Invoked like:

 zow not quite 42

it should display:

 got: ("not" quite 42)

in the echo area.  Of course, this technique loses w/ certain (stealthy)
‘interactive’ specs, regions, stateful (history var) defaults, args that
include a space, etc, but it might be fun to try, anyway.  That's the
primary benefit of all DWIM hacking, after all, for both you and Emacs!

-- 
Thien-Thi Nguyen
   GPG key: 4C807502
   (if you're human and you know it)
      read my lisp: (responsep (questions 'technical)
                               (not (via 'mailing-list)))
                     => nil

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2013-08-24  0:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.664.1377295372.10748.help-gnu-emacs@gnu.org>
2013-08-23 22:42 ` shell-CLI for Emacs Emanuel Berg
2013-08-24  0:37   ` Thien-Thi Nguyen [this message]
     [not found]   ` <mailman.670.1377304488.10748.help-gnu-emacs@gnu.org>
2013-08-24  3:30     ` Emanuel Berg
2013-08-26  0:56     ` Emanuel Berg
2013-08-26  4:03       ` Yuri Khan
2013-08-26  5:38       ` Thien-Thi Nguyen
2013-08-23 22:02 Barry OReilly
  -- strict thread matches above, loose matches on Subject: below --
2013-08-23 20:46 Emanuel Berg

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=87zjs7diuy.fsf@zigzag.favinet \
    --to=ttn@gnu.org \
    --cc=embe8573@student.uu.se \
    --cc=help-gnu-emacs@gnu.org \
    /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).