From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: pillule Newsgroups: gmane.emacs.help Subject: Re: Visiting buffers programmatically Date: Fri, 11 Jun 2021 02:17:12 +0200 Message-ID: <87eed9ntaw.fsf@riseup.net> References: <5fc2e0a6-470e-0ebc-fe81-9eea2dd7fa5f@akwebsoft.com> <87k0n1nuvu.fsf@riseup.net> <2fbb0066-120a-6f06-b2d3-659846bcf923@akwebsoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27374"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Tim Johnson Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 11 02:23:49 2021 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 1lrUxh-0006x5-IM for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 11 Jun 2021 02:23:49 +0200 Original-Received: from localhost ([::1]:49326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrUxf-0006pm-SU for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 10 Jun 2021 20:23:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrUxD-0006pP-Mg for help-gnu-emacs@gnu.org; Thu, 10 Jun 2021 20:23:19 -0400 Original-Received: from mx1.riseup.net ([198.252.153.129]:46096) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrUxB-0001Ik-Ua for help-gnu-emacs@gnu.org; Thu, 10 Jun 2021 20:23:19 -0400 Original-Received: from fews1.riseup.net (fews1-pn.riseup.net [10.0.1.83]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4G1M503St3zDqBR; Thu, 10 Jun 2021 17:23:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1623370996; bh=36Cv0RjM5sh4NYCjSCu1n/hYh/+DgOgSsjsiJ6lX2HM=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=ZaJT7gZu/5qQTciSvCnDvHr2LhQFYASrKMKdPyBVYhH3oflEfBYXm4u05O5tVu5zV qrIzZ98x4XvURQaXP7mgbUeqqpKSKQ5qohSps219od+2KJzLgtXfeKOV/0gQytNrvY YVtUt3EeiwEbNBKQaZmKi7Kubt5iOFmqcyc2kp74= X-Riseup-User-ID: 8257DCA8C906883E9CDE52B05C4E432ADA7C2C979DF73EF034EB3573BAAF0FDA Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews1.riseup.net (Postfix) with ESMTPSA id 4G1M4z2vBbz5w5b; Thu, 10 Jun 2021 17:23:15 -0700 (PDT) In-reply-to: <2fbb0066-120a-6f06-b2d3-659846bcf923@akwebsoft.com> Received-SPF: pass client-ip=198.252.153.129; envelope-from=pillule@riseup.net; helo=mx1.riseup.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no 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:130736 Archived-At: Tim Johnson writes: > On 6/10/21 3:31 PM, pillule wrote: >> Tim Johnson writes: >> >>> GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cai= ro version 1.16.0) >>> =C2=A0of 2021-06-04 ubuntu 20.04 >>> >>> I would like to write three simple elisp routines that would each visit= one of: >>> *scratch*, *messages* and *shell* >>> >>> For *messages* I would only be reading or copying text. >>> For *scratch* and *shell* I would be modifying those buffers. >>> >>> which elisp function is best for each of >>> these buffers? >>> >>> Would it be switch-to-buffer, display-buffer, set-buffer or something e= lse.? >>> Thanks >> Do you need to see the window displaying the buffer ? > Yes. I would need to see the window that displays the buffer. > >> If not you can use 'set-buffer' or the macro 'with-current-buffer' that = call it. >> >> The others options are meant to display a buffer and not for batch proce= ssing. > If I grok you correctly, batch processing would mean that a whole list of= buffers > would be processed and displayed. No. what I call batch processing is exactly when you do not display things = and programmatically do all your tasks. > No, I would not need to do that. > > It sounds like switch-to-buffer would work fine? Yes. 'switch-to-buffer' should display the buffer in the selected window (e= xcept unordinary cases). --