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

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

Re: Open files in a new frames from command line


From: Oliver Scholz
Subject: Re: Open files in a new frames from command line
Date: Sat, 31 Jan 2004 00:44:16 +0100
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux)

"Michael B. Schmidt" <MiBSchmidt@gmx.de> writes:

> Hello,
>
> I need to open multiple files to work with them. I use the command:
> "emacs foo bar baz". This open the file foo,bar and baz each in a new
> Buffer. Is there away (command line option,script) to open the files
> in frames instead of new Buffers? (I know that I can open one of the
> files and then open each file with c-x 5 f but this is to much work
> :-)))

There is no such command line option, but you could make your own
command line option, if you put something like this (only slightly
tested) into your .emacs:

(defun my-is-option-p (str)
  "Return non-nil if STR is an command line option."
  (string-match "^--?"
                str))

(defun my-command-line-make-new-frames ()
  "Process open each files in a new frame.
This function is supposed to be an element of
`command-line-functions' (q.v.). Its functionality is triggered
if ARGI is \"--as-frames\" and opens each element in
COMMAND-LINE-ARGS-LEFT not starting with a slash as a file in a
separate frame."
  (when (string= argi "--as-frames")
    (unless (my-is-option-p (car command-line-args-left))
      (find-file (pop command-line-args-left)))
    (while (and command-line-args-left
                (not (my-is-option-p
                      (car command-line-args-left))))
      (find-file-other-frame
       (pop command-line-args-left))
      t)))

(push 'my-command-line-make-new-frames
      command-line-functions)


Use as 

emacs --as-frames lirum.txt larum.txt

    Oliver
-- 
12 Pluviôse an 212 de la Révolution
Liberté, Egalité, Fraternité!


reply via email to

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