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: Jakub Jankiewicz
Subject: Re: Opening multiple files in a single buffer?
Date: Sat, 13 Jun 2020 17:49:58 +0200


On Sat, 13 Jun 2020 14:31:52 +0000
Gregory Heytings <ghe@sdf.org> wrote:

> Dear List,
> 
> I've now been using Emacs for many, many years, and there is perhaps a 
> single feature I'm really missing, namely opening more than one file in a 
> single buffer, with the contents of the files appearing one after the 
> other in the same buffer, with some kind of visual separator between them. 
> I don't know if that feature exists in other text editors.
> 
> 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.
> 
> My question is: Is this feasible, or is the one-to-one correspondence 
> between buffers and files too deeply rooted in Emacs' codebase that it is 
> not feasible?  If it is feasible, could this feature be considered for 
> implementation in a future Emacs version?

I think it's doable, it may require lot of work, to do this right though.
The only limitation I think is that you may have problems with multiple major
modes, but there is mode that do that polymode use different major modes in
same buffer and since you can create almost anything in Emacs (e.g. ERC,
dired mode or web browser) you probably can create something like this.

If you know ELips you can try writing something like this. Probably user will
use it to edit books if it would be easy to use.

--
Jakub Jankiewicz, Web Developer
https://jcubic.pl/me

Attachment: pgpsSqCbj96NC.pgp
Description: Podpis cyfrowy OpenPGP


reply via email to

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