aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/gnus/ChangeLog9
-rw-r--r--lisp/gnus/gnus-art.el72
2 files changed, 48 insertions, 33 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 801acc437a8..c97ad7fc0a2 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,12 @@
12014-05-09 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gnus-art.el (gnus-mm-display-part): Don't put article out of sight
4 while prompting a user for a file name, etc.
5 (gnus-mime-display-single): Display part with a common appearance no
6 matter whether MIME button is omitted or not; don't add duplicate entry
7 to gnus-article-mime-handle-alist.
8 (gnus-mime-buttonize-attachments-in-header): Use copied buttons.
9
12014-05-08 Adam Sjøgren <asjo@koldfront.dk> 102014-05-08 Adam Sjøgren <asjo@koldfront.dk>
2 11
3 * mml2015.el (mml2015-display-key-image): New variable. 12 * mml2015.el (mml2015-display-key-image): New variable.
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 0fbac51d27c..a05507ead37 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -5693,27 +5693,36 @@ all parts."
5693 (setq point (previous-single-property-change 5693 (setq point (previous-single-property-change
5694 (next-single-property-change point 'gnus-data) 5694 (next-single-property-change point 'gnus-data)
5695 'gnus-data)) 5695 'gnus-data))
5696 (forward-line)
5697 (if (mm-handle-displayed-p handle) 5696 (if (mm-handle-displayed-p handle)
5698 ;; This will remove the part. 5697 ;; This will remove the part.
5699 (setq retval (mm-display-part handle)) 5698 (setq retval (mm-display-part handle))
5700 (save-window-excursion 5699 (let ((part (or (and (mm-inlinable-p handle)
5701 (save-restriction 5700 (mm-inlined-p handle)
5702 ;; FIXME: nothing is displayed in the article buffer 5701 t)
5703 ;; while prompting a user for a file name. 5702 (with-temp-buffer
5704 (narrow-to-region (point) 5703 (gnus-bind-safe-url-regexp
5705 (if (eobp) (point) (1+ (point)))) 5704 (setq retval (mm-display-part handle)))
5706 (gnus-bind-safe-url-regexp 5705 (unless (zerop (buffer-size))
5707 (setq retval (mm-display-part handle))) 5706 (buffer-string))))))
5708 ;; We narrow to the part itself and 5707 (forward-line)
5709 ;; then call the treatment functions. 5708 (cond ((stringp part)
5710 (goto-char (point-min)) 5709 (save-restriction
5711 (forward-line 1) 5710 (narrow-to-region (point)
5712 (narrow-to-region (point) (point-max)) 5711 (progn
5713 (gnus-treat-article 5712 (insert part)
5714 nil id 5713 (unless (bolp) (insert "\n"))
5715 (gnus-article-mime-total-parts) 5714 (point)))
5716 (mm-handle-media-type handle)))))) 5715 (gnus-treat-article nil id
5716 (gnus-article-mime-total-parts)
5717 (mm-handle-media-type handle))
5718 (mm-handle-set-undisplayer
5719 handle
5720 `(lambda ()
5721 (let ((inhibit-read-only t))
5722 (delete-region ,(copy-marker (point-min) t)
5723 ,(point-max-marker)))))))
5724 (part
5725 (mm-display-inline handle))))))
5717 (goto-char point) 5726 (goto-char point)
5718 ;; Toggle the button appearance between `[button]...' and `[button]'. 5727 ;; Toggle the button appearance between `[button]...' and `[button]'.
5719 (gnus-insert-mime-button handle id (list (mm-handle-displayed-p handle))) 5728 (gnus-insert-mime-button handle id (list (mm-handle-displayed-p handle)))
@@ -5985,7 +5994,6 @@ If nil, don't show those extra buttons."
5985 (let ((type (mm-handle-media-type handle)) 5994 (let ((type (mm-handle-media-type handle))
5986 (ignored gnus-ignored-mime-types) 5995 (ignored gnus-ignored-mime-types)
5987 (not-attachment t) 5996 (not-attachment t)
5988 (move nil)
5989 display text) 5997 display text)
5990 (catch 'ignored 5998 (catch 'ignored
5991 (progn 5999 (progn
@@ -6011,9 +6019,11 @@ If nil, don't show those extra buttons."
6011 (setq display t) 6019 (setq display t)
6012 (when (equal (mm-handle-media-supertype handle) "text") 6020 (when (equal (mm-handle-media-supertype handle) "text")
6013 (setq text t))) 6021 (setq text t)))
6014 (let ((id (1+ (length gnus-article-mime-handle-alist))) 6022 (let ((id (car (rassq handle gnus-article-mime-handle-alist)))
6015 beg) 6023 beg)
6016 (push (cons id handle) gnus-article-mime-handle-alist) 6024 (unless id
6025 (setq id (1+ (length gnus-article-mime-handle-alist)))
6026 (push (cons id handle) gnus-article-mime-handle-alist))
6017 (when (and display 6027 (when (and display
6018 (equal (mm-handle-media-supertype handle) "message")) 6028 (equal (mm-handle-media-supertype handle) "message"))
6019 (insert-char 6029 (insert-char
@@ -6025,16 +6035,13 @@ If nil, don't show those extra buttons."
6025 (not (gnus-unbuttonized-mime-type-p type)) 6035 (not (gnus-unbuttonized-mime-type-p type))
6026 (eq id gnus-mime-buttonized-part-id)) 6036 (eq id gnus-mime-buttonized-part-id))
6027 (gnus-insert-mime-button 6037 (gnus-insert-mime-button
6028 handle id (list (or display (and not-attachment text)))) 6038 handle id (list (or display (and not-attachment text)))))
6029 (gnus-article-insert-newline) 6039 (gnus-article-insert-newline)
6030 ;; Remember modify the number of forward lines. 6040 (when (or display (and text not-attachment))
6031 (setq move t)) 6041 (forward-line -1))
6032 (setq beg (point)) 6042 (setq beg (point))
6033 (cond 6043 (cond
6034 (display 6044 (display
6035 (when move
6036 (forward-line -1)
6037 (setq beg (point)))
6038 (let ((mail-parse-charset gnus-newsgroup-charset) 6045 (let ((mail-parse-charset gnus-newsgroup-charset)
6039 (mail-parse-ignored-charsets 6046 (mail-parse-ignored-charsets
6040 (save-excursion (condition-case () 6047 (save-excursion (condition-case ()
@@ -6044,9 +6051,6 @@ If nil, don't show those extra buttons."
6044 (gnus-bind-safe-url-regexp (mm-display-part handle t))) 6051 (gnus-bind-safe-url-regexp (mm-display-part handle t)))
6045 (goto-char (point-max))) 6052 (goto-char (point-max)))
6046 ((and text not-attachment) 6053 ((and text not-attachment)
6047 (when move
6048 (forward-line -1)
6049 (setq beg (point)))
6050 (gnus-article-insert-newline) 6054 (gnus-article-insert-newline)
6051 (mm-display-inline handle) 6055 (mm-display-inline handle)
6052 (goto-char (point-max)))) 6056 (goto-char (point-max))))
@@ -6334,7 +6338,7 @@ in the body. Use `gnus-header-face-alist' to highlight buttons."
6334 (setcar handle (caar handle)))) 6338 (setcar handle (caar handle))))
6335 flat) 6339 flat)
6336 flat)))) 6340 flat))))
6337 (let ((case-fold-search t) buttons st) 6341 (let ((case-fold-search t) buttons st handle)
6338 (save-excursion 6342 (save-excursion
6339 (save-restriction 6343 (save-restriction
6340 (widen) 6344 (widen)
@@ -6371,7 +6375,9 @@ in the body. Use `gnus-header-face-alist' to highlight buttons."
6371 (dolist (button (nreverse buttons)) 6375 (dolist (button (nreverse buttons))
6372 (setq st (point)) 6376 (setq st (point))
6373 (insert " ") 6377 (insert " ")
6374 (gnus-insert-mime-button (cdr button) (car button)) 6378 (mm-handle-set-undisplayer
6379 (setq handle (copy-sequence (cdr button))) nil)
6380 (gnus-insert-mime-button handle (car button))
6375 (skip-chars-backward "\t\n ") 6381 (skip-chars-backward "\t\n ")
6376 (delete-region (point) (point-max)) 6382 (delete-region (point) (point-max))
6377 (when (> (current-column) (window-width)) 6383 (when (> (current-column) (window-width))