all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: shell-CLI for Emacs
@ 2013-08-23 22:02 Barry OReilly
  0 siblings, 0 replies; 8+ messages in thread
From: Barry OReilly @ 2013-08-23 22:02 UTC (permalink / raw)
  To: help-gnu-emacs

> (defun string-to-cmd (str)
>   (interactive "s $> ")
>   (let*((cmd-and-args (split-string str " "))
>         (cmd  (car cmd-and-args))
>         (args (cdr cmd-and-args)))
>     (eval `(,(read cmd) ,@args) )))

Clearer than (eval `(,(read cmd) ,@args) ) is (apply (read cmd) args)


^ permalink raw reply	[flat|nested] 8+ messages in thread
* shell-CLI for Emacs
@ 2013-08-23 20:46 Emanuel Berg
  0 siblings, 0 replies; 8+ messages in thread
From: Emanuel Berg @ 2013-08-23 20:46 UTC (permalink / raw)
  To: help-gnu-emacs

I have done some experimentation on the "Emacs-shell-CLI" I've
been thinking about (as opposed to the current "M-x-CLI").

I would be very happy if you offered your comments on this idea
(and code).

To try out the below code:

1. Hit M-i to bring up the prompt string.
2. Type "man emacs".
3. Hit RET.

(defun string-to-cmd (str)
  (interactive "s $> ")
  (let*((cmd-and-args (split-string str " "))
        (cmd  (car cmd-and-args))
        (args (cdr cmd-and-args)))
    (eval `(,(read cmd) ,@args) )))
(define-key (current-global-map) (kbd "M-i") 'string-to-cmd)

-- 
Emanuel Berg - programmer (hire me! CV below)
computer projects: http://user.it.uu.se/~embe8573
internet activity: http://home.student.uu.se/embe8573


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

end of thread, other threads:[~2013-08-26  5:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
     [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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.