From 33965a53081332d78df42c20b6da50ef1f568b22 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Tue, 24 Jan 2006 10:28:33 +0000 Subject: [PATCH] Synch to No Gnus 200601241028. --- lisp/ChangeLog | 16 ++++++++++++ lisp/gnus-art.el | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++--- lisp/mm-decode.el | 4 --- lisp/mm-uu.el | 18 ++----------- 4 files changed, 89 insertions(+), 23 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1e9b448..70d2a97 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,21 @@ 2006-01-24 Katsumi Yamaoka + * gnus-art.el (gnus-mime-security-button-commands): New variable. + (gnus-mime-security-button-menu): New definition. + (gnus-mime-security-button-map): Use them. + (gnus-mime-security-button-menu): New function. + (gnus-insert-mime-security-button): Addition to help echo. + (gnus-mime-security-run-function, gnus-mime-security-save-part) + (gnus-mime-security-pipe-part): New functions. + + * mm-uu.el (mm-uu-buttonize-original-text-parts): Remove. + (mm-uu-dissect-text-parts): Revert 2006-01-23 change. + + * mm-decode.el (mm-handle-set-disposition): Remove. + (mm-handle-set-description): Remove. + +2006-01-24 Katsumi Yamaoka + * mm-view.el (mm-w3m-standalone-supports-m17n-p): New variable. (mm-w3m-standalone-supports-m17n-p): New function. (mm-inline-text-html-render-with-w3m-standalone): Use it to alter diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 43d9335..7d4ccfd 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -7910,12 +7910,51 @@ For example: (?d gnus-tmp-details ?s) (?D gnus-tmp-pressed-details ?s))) +(defvar gnus-mime-security-button-commands + '((gnus-article-press-button "\r" "Show Detail") + (undefined "v") + (undefined "t") + (undefined "C") + (gnus-mime-security-save-part "o" "Save...") + (undefined "\C-o") + (undefined "r") + (undefined "d") + (undefined "c") + (undefined "i") + (undefined "E") + (undefined "e") + (undefined "p") + (gnus-mime-security-pipe-part "|" "Pipe To Command...") + (undefined "."))) + (defvar gnus-mime-security-button-map (let ((map (make-sparse-keymap))) (define-key map gnus-mouse-2 'gnus-article-push-button) - (define-key map "\r" 'gnus-article-press-button) + (define-key map gnus-down-mouse-3 'gnus-mime-security-button-menu) + (dolist (c gnus-mime-security-button-commands) + (define-key map (cadr c) (car c))) map)) +(easy-menu-define + gnus-mime-security-button-menu gnus-mime-security-button-map + "Security button menu." + `("Security Part" + ,@(delq nil + (mapcar (lambda (c) + (unless (eq (car c) 'undefined) + (vector (caddr c) (car c) :enable t))) + gnus-mime-security-button-commands)))) + +(defun gnus-mime-security-button-menu (event prefix) + "Construct a context-sensitive menu of security commands." + (interactive "e\nP") + (save-window-excursion + (let ((pos (event-start event))) + (select-window (posn-window pos)) + (goto-char (posn-point pos)) + (gnus-article-check-buffer) + (popup-menu gnus-mime-security-button-menu nil prefix)))) + (defvar gnus-mime-security-details-buffer nil) (defvar gnus-mime-security-button-pressed nil) @@ -8040,8 +8079,9 @@ For example: (when (boundp 'help-echo-owns-message) (setq help-echo-owns-message t)) (format - "%S: show detail" - (aref gnus-mouse-2 0)))))) + "%S: show detail; %S: more options" + (aref gnus-mouse-2 0) + (aref gnus-down-mouse-3 0)))))) (defun gnus-mime-display-security (handle) (save-restriction @@ -8104,6 +8144,34 @@ For example: ;;; @ end ;;; +(defun gnus-mime-security-run-function (function) + "Run FUNCTION with the security part under point." + (gnus-article-check-buffer) + (let ((data (get-text-property (point) 'gnus-data)) + buffer handle) + (when (and (stringp (car-safe data)) + (setq buffer (mm-handle-multipart-original-buffer data)) + (setq handle (cadr data))) + (if (bufferp (mm-handle-buffer handle)) + (progn + (setq handle (cons buffer (copy-sequence (cdr handle)))) + (mm-handle-set-undisplayer handle nil)) + (setq handle (mm-make-handle + buffer + (mm-handle-multipart-ctl-parameter handle 'protocol) + nil nil nil nil nil nil))) + (funcall function handle)))) + +(defun gnus-mime-security-save-part () + "Save the security part under point." + (interactive) + (gnus-mime-security-run-function 'mm-save-part)) + +(defun gnus-mime-security-pipe-part () + "Pipe the security part under point to a process." + (interactive) + (gnus-mime-security-run-function 'mm-pipe-part)) + (gnus-ems-redefine) (provide 'gnus-art) diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index 455c14d..96352a2 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -78,12 +78,8 @@ `(setcar (nthcdr 3 ,handle) ,function)) (defmacro mm-handle-disposition (handle) `(nth 4 ,handle)) -(defmacro mm-handle-set-disposition (handle disposition) - `(setcar (nthcdr 4 ,handle) ,disposition)) (defmacro mm-handle-description (handle) `(nth 5 ,handle)) -(defmacro mm-handle-set-description (handle description) - `(setcar (nthcdr 5 ,handle) ,description)) (defmacro mm-handle-cache (handle) `(nth 6 ,handle)) (defmacro mm-handle-set-cache (handle contents) diff --git a/lisp/mm-uu.el b/lisp/mm-uu.el index 717d118..04a16bc 100644 --- a/lisp/mm-uu.el +++ b/lisp/mm-uu.el @@ -618,13 +618,6 @@ value of `mm-uu-text-plain-type'." (setq result (cons "multipart/mixed" (nreverse result)))) result))) -(defcustom mm-uu-buttonize-original-text-parts nil - "Non-nil means that the originals of dissected parts get buttons. -This variable is overridden by `gnus-inhibit-mime-unbuttonizing'." - :type 'boolean - :version "23.0" - :group 'gnus-article-mime) - (defun mm-uu-dissect-text-parts (handle) "Dissect text parts and put uu handles into HANDLE. If `mm-uu-buttonize-original-text-parts' is non-nil, the part that HANDLE @@ -651,15 +644,8 @@ points will always get a button." encoding type) (mm-uu-dissect t (mm-handle-type handle))) (mm-uu-dissect t (mm-handle-type handle)))))) - (if (or mm-uu-buttonize-original-text-parts - (and (boundp 'gnus-inhibit-mime-unbuttonizing) - (symbol-value 'gnus-inhibit-mime-unbuttonizing))) - (let ((parent (copy-sequence handle))) - (mm-handle-set-disposition parent '("attachment")) - (mm-handle-set-description parent "The original part of") - (setcdr handle (cons parent (cdr children)))) - (kill-buffer buffer) - (setcdr handle (cdr children))) + (kill-buffer buffer) + (setcdr handle (cdr children)) (setcar handle (car children)) ;; "multipart/mixed" (mapc 'mm-uu-dissect-text-parts (cdr children))))) (t -- 1.7.10.4