1 |
;;; mh-mime.el --- MH-E support for composing MIME messages |
;;; mh-mime.el --- MH-E support for composing MIME messages |
2 |
|
|
3 |
;; Copyright (C) 1993, 1995, 2005 Free Software Foundation, Inc. |
;; Copyright (C) 1993, 1995, |
4 |
|
;; 2001, 2002, 2003, 2004 Free Software Foundation, Inc. |
5 |
|
|
6 |
;; Author: Bill Wohler <wohler@newt.com> |
;; Author: Bill Wohler <wohler@newt.com> |
7 |
;; Maintainer: Bill Wohler <wohler@newt.com> |
;; Maintainer: Bill Wohler <wohler@newt.com> |
1326 |
(point-max))) |
(point-max))) |
1327 |
(forward-line -1))))) |
(forward-line -1))))) |
1328 |
|
|
1329 |
|
(defun mh-mime-security-button-face (info) |
1330 |
|
"Return the button face to use for encrypted/signed mail based on INFO." |
1331 |
|
(cond ((string-match "OK" info) ;Decrypted mail |
1332 |
|
mh-show-pgg-good-face) |
1333 |
|
((string-match "Failed" info) ;Decryption failed or signature invalid |
1334 |
|
mh-show-pgg-bad-face) |
1335 |
|
((string-match "Undecided" info);Unprocessed mail |
1336 |
|
mh-show-pgg-unknown-face) |
1337 |
|
((string-match "Untrusted" info);Key not trusted |
1338 |
|
mh-show-pgg-unknown-face) |
1339 |
|
(t mh-show-pgg-good-face))) |
1340 |
|
|
1341 |
(defun mh-mime-security-press-button (handle) |
(defun mh-mime-security-press-button (handle) |
1342 |
"Callback from security button for part HANDLE." |
"Callback from security button for part HANDLE." |
1343 |
(if (mm-handle-multipart-ctl-parameter handle 'gnus-info) |
(if (mm-handle-multipart-ctl-parameter handle 'gnus-info) |
1377 |
(info (or (mm-handle-multipart-ctl-parameter handle 'gnus-info) |
(info (or (mm-handle-multipart-ctl-parameter handle 'gnus-info) |
1378 |
"Undecided")) |
"Undecided")) |
1379 |
(details (mm-handle-multipart-ctl-parameter handle 'gnus-details)) |
(details (mm-handle-multipart-ctl-parameter handle 'gnus-details)) |
1380 |
pressed-details begin end) |
pressed-details begin end face) |
1381 |
(setq details (if details (concat "\n" details) "")) |
(setq details (if details (concat "\n" details) "")) |
1382 |
(setq pressed-details (if mh-mime-security-button-pressed details "")) |
(setq pressed-details (if mh-mime-security-button-pressed details "")) |
1383 |
|
(setq face (mh-mime-security-button-face info)) |
1384 |
(unless (bolp) (insert "\n")) |
(unless (bolp) (insert "\n")) |
1385 |
(setq begin (point)) |
(setq begin (point)) |
1386 |
(gnus-eval-format |
(gnus-eval-format |
1396 |
:mime-handle handle |
:mime-handle handle |
1397 |
:action 'mh-widget-press-button |
:action 'mh-widget-press-button |
1398 |
:button-keymap mh-mime-security-button-map |
:button-keymap mh-mime-security-button-map |
1399 |
|
:button-face face |
1400 |
:help-echo "Mouse-2 click or press RET (in show buffer) to see security details.") |
:help-echo "Mouse-2 click or press RET (in show buffer) to see security details.") |
1401 |
(dolist (ov (mh-funcall-if-exists overlays-in begin end)) |
(dolist (ov (mh-funcall-if-exists overlays-in begin end)) |
1402 |
(mh-funcall-if-exists overlay-put ov 'evaporate t)) |
(mh-funcall-if-exists overlay-put ov 'evaporate t)) |