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.
This commit is contained in:
Katsumi Yamaoka 2010-05-07 06:58:17 +00:00
parent 40ab7974b5
commit 765d43190e
20 changed files with 139 additions and 67 deletions

View file

@ -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.

View file

@ -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.

View file

@ -2897,7 +2897,7 @@ message header will be added to the bodies of the \"text/html\" parts."
<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)

View file

@ -87,6 +87,12 @@ See `mail-user-agent' for more information."
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.

View file

@ -2364,7 +2364,7 @@ specified by `gnus-gmane-group-download-format'."
(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 @@ the bug number, and browsing the URL must return mbox output."
(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)

View file

@ -85,6 +85,12 @@ If FORCE is non-nil, replace the old ones."
(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.

View file

@ -101,6 +101,11 @@ It accepts the same format specs that `gnus-summary-line-format' does."
["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 @@ This must be bound to a button-down mouse event."
'("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

View file

@ -8185,14 +8185,15 @@ in `nnmail-extra-headers'."
(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.

View file

@ -404,14 +404,10 @@ spaces. Die Die Die."
((= 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)

View file

@ -908,20 +908,20 @@ mail with multiple parts is preferred to sending a Unicode one.")
(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 @@ worth using this macro in unibyte buffers of course). Use of
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))

View file

@ -525,7 +525,7 @@ Valid types include `google', `dejanews', and `gmane'.")
;;("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)

View file

@ -191,10 +191,10 @@ Valid states are `closed', `initial', `nonauth', and `auth'.")
;; 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))

View file

@ -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)

View file

@ -221,7 +221,8 @@ If HEADER-ONLY is non-nil only decode header and return filename."
(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

View file

@ -216,7 +216,7 @@ If FILE-NAME is non-nil, save the result to FILE-NAME."
(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)

View file

@ -101,7 +101,7 @@ If nil, /etc/resolv.conf and nslookup will be consulted.")
(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 @@ If nil, /etc/resolv.conf and nslookup will be consulted.")
"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 @@ If TCP-P, the first two bytes of the package with be the length field."
(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 @@ If TCP-P, the first two bytes of the package with be the length field."
(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 REVERSEP, look up an IP address."
(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

View file

@ -475,10 +475,10 @@ sure of changing the value of `foo'."
(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

View file

@ -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))))

View file

@ -475,8 +475,8 @@ signer's public key from `pgg-default-keyserver-address'."
(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)))))))

View file

@ -95,7 +95,7 @@ If this variable is set to nil, use internal function only."
(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)