emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Switch buffers without modifying the buffer list ordering?


From: Kevin Vigouroux
Subject: Re: Switch buffers without modifying the buffer list ordering?
Date: Wed, 02 Feb 2022 12:24:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

The NORECORD argument of `switch-to-buffer' is actually passed to
`select-window' (see its docstring).

#+begin_quote
Optional second arg NORECORD non-nil means do not put this buffer at the
front of the buffer list and do not make this window the most recently
selected one.  Also, do not mark WINDOW for redisplay unless NORECORD
equals the special symbol ‘mark-for-redisplay’.
#+end_quote

Anyway, `switch-to-buffer' displays the buffer in some window and
finally selects that window.

#+begin_quote
Also note that the main editor command loop sets the current buffer to
the buffer of the selected window before each command.
#+end_quote

The displayed buffer is in the selected window, so the command loops
sets the current buffer to this buffer.

⏵ Emacs Lisp Ref. Manual — 27.8 “The Buffer List”.

#+begin_quote
A buffer moves to the front of this list whenever it is chosen for
display in a window (*note Switching Buffers) or a window displaying
it is selected (see Selecting Windows).
#+end_quote

If we select another window, we see that everything works as you expected.
-- 
Kevin Vigouroux
Best regards



reply via email to

[Prev in Thread] Current Thread [Next in Thread]