From 115c7b772d414707ee565438b02511aa01cee0dc Mon Sep 17 00:00:00 2001 From: yamaoka Date: Thu, 5 Oct 2000 22:46:17 +0000 Subject: [PATCH] Synch with Gnus. --- lisp/ChangeLog | 31 +++++++++++++++++- lisp/binhex.el | 11 ++----- lisp/gnus-agent.el | 1 + lisp/mm-bodies.el | 2 +- lisp/mm-util.el | 90 +++++++++++++++++++++++++--------------------------- lisp/rfc1843.el | 1 + lisp/rfc2047.el | 7 ++-- lisp/webmail.el | 2 +- 8 files changed, 85 insertions(+), 60 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 02f908b..854c4d3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6 +1,35 @@ +2000-10-05 Dave Love + + * rfc2047.el (rfc2047-fold-region): Use gnus-point-at-bol. + (rfc2047-charset-encoding-alist): Add iso-8859-1[45]. + + * binhex.el: Use defalias, not fset. + + * rfc1843.el: Require cl when compiling. + +2000-10-05 12:25:08 ShengHuo ZHU + + * gnus-agent.el (gnus-agent-fetch-group-1): Score-param could be nil. + +2000-10-05 11:43:25 ShengHuo ZHU + + * rfc2047.el (rfc2047-encode-region): Merge only if regions are + adjacent. + +2000-10-05 09:41:33 ShengHuo ZHU + + * mm-util.el (mm-multibyte-p): In XEmacs, it is (feature 'mule). + (mm-find-charset-region): Merge conditions, delete ascii. + (mm-charset-after): Rewrite. + * mm-bodies.el (mm-encode-body): Use it. + +2000-10-05 09:04:32 ShengHuo ZHU + + * webmail.el (webmail-hotmail-list): Fix. + 2000-10-05 Stefan Monnier - * nnimap.el (require): cl. + * nnimap.el (require): cl. 2000-10-04 15:24:46 ShengHuo ZHU diff --git a/lisp/binhex.el b/lisp/binhex.el index c7fb243..1a181a3 100644 --- a/lisp/binhex.el +++ b/lisp/binhex.el @@ -29,7 +29,7 @@ (eval-when-compile (require 'cl)) (if (not (fboundp 'char-int)) - (fset 'char-int 'identity)) + (defalias 'char-int 'identity)) (defvar binhex-decoder-program "hexbin" "*Non-nil value should be a string that names a uu decoder. @@ -198,15 +198,8 @@ If HEADER-ONLY is non-nil only decode header and return filename." (save-excursion (goto-char start) (when (re-search-forward binhex-begin-line end t) - (if (and (not (featurep 'xemacs)) - (boundp 'enable-multibyte-characters)) - (let ((multibyte - (default-value 'enable-multibyte-characters))) - (setq-default enable-multibyte-characters nil) - (setq work-buffer (generate-new-buffer " *binhex-work*")) - (setq-default enable-multibyte-characters multibyte)) + (let (default-enable-multibyte-characters) (setq work-buffer (generate-new-buffer " *binhex-work*"))) - (buffer-disable-undo work-buffer) (beginning-of-line) (setq bits 0 counter 0) (while tmp diff --git a/lisp/gnus-agent.el b/lisp/gnus-agent.el index 4e4d387..b301e76 100644 --- a/lisp/gnus-agent.el +++ b/lisp/gnus-agent.el @@ -1162,6 +1162,7 @@ the actual number of articles toggled is returned." (caddr category))) ;; Translate score-param into real one (cond + ((not score-param)) ((eq score-param 'file) (setq score-param (gnus-all-score-files group))) ((stringp (car score-param))) diff --git a/lisp/mm-bodies.el b/lisp/mm-bodies.el index f90f74c..5b8874c 100644 --- a/lisp/mm-bodies.el +++ b/lisp/mm-bodies.el @@ -58,7 +58,7 @@ If there is more than one non-ASCII MULE charset, then list of found MULE charsets are returned. If successful, the MIME charset is returned. If no encoding was done, nil is returned." - (if (not (featurep 'mule)) + (if (not (mm-multibyte-p)) ;; In the non-Mule case, we search for non-ASCII chars and ;; return the value of `mail-parse-charset' if any are found. (save-excursion diff --git a/lisp/mm-util.el b/lisp/mm-util.el index 31f5938..b8df4e1 100644 --- a/lisp/mm-util.el +++ b/lisp/mm-util.el @@ -239,30 +239,33 @@ used as the line break code type of the coding system." If POS is nil, it defauls to the current point. If POS is out of range, the value is nil. If the charset is `composition', return the actual one." - (let ((charset (cond - ((fboundp 'charset-after) - (charset-after pos)) - ((fboundp 'char-charset) - (char-charset (char-after pos))) - ((< (mm-char-int (char-after pos)) 128) - 'ascii) - (mail-parse-mule-charset ;; cached mule-charset - mail-parse-mule-charset) - ((boundp 'current-language-environment) - (let ((entry (assoc current-language-environment - language-info-alist))) - (setq mail-parse-mule-charset - (or (car (last (assq 'charset entry))) - 'latin-iso8859-1)))) - (t ;; figure out the charset - (setq mail-parse-mule-charset - (or (car (last (assq mail-parse-charset - mm-mime-mule-charset-alist))) - 'latin-iso8859-1)))))) - (if (eq charset 'composition) - (let ((p (or pos (point)))) - (cadr (find-charset-region p (1+ p)))) - charset))) + (let ((char (char-after pos)) charset) + (if (< (mm-char-int char) 128) + (setq charset 'ascii) + ;; charset-after is fake in some Emacsen. + (setq charset (and (fboundp 'char-charset) (char-charset char))) + (if (eq charset 'composition) + (let ((p (or pos (point)))) + (cadr (find-charset-region p (1+ p)))) + (if (and charset (not (memq charset '(ascii eight-bit-control + eight-bit-graphic)))) + charset + (or + mail-parse-mule-charset ;; cached mule-charset + (progn + (setq mail-parse-mule-charset + (and (boundp 'current-language-environment) + (car (last + (assq 'charset + (assoc current-language-environment + language-info-alist)))))) + (if (or (not mail-parse-mule-charset) + (eq mail-parse-mule-charset 'ascii)) + (setq mail-parse-mule-charset + (or (car (last (assq mail-parse-charset + mm-mime-mule-charset-alist))) + 'latin-iso8859-1))) + mail-parse-mule-charset))))))) (defun mm-mime-charset (charset) "Return the MIME charset corresponding to the MULE CHARSET." @@ -304,9 +307,9 @@ If the charset is `composition', return the actual one." (defsubst mm-multibyte-p () "Say whether multibyte is enabled." - (or (featurep 'xemacs) - (and (boundp 'enable-multibyte-characters) - enable-multibyte-characters))) + (if (boundp 'enable-multibyte-characters) + enable-multibyte-characters + (featurep 'mule))) (defmacro mm-with-unibyte-buffer (&rest forms) "Create a temporary buffer, and evaluate FORMS there like `progn'. @@ -377,7 +380,8 @@ See also `with-temp-file' and `with-output-to-string'." (fboundp 'find-charset-region)) ;; Remove composition since the base charsets have been included. (delq 'composition (find-charset-region b e))) - ((not (boundp 'current-language-environment)) + (t + ;; We are in a unibyte buffer or XEmacs non-mule, so we futz around a bit. (save-excursion (save-restriction (narrow-to-region b e) @@ -385,24 +389,18 @@ See also `with-temp-file' and `with-output-to-string'." (skip-chars-forward "\0-\177") (if (eobp) '(ascii) - (delq nil (list 'ascii - (or (car (last (assq mail-parse-charset - mm-mime-mule-charset-alist))) - 'latin-iso8859-1))))))) - (t - ;; We are in a unibyte buffer, so we futz around a bit. - (save-excursion - (save-restriction - (narrow-to-region b e) - (goto-char (point-min)) - (let ((entry (assoc current-language-environment - language-info-alist))) - (skip-chars-forward "\0-\177") - (if (eobp) - '(ascii) - (delq nil (list 'ascii - (or (car (last (assq 'charset entry))) - 'latin-iso8859-1)))))))))) + (let (charset) + (setq charset + (and (boundp 'current-language-environment) + (car (last (assq 'charset + (assoc current-language-environment + language-info-alist)))))) + (if (eq charset 'ascii) (setq charset nil)) + (or charset + (setq charset + (car (last (assq mail-parse-charset + mm-mime-mule-charset-alist))))) + (list 'ascii (or charset 'latin-iso8859-1))))))))) (static-if (fboundp 'shell-quote-argument) (defalias 'mm-quote-arg 'shell-quote-argument) diff --git a/lisp/rfc1843.el b/lisp/rfc1843.el index 7bc6e80..05832cc 100644 --- a/lisp/rfc1843.el +++ b/lisp/rfc1843.el @@ -32,6 +32,7 @@ ;;; Code: +(eval-when-compile (require 'cl)) (require 'mm-util) (defvar rfc1843-word-regexp diff --git a/lisp/rfc2047.el b/lisp/rfc2047.el index 0b10d04..5e2eed4 100644 --- a/lisp/rfc2047.el +++ b/lisp/rfc2047.el @@ -61,6 +61,8 @@ The values can be: (iso-8859-7 . Q) (iso-8859-8 . Q) (iso-8859-9 . Q) + (iso-8859-14 . Q) + (iso-8859-15 . Q) (iso-2022-jp . B) (iso-2022-kr . B) (gb2312 . B) @@ -224,7 +226,8 @@ Should be called narrowed to the head of the message." (let ((words (rfc2047-dissect-region b e)) beg end current word) (while (setq word (pop words)) - (if (equal (nth 2 word) current) + (if (and (eq (nth 2 word) current) + (eq beg (nth 1 word))) (setq beg (nth 0 word)) (when current (if (and (eq beg (nth 1 word)) (nth 2 word)) @@ -297,7 +300,7 @@ Should be called narrowed to the head of the message." (setq break (point))) ((and break (looking-at "\\?=") - (> (- (point) (save-excursion (beginning-of-line) (point))) 76)) + (> (- (point) (gnus-point-at-bol)) 76)) (goto-char break) (setq break nil) (insert "\n "))) diff --git a/lisp/webmail.el b/lisp/webmail.el index a307f93..d8dcc14 100644 --- a/lisp/webmail.el +++ b/lisp/webmail.el @@ -428,7 +428,7 @@ (setq site (match-string 1)) (webmail-error "list@1")) (goto-char (point-min)) - (if (re-search-forward "disk=\\([^&]+\\)&" nil t) + (if (re-search-forward "disk=\\([^&]*\\)&" nil t) (setq webmail-aux (concat "http://" site "/cgi-bin/HoTMaiL?disk=" (match-string 1))) -- 1.7.10.4