]> git.eshelyaron.com Git - emacs.git/commitdiff
Name buffer according to attachment filename (bug#34478).
authorTassilo Horn <tsdh@gnu.org>
Sat, 9 Mar 2019 20:27:24 +0000 (21:27 +0100)
committerTassilo Horn <tsdh@gnu.org>
Sat, 9 Mar 2019 20:29:18 +0000 (21:29 +0100)
* lisp/gnus/mm-decode.el (mm-display-external): Name buffer showing
  the attachment according to the attachment's filename, i.e. "*mm*
  <filename>" instead of " *mm*12345".

lisp/gnus/mm-decode.el

index 2a769fccf5461ae7f84dba020a531bac0834ccb8..b689b51d6a53842912f33e5bfe555cbdbc8b57bd 100644 (file)
@@ -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))