[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Visiting buffers programmatically
From: |
pillule |
Subject: |
Re: Visiting buffers programmatically |
Date: |
Fri, 11 Jun 2021 02:17:12 +0200 |
Tim Johnson <tim@akwebsoft.com> writes:
> On 6/10/21 3:31 PM, pillule wrote:
>> Tim Johnson <tim@akwebsoft.com> writes:
>>
>>> GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo
>>> version 1.16.0)
>>> of 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 else.?
>>> 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
>> processing.
> 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
(except unordinary cases).
--