[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to open a list of files?
From: |
Thierry Volpiatto |
Subject: |
Re: how to open a list of files? |
Date: |
Mon, 05 Jan 2009 17:10:46 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
Hi,
thth <thomas.hartmann@uni-rostock.de> writes:
> Hi,
>
> I have a file containing pathes to several other files I want to open
> (actually it is just the buffer list of a previous session saved in a file).
> Opening each file by hand from this list is a bit laborious. So I wonder if
> there is a way to open all files contained in a list automatically in emacs?
May be you can use desktop mode to save your session and restore all
your buffers.
But if you want to do that alone with a list of file name in a file, you
can do something like this:
,----
| ELISP> (defun open-all-my-files ()
| (save-excursion
| (find-file "file-containing-file-names")
| (goto-char (point-min))
| (while (not (eobp))
| (save-excursion
| (find-file (buffer-substring (point-at-bol)
| (point-at-eol)))
| (display-buffer (current-buffer)))
| (forward-line))
| (kill-buffer (current-buffer))))
`----
with a "file-containing-file-names" like:
,----
| /home/you/foo
| /home/you/bar
| /home/you/somefile
`----
--
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France