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

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

Re: Opening multiple files in a single buffer?


From: Dan Hitt
Subject: Re: Opening multiple files in a single buffer?
Date: Sat, 13 Jun 2020 11:10:00 -0700

On Sat, Jun 13, 2020 at 7:41 AM Gregory Heytings <ghe@sdf.org> wrote:

>
> .....
>
> For example, suppose you write a book, which has fifteen chapters in files
> chap1.tex, ..., chap15.tex.  Opening these files in a single buffer means
> that you could use isearch-{forward,backward} in the whole book.  (I know
> that multi-isearch-buffers could be used in this particular case, but it
> is not as convenient to use.)  You could also use query-replace on the
> whole book, or reindent all files, or execute shell-command on all files
> at once, and so forth.  (Again I know that all this can be done with
> already existing features, e.g. through dired, but again I find them not
> as convenient as what I have in mind.)
>
> Each file would have its own major and minor modes, and the mode-line
> would adapt depending on the file corresponding to the buffer portion in
> which the point is currently located.
>
>
>
Another application would be to open all the code files in a directory into
a single buffer, and do replace-string or query-replace on all of them, to
rename variables, for example.  You'd want to be able to mark the
sub-buffers read-only or not independently, since (e.g.) not all of them
might be owned by the same account.  And you might want to make a provision
so that one file could appear more than once in the linear list of
sub-buffers (as could happen naturally with links).

I think your idea is a real winner.

I have no idea how hard it would be to implement, but could it be just a
matter of making a new kind of buffer, say a multi-file buffer, and then
just specifying the new behavior for all buffer functions for this new kind
of buffer?

dan


reply via email to

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