[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: shell-CLI for Emacs
From: |
Thien-Thi Nguyen |
Subject: |
Re: shell-CLI for Emacs |
Date: |
Sat, 24 Aug 2013 02:37:25 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
() 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
pgpqF0ul8Y4R2.pgp
Description: PGP signature