Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue with justl-pop-to-buffer-on-display #73

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Changelog.org
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
- Justl buffer names are changed to include filename too. This is made
in preparation for supporting just modules.
- Add ~justl-pop-to-buffer-on-display~. When on, input focus moves to the justl
buffer when it is displayed (the previous behavior). Otherwise the buffer is
displayed without selecting it. (defaults to on).
output buffer when it is displayed (the previous behavior). Otherwise the
output buffer is displayed without selecting it. (defaults to on).
- Better defgroup integration.

* 0.14
Expand Down
9 changes: 3 additions & 6 deletions justl.el
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ package to be installed."
:group 'justl)

(defcustom justl-pop-to-buffer-on-display t
"If non-nil, selects the justl buffer when it is displayed.
If nil, displays the buffer without selecting it."
"If non-nil, selects the justl output buffer when it is displayed.
If nil, displays the output buffer without selecting it."
:type 'boolean
:group 'justl
:safe 'booleanp)
Expand All @@ -153,10 +153,7 @@ If nil, displays the buffer without selecting it."
"Utility function to pop to buffer or create it.

NAME is the buffer name."
(let ((buf (get-buffer-create name)))
(if justl-pop-to-buffer-on-display
(pop-to-buffer-same-window buf)
(display-buffer buf display-buffer--same-window-action))))
(pop-to-buffer-same-window (get-buffer-create name)))

(defconst justl--process-buffer "*just-process*"
"Just process buffer name.")
Expand Down
Loading