changeset 108288:89e25734c87b

Synch with Gnus trunk. * mail/binhex.el (binhex-decode-region-internal) * mail/uudecode.el (uudecode-decode-region-internal) * net/dns.el (dns-read-string-name, dns-write, dns-read) (dns-read-type, dns-query) * pgg-parse.el (pgg-parse-armor) * pgg.el (pgg-verify-region) * sha1.el (sha1-string-external): Don't run set-buffer-multibyte for XEmacs. * net/imap.el (imap-disable-multibyte): Redefine them as a macro. * nnweb.el (nnweb-gmane-search) * yenc.el (yenc-decode-region): Don't run set-buffer-multibyte for XEmacs. * gnus-art.el (gnus-article-browse-html-parts) * gnus-group.el (gnus-read-ephemeral-gmane-group) (gnus-read-ephemeral-bug-grou): Use mm-make-temp-file instead of make-temp-file. * gnus-dired.el (gnus-dired-mode): Bind gnus-dired-mode-hook, gnus-dired-mode-on-hook and gnus-dired-mode-off-hook for XEmacs when compiling. * gnus-ml.el (gnus-mailing-list-mode): Bind gnus-mailing-list-mode-hook, gnus-mailing-list-mode-on-hook and gnus-mailing-list-mode-off-hook for XEmacs when compiling. * gnus-salt.el (gnus-pick-mode): Bind gnus-pick-mode-on-hook and gnus-pick-mode-off-hook for XEmacs when compiling. (gnus-binary-mode): Bind gnus-binary-mode-on-hook and gnus-binary-mode-off-hook for XEmacs when compiling. * gnus-sum.el (gnus-summary-limit-strange-charsets-predicate): Return nil if char-charset is not available. * sieve-manage.el (sieve-manage-disable-multibyte): Redefine them as a macro. * mm-url.el (mm-url-form-encode-xwfu): Use mm-encode-coding-string instead of encode-coding-string. * mm-util.el (mm-enable-multibyte, mm-disable-multibyte): Use (featurep 'xemacs) instead of mm-emacs-mule to switch function definitions. (mm-with-unibyte-current-buffer): Make it a progn macro for XEmacs.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Fri, 07 May 2010 07:01:10 +0000
parents d951d5810160 (current diff) c0d13767677a (diff)
children c5156d99ad78 00d26519e57d
files
diffstat 20 files changed, 139 insertions(+), 67 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/ChangeLog	Fri May 07 07:01:10 2010 +0000
@@ -1,3 +1,16 @@
+2010-05-07  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* mail/binhex.el (binhex-decode-region-internal)
+	* mail/uudecode.el (uudecode-decode-region-internal)
+	* net/dns.el (dns-read-string-name, dns-write, dns-read)
+	(dns-read-type, dns-query)
+	* pgg-parse.el (pgg-parse-armor)
+	* pgg.el (pgg-verify-region)
+	* sha1.el (sha1-string-external): Don't run set-buffer-multibyte for
+	XEmacs.
+
+	* net/imap.el (imap-disable-multibyte): Redefine them as a macro.
+
 2010-05-07  Juanma Barranquero  <lekktu@gmail.com>
 
 	* progmodes/cperl-mode.el (cperl-mode-unload-function): New function.
--- a/lisp/gnus/ChangeLog	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/gnus/ChangeLog	Fri May 07 07:01:10 2010 +0000
@@ -1,3 +1,40 @@
+2010-05-07  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* nnweb.el (nnweb-gmane-search)
+	* yenc.el (yenc-decode-region): Don't run set-buffer-multibyte for
+	XEmacs.
+
+	* gnus-art.el (gnus-article-browse-html-parts)
+	* gnus-group.el (gnus-read-ephemeral-gmane-group)
+	(gnus-read-ephemeral-bug-grou): Use mm-make-temp-file instead of
+	make-temp-file.
+
+	* gnus-dired.el (gnus-dired-mode): Bind gnus-dired-mode-hook,
+	gnus-dired-mode-on-hook and gnus-dired-mode-off-hook for XEmacs when
+	compiling.
+
+	* gnus-ml.el (gnus-mailing-list-mode): Bind gnus-mailing-list-mode-hook,
+	gnus-mailing-list-mode-on-hook and gnus-mailing-list-mode-off-hook for
+	XEmacs when compiling.
+
+	* gnus-salt.el (gnus-pick-mode): Bind gnus-pick-mode-on-hook and
+	gnus-pick-mode-off-hook for XEmacs when compiling.
+	(gnus-binary-mode): Bind gnus-binary-mode-on-hook and
+	gnus-binary-mode-off-hook for XEmacs when compiling.
+
+	* gnus-sum.el (gnus-summary-limit-strange-charsets-predicate): Return
+	nil if char-charset is not available.
+
+	* sieve-manage.el (sieve-manage-disable-multibyte): Redefine them as a
+	macro.
+
+	* mm-url.el (mm-url-form-encode-xwfu): Use mm-encode-coding-string
+	instead of encode-coding-string.
+
+	* mm-util.el (mm-enable-multibyte, mm-disable-multibyte): Use (featurep
+	'xemacs) instead of mm-emacs-mule to switch function definitions.
+	(mm-with-unibyte-current-buffer): Make it a progn macro for XEmacs.
+
 2010-05-06  Tommi Vainikainen  <thv@iki.fi>  (tiny change)
 
 	* mml-sec.el (mml-secure-message-sign): Fix cut and paste error.
--- a/lisp/gnus/gnus-art.el	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/gnus/gnus-art.el	Fri May 07 07:01:10 2010 +0000
@@ -2897,7 +2897,7 @@
 <img[\t\n ]+\\(?:[^\t\n >]+[\t\n ]+\\)*src=\"\\(cid:\\([^\"]+\\)\\)\""
 					   nil t)
 		   (unless cid-dir
-		     (setq cid-dir (make-temp-file "cid" t))
+		     (setq cid-dir (mm-make-temp-file "cid" t))
 		     (add-to-list 'gnus-article-browse-html-temp-list cid-dir))
 		   (setq file nil
 			 content nil)
--- a/lisp/gnus/gnus-dired.el	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/gnus/gnus-dired.el	Fri May 07 07:01:10 2010 +0000
@@ -87,6 +87,12 @@
 			       gnus-user-agent)
 		(function :tag "Other")))
 
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (defvar gnus-dired-mode-hook)
+    (defvar gnus-dired-mode-on-hook)
+    (defvar gnus-dired-mode-off-hook)))
+
 (define-minor-mode gnus-dired-mode
   "Minor mode for intersections of gnus and dired.
 
--- a/lisp/gnus/gnus-group.el	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/gnus/gnus-group.el	Fri May 07 07:01:10 2010 +0000
@@ -2364,7 +2364,7 @@
   (unless range (setq range 500))
   (when (< range 1)
     (error "Invalid range: %s" range))
-  (let ((tmpfile (make-temp-file
+  (let ((tmpfile (mm-make-temp-file
 		  (format "%s.start-%s.range-%s." group start range)))
 	(gnus-thread-sort-functions '(gnus-thread-sort-by-number)))
     (with-temp-file tmpfile
@@ -2445,7 +2445,7 @@
 		     (cdr (assoc 'emacs gnus-bug-group-download-format-alist))))
   (when (stringp number)
     (setq number (string-to-number number)))
-  (let ((tmpfile (make-temp-file "gnus-temp-group-")))
+  (let ((tmpfile (mm-make-temp-file "gnus-temp-group-")))
     (with-temp-file tmpfile
       (url-insert-file-contents (format mbox-url number))
       (write-region (point-min) (point-max) tmpfile)
--- a/lisp/gnus/gnus-ml.el	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/gnus/gnus-ml.el	Fri May 07 07:01:10 2010 +0000
@@ -85,6 +85,12 @@
 	  (gnus-mailing-list-mode 1))
       (gnus-message 1 "no list-post in this message."))))
 
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (defvar gnus-mailing-list-mode-hook)
+    (defvar gnus-mailing-list-mode-on-hook)
+    (defvar gnus-mailing-list-mode-off-hook)))
+
 ;;;###autoload
 (define-minor-mode gnus-mailing-list-mode
   "Minor mode for providing mailing-list commands.
--- a/lisp/gnus/gnus-salt.el	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/gnus/gnus-salt.el	Fri May 07 07:01:10 2010 +0000
@@ -101,6 +101,11 @@
 	["Start reading" gnus-pick-start-reading t]
 	["Switch pick mode off" gnus-pick-mode gnus-pick-mode]))))
 
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (defvar gnus-pick-mode-on-hook)
+    (defvar gnus-pick-mode-off-hook)))
+
 (define-minor-mode gnus-pick-mode
   "Minor mode for providing a pick-and-read interface in Gnus summary buffers.
 
@@ -332,6 +337,11 @@
       '("Pick"
 	["Switch binary mode off" gnus-binary-mode t]))))
 
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (defvar gnus-binary-mode-on-hook)
+    (defvar gnus-binary-mode-off-hook)))
+
 (define-minor-mode gnus-binary-mode
   "Minor mode for providing a binary group interface in Gnus summary buffers."
   :lighter " Binary" :keymap gnus-binary-mode-map
--- a/lisp/gnus/gnus-sum.el	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/gnus/gnus-sum.el	Fri May 07 07:01:10 2010 +0000
@@ -8185,14 +8185,15 @@
       (gnus-summary-position-point))))
 
 (defun gnus-summary-limit-strange-charsets-predicate (header)
-  (let ((string (concat (mail-header-subject header)
-			(mail-header-from header)))
-	charset found)
-    (dotimes (i (1- (length string)))
-      (setq charset (format "%s" (char-charset (aref string (1+ i)))))
-      (when (string-match "unicode\\|big\\|japanese" charset)
-	(setq found t)))
-    found))
+  (when (fboundp 'char-charset)
+    (let ((string (concat (mail-header-subject header)
+			  (mail-header-from header)))
+	  charset found)
+      (dotimes (i (1- (length string)))
+	(setq charset (format "%s" (char-charset (aref string (1+ i)))))
+	(when (string-match "unicode\\|big\\|japanese" charset)
+	  (setq found t)))
+      found)))
 
 (defun gnus-summary-limit-to-predicate (predicate)
   "Limit to articles where PREDICATE returns non-nil.
--- a/lisp/gnus/mm-url.el	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/gnus/mm-url.el	Fri May 07 07:01:10 2010 +0000
@@ -404,14 +404,10 @@
       ((= char ?  ) "+")
       ((memq char mm-url-unreserved-chars) (char-to-string char))
       (t (upcase (format "%%%02x" char)))))
-   ;; Fixme: Should this actually be accepting multibyte?  Is there a
-   ;; better way in XEmacs?
-   (if (featurep 'mule)
-       (encode-coding-string chunk
-			     (if (fboundp 'find-coding-systems-string)
-				 (car (find-coding-systems-string chunk))
-				 buffer-file-coding-system))
-     chunk)
+   (mm-encode-coding-string chunk
+			    (if (fboundp 'find-coding-systems-string)
+				(car (find-coding-systems-string chunk))
+			      buffer-file-coding-system))
    ""))
 
 (defun mm-url-encode-www-form-urlencoded (pairs)
--- a/lisp/gnus/mm-util.el	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/gnus/mm-util.el	Fri May 07 07:01:10 2010 +0000
@@ -908,20 +908,20 @@
 			     (fboundp 'set-buffer-multibyte))
     "True in Emacs with Mule.")
 
-  (if mm-emacs-mule
-      (defun mm-enable-multibyte ()
-	"Set the multibyte flag of the current buffer.
+  (if (featurep 'xemacs)
+      (defalias 'mm-enable-multibyte 'ignore)
+    (defun mm-enable-multibyte ()
+      "Set the multibyte flag of the current buffer.
 Only do this if the default value of `enable-multibyte-characters' is
 non-nil.  This is a no-op in XEmacs."
-	(set-buffer-multibyte 'to))
-    (defalias 'mm-enable-multibyte 'ignore))
+      (set-buffer-multibyte t)))
 
-  (if mm-emacs-mule
-      (defun mm-disable-multibyte ()
-	"Unset the multibyte flag of in the current buffer.
+  (if (featurep 'xemacs)
+      (defalias 'mm-disable-multibyte 'ignore)
+    (defun mm-disable-multibyte ()
+      "Unset the multibyte flag of in the current buffer.
 This is a no-op in XEmacs."
-	(set-buffer-multibyte nil))
-    (defalias 'mm-disable-multibyte 'ignore)))
+      (set-buffer-multibyte nil))))
 
 (defun mm-preferred-coding-system (charset)
   ;; A typo in some Emacs versions.
@@ -1239,22 +1239,24 @@
 harmful since it is likely to modify existing data in the buffer.
 For instance, it converts \"\\300\\255\" into \"\\255\" in
 Emacs 23 (unicode)."
-  ;; FIXME: (default-value 'enable-multibyte-characters) is read-only
-  ;; so let-binding it is wrong.  The right fix is to not use this
-  ;; macro at all any more, since it's been ill-defined from the start.
-  (let ((multibyte (make-symbol "multibyte"))
-	(buffer (make-symbol "buffer")))
-    `(if mm-emacs-mule
-	 (let ((,multibyte enable-multibyte-characters)
-	       (,buffer (current-buffer)))
-	   (unwind-protect
-	       (letf (((default-value 'enable-multibyte-characters) nil))
-		 (set-buffer-multibyte nil)
-		 ,@forms)
-	     (set-buffer ,buffer)
-	     (set-buffer-multibyte ,multibyte)))
-       (letf (((default-value 'enable-multibyte-characters) nil))
-	 ,@forms))))
+  (if (featurep 'xemacs)
+      `(progn ,@forms)
+    ;; FIXME: (default-value 'enable-multibyte-characters) is read-only
+    ;; so let-binding it is wrong.  The right fix is to not use this
+    ;; macro at all any more, since it's been ill-defined from the start.
+    (let ((multibyte (make-symbol "multibyte"))
+	  (buffer (make-symbol "buffer")))
+      `(if mm-emacs-mule
+	   (let ((,multibyte enable-multibyte-characters)
+		 (,buffer (current-buffer)))
+	     (unwind-protect
+		 (letf (((default-value 'enable-multibyte-characters) nil))
+		       (set-buffer-multibyte nil)
+		       ,@forms)
+	       (set-buffer ,buffer)
+	       (set-buffer-multibyte ,multibyte)))
+	 (letf (((default-value 'enable-multibyte-characters) nil))
+	       ,@forms)))))
 (put 'mm-with-unibyte-current-buffer 'lisp-indent-function 0)
 (put 'mm-with-unibyte-current-buffer 'edebug-form-spec '(body))
 
--- a/lisp/gnus/nnweb.el	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/gnus/nnweb.el	Fri May 07 07:01:10 2010 +0000
@@ -525,7 +525,7 @@
        ;;("TOPDOC" . "1000")
        ))))
   (setq buffer-file-name nil)
-  (set-buffer-multibyte t)
+  (unless (featurep 'xemacs) (set-buffer-multibyte t))
   (mm-decode-coding-region (point-min) (point-max) 'utf-8)
   t)
 
--- a/lisp/gnus/sieve-manage.el	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/gnus/sieve-manage.el	Fri May 07 07:01:10 2010 +0000
@@ -191,10 +191,10 @@
 
 ;; Internal utility functions
 
-(defsubst sieve-manage-disable-multibyte ()
+(defmacro sieve-manage-disable-multibyte ()
   "Enable multibyte in the current buffer."
-  (when (fboundp 'set-buffer-multibyte)
-    (set-buffer-multibyte nil)))
+  (unless (featurep 'xemacs)
+    '(set-buffer-multibyte nil)))
 
 (declare-function password-read         "password-cache" (prompt &optional key))
 (declare-function password-cache-add    "password-cache" (key password))
--- a/lisp/gnus/yenc.el	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/gnus/yenc.el	Fri May 07 07:01:10 2010 +0000
@@ -89,9 +89,9 @@
 	      (when (re-search-forward "^=yend.*$" end t)
 		(setq last (match-beginning 0))
 		(setq footer-alist (yenc-parse-line (match-string 0)))
-                (with-current-buffer
-                    (setq work-buffer (generate-new-buffer " *yenc-work*"))
-                  (set-buffer-multibyte nil))
+		(setq work-buffer (generate-new-buffer " *yenc-work*"))
+		(unless (featurep 'xemacs)
+		  (with-current-buffer work-buffer (set-buffer-multibyte nil)))
 		(while (< first last)
 		  (setq char (char-after first))
 		  (cond ((or (eq char ?\r)
--- a/lisp/mail/binhex.el	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/mail/binhex.el	Fri May 07 07:01:10 2010 +0000
@@ -221,7 +221,8 @@
 	  (goto-char start)
 	  (when (re-search-forward binhex-begin-line end t)
             (setq work-buffer (generate-new-buffer " *binhex-work*"))
-            (with-current-buffer work-buffer (set-buffer-multibyte nil))
+	    (unless (featurep 'xemacs)
+	      (with-current-buffer work-buffer (set-buffer-multibyte nil)))
 	    (beginning-of-line)
 	    (setq bits 0 counter 0)
 	    (while tmp
--- a/lisp/mail/uudecode.el	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/mail/uudecode.el	Fri May 07 07:01:10 2010 +0000
@@ -216,7 +216,7 @@
 	  (skip-chars-forward non-data-chars end))
 	(if file-name
             (with-temp-file file-name
-              (set-buffer-multibyte nil)
+              (unless (featurep 'xemacs) (set-buffer-multibyte nil))
               (insert (apply 'concat (nreverse result))))
 	  (or (markerp end) (setq end (set-marker (make-marker) end)))
 	  (goto-char start)
--- a/lisp/net/dns.el	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/net/dns.el	Fri May 07 07:01:10 2010 +0000
@@ -101,7 +101,7 @@
 
 (defun dns-read-string-name (string buffer)
   (with-temp-buffer
-    (set-buffer-multibyte nil)
+    (unless (featurep 'xemacs) (set-buffer-multibyte nil))
     (insert string)
     (goto-char (point-min))
     (dns-read-name buffer)))
@@ -135,7 +135,7 @@
   "Write a DNS packet according to SPEC.
 If TCP-P, the first two bytes of the package with be the length field."
   (with-temp-buffer
-    (set-buffer-multibyte nil)
+    (unless (featurep 'xemacs) (set-buffer-multibyte nil))
     (dns-write-bytes (dns-get 'id spec) 2)
     (dns-write-bytes
      (logior
@@ -186,7 +186,7 @@
 
 (defun dns-read (packet)
   (with-temp-buffer
-    (set-buffer-multibyte nil)
+    (unless (featurep 'xemacs) (set-buffer-multibyte nil))
     (let ((spec nil)
           queries answers authorities additionals)
       (insert packet)
@@ -263,7 +263,7 @@
 	(point (point)))
     (prog1
         (with-temp-buffer
-          (set-buffer-multibyte nil)
+	  (unless (featurep 'xemacs) (set-buffer-multibyte nil))
           (insert string)
           (goto-char (point-min))
           (cond
@@ -391,7 +391,7 @@
   (if (not dns-servers)
       (message "No DNS server configuration found")
     (with-temp-buffer
-      (set-buffer-multibyte nil)
+      (unless (featurep 'xemacs) (set-buffer-multibyte nil))
       (let ((process (condition-case ()
                          (dns-make-network-process (car dns-servers))
                        (error
--- a/lisp/net/imap.el	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/net/imap.el	Fri May 07 07:01:10 2010 +0000
@@ -475,10 +475,10 @@
       (setcdr alist (imap-remassoc key (cdr alist)))
       alist)))
 
-(defsubst imap-disable-multibyte ()
+(defmacro imap-disable-multibyte ()
   "Enable multibyte in the current buffer."
-  (when (fboundp 'set-buffer-multibyte)
-    (set-buffer-multibyte nil)))
+  (unless (featurep 'xemacs)
+    '(set-buffer-multibyte nil)))
 
 (defsubst imap-utf7-encode (string)
   (if imap-use-utf7
--- a/lisp/pgg-parse.el	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/pgg-parse.el	Fri May 07 07:01:10 2010 +0000
@@ -503,8 +503,8 @@
 (defun pgg-parse-armor (string)
   (with-temp-buffer
     (buffer-disable-undo)
-    (if (fboundp 'set-buffer-multibyte)
-	(set-buffer-multibyte nil))
+    (unless (featurep 'xemacs)
+      (set-buffer-multibyte nil))
     (insert string)
     (pgg-decode-armor-region (point-min)(point))))
 
--- a/lisp/pgg.el	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/pgg.el	Fri May 07 07:01:10 2010 +0000
@@ -475,8 +475,8 @@
 	  (if (null signature) nil
 	    (with-temp-buffer
 	      (buffer-disable-undo)
-	      (if (fboundp 'set-buffer-multibyte)
-		  (set-buffer-multibyte nil))
+	      (unless (featurep 'xemacs)
+		(set-buffer-multibyte nil))
 	      (insert-file-contents signature)
 	      (cdr (assq 2 (pgg-decode-armor-region
 			    (point-min)(point-max)))))))
--- a/lisp/sha1.el	Fri May 07 05:21:06 2010 +0200
+++ b/lisp/sha1.el	Fri May 07 07:01:10 2010 +0000
@@ -95,7 +95,7 @@
       (setq prog sha1-program
 	    args nil))
     (with-temp-buffer
-      (set-buffer-multibyte nil)
+      (unless (featurep 'xemacs) (set-buffer-multibyte nil))
       (insert string)
       (apply (function call-process-region)
 	     (point-min) (point-max)