From: Katsumi Yamaoka Date: Mon, 10 Dec 2007 02:17:07 +0000 (+0000) Subject: * gnus-art.el (gnus-article-browse-html-parts): Decode CTE. X-Git-Url: http://cgit.sxemacs.org/?a=commitdiff_plain;h=ecdd500affc56e6330e3a06883235171d0a454da;p=gnus * gnus-art.el (gnus-article-browse-html-parts): Decode CTE. * pgg.el (pgg-run-at-time, pgg-cancel-timer): Use eval-and-compile. * lpath.el: Fbind run-mode-hooks for Emacs 21; bind show-trailing-whitespace for XEmacs. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6aab931ba..9c49614d0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2007-12-10 Katsumi Yamaoka + + * gnus-art.el (gnus-article-browse-html-parts): Decode CTE. + + * pgg.el (pgg-run-at-time, pgg-cancel-timer): Use eval-and-compile. + + * lpath.el: Fbind run-mode-hooks for Emacs 21; + bind show-trailing-whitespace for XEmacs. + 2007-12-09 Reiner Steib * hashcash.el, imap.el, pgg.el, pgg-parse.el (declare-function): Add diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index d8f03ff2c..8718ac4fe 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -2817,28 +2817,23 @@ Recurse into multiparts." (if charset ;; Add a meta html tag to specify charset. (mm-with-unibyte-buffer - (insert (with-current-buffer (mm-handle-buffer handle) - (if (eq charset 'gnus-decoded) - (mm-encode-coding-string - (buffer-string) - (setq charset 'utf-8)) - (buffer-string)))) - (setq charset (format "\ -" - charset)) + (insert + (if (eq charset 'gnus-decoded) + (mm-encode-coding-string (mm-get-part handle) + (setq charset 'utf-8)) + (mm-get-part handle))) (goto-char (point-min)) (let ((case-fold-search t)) - (cond (;; Don't modify existing meta tag. - (re-search-forward "\ -]+>" - nil t)) - ((re-search-forward "[\t\n\r ]*" nil t) - (insert charset "\n")) - (t - (re-search-forward "\ -]+\\|[\t\n\r ]*\\)>[\t\n\r ]*" - nil t) - (insert "\n" charset "\n\n")))) + (if (re-search-forward "\ +]+>" nil t) + nil ;; Don't modify existing meta tag. + (setq charset (format "\ +" charset)) + (if (re-search-forward "[\t\n\r ]*" nil t) + (insert charset "\n") + (re-search-forward "\ +]+\\|[\t\n\r ]*\\)>[\t\n\r ]*" nil t) + (insert "\n" charset "\n\n")))) (mm-write-region (point-min) (point-max) tmp-file nil nil nil 'binary t)) (mm-save-part-to-file handle tmp-file)) diff --git a/lisp/lpath.el b/lisp/lpath.el index 5e3b20527..22470dcfc 100644 --- a/lisp/lpath.el +++ b/lisp/lpath.el @@ -48,16 +48,16 @@ gnus-agent-expire-current-dirs anguage-info-alist line-spacing mark-active mouse-selection-click-count mouse-selection-click-count-buffer pgg-parse-crc24 - temporary-file-directory timer-list tool-bar-mode - transient-mark-mode))) + show-trailing-whitespace temporary-file-directory + timer-list tool-bar-mode transient-mark-mode))) (maybe-fbind '(bbdb-complete-name delete-annotation delete-extent device-connection dfw-device events-to-keys find-face font-lock-set-defaults frame-device get-char-table glyph-height glyph-width ldap-search-entries mail-aliases-setup make-annotation make-event make-glyph map-extents message-xmas-redefine put-char-table - set-extent-property set-itimer-function temp-directory - valid-image-instantiator-format-p + run-mode-hooks set-extent-property set-itimer-function + temp-directory valid-image-instantiator-format-p w3-coding-system-for-mime-charset w3-do-setup w3-prepare-buffer w3-region window-pixel-height window-pixel-width)) diff --git a/lisp/pgg.el b/lisp/pgg.el index 74b6ed7cb..26911974e 100644 --- a/lisp/pgg.el +++ b/lisp/pgg.el @@ -42,12 +42,10 @@ ;;; (eval-when-compile - (unless (featurep 'xemacs) - (defalias 'pgg-run-at-time 'run-at-time) - (defalias 'pgg-cancel-timer 'cancel-timer)) - - (when (featurep 'xemacs) - (defmacro pgg-run-at-time-1 (time repeat function args) + ;; Define it as a null macro for Emacs in order to suppress a byte + ;; compile warning that Emacs 21 issues. + (defmacro pgg-run-at-time-1 (time repeat function args) + (when (featurep 'xemacs) (if (condition-case nil (let ((delete-itimer 'delete-itimer) (itimer-driver-start 'itimer-driver-start) @@ -105,19 +103,23 @@ itimer (append (list itimer function) args))))) 1e-9 (if time (max time 1e-9) 1e-9) - nil t itimers ,repeat ,function ,args)))) + nil t itimers ,repeat ,function ,args)))))) - (defun pgg-run-at-time (time repeat function &rest args) - "Emulating function run as `run-at-time'. +(eval-and-compile + (if (featurep 'xemacs) + (progn + (defun pgg-run-at-time (time repeat function &rest args) + "Emulating function run as `run-at-time'. TIME should be nil meaning now, or a number of seconds from now. Return an itimer object which can be used in either `delete-itimer' or `cancel-timer'." - (pgg-run-at-time-1 time repeat function args)) - (defun pgg-cancel-timer (timer) - "Emulate cancel-timer for xemacs." - (let ((delete-itimer 'delete-itimer)) - (funcall delete-itimer timer))) - )) + (pgg-run-at-time-1 time repeat function args)) + (defun pgg-cancel-timer (timer) + "Emulate cancel-timer for xemacs." + (let ((delete-itimer 'delete-itimer)) + (funcall delete-itimer timer)))) + (defalias 'pgg-run-at-time 'run-at-time) + (defalias 'pgg-cancel-timer 'cancel-timer))) (defun pgg-invoke (func scheme &rest args) (progn