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 01:31:57 +0200 Message-ID: <87k0n1nuvu.fsf@riseup.net> References: <5fc2e0a6-470e-0ebc-fe81-9eea2dd7fa5f@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="30137"; 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 01:49:39 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 1lrUQc-0007eF-BO for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 11 Jun 2021 01:49:38 +0200 Original-Received: from localhost ([::1]:40172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrUQb-0007Vd-6x for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 10 Jun 2021 19:49:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrUQ8-0007TK-31 for help-gnu-emacs@gnu.org; Thu, 10 Jun 2021 19:49:08 -0400 Original-Received: from mx1.riseup.net ([198.252.153.129]:59714) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrUQ4-0003tO-Rc for help-gnu-emacs@gnu.org; Thu, 10 Jun 2021 19:49:07 -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 4G1LKW43gFzDrCk; Thu, 10 Jun 2021 16:49:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1623368943; bh=uPD3k4xJUSJOxBOuaDtS8VYAGIQbdUm/bGaeSIqIb9M=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=mvqCPvBtb+vXtzYXvzL59mL4lCbSqpglbBEODZDIayCEEspyjgLTVIHhYTVt43aE9 o0qBWqyH0AsxwHfLKx3OBSYlpdaDDol3bM+Tg40eGRI4DVIv5Q1uB0DjXuN+wunLUH OTa8W3UTH4ifP78dPm7WoKWpxieWhRW+zxyAdnSY= X-Riseup-User-ID: 63D88CEBBBBD0AA95C71AB828FC94EB22E2746A737E73AFAA725694284003456 Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews1.riseup.net (Postfix) with ESMTPSA id 4G1LKV2Xf1z5vcH; Thu, 10 Jun 2021 16:49:01 -0700 (PDT) In-reply-to: <5fc2e0a6-470e-0ebc-fe81-9eea2dd7fa5f@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:130732 Archived-At: Tim Johnson writes: > GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo= 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 o= ne 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 els= e.? > Thanks Do you need to see the window displaying the buffer ? If not you can use 'set-buffer' or the macro 'with-current-buffer' that cal= l it. The others options are meant to display a buffer and not for batch processi= ng. --