diff options
author | martianh <martianh@noreply.codeberg.org> | 2024-02-08 08:04:48 +0000 |
---|---|---|
committer | martianh <martianh@noreply.codeberg.org> | 2024-02-08 08:04:48 +0000 |
commit | 51132d08682b7b13473d24a4bf60417541905c81 (patch) | |
tree | 201cc33faec6c856418fc5565d3b81892ad4d394 /lisp/mastodon.el | |
parent | a01eec0d57ed64f8a83784cd48e44fc2961e0d64 (diff) | |
parent | 2e6bcd41a9bb5953b20758ada8cec2b4ff8e9b4f (diff) |
Merge pull request 'Use display-buffer to allow customization' (#522) from rahguzar/mastodon.el:display-buffer into develop
Reviewed-on: https://codeberg.org/martianh/mastodon.el/pulls/522
Diffstat (limited to 'lisp/mastodon.el')
-rw-r--r-- | lisp/mastodon.el | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 9dac1d1..142eced 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -291,7 +291,7 @@ See `mastodon-toot-display-orig-in-reply-buffer'.") (buffer-list))))) ; catch any other masto buffer (mastodon-return-credential-account :force) (if buffer - (switch-to-buffer buffer) + (pop-to-buffer buffer '(display-buffer-same-window)) (mastodon-tl--get-home-timeline) (message "Loading Mastodon account %s on %s..." (mastodon-auth--user-acct) @@ -337,7 +337,7 @@ from the server and load anew." "*mastodon-notifications*"))) (if (and (not force) (get-buffer buffer)) - (progn (switch-to-buffer buffer) + (progn (pop-to-buffer buffer '(display-buffer-same-window)) (mastodon-tl--update)) (message "Loading your notifications...") (mastodon-tl--init-sync (or buffer-name "notifications") @@ -435,10 +435,12 @@ Calls `mastodon-tl--get-buffer-type', which see." (defun mastodon-switch-to-buffer () "Switch to a live mastodon buffer." (interactive) - (let* ((bufs (mastodon-live-buffers)) - (buf-names (mapcar #'buffer-name bufs)) - (choice (completing-read "Switch to mastodon buffer: " - buf-names))) + (let ((choice (read-buffer + "Switch to mastodon buffer: " nil t + (lambda (cand) + (with-current-buffer + (if (stringp cand) cand (car cand)) + (mastodon-tl--get-buffer-type)))))) (switch-to-buffer choice))) (defun mastodon-mode-hook-fun () |