Replace kill-this-buffer with kill-current-buffer

As per the documentation for kill-this-buffer, it should only be invoked
from the menu and behaves unpredictably when invoked programmatically.
This commit is contained in:
Siddharth Shekar 2019-05-30 18:54:58 -07:00
parent 0c743afcfd
commit aa64cf9426
14 changed files with 22 additions and 22 deletions

View file

@ -250,10 +250,10 @@ regex PATTERN. Returns the number of killed buffers."
;;;###autoload
(defun doom*switch-to-fallback-buffer-maybe (orig-fn)
"Advice for `kill-this-buffer'. If in a dedicated window, delete it. If there
"Advice for `kill-current-buffer'. If in a dedicated window, delete it. If there
are no real buffers left OR if all remaining buffers are visible in other
windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
`kill-this-buffer'."
`kill-current-buffer'."
(let ((buf (current-buffer)))
(cond ((window-dedicated-p)
(delete-window))

View file

@ -190,7 +190,7 @@ markdown and copies it to your clipboard, ready to be pasted into bug reports!"
(define-key map (kbd "C-c C-d") #'doom--run-vanilla-doom)
(define-key map (kbd "C-c C-p") #'doom--run-vanilla-doom+)
(define-key map (kbd "C-c C-f") #'doom--run-full-doom)
(define-key map (kbd "C-c C-k") #'kill-this-buffer)
(define-key map (kbd "C-c C-k") #'kill-current-buffer)
map))
(define-derived-mode doom-sandbox-emacs-lisp-mode emacs-lisp-mode "Sandbox Elisp"
@ -289,7 +289,7 @@ will be automatically appended to the result."
backtrace)
"")))
(local-set-key (kbd "C-c C-c") #'doom--report-bug)
(local-set-key (kbd "C-c C-k") #'kill-this-buffer)
(local-set-key (kbd "C-c C-k") #'kill-current-buffer)
(setq header-line-format "C-c C-c to submit / C-c C-k to close")
;;
(narrow-to-region (point-min) pos)

View file

@ -187,7 +187,7 @@ file if it exists, without confirmation."
(when-let* ((dest (doom--copy-file old-path new-path force-p)))
(when (file-exists-p old-path)
(delete-file old-path))
(kill-this-buffer)
(kill-current-buffer)
(doom--forget-file old-path new-path)
(doom--update-file new-path)
(find-file new-path)

View file

@ -178,7 +178,7 @@ Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/"
(setq doom--buffer-narrowed-origin old-buf)))
(narrow-to-region beg end))
(doom--buffer-narrowed-origin
(kill-this-buffer)
(kill-current-buffer)
(switch-to-buffer doom--buffer-narrowed-origin)
(setq doom--buffer-narrowed-origin nil))
(t