Emacs: embark kill buffer no prompt and fix find-file-other-window
This commit is contained in:
parent
cee5d08902
commit
cc318d1600
@ -1592,35 +1592,20 @@ Stuff to immediately switch to Jetbrains for debugging
|
||||
*** Embark
|
||||
#+begin_src emacs-lisp
|
||||
(require 'embark)
|
||||
#+end_src
|
||||
|
||||
;; TODO Try using embark to kill this buffer
|
||||
(defun prot-simple-kill-buffer-current (&optional arg)
|
||||
"Kill current buffer.
|
||||
With optional prefix ARG (\\[universal-argument]) delete the
|
||||
buffer's window as well."
|
||||
(interactive "P")
|
||||
(let ((kill-buffer-query-functions nil))
|
||||
(if (and arg (not (one-window-p)))
|
||||
(kill-buffer-and-window)
|
||||
(kill-buffer))))
|
||||
These two lines allow you to kill buffers without a confirmation and without
|
||||
closing the mini-buffer so you can quickly kill multiple buffers if needed. The
|
||||
odd looking ~'(t .t)~ is for specifying a default for all other actions.
|
||||
|
||||
(defun prot-simple-kill-buffer (buffer)
|
||||
"Kill current BUFFER.
|
||||
When called interactively, prompt for BUFFER."
|
||||
(interactive (list (read-buffer "Select buffer: ")))
|
||||
(let ((kill-buffer-query-functions nil))
|
||||
(kill-buffer (or buffer (current-buffer)))))
|
||||
#+begin_src emacs-lisp
|
||||
(setq embark-quit-after-action '((t . t)
|
||||
(kill-buffer . nil)))
|
||||
|
||||
(setq embark-quit-after-action '((kill-buffer . nil)))
|
||||
(setf (alist-get 'kill-buffer embark-pre-action-hooks) nil)
|
||||
#+end_src
|
||||
|
||||
;; TODO Add this to display-buffer-alist
|
||||
;; ("\\*Embark Actions\\*"
|
||||
;; (display-buffer-reuse-mode-window display-buffer-at-bottom)
|
||||
;; (window-height . fit-window-to-buffer)
|
||||
;; (window-parameters . ((no-other-window . t)
|
||||
;; (mode-line-format . none))))
|
||||
|
||||
;; TODO Remove the which-key stuff because it seems to be breaking things
|
||||
#+begin_src emacs-lisp
|
||||
(defun embark-which-key-indicator ()
|
||||
"An embark indicator that displays keymaps using which-key.
|
||||
The which-key help message will show the type and value of the
|
||||
|
Loading…
x
Reference in New Issue
Block a user