2006-01-24 Katsumi Yamaoka <yamaoka@jpl.org>
+ * 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 <yamaoka@jpl.org>
+
* 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
(?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)
(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
;;; @ 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)
`(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)
(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
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