From e97a63c7d75c0b643a7d48bf61af5795c841c7f2 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Fri, 1 Dec 2000 05:28:05 +0000 Subject: [PATCH] Synch with Gnus. * lisp/dgnushack.el: Attempt to add another FLIM path to `load-path' if the module `mel' does not found. This procedure may be needed when recent FLIM 1.14 is used under old Emacsen. --- ChangeLog | 6 ++++++ lisp/ChangeLog | 14 ++++++++++++++ lisp/dgnushack.el | 13 +++++++++++++ lisp/gnus-art.el | 48 ++++++++++++++++++++++++++++++++++++++++++------ lisp/mml2015.el | 50 +++++++++++++++++++++++++++++--------------------- 5 files changed, 104 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 82bc905..9b933ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2000-12-01 Katsumi Yamaoka + + * lisp/dgnushack.el: Attempt to add another FLIM path to `load-path' + if the module `mel' does not found. This procedure may be needed + when recent FLIM 1.14 is used under old Emacsen. + 2000-11-27 Katsumi Yamaoka * lisp/gnus-vers.el (gnus-revision-number): Increment to 08. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e2b23a9..cf72c33 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,17 @@ +2000-11-30 23:00:00 ShengHuo ZHU + + * gnus-art.el (gnus-mime-security-button-line-format-alist): Add + ?d and ?D. + (gnus-mime-security-show-details-inline): New variable. + (gnus-mime-security-show-details): Use them. + (gnus-insert-mime-security-button): Ditto. + + * mml2015.el (mml2015-gpg-verify): Set details when succeed. + Suggest by Michael Duggan (md5i@cs.cmu.edu). + (mml2015-gpg-clear-verify): Ditto. + (mml2015-gpg-decrypt-1): Ditto. + (mml2015-use): Prefer 'gpg. + 2000-11-30 19:00:00 ShengHuo ZHU * gnus-util.el (gnus-add-text-properties-when): New function. diff --git a/lisp/dgnushack.el b/lisp/dgnushack.el index 5072a5d..1014b5c 100644 --- a/lisp/dgnushack.el +++ b/lisp/dgnushack.el @@ -138,6 +138,19 @@ (load "apel/path-util")) (add-path "apel") (add-path "flim") +(unless (module-installed-p 'mel) + ;; FLIM 1.14 may have installed in two "flim" subdirectories. + (push (expand-file-name "flim" + (file-name-directory (get-latest-path "^apel$" t))) + load-path) + (unless (module-installed-p 'mel) + (error " +FLIM package does not found in %s. +Try to re-configure with --with-addpath=FLIM_PATH and run make again. +" + (progn + (add-path "semi") + load-path)))) (add-path "semi") (push srcdir load-path) diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 6cd3774..6257f5c 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -5667,19 +5667,25 @@ For example: (gnus-cache-update-article (car gnus-article-current) (cdr gnus-article-current)))))))) -(defvar gnus-mime-security-button-line-format "%{%([[%t:%i]]%)%}\n" +(defvar gnus-mime-security-button-line-format "%{%([[%t:%i]%D]%)%}\n" "The following specs can be used: %t The security MIME type -%i Additional info") +%i Additional info +%d Details +%D Details if button is pressed") -(defvar gnus-mime-security-button-end-line-format "%{%([[End of %t]]%)%}\n" +(defvar gnus-mime-security-button-end-line-format "%{%([[End of %t]%D]%)%}\n" "The following specs can be used: %t The security MIME type -%i Additional info") +%i Additional info +%d Details +%D Details if button is pressed") (defvar gnus-mime-security-button-line-format-alist '((?t gnus-tmp-type ?s) - (?i gnus-tmp-info ?s))) + (?i gnus-tmp-info ?s) + (?d gnus-tmp-details ?s) + (?D gnus-tmp-pressed-details ?s))) (defvar gnus-mime-security-button-map (let ((map (make-sparse-keymap))) @@ -5690,6 +5696,11 @@ For example: (defvar gnus-mime-security-details-buffer nil) +(defvar gnus-mime-security-button-pressed nil) + +(defvar gnus-mime-security-show-details-inline t + "If non-nil, show details in the article buffer.") + (defun gnus-mime-security-verify-or-decrypt (handle) (mm-remove-parts (cdr handle)) (let ((region (mm-handle-multipart-ctl-parameter handle 'gnus-region)) @@ -5713,7 +5724,23 @@ For example: (defun gnus-mime-security-show-details (handle) (let ((details (mm-handle-multipart-ctl-parameter handle 'gnus-details))) (if details - (progn + (if gnus-mime-security-show-details-inline + (let ((gnus-mime-security-button-pressed t) + (gnus-mime-security-button-line-format + (get-text-property (point) 'gnus-line-format)) + buffer-read-only) + (forward-char -1) + (while (eq (get-text-property (point) 'gnus-line-format) + gnus-mime-security-button-line-format) + (forward-char -1)) + (forward-char) + (delete-region (point) + (or (text-property-not-all + (point) (point-max) + 'gnus-line-format + gnus-mime-security-button-line-format) + (point-max))) + (gnus-insert-mime-security-button handle)) (if (gnus-buffer-live-p gnus-mime-security-details-buffer) (with-current-buffer gnus-mime-security-details-buffer (erase-buffer) @@ -5744,7 +5771,15 @@ For example: (gnus-tmp-info (or (mm-handle-multipart-ctl-parameter handle 'gnus-info) "Undecided")) + (gnus-tmp-details + (mm-handle-multipart-ctl-parameter handle 'gnus-details)) + gnus-tmp-pressed-details b e) + (setq gnus-tmp-details + (if gnus-tmp-details + (concat "\n" gnus-tmp-details) "")) + (setq gnus-tmp-pressed-details + (if gnus-mime-security-button-pressed gnus-tmp-details "")) (unless (bolp) (insert "\n")) (setq b (point)) @@ -5754,6 +5789,7 @@ For example: `(local-map ,gnus-mime-security-button-map keymap ,gnus-mime-security-button-map gnus-callback gnus-mime-security-press-button + gnus-line-format ,gnus-mime-security-button-line-format article-type annotation gnus-data ,handle)) (setq e (point)) diff --git a/lisp/mml2015.el b/lisp/mml2015.el index 4c67096..b682d89 100644 --- a/lisp/mml2015.el +++ b/lisp/mml2015.el @@ -28,17 +28,18 @@ (eval-when-compile (require 'cl)) (require 'mm-decode) -(defvar mml2015-use (or (progn (ignore-errors - (load "mc-toplev")) - (and (fboundp 'mc-encrypt-generic) - (fboundp 'mc-sign-generic) - (fboundp 'mc-cleanup-recipient-headers) - 'mailcrypt)) - (progn - (ignore-errors - (require 'gpg)) - (and (fboundp 'gpg-sign-detached) - 'gpg))) +(defvar mml2015-use (or + (progn + (ignore-errors + (require 'gpg)) + (and (fboundp 'gpg-sign-detached) + 'gpg)) + (progn (ignore-errors + (load "mc-toplev")) + (and (fboundp 'mc-encrypt-generic) + (fboundp 'mc-sign-generic) + (fboundp 'mc-cleanup-recipient-headers) + 'mailcrypt))) "The package used for PGP/MIME.") ;; Something is not RFC2015. @@ -292,6 +293,7 @@ (eval-and-compile (autoload 'gpg-decrypt "gpg") (autoload 'gpg-verify "gpg") + (autoload 'gpg-verify-cleartext "gpg") (autoload 'gpg-sign-detached "gpg") (autoload 'gpg-sign-encrypt "gpg") (autoload 'gpg-passphrase-read "gpg")) @@ -306,6 +308,10 @@ (prog1 (gpg-decrypt cipher (setq plain (current-buffer)) mml2015-result-buffer nil) + (mm-set-handle-multipart-parameter + mm-security-handle 'gnus-details + (with-current-buffer mml2015-result-buffer + (buffer-string))) (set-buffer cipher) (erase-buffer) (insert-buffer plain))) @@ -313,10 +319,6 @@ ;; Some wrong with the return value, check plain text buffer. (if (> (point-max) (point-min)) '(t) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details - (with-current-buffer mml2015-result-buffer - (buffer-string))) nil)))) (defun mml2015-gpg-decrypt (handle ctl) @@ -355,7 +357,12 @@ (throw 'error handle)) (mm-insert-part part) (unless (condition-case err - (gpg-verify message signature mml2015-result-buffer) + (prog1 + (gpg-verify message signature mml2015-result-buffer) + (mm-set-handle-multipart-parameter + mm-security-handle 'gnus-details + (with-current-buffer mml2015-result-buffer + (buffer-string)))) (error (mm-set-handle-multipart-parameter mm-security-handle 'gnus-details (cadr err)) @@ -365,10 +372,6 @@ mm-security-handle 'gnus-details "Quit.") nil)) (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details - (with-current-buffer mml2015-result-buffer - (buffer-string))) - (mm-set-handle-multipart-parameter mm-security-handle 'gnus-info "Failed") (throw 'error handle))) (mm-set-handle-multipart-parameter @@ -377,7 +380,12 @@ (defun mml2015-gpg-clear-verify () (if (condition-case err - (funcall mml2015-verify-function) + (prog1 + (gpg-verify-cleartext (current-buffer) mml2015-result-buffer) + (mm-set-handle-multipart-parameter + mm-security-handle 'gnus-details + (with-current-buffer mml2015-result-buffer + (buffer-string)))) (error (mm-set-handle-multipart-parameter mm-security-handle 'gnus-details (cadr err)) -- 1.7.10.4