Adds native comp exception for warnings. Modifies kill-buffer-and-window to keep leftmost widnows.
This commit is contained in:
parent
c3add5d12e
commit
b6fa735642
1 changed files with 12 additions and 8 deletions
20
Config.org
20
Config.org
|
|
@ -16,6 +16,9 @@
|
||||||
;; Avoid asking confirmation when killing a buffer with a process.
|
;; Avoid asking confirmation when killing a buffer with a process.
|
||||||
(setq kill-buffer-query-functions nil)
|
(setq kill-buffer-query-functions nil)
|
||||||
|
|
||||||
|
;; Don't show warnings when doing async native com.
|
||||||
|
(setq native-comp-async-report-warnings-errors nil)
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Package system setup
|
** Package system setup
|
||||||
|
|
@ -225,18 +228,19 @@ Leader key combinations to deal with buffers.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
||||||
;; Kill all buffers except the current one.
|
;; Kill all buffers except the current one.
|
||||||
(defun kill-other-buffers ()
|
(defun kill-other-buffers ()
|
||||||
"Kill all other buffers."
|
"Kill all other buffers."
|
||||||
(interactive)
|
(interactive)
|
||||||
(mapc 'kill-buffer ;; Apply the command kill-buffer to all elements of the list.
|
(mapc 'kill-buffer ;; Apply the command kill-buffer to all elements of the list.
|
||||||
(delq (current-buffer) ;; Remove the current buffer from the list of to-be-removed.
|
(delq (current-buffer) ;; Remove the current buffer from the list of to-be-removed.
|
||||||
(cl-remove-if-not 'buffer-file-name (buffer-list))))) ;; Only remove file buffers.
|
(cl-remove-if-not 'buffer-file-name (buffer-list))))) ;; Only remove file buffers.
|
||||||
|
|
||||||
(defun mariano/kill-buffer-and-window ()
|
(defun mariano/kill-buffer-and-window ()
|
||||||
"Kills the current buffer. If there's more than one active window it also closes the current one"
|
"Kills the current buffer. If there's more than one window and it is not the leftmost window, it also kills it."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (> (count-windows) 1)
|
(if (and (> (count-windows) 1)
|
||||||
(kill-buffer-and-window)
|
(window-left (selected-window)))
|
||||||
|
(kill-buffer-and-window)
|
||||||
(kill-buffer)))
|
(kill-buffer)))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue