+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.
+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.
<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)
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.
(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
(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)
(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.
["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.
'("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
(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.
((= 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)
(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.
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))
;;("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)
;; 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))
(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)
(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
(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)
(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)))
"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
(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)
(point (point)))
(prog1
(with-temp-buffer
- (set-buffer-multibyte nil)
+ (unless (featurep 'xemacs) (set-buffer-multibyte nil))
(insert string)
(goto-char (point-min))
(cond
(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
(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
(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))))
(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)))))))
(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)