From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Jakub Jankiewicz Newsgroups: gmane.emacs.help Subject: Re: Opening multiple files in a single buffer? Date: Sat, 13 Jun 2020 20:41:21 +0200 Message-ID: <20200613204121.44ed6dab@jcubic> References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/QEsn/Wj0VD_S7SbLOKc63=/"; protocol="application/pgp-signature"; micalg=pgp-sha256 Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="49088"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Gregory Heytings , help-gnu-emacs@gnu.org To: Dan Hitt Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 13 20:42:02 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 1jkB6P-000Ccn-OK for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Jun 2020 20:42:01 +0200 Original-Received: from localhost ([::1]:37288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jkB6O-0002UG-Nz for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Jun 2020 14:42:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jkB60-0002Sz-BS for help-gnu-emacs@gnu.org; Sat, 13 Jun 2020 14:41:36 -0400 Original-Received: from smtpo55.poczta.onet.pl ([213.180.142.186]:42389) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jkB5y-0005CC-A5 for help-gnu-emacs@gnu.org; Sat, 13 Jun 2020 14:41:36 -0400 Original-Received: from jcubic (unknown [185.129.113.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jcubic@onet.pl) by smtp.poczta.onet.pl (Onet) with ESMTPSA id 49kmdZ5RKvz1XQmBc; Sat, 13 Jun 2020 20:41:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=onet.pl; s=2011; t=1592073684; bh=ZV2sLRxqESt74+CSaYhs944ZX4I1Nn6SgEiZL1wKx7A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XsteiFYBhd9OWhIqJX10LlpxdyGVFPSe1+G1crWmmh42P8omCnPaZqbmmbJZNEIYN RrI+5U5EUT7dxkTDMY5nmUhjDH7wf5d9LhDjBuR4GtrnVR+A+VhTfxmeJyDoxQdEdg pbey9nmOvAWWSUi4wlFxnufeKGo9gPtfSUP3LTr8= In-Reply-To: X-Mailer: Claws Mail 3.17.3git196 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-ONET_PL-MDA-SEGREGATION: 0 Received-SPF: pass client-ip=213.180.142.186; envelope-from=jcubic@onet.pl; helo=smtpo55.poczta.onet.pl X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/13 14:41:29 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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:123379 Archived-At: --Sig_/QEsn/Wj0VD_S7SbLOKc63=/ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sat, 13 Jun 2020 11:10:00 -0700 Dan Hitt wrote: > On Sat, Jun 13, 2020 at 7:41 AM Gregory Heytings wrote: >=20 > > > > ..... > > > > For example, suppose you write a book, which has fifteen chapters in fi= les > > chap1.tex, ..., chap15.tex. Opening these files in a single buffer mea= ns > > that you could use isearch-{forward,backward} in the whole book. (I kn= ow > > 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. > > > > > > =20 > Another application would be to open all the code files in a directory in= to > 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 provisi= on > so that one file could appear more than once in the linear list of > sub-buffers (as could happen naturally with links). >=20 > I think your idea is a real winner. >=20 > 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 ki= nd > of buffer? It can be just multi-file-mode major mode where you open file/buffers as linked list and have functions that operate on that list like on one buffer. You should be able to add and remove file/buffers form that list. With this you will be able to write lisp function that open all the files and create a list. Then you will need to implement the display. I'm not elisp expert, but it look like something you can try to create. May= be start with POC to test if something like this is possible. -- Jakub Jankiewicz, Web Developer https://jcubic.pl/me --Sig_/QEsn/Wj0VD_S7SbLOKc63=/ Content-Type: application/pgp-signature Content-Description: Podpis cyfrowy OpenPGP -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEvGU/kjFLOYteHgvHpY7m8TH4MBMFAl7lHdEACgkQpY7m8TH4 MBOyAQf/RvgWZSvLuNTNxuzNvRjFyzkkMFcmCSlcZzXLud0BWsLOj5nwclLWCCqk FHMP723919vvSTlP5SApyczolan7I+f0DXg6baAcYl4Z8ZjJxTj5zBpC3cUu86v1 S2PB/gitOGxUzE2Uz80xnSfWLIXJx2/awnnyTbTfZarG6+upkvNAwKSQs4ITh9Jx B47vop1FXtIH5Gd8YrpdujkfmEjlqoQ3y3rqF1Sc7fccFG9pSX7F0Dl/NSKX6QCJ 3orTfEuUKojqhfqOVUU2fnD1quW+SiWo3l5HYvUX+TP1J9nfnP/UEanZdpW73f4K 4vMexXyzuBR9Vrf1K3S4rYpN1Vrm2g== =+vO6 -----END PGP SIGNATURE----- --Sig_/QEsn/Wj0VD_S7SbLOKc63=/--