Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Emphasise the EXWM aspect further
Link
phils
  • 53.1k
  • 3
  • 84
  • 127

In EXWM `split-window-right` followed by immediate `windmove-right` swaps order of buffers

added 5 characters in body; edited tags
Source Link
extremeaxe5
  • 669
  • 3
  • 11

I have a function

(defun bad-fn ()
  (interactive)
  (split-window-right)
  (windmove-right)
  )

If I go to a frame with just one window visiting EXWM buffer A (and buffer B is next), and call

  • split-window-right
  • windmove-right

Manually with M-x, I have A to the left of B, and B is the selected window.

If I use the above function, I have B to the left of A, and A is the selected window.

Changing the above to

(defun bad-fn ()
  (interactive)
  (split-window-right)
    (sit-for 0.5)
  (windmove-right)
  )

fixes things.

Emacs version info: "GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.17.3) of 2020-08-28"

As a note, I don't think this happened in Emacs 26.3.

I have a function

(defun bad-fn ()
  (interactive)
  (split-window-right)
  (windmove-right)
  )

If I go to a frame with just one window visiting buffer A (and buffer B is next), and call

  • split-window-right
  • windmove-right

Manually with M-x, I have A to the left of B, and B is the selected window.

If I use the above function, I have B to the left of A, and A is the selected window.

Changing the above to

(defun bad-fn ()
  (interactive)
  (split-window-right)
    (sit-for 0.5)
  (windmove-right)
  )

fixes things.

Emacs version info: "GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.17.3) of 2020-08-28"

As a note, I don't think this happened in Emacs 26.3.

I have a function

(defun bad-fn ()
  (interactive)
  (split-window-right)
  (windmove-right)
  )

If I go to a frame with just one window visiting EXWM buffer A (and buffer B is next), and call

  • split-window-right
  • windmove-right

Manually with M-x, I have A to the left of B, and B is the selected window.

If I use the above function, I have B to the left of A, and A is the selected window.

Changing the above to

(defun bad-fn ()
  (interactive)
  (split-window-right)
    (sit-for 0.5)
  (windmove-right)
  )

fixes things.

Emacs version info: "GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.17.3) of 2020-08-28"

As a note, I don't think this happened in Emacs 26.3.

Source Link
extremeaxe5
  • 669
  • 3
  • 11

`split-window-right` followed by immediate `windmove-right` swaps order of buffers

I have a function

(defun bad-fn ()
  (interactive)
  (split-window-right)
  (windmove-right)
  )

If I go to a frame with just one window visiting buffer A (and buffer B is next), and call

  • split-window-right
  • windmove-right

Manually with M-x, I have A to the left of B, and B is the selected window.

If I use the above function, I have B to the left of A, and A is the selected window.

Changing the above to

(defun bad-fn ()
  (interactive)
  (split-window-right)
    (sit-for 0.5)
  (windmove-right)
  )

fixes things.

Emacs version info: "GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.17.3) of 2020-08-28"

As a note, I don't think this happened in Emacs 26.3.