Here's the definition of deft
(version 20210101.1519 on MELPA)
(defun deft ()
"Switch to *Deft* buffer and load files."
(interactive)
(switch-to-buffer deft-buffer)
(if (not (eq major-mode 'deft-mode))
(deft-mode)))
So it uses your current window, then switch to a buffer with a name of the value of deft-buffer
variable, "\*Deft\*"
by default, then call deft-mode
. This means that it doesn't create a new window, so setting
display-buffer-alist
does nothing. (Hope this is clear enough.)
You can probably write this in function advice, I prefer to not do this
because of reasons. So
here is a new function
(defun deft-side-window ()
(interactive)
(let ((dummy-buf (generate-new-buffer deft-buffer)))
(with-current-buffer dummy-buf
(deft-mode))
(display-buffer dummy-buf)))
Firstly, it creates a new buffer named after the variable deft-buffer
, call deft-mode
then having Emacs try to display it, with this, it respects your display-buffer-alist
.
Here's another version with your window rules if you want to do it manually.
(defun deft-side-window ()
(interactive)
(let ((dummy-buf (generate-new-buffer deft-buffer)))
(with-current-buffer dummy-buf
(deft-mode))
(display-buffer-in-side-window dummy-buf
'((side . left)
(slot . 0)
(window-width . 0.25))))))
I messed up the formatting but it works! Hope this helps.