From: Miles Bader Date: Tue, 5 Sep 2006 08:17:35 +0000 (+0000) Subject: Merge from gnus--rel--5.10 X-Git-Tag: emacs-pretest-22.0.90~758 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8fbdffe57a11cb95aa620a3a34b4bbe25219218d;p=emacs.git Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 131-133) - Update from CVS 2006-09-05 Daiki Ueno * lisp/pgg.el (pgg-clear-string): Alias to clear-string for backward compatibility. * lisp/pgg-gpg.el (pgg-gpg-process-region): Avoid display blinking with inhibit-redisplay; encode passphrase with locale-coding-system. 2006-09-04 Katsumi Yamaoka * lisp/gnus/gnus-art.el (article-decode-encoded-words): Make it fast. 2006-09-04 Katsumi Yamaoka * lisp/gnus/gnus-art.el (article-decode-encoded-words): Don't infloop in XEmacs. Revision: emacs@sv.gnu.org/emacs--devo--0--patch-424 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index be5a4d872de..f9cb36ca901 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2006-09-05 Daiki Ueno + + * pgg.el (pgg-clear-string): Alias to clear-string for backward + compatibility. + + * pgg-gpg.el (pgg-gpg-process-region): Avoid display blinking with + inhibit-redisplay; encode passphrase with locale-coding-system. + 2006-09-04 Dan Nicolaescu * term/xterm.el (terminal-init-xterm): Add more C-M- bindings. diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 81d566fc856..25a7ff4c29a 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -5,6 +5,12 @@ 2006-09-04 Katsumi Yamaoka + * gnus-art.el (article-decode-encoded-words): Make it fast. + +2006-09-04 Katsumi Yamaoka + + * gnus-art.el (article-decode-encoded-words): Don't infloop in XEmacs. + * rfc2047.el (rfc2047-strip-backslashes-in-quoted-strings): Decode `\\' in quoted string into `\'. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 17cbbeb0a75..7690d533cc8 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -2381,22 +2381,23 @@ If PROMPT (the prefix), prompt for a coding system to use." (error)) gnus-newsgroup-ignored-charsets)) (inhibit-read-only t) - start) - (save-restriction - (article-narrow-to-head) - (while (not (eobp)) - (setq start (point)) - (if (prog1 - (looking-at "\ + end start) + (goto-char (point-min)) + (when (search-forward "\n\n" nil 'move) + (forward-line -1)) + (setq end (point)) + (while (not (bobp)) + (while (progn + (forward-line -1) + (and (not (bobp)) + (memq (char-after) '(?\t ? ))))) + (setq start (point)) + (if (looking-at "\ \\(?:Resent-\\)?\\(?:From\\|Cc\\|To\\|Bcc\\|\\(?:In-\\)?Reply-To\\|Sender\ \\|Mail-Followup-To\\|Mail-Copies-To\\|Approved\\):") - (while (progn - (forward-line) - (if (eobp) - nil - (memq (char-after) '(?\t ? )))))) - (funcall gnus-decode-address-function start (point)) - (funcall gnus-decode-header-function start (point))))))) + (funcall gnus-decode-address-function start end) + (funcall gnus-decode-header-function start end)) + (goto-char (setq end start))))) (defun article-decode-group-name () "Decode group names in `Newsgroups:'." diff --git a/lisp/pgg-gpg.el b/lisp/pgg-gpg.el index 46dbf833311..07be6c47f61 100644 --- a/lisp/pgg-gpg.el +++ b/lisp/pgg-gpg.el @@ -74,7 +74,10 @@ (errors-buffer pgg-errors-buffer) (orig-mode (default-file-modes)) (process-connection-type nil) - process status exit-status) + (inhibit-redisplay t) + process status exit-status + passphrase-with-newline + encoded-passphrase-with-new-line) (with-current-buffer (get-buffer-create errors-buffer) (buffer-disable-undo) (erase-buffer)) @@ -87,7 +90,16 @@ program args))) (set-process-sentinel process #'ignore) (when passphrase - (process-send-string process (concat passphrase "\n"))) + (setq passphrase-with-newline (concat passphrase "\n")) + (if (boundp 'locale-coding-system) + (progn + (setq encoded-passphrase-with-new-line + (encode-coding-string passphrase-with-newline + locale-coding-system)) + (pgg-clear-string passphrase-with-newline)) + (setq encoded-passphrase-with-new-line passphrase-with-newline + passphrase-with-newline nil)) + (process-send-string process encoded-passphrase-with-new-line)) (process-send-region process start end) (process-send-eof process) (while (eq 'run (process-status process)) @@ -108,6 +120,10 @@ (error "%s exited abnormally: '%s'" program exit-status)) (if (= 127 exit-status) (error "%s could not be found" program)))) + (if passphrase-with-newline + (pgg-clear-string passphrase-with-newline)) + (if encoded-passphrase-with-new-line + (pgg-clear-string encoded-passphrase-with-new-line)) (if (and process (eq 'run (process-status process))) (interrupt-process process)) (if (file-exists-p output-file-name) diff --git a/lisp/pgg.el b/lisp/pgg.el index 7a30dafce8d..e8a85b58fae 100644 --- a/lisp/pgg.el +++ b/lisp/pgg.el @@ -148,6 +148,11 @@ regulate cache behavior." #'pgg-remove-passphrase-from-cache key notruncate)))) +(if (fboundp 'clear-string) + (defalias 'pgg-clear-string 'clear-string) + (defun pgg-clear-string (string) + (fillarray string ?_))) + (defun pgg-remove-passphrase-from-cache (key &optional notruncate) "Omit passphrase associated with KEY in time-limited passphrase cache. @@ -166,7 +171,7 @@ regulate cache behavior." (interned-timer-key (intern-soft key pgg-pending-timers)) (old-timer (symbol-value interned-timer-key))) (when passphrase - (fillarray passphrase ?_) + (pgg-clear-string passphrase) (unintern key pgg-passphrase-cache)) (when old-timer (pgg-cancel-timer old-timer)