diff options
| author | Katsumi Yamaoka | 2012-09-06 02:20:21 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2012-09-06 02:20:21 +0000 |
| commit | 4fd78b62d1c815e4dfd7ffe4e7862ef4c4fceaca (patch) | |
| tree | bed80daf4930589a365d73425f40f160cc6f4009 | |
| parent | fca81a8d405cd4c825e144099c54dd163636aa3b (diff) | |
| download | emacs-4fd78b62d1c815e4dfd7ffe4e7862ef4c4fceaca.tar.gz emacs-4fd78b62d1c815e4dfd7ffe4e7862ef4c4fceaca.zip | |
[Gnus] XEmacs 21.5 compilation fix
* gnus-score.el (gnus-score-decode-text-parts): Use #' for
mm-text-parts used in labels macro to make it work with XEmacs 21.5.
* gnus-util.el (gnus-string-prefix-p): New function, an alias to
string-prefix-p in Emacs >=23.2.
* nnmaildir.el (nnmaildir--ensure-suffix, nnmaildir--add-flag)
(nnmaildir--remove-flag, nnmaildir--scan): Use gnus-string-match-p
instead of string-match-p.
(nnmaildir--scan): Use gnus-string-prefix-p instead of string-prefix-p.
| -rw-r--r-- | lisp/gnus/ChangeLog | 13 | ||||
| -rw-r--r-- | lisp/gnus/gnus-score.el | 4 | ||||
| -rw-r--r-- | lisp/gnus/gnus-util.el | 9 | ||||
| -rw-r--r-- | lisp/gnus/nnmaildir.el | 12 |
4 files changed, 30 insertions, 8 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 0a7866794a8..ddb0143b37a 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,16 @@ | |||
| 1 | 2012-09-06 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * gnus-score.el (gnus-score-decode-text-parts): Use #' for | ||
| 4 | mm-text-parts used in labels macro to make it work with XEmacs 21.5. | ||
| 5 | |||
| 6 | * gnus-util.el (gnus-string-prefix-p): New function, an alias to | ||
| 7 | string-prefix-p in Emacs >=23.2. | ||
| 8 | |||
| 9 | * nnmaildir.el (nnmaildir--ensure-suffix, nnmaildir--add-flag) | ||
| 10 | (nnmaildir--remove-flag, nnmaildir--scan): Use gnus-string-match-p | ||
| 11 | instead of string-match-p. | ||
| 12 | (nnmaildir--scan): Use gnus-string-prefix-p instead of string-prefix-p. | ||
| 13 | |||
| 1 | 2012-09-06 Kenichi Handa <handa@gnu.org> | 14 | 2012-09-06 Kenichi Handa <handa@gnu.org> |
| 2 | 15 | ||
| 3 | * qp.el (quoted-printable-decode-region): Fix previous change; handle | 16 | * qp.el (quoted-printable-decode-region): Fix previous change; handle |
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index bc35cf3dea5..f215b845514 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el | |||
| @@ -1720,7 +1720,7 @@ score in `gnus-newsgroup-scored' by SCORE." | |||
| 1720 | (defun gnus-score-decode-text-parts () | 1720 | (defun gnus-score-decode-text-parts () |
| 1721 | (labels ((mm-text-parts (handle) | 1721 | (labels ((mm-text-parts (handle) |
| 1722 | (cond ((stringp (car handle)) | 1722 | (cond ((stringp (car handle)) |
| 1723 | (let ((parts (mapcan 'mm-text-parts (cdr handle)))) | 1723 | (let ((parts (mapcan #'mm-text-parts (cdr handle)))) |
| 1724 | (if (equal "multipart/alternative" (car handle)) | 1724 | (if (equal "multipart/alternative" (car handle)) |
| 1725 | ;; pick the first supported alternative | 1725 | ;; pick the first supported alternative |
| 1726 | (list (car parts)) | 1726 | (list (car parts)) |
| @@ -1730,7 +1730,7 @@ score in `gnus-newsgroup-scored' by SCORE." | |||
| 1730 | (when (string-match "^text/" (mm-handle-media-type handle)) | 1730 | (when (string-match "^text/" (mm-handle-media-type handle)) |
| 1731 | (list handle))) | 1731 | (list handle))) |
| 1732 | 1732 | ||
| 1733 | (t (mapcan 'mm-text-parts handle)))) | 1733 | (t (mapcan #'mm-text-parts handle)))) |
| 1734 | (my-mm-display-part (handle) | 1734 | (my-mm-display-part (handle) |
| 1735 | (when handle | 1735 | (when handle |
| 1736 | (save-restriction | 1736 | (save-restriction |
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 26178afa864..3c4af9b4e50 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el | |||
| @@ -1926,6 +1926,15 @@ Same as `string-match' except this function does not change the match data." | |||
| 1926 | (save-match-data | 1926 | (save-match-data |
| 1927 | (string-match regexp string start)))) | 1927 | (string-match regexp string start)))) |
| 1928 | 1928 | ||
| 1929 | (if (fboundp 'string-prefix-p) | ||
| 1930 | (defalias 'gnus-string-prefix-p 'string-prefix-p) | ||
| 1931 | (defun gnus-string-prefix-p (str1 str2 &optional ignore-case) | ||
| 1932 | "Return non-nil if STR1 is a prefix of STR2. | ||
| 1933 | If IGNORE-CASE is non-nil, the comparison is done without paying attention | ||
| 1934 | to case differences." | ||
| 1935 | (eq t (compare-strings str1 nil nil | ||
| 1936 | str2 0 (length str1) ignore-case)))) | ||
| 1937 | |||
| 1929 | (eval-and-compile | 1938 | (eval-and-compile |
| 1930 | (if (fboundp 'macroexpand-all) | 1939 | (if (fboundp 'macroexpand-all) |
| 1931 | (defalias 'gnus-macroexpand-all 'macroexpand-all) | 1940 | (defalias 'gnus-macroexpand-all 'macroexpand-all) |
diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el index 327649d41a1..74a693a9c61 100644 --- a/lisp/gnus/nnmaildir.el +++ b/lisp/gnus/nnmaildir.el | |||
| @@ -100,14 +100,14 @@ See `nnmaildir-flag-mark-mapping'." | |||
| 100 | 100 | ||
| 101 | (defun nnmaildir--ensure-suffix (filename) | 101 | (defun nnmaildir--ensure-suffix (filename) |
| 102 | "Ensure that FILENAME contains the suffix \":2,\"." | 102 | "Ensure that FILENAME contains the suffix \":2,\"." |
| 103 | (if (string-match-p ":2," filename) | 103 | (if (gnus-string-match-p ":2," filename) |
| 104 | filename | 104 | filename |
| 105 | (concat filename ":2,"))) | 105 | (concat filename ":2,"))) |
| 106 | 106 | ||
| 107 | (defun nnmaildir--add-flag (flag suffix) | 107 | (defun nnmaildir--add-flag (flag suffix) |
| 108 | "Return a copy of SUFFIX where FLAG is set. | 108 | "Return a copy of SUFFIX where FLAG is set. |
| 109 | SUFFIX should start with \":2,\"." | 109 | SUFFIX should start with \":2,\"." |
| 110 | (unless (string-match-p "^:2," suffix) | 110 | (unless (gnus-string-match-p "^:2," suffix) |
| 111 | (error "Invalid suffix `%s'" suffix)) | 111 | (error "Invalid suffix `%s'" suffix)) |
| 112 | (let* ((flags (substring suffix 3)) | 112 | (let* ((flags (substring suffix 3)) |
| 113 | (flags-as-list (append flags nil)) | 113 | (flags-as-list (append flags nil)) |
| @@ -120,7 +120,7 @@ SUFFIX should start with \":2,\"." | |||
| 120 | (defun nnmaildir--remove-flag (flag suffix) | 120 | (defun nnmaildir--remove-flag (flag suffix) |
| 121 | "Return a copy of SUFFIX where FLAG is cleared. | 121 | "Return a copy of SUFFIX where FLAG is cleared. |
| 122 | SUFFIX should start with \":2,\"." | 122 | SUFFIX should start with \":2,\"." |
| 123 | (unless (string-match-p "^:2," suffix) | 123 | (unless (gnus-string-match-p "^:2," suffix) |
| 124 | (error "Invalid suffix `%s'" suffix)) | 124 | (error "Invalid suffix `%s'" suffix)) |
| 125 | (let* ((flags (substring suffix 3)) | 125 | (let* ((flags (substring suffix 3)) |
| 126 | (flags-as-list (append flags nil)) | 126 | (flags-as-list (append flags nil)) |
| @@ -856,11 +856,11 @@ by nnmaildir-request-article.") | |||
| 856 | (when (or | 856 | (when (or |
| 857 | ;; first look for marks in suffix, if it's valid... | 857 | ;; first look for marks in suffix, if it's valid... |
| 858 | (when (and (stringp suffix) | 858 | (when (and (stringp suffix) |
| 859 | (string-prefix-p ":2," suffix)) | 859 | (gnus-string-prefix-p ":2," suffix)) |
| 860 | (or | 860 | (or |
| 861 | (not (string-match-p | 861 | (not (gnus-string-match-p |
| 862 | (string (nnmaildir--mark-to-flag 'read)) suffix)) | 862 | (string (nnmaildir--mark-to-flag 'read)) suffix)) |
| 863 | (string-match-p | 863 | (gnus-string-match-p |
| 864 | (string (nnmaildir--mark-to-flag 'tick)) suffix))) | 864 | (string (nnmaildir--mark-to-flag 'tick)) suffix))) |
| 865 | ;; then look in marks directories | 865 | ;; then look in marks directories |
| 866 | (not (file-exists-p (concat cdir prefix))) | 866 | (not (file-exists-p (concat cdir prefix))) |