* lisp/simple.el (kill-current-buffer): New function.
(completion-list-mode-map): Use it instead of kill-this-buffer.
* lisp/type-break.el (type-break-mode):
* lisp/term/ns-win.el (global-map):
* lisp/progmodes/gdb-mi.el (gdb-memory-mode-map)
(gdb-disassembly-mode-map, gdb-frames-mode-map)
(gdb-locals-mode-map, gdb-registers-mode-map):
* lisp/org/org-mhe.el (org-mhe-follow-link):
* lisp/net/secrets.el (secrets-mode-map):
* lisp/net/eudc.el (eudc-mode-map):
* lisp/net/eudc-hotlist.el (eudc-hotlist-mode-map): Use
kill-current-buffer instead of kill-this-buffer. (Bug#26466)
(define-key map "s" 'eudc-hotlist-select-server)
(define-key map "t" 'eudc-hotlist-transpose-servers)
(define-key map "q" 'eudc-hotlist-quit-edit)
- (define-key map "x" 'kill-this-buffer)
+ (define-key map "x" 'kill-current-buffer)
map))
(define-derived-mode eudc-hotlist-mode fundamental-mode "EUDC-Servers"
(defvar eudc-mode-map
(let ((map (make-sparse-keymap)))
- (define-key map "q" 'kill-this-buffer)
- (define-key map "x" 'kill-this-buffer)
+ (define-key map "q" 'kill-current-buffer)
+ (define-key map "x" 'kill-current-buffer)
(define-key map "f" 'eudc-query-form)
(define-key map "b" 'eudc-try-bbdb-insert)
(define-key map "n" 'eudc-move-to-next-record)
(set-keymap-parent map (make-composed-keymap special-mode-map widget-keymap))
(define-key map "n" 'next-line)
(define-key map "p" 'previous-line)
- (define-key map "z" 'kill-this-buffer)
+ (define-key map "z" 'kill-current-buffer)
map)
"Keymap used in `secrets-mode' buffers.")
(mh-search folder (list "--message-id" article))
(when (and org-mhe-search-all-folders
(not (org-mhe-get-message-real-folder)))
- (kill-this-buffer)
+ (kill-current-buffer)
(mh-search "+" (list "--message-id" article))))
(if mh-search-regexp-builder
(mh-search "+" (funcall mh-search-regexp-builder
(mh-search "+" article)))
(if (org-mhe-get-message-real-folder)
(mh-show-msg 1)
- (kill-this-buffer)
+ (kill-current-buffer)
(error "Message not found"))))
(provide 'org-mhe)
(defvar gdb-memory-mode-map
(let ((map (make-sparse-keymap)))
(suppress-keymap map t)
- (define-key map "q" 'kill-this-buffer)
+ (define-key map "q" 'kill-current-buffer)
(define-key map "n" 'gdb-memory-show-next-page)
(define-key map "p" 'gdb-memory-show-previous-page)
(define-key map "a" 'gdb-memory-set-address)
;; TODO
(let ((map (make-sparse-keymap)))
(suppress-keymap map)
- (define-key map "q" 'kill-this-buffer)
+ (define-key map "q" 'kill-current-buffer)
map))
(define-derived-mode gdb-disassembly-mode gdb-parent-mode "Disassembly"
(defvar gdb-frames-mode-map
(let ((map (make-sparse-keymap)))
(suppress-keymap map)
- (define-key map "q" 'kill-this-buffer)
+ (define-key map "q" 'kill-current-buffer)
(define-key map "\r" 'gdb-select-frame)
(define-key map [mouse-2] 'gdb-select-frame)
(define-key map [follow-link] 'mouse-face)
(defvar gdb-locals-mode-map
(let ((map (make-sparse-keymap)))
(suppress-keymap map)
- (define-key map "q" 'kill-this-buffer)
+ (define-key map "q" 'kill-current-buffer)
(define-key map "\t" (lambda ()
(interactive)
(gdb-set-window-buffer
(suppress-keymap map)
(define-key map "\r" 'gdb-edit-register-value)
(define-key map [mouse-2] 'gdb-edit-register-value)
- (define-key map "q" 'kill-this-buffer)
+ (define-key map "q" 'kill-current-buffer)
(define-key map "\t" (lambda ()
(interactive)
(gdb-set-window-buffer
(point-max)))
(goto-char (next-overlay-change (point))))
(end-of-line)))
+
+(defun kill-current-buffer ()
+ "Kill the current buffer.
+When called in the minibuffer, get out of the minibuffer
+using `abort-recursive-edit'.
+
+This is like `kill-this-buffer', but it doesn't have to be invoked
+via the menu bar, and pays no attention to the menu-bar's frame."
+ (interactive)
+ (let ((frame (selected-frame)))
+ (if (and (frame-live-p frame)
+ (not (window-minibuffer-p (frame-selected-window frame))))
+ (kill-buffer (current-buffer))
+ (abort-recursive-edit))))
+
\f
(defun insert-buffer (buffer)
"Insert after point the contents of BUFFER.
(define-key map [?\t] 'next-completion)
(define-key map [backtab] 'previous-completion)
(define-key map "q" 'quit-window)
- (define-key map "z" 'kill-this-buffer)
+ (define-key map "z" 'kill-current-buffer)
map)
"Local map for completion list buffers.")
(define-key global-map [?\s-:] 'ispell)
(define-key global-map [?\s-?] 'info)
(define-key global-map [?\s-^] 'kill-some-buffers)
-(define-key global-map [?\s-&] 'kill-this-buffer)
+(define-key global-map [?\s-&] 'kill-current-buffer)
(define-key global-map [?\s-C] 'ns-popup-color-panel)
(define-key global-map [?\s-D] 'dired)
(define-key global-map [?\s-E] 'edit-abbrevs)
(define-key global-map [?\s-h] 'ns-do-hide-emacs)
(define-key global-map [?\s-H] 'ns-do-hide-others)
(define-key global-map [?\s-j] 'exchange-point-and-mark)
-(define-key global-map [?\s-k] 'kill-this-buffer)
+(define-key global-map [?\s-k] 'kill-current-buffer)
(define-key global-map [?\s-l] 'goto-line)
(define-key global-map [?\s-m] 'iconify-frame)
(define-key global-map [?\s-n] 'make-frame)
'nowarn)
(set-buffer-modified-p nil)
(unlock-buffer)
- (kill-this-buffer))))))
+ (kill-current-buffer))))))
(define-minor-mode type-break-mode-line-message-mode
"Toggle warnings about typing breaks in the mode line.