From: Mark Oteiza Date: Tue, 13 Dec 2016 16:41:45 +0000 (-0500) Subject: Remove image-dired-kill-buffer-and-window X-Git-Tag: emacs-26.0.90~1112 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=86762eb174653ead8fa8c5d1cd5b263e9e0a2ac6;p=emacs.git Remove image-dired-kill-buffer-and-window This breaks window layout, especially when quitting a image-dired-display-image-mode buffer. * lisp/image-dired.el (image-dired-thumbnail-mode-map): (image-dired-display-image-mode-map): Replace in keymap and menu items bindings to image-dired-kill-buffer-and-window with quit-window. (image-dired-kill-buffer-and-window): Remove. --- diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 80b57336ac8..30705f841e7 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -1331,7 +1331,7 @@ You probably want to use this together with (define-key map " " 'image-dired-display-next-thumbnail-original) (define-key map (kbd "DEL") 'image-dired-display-previous-thumbnail-original) (define-key map "c" 'image-dired-comment-thumbnail) - (define-key map "q" 'image-dired-kill-buffer-and-window) + (define-key map "q" 'quit-window) ;; Mouse (define-key map [mouse-2] 'image-dired-mouse-display-image) @@ -1348,7 +1348,7 @@ You probably want to use this together with (easy-menu-define nil map "Menu for `image-dired-thumbnail-mode'." '("Image-Dired" - ["Quit" image-dired-kill-buffer-and-window] + ["Quit" quit-window] ["Delete thumbnail from buffer" image-dired-delete-char] ["Remove tag from thumbnail" image-dired-tag-thumbnail-remove] ["Tag thumbnail" image-dired-tag-thumbnail] @@ -1378,14 +1378,14 @@ You probably want to use this together with (defvar image-dired-display-image-mode-map (let ((map (make-sparse-keymap))) - (define-key map "q" 'image-dired-kill-buffer-and-window) + (define-key map "q" 'quit-window) (define-key map "f" 'image-dired-display-current-image-full) (define-key map "s" 'image-dired-display-current-image-sized) (easy-menu-define nil map "Menu for `image-dired-display-image-mode-map'." '("Image-Dired" - ["Quit" image-dired-kill-buffer-and-window] + ["Quit" quit-window] ["Display original, sized to fit" image-dired-display-current-image-sized] ["Display original, full size" image-dired-display-current-image-full])) map) @@ -2336,15 +2336,6 @@ when using per-directory thumbnail file storage")) (insert " \n") (insert "")))) -(defun image-dired-kill-buffer-and-window () - "Kill the current buffer and, if possible, also the window." - (interactive) - (let ((buffer (current-buffer))) - (condition-case nil - (delete-window (selected-window)) - (error nil)) - (kill-buffer buffer))) - (defvar image-dired-widget-list nil "List to keep track of meta data in edit buffer.")