From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dan Hitt Newsgroups: gmane.emacs.help Subject: Re: Opening multiple files in a single buffer? Date: Sat, 13 Jun 2020 11:10:00 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="51422"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Gregory Heytings Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 13 20:10:47 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 1jkAcB-000DHw-EZ for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Jun 2020 20:10:47 +0200 Original-Received: from localhost ([::1]:45720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jkAcA-0005vl-Gy for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Jun 2020 14:10:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jkAbl-0005vd-Tr for help-gnu-emacs@gnu.org; Sat, 13 Jun 2020 14:10:22 -0400 Original-Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:38596) by eggs.gnu.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jkAbj-00087J-4u for help-gnu-emacs@gnu.org; Sat, 13 Jun 2020 14:10:21 -0400 Original-Received: by mail-wm1-x336.google.com with SMTP id f185so10866533wmf.3 for ; Sat, 13 Jun 2020 11:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xsjDMqsQPjlaj1SJ6LMNrv382b8TO7fg05Jax+/+4wg=; b=PBYJ6rzJ+AlM3J6ouG/pueqBU51Cb34K5cTn/hdYgtZf3ttawg1n9ZJVQpVoAAGVsD iLkW/r2Rw3y3LFQRzfxFxapjr3tXwJMum/Tz26cBm8Y1f/Z9RT5e8jtX5Htw9LvKcu6q Q3wq2TH6pPcP6rKcXIzwESB2TnywdISGhcFJrn/N/QFApeukcOF3vA2FSIEVEC/X/d2R iBFjdxqlghAaGc172uPPP3NK3pO5uG/nPkntRRm8StloVoMqyS1cynVjF0KrhcqjgWPt yBz9laSCqtnolkAdPg8DpCm6rCXYDJWSwvDbMZotbF8lPFopUTl2XVMsrQmwobCV2puv sCew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xsjDMqsQPjlaj1SJ6LMNrv382b8TO7fg05Jax+/+4wg=; b=eKT2SKfHfv8SxzJbp0aeV2SUM2xC6y5m1bEnZkpQX0xX6lHNhwfE7fCzOba0PKZgzS Hrhs+zt8fb6X8zOGnTPDpOD+V3cd55cMOH82JraCnmCGtLcgXkMCFQEhByE7w2/z2/Z8 YTnQX9g3Nqcog1kJOsOD6I4PkL6+y8Ug3femTlp41P+EXb8mYj3rvEx3RJyI1sLt7qQv 76YQyAJH+j29VaUTl0TaGLiq3Trnu3S1+HNKfGeDNm/zq8nr220oUNtAOE0xBwyWhfu9 e8vCsoqbmlTuml3cXU9OvqM2j7n9Q8JFAQpWTwI97E+6Vn2+iorEPMwUCZAdx8bQX4Cg pCaQ== X-Gm-Message-State: AOAM530CtTLb/Pq070zwWWJaTK6+fjcz8WgVuG0MA+TVAVjH9TE3Ryax Y3XCrYTCVRk6N5FbYlJsbWMcYdc+G/ZThjNGiAA= X-Google-Smtp-Source: ABdhPJwZCqksBKGnwadcnB7amwnKOcvw3KdLu5Faq1m7UMNeVc1yzK19n1FgKGaD94z2ClNqY3svSze2q1Piw7AM43Y= X-Received: by 2002:a1c:a905:: with SMTP id s5mr4728981wme.120.1592071812062; Sat, 13 Jun 2020 11:10:12 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=dan.hitt@gmail.com; helo=mail-wm1-x336.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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, HTML_MESSAGE=0.001, 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:123377 Archived-At: On Sat, Jun 13, 2020 at 7:41 AM Gregory Heytings 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