From: Tassilo Horn Date: Sat, 9 Mar 2019 20:27:24 +0000 (+0100) Subject: Name buffer according to attachment filename (bug#34478). X-Git-Tag: emacs-27.0.90~3442 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7073db2b64726e4970e5a62bad01c49b68582178;p=emacs.git Name buffer according to attachment filename (bug#34478). * lisp/gnus/mm-decode.el (mm-display-external): Name buffer showing the attachment according to the attachment's filename, i.e. "*mm* " instead of " *mm*12345". --- diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 2a769fccf54..b689b51d6a5 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -890,6 +890,7 @@ external if displayed external." (when method (message "Viewing with %s" method)) (let ((mm (current-buffer)) + (attachment-filename (mm-handle-filename handle)) (non-viewer (assq 'non-viewer (mailcap-mime-info (mm-handle-media-type handle) t)))) @@ -899,6 +900,9 @@ external if displayed external." (when (and (boundp 'gnus-summary-buffer) (bufferp gnus-summary-buffer) (buffer-name gnus-summary-buffer)) + (when attachment-filename + (with-current-buffer mm + (rename-buffer (format "*mm* %s" attachment-filename) t))) ;; So that we pop back to the right place, sort of. (switch-to-buffer gnus-summary-buffer) (switch-to-buffer mm))