From d709390421bc438bfcf6d24e4f07a51e20c84fa1 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 4 Sep 2006 06:27:27 +0000 Subject: [PATCH] Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 129-130) - Merge from emacs--devo--0 - Update from CVS 2006-09-04 Daiki Ueno * lisp/pgg-gpg.el (pgg-gpg-process-region): Revert two patches from Satyaki Das. http://article.gmane.org/gmane.emacs.gnus.general/49947 http://article.gmane.org/gmane.emacs.gnus.general/50457 2006-09-04 Katsumi Yamaoka * lisp/gnus/rfc2047.el (rfc2047-strip-backslashes-in-quoted-strings): Decode `\\' in quoted string into `\'. Revision: emacs@sv.gnu.org/emacs--devo--0--patch-421 --- lisp/ChangeLog | 6 ++++++ lisp/gnus/ChangeLog | 9 +++++---- lisp/gnus/rfc2047.el | 4 ++-- lisp/pgg-gpg.el | 35 +++++++++++++++++++++-------------- 4 files changed, 34 insertions(+), 20 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8712304b363..9013d010f62 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2006-09-04 Daiki Ueno + + * pgg-gpg.el (pgg-gpg-process-region): Revert two patches from Satyaki + Das. http://article.gmane.org/gmane.emacs.gnus.general/49947 + http://article.gmane.org/gmane.emacs.gnus.general/50457 + 2006-09-03 Chong Yidong * cus-edit.el (custom-group-menu-create): Avoid deactivating the diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 87f00faef76..c46cc3d87f9 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2006-09-04 Katsumi Yamaoka + + * rfc2047.el (rfc2047-strip-backslashes-in-quoted-strings): Decode `\\' + in quoted string into `\'. + 2006-09-01 Katsumi Yamaoka * rfc2047.el (rfc2047-quote-special-characters-in-quoted-strings): @@ -419,10 +424,6 @@ * gnus-sum.el (gnus-get-newsgroup-headers-xover): Group is an optional parameter. -2006-04-07 Reiner Steib - - * pgg-gpg.el: Revert to revision 7.15 to allow the use of gpg-agent. - 2006-04-06 Reiner Steib * gnus-fun.el (gnus): Require it for gnus-directory. diff --git a/lisp/gnus/rfc2047.el b/lisp/gnus/rfc2047.el index dc51a104c2f..cda7979252f 100644 --- a/lisp/gnus/rfc2047.el +++ b/lisp/gnus/rfc2047.el @@ -859,7 +859,7 @@ the decoder will fully decode each encoded-word before concatenating them.") (defun rfc2047-strip-backslashes-in-quoted-strings () - "Strip backslashes in quoted strings. `\\\"' and `\\\\' remain." + "Strip backslashes in quoted strings. `\\\"' remains." (goto-char (point-min)) (let (beg) (with-syntax-table (standard-syntax-table) @@ -874,7 +874,7 @@ them.") (narrow-to-region beg (1- (point))) (goto-char beg) (while (search-forward "\\" nil 'move) - (unless (memq (char-after) '(?\" ?\\)) + (unless (memq (char-after) '(?\")) (delete-backward-char 1)) (forward-char))) (forward-char)) diff --git a/lisp/pgg-gpg.el b/lisp/pgg-gpg.el index ab91471a619..46dbf833311 100644 --- a/lisp/pgg-gpg.el +++ b/lisp/pgg-gpg.el @@ -74,23 +74,27 @@ (errors-buffer pgg-errors-buffer) (orig-mode (default-file-modes)) (process-connection-type nil) - exit-status) + process status exit-status) (with-current-buffer (get-buffer-create errors-buffer) (buffer-disable-undo) (erase-buffer)) (unwind-protect (progn (set-default-file-modes 448) - (let ((coding-system-for-write 'binary) - (input (buffer-substring-no-properties start end)) - (default-enable-multibyte-characters nil)) - (with-temp-buffer - (when passphrase - (insert passphrase "\n")) - (insert input) - (setq exit-status - (apply #'call-process-region (point-min) (point-max) program - nil errors-buffer nil args)))) + (let ((coding-system-for-write 'binary)) + (setq process + (apply #'start-process "*GnuPG*" errors-buffer + program args))) + (set-process-sentinel process #'ignore) + (when passphrase + (process-send-string process (concat passphrase "\n"))) + (process-send-region process start end) + (process-send-eof process) + (while (eq 'run (process-status process)) + (accept-process-output process 5)) + (setq status (process-status process) + exit-status (process-exit-status process)) + (delete-process process) (with-current-buffer (get-buffer-create output-buffer) (buffer-disable-undo) (erase-buffer) @@ -100,9 +104,12 @@ 'binary))) (insert-file-contents output-file-name))) (set-buffer errors-buffer) - (if (not (equal exit-status 0)) - (insert (format "\n%s exited abnormally: '%s'\n" - program exit-status))))) + (if (memq status '(stop signal)) + (error "%s exited abnormally: '%s'" program exit-status)) + (if (= 127 exit-status) + (error "%s could not be found" program)))) + (if (and process (eq 'run (process-status process))) + (interrupt-process process)) (if (file-exists-p output-file-name) (delete-file output-file-name)) (set-default-file-modes orig-mode)))) -- 2.39.2