From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.help Subject: Re: Opening multiple files in a single buffer? Date: Sat, 13 Jun 2020 16:53:48 +0000 Message-ID: References: <680ce1a6-6a1d-9212-9e4a-08cd443e9ef5@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="2968"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Alpine 2.21 (NEB 202 2017-01-01) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 13 18:54:21 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jk9QC-0000ey-W6 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Jun 2020 18:54:20 +0200 Original-Received: from localhost ([::1]:41208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jk9QB-0004dg-Us for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Jun 2020 12:54:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jk9Pr-0004dI-SK for help-gnu-emacs@gnu.org; Sat, 13 Jun 2020 12:54:00 -0400 Original-Received: from mx.sdf.org ([205.166.94.20]:55484) by eggs.gnu.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jk9Pp-0003LZ-DV for help-gnu-emacs@gnu.org; Sat, 13 Jun 2020 12:53:59 -0400 Original-Received: from sdf.org (IDENT:ghe@faeroes.freeshell.org [205.166.94.9]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 05DGrpFx027990 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for ; Sat, 13 Jun 2020 16:53:51 GMT Original-Received: (from ghe@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 05DGrpmc024126; Sat, 13 Jun 2020 16:53:51 GMT In-Reply-To: <680ce1a6-6a1d-9212-9e4a-08cd443e9ef5@gmail.com> Content-ID: Received-SPF: pass client-ip=205.166.94.20; envelope-from=ghe@sdf.org; helo=mx.sdf.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/13 12:53:51 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:123376 Archived-At: Douglas Lewan: > >> I've now been using Emacs for many, many years, and there is perhaps a= =20 >> single feature I'm really missing, namely opening more than one file in= =20 >> a single buffer, with the contents of the files appearing one after the= =20 >> other in the same buffer, with some kind of visual separator between=20 >> them. I don't know if that feature exists in other text editors. >>=20 >> For example, suppose you write a book, which has fifteen chapters in=20 >> files chap1.tex, ..., chap15.tex.=A0 Opening these files in a single=20 >> buffer means that you could use isearch-{forward,backward} in the whole= =20 >> book.=A0 (I know that multi-isearch-buffers could be used in this=20 >> particular case, but it is not as convenient to use.)=A0 You could also= =20 >> use query-replace on the whole book, or reindent all files, or execute= =20 >> shell-command on all files at once, and so forth.=A0 (Again I know that= =20 >> all this can be done with already existing features, e.g. through=20 >> dired, but again I find them not as convenient as what I have in mind.) >>=20 >> Each file would have its own major and minor modes, and the mode-line=20 >> would adapt depending on the file corresponding to the buffer portion=20 >> in which the point is currently located. >>=20 >> My question is: Is this feasible, or is the one-to-one correspondence=20 >> between buffers and files too deeply rooted in Emacs' codebase that it= =20 >> is not feasible?=A0 If it is feasible, could this feature be considered= =20 >> for implementation in a future Emacs version? > > I would say it's feasible, but probably awkward as stated. An=20 > application that implements something similar via a sequence of buffers= =20 > with a way of navigating next and previous and providing appropriate=20 > commands via a (map) function would probably be simpler to build and=20 > manage. It would also be much more natural. > In fact, what I have in mind is not an additional application, but a core= =20 feature, that would be transparent (or almost transparent) to everything=20 else. It would not require a rewrite of any command. For example it=20 would also be possible to narrow the (multi-file) buffer to the last X=20 lines of a file and the first Y lines of the next file in the buffer. Gregory