help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dired command on marked files


From: Rupert Swarbrick
Subject: Re: dired command on marked files
Date: Wed, 18 Jun 2008 22:10:57 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]