* gnus-art.el (gnus-article-browse-html-parts): Decode CTE.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 10 Dec 2007 02:17:07 +0000 (02:17 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 10 Dec 2007 02:17:07 +0000 (02:17 +0000)
* 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.

lisp/ChangeLog
lisp/gnus-art.el
lisp/lpath.el
lisp/pgg.el

index 6aab931..9c49614 100644 (file)
@@ -1,3 +1,12 @@
+2007-12-10  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * 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  <Reiner.Steib@gmx.de>
 
        * hashcash.el, imap.el, pgg.el, pgg-parse.el (declare-function): Add
index d8f03ff..8718ac4 100644 (file)
@@ -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 "\
-<meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">"
-                                            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 "\
-<meta[\t\n\r ]+http-equiv=\"content-type\"[^>]+>"
-                                                  nil t))
-                              ((re-search-forward "<head>[\t\n\r ]*" nil t)
-                               (insert charset "\n"))
-                              (t
-                               (re-search-forward "\
-<html\\(?:[\t\n\r ]+[^>]+\\|[\t\n\r ]*\\)>[\t\n\r ]*"
-                                                  nil t)
-                               (insert "<head>\n" charset "\n</head>\n"))))
+                        (if (re-search-forward "\
+<meta[\t\n\r ]+http-equiv=\"content-type\"[^>]+>" nil t)
+                            nil ;; Don't modify existing meta tag.
+                          (setq charset (format "\
+<meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">" charset))
+                          (if (re-search-forward "<head>[\t\n\r ]*" nil t)
+                              (insert charset "\n")
+                            (re-search-forward "\
+<html\\(?:[\t\n\r ]+[^>]+\\|[\t\n\r ]*\\)>[\t\n\r ]*" nil t)
+                            (insert "<head>\n" charset "\n</head>\n"))))
                       (mm-write-region (point-min) (point-max)
                                        tmp-file nil nil nil 'binary t))
                   (mm-save-part-to-file handle tmp-file))
index 5e3b205..22470dc 100644 (file)
                    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))
index 74b6ed7..2691197 100644 (file)
 ;;;
 
 (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)
                        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