* dired command on marked files
@ 2008-06-16 19:13 Fabian Braennstroem
2008-06-16 21:04 ` Joel J. Adamson
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Fabian Braennstroem @ 2008-06-16 19:13 UTC (permalink / raw)
To: help-gnu-emacs
Hi,
I would like to use dired to create some plots using
xmgrace/gracebat. My idea is to mark some files and plot
them all into one diagram using something like:
gracebat <file1> <file2> ... <file n> -pexec 'subtitle "<title>"' -hardcopy -hdevice EPS -printfile "<name>"
Generally, I would use 'call-process' , but I have no clue, how I can create a call with variable number of files (depending on the marks).
In the end, emacs should ask for the 'title' and 'name'.
Does anyone have an idea or any suggestion, how I should do that?
Thanks!
Greetings!
Fabian
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: dired command on marked files
2008-06-16 19:13 dired command on marked files Fabian Braennstroem
@ 2008-06-16 21:04 ` Joel J. Adamson
[not found] ` <mailman.13422.1213650548.18990.help-gnu-emacs@gnu.org>
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Joel J. Adamson @ 2008-06-16 21:04 UTC (permalink / raw)
To: f.braennstroem; +Cc: help-gnu-emacs
Fabian Braennstroem <f.braennstroem@gmx.de> writes:
> Hi,
>
> I would like to use dired to create some plots using
> xmgrace/gracebat. My idea is to mark some files and plot
> them all into one diagram using something like:
>
> gracebat <file1> <file2> ... <file n> -pexec 'subtitle "<title>"' -hardcopy -hdevice EPS -printfile "<name>"
>
> Generally, I would use 'call-process' , but I have no clue, how I can create a call with variable number of files (depending on the marks).
> In the end, emacs should ask for the 'title' and 'name'.
Are you talking about a program, or interactively? Interactively, I
would use a shell for loop.
Joel
--
Joel J. Adamson
(303) 880-3109
Public key: http://pgp.mit.edu
http://www.unc.edu/~adamsonj
http://trashbird1240.blogspot.com
^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <mailman.13422.1213650548.18990.help-gnu-emacs@gnu.org>]
* Re: dired command on marked files
[not found] ` <mailman.13422.1213650548.18990.help-gnu-emacs@gnu.org>
@ 2008-06-18 19:08 ` Fabian Braennstroem
2008-06-18 21:10 ` Rupert Swarbrick
0 siblings, 1 reply; 7+ messages in thread
From: Fabian Braennstroem @ 2008-06-18 19:08 UTC (permalink / raw)
To: help-gnu-emacs
* Joel J. Adamson <adamsonj@email.unc.edu> wrote:
> Fabian Braennstroem <f.braennstroem@gmx.de> writes:
>
>> Hi,
>>
>> I would like to use dired to create some plots using
>> xmgrace/gracebat. My idea is to mark some files and plot
>> them all into one diagram using something like:
>>
>> gracebat <file1> <file2> ... <file n> -pexec 'subtitle "<title>"' -hardcopy -hdevice EPS -printfile "<name>"
>>
>> Generally, I would use 'call-process' , but I have no clue, how I can create a call with variable number of files (depending on the marks).
>> In the end, emacs should ask for the 'title' and 'name'.
>
> Are you talking about a program, or interactively? Interactively, I
> would use a shell for loop.
This first part of my problem was easier than I thought:
(defun grace()
"Create Plot using grace"
(interactive)
(call-process-shell-command (concat (dired-shell-stuff-it "xterm -e 'xmgrace " (dired-get-marked-files) nil) " '&"))
)
This would plot all marked files ... now I take a look at the <title> and <name>.
Greetings!
Fabian
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: dired command on marked files
2008-06-18 19:08 ` Fabian Braennstroem
@ 2008-06-18 21:10 ` Rupert Swarbrick
2008-06-20 19:54 ` Fabian Braennstroem
0 siblings, 1 reply; 7+ messages in thread
From: Rupert Swarbrick @ 2008-06-18 21:10 UTC (permalink / raw)
To: help-gnu-emacs
Fabian Braennstroem <f.braennstroem@gmx.de> writes:
> This first part of my problem was easier than I thought:
>
> (defun grace()
> "Create Plot using grace"
> (interactive)
> (call-process-shell-command (concat (dired-shell-stuff-it "xterm -e 'xmgrace " (dired-get-marked-files) nil) " '&"))
> )
>
This is of course irrelevant, but you might be interested to note that
one normally formats lisp code more like the following:
(defun grace ()
"Create Plot using grace"
(interactive)
(call-process-shell-command
(concat (dired-shell-stuff-it "xterm -e 'xmgrace "
(dired-get-marked-files) nil)
" '&")) )
(although the last line's a bit icky). In particular, when in
emacs-lisp-mode, you'll find that TAB indents the line to the "right
place".
Also note that the lambda list (which in the above is just "()")
doesn't have to be connected to the function/macro symbol ("grace") -
and the normal idiom is to put it as above. This is particularly
relevant if you've got a long lambda list:
(defun my-func
(has a very &optional long lambda list here indeed)
(+ 1 2))
(my-func 0 0 0)
=> 3
Hope this is of some interest,
Rupert
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: dired command on marked files
2008-06-18 21:10 ` Rupert Swarbrick
@ 2008-06-20 19:54 ` Fabian Braennstroem
0 siblings, 0 replies; 7+ messages in thread
From: Fabian Braennstroem @ 2008-06-20 19:54 UTC (permalink / raw)
To: help-gnu-emacs
Hi Rupert,
thanks.
* Rupert Swarbrick <rswarbrick@gmail.com> wrote:
> Fabian Braennstroem <f.braennstroem@gmx.de> writes:
>
>> This first part of my problem was easier than I thought:
>>
>> (defun grace()
>> "Create Plot using grace"
>> (interactive)
>> (call-process-shell-command (concat (dired-shell-stuff-it "xterm -e 'xmgrace " (dired-get-marked-files) nil) " '&"))
>> )
>>
>
> This is of course irrelevant, but you might be interested to note that
> one normally formats lisp code more like the following:
>
> (defun grace ()
> "Create Plot using grace"
> (interactive)
> (call-process-shell-command
> (concat (dired-shell-stuff-it "xterm -e 'xmgrace "
> (dired-get-marked-files) nil)
> " '&")) )
>
> (although the last line's a bit icky). In particular, when in
> emacs-lisp-mode, you'll find that TAB indents the line to the "right
> place".
>
> Also note that the lambda list (which in the above is just "()")
> doesn't have to be connected to the function/macro symbol ("grace") -
> and the normal idiom is to put it as above. This is particularly
> relevant if you've got a long lambda list:
>
> (defun my-func
> (has a very &optional long lambda list here indeed)
> (+ 1 2))
>
> (my-func 0 0 0)
> => 3
>
>
> Hope this is of some interest,
>
> Rupert
Greetings!
Fabian
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: dired command on marked files
2008-06-16 19:13 dired command on marked files Fabian Braennstroem
2008-06-16 21:04 ` Joel J. Adamson
[not found] ` <mailman.13422.1213650548.18990.help-gnu-emacs@gnu.org>
@ 2008-06-19 3:27 ` Kevin Rodgers
[not found] ` <mailman.13550.1213846072.18990.help-gnu-emacs@gnu.org>
3 siblings, 0 replies; 7+ messages in thread
From: Kevin Rodgers @ 2008-06-19 3:27 UTC (permalink / raw)
To: help-gnu-emacs
Fabian Braennstroem wrote:
> In the end, emacs should ask for the 'title' and 'name'.
(defun gracebat (title name)
(interactive "sTitle: \nsName: ")
...
)
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <mailman.13550.1213846072.18990.help-gnu-emacs@gnu.org>]
* Re: dired command on marked files
[not found] ` <mailman.13550.1213846072.18990.help-gnu-emacs@gnu.org>
@ 2008-06-20 19:56 ` Fabian Braennstroem
0 siblings, 0 replies; 7+ messages in thread
From: Fabian Braennstroem @ 2008-06-20 19:56 UTC (permalink / raw)
To: help-gnu-emacs
Hi Kevin,
* Kevin Rodgers <kevin.d.rodgers@gmail.com> wrote:
> Fabian Braennstroem wrote:
>> In the end, emacs should ask for the 'title' and 'name'.
>
> (defun gracebat (title name)
> (interactive "sTitle: \nsName: ")
> ...
> )
Thanks for the hint! I tried to incorporate it, but without
success. I think all those marks make a problem:
(defun grace( title1 name)
"Create Plot using grace"
(interactive "sTitle: \nsName: ")
(call-process-shell-command (concat (dired-shell-stuff-it "xmgrace " (dired-get-marked-files) nil) " -pexec 'title "" (title1) ""' &"))
)
Greetings!
Fabian
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-06-20 19:56 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-16 19:13 dired command on marked files Fabian Braennstroem
2008-06-16 21:04 ` Joel J. Adamson
[not found] ` <mailman.13422.1213650548.18990.help-gnu-emacs@gnu.org>
2008-06-18 19:08 ` Fabian Braennstroem
2008-06-18 21:10 ` Rupert Swarbrick
2008-06-20 19:54 ` Fabian Braennstroem
2008-06-19 3:27 ` Kevin Rodgers
[not found] ` <mailman.13550.1213846072.18990.help-gnu-emacs@gnu.org>
2008-06-20 19:56 ` Fabian Braennstroem
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.