Skip to content

Commit

Permalink
Revert "buffer: Delete dummy-buffer-p."
Browse files Browse the repository at this point in the history
This reverts commit d027b31.

It turns out that the changes introduced in
d027b31 change the logic.

Indeed window-set-buffer is a sea of obscure incantations and bad design.

See #3510.
  • Loading branch information
aadcg committed Sep 19, 2024
1 parent a6ae245 commit c8f5f0e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/buffer.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,9 @@ This is a low-level function. See `buffer-delete' and `delete-buffer'."
(when *browser*
(alex:hash-table-values (windows *browser*))))

(defun dummy-buffer-p (buffer)
(eq 'buffer (type-of buffer)))

(export-always 'window-set-buffer)
(defun window-set-buffer (window buffer &key (focus t))
"Set BROWSER's WINDOW buffer to BUFFER.
Expand All @@ -1030,7 +1033,7 @@ proceeding."
;; So that `current-buffer' returns the new value if buffer was
;; switched inside a `with-current-buffer':
(setf %buffer nil)
(if (active-buffer window)
(if (dummy-buffer-p (active-buffer window))
(let ((dummy (active-buffer window)))
(ffi-window-set-buffer window buffer :focus focus)
(setf (active-buffer window) buffer)
Expand Down

0 comments on commit c8f5f0e

Please sign in to comment.