diff options
| author | Lars Magne Ingebrigtsen | 2015-01-27 06:06:43 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2015-01-27 06:06:43 +0000 |
| commit | b28c81bcf2c00b282cd7f25bf784563e181fc70c (patch) | |
| tree | f480a6affe29a4133ca5e345336404a1fdfdd724 /lisp | |
| parent | 4f2ca8e5506de6f5be92bf50c45d5ed3987b5458 (diff) | |
| download | emacs-b28c81bcf2c00b282cd7f25bf784563e181fc70c.tar.gz emacs-b28c81bcf2c00b282cd7f25bf784563e181fc70c.zip | |
lisp/gnus/nnir.el Check for literal+ capability in IMAP
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/gnus/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/gnus/nnir.el | 47 |
2 files changed, 29 insertions, 23 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 0d105a9b163..7bf4a6e01d6 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2015-01-27 Lars Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * nnir.el (nnir-imap-expr-to-imap): Check for literal+ capability in | ||
| 4 | IMAP. | ||
| 5 | |||
| 1 | 2015-01-27 Eric Abrahamsen <eric@ericabrahamsen.net> | 6 | 2015-01-27 Eric Abrahamsen <eric@ericabrahamsen.net> |
| 2 | 7 | ||
| 3 | * nnir.el (nnir-run-imap): Enable non-ASCII IMAP searches. | 8 | * nnir.el (nnir-run-imap): Enable non-ASCII IMAP searches. |
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index dcb69aabcd7..6d111e89e80 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el | |||
| @@ -1069,29 +1069,30 @@ In future the following will be added to the language: | |||
| 1069 | (defun nnir-imap-expr-to-imap (criteria expr) | 1069 | (defun nnir-imap-expr-to-imap (criteria expr) |
| 1070 | "Convert EXPR into an IMAP search expression on CRITERIA" | 1070 | "Convert EXPR into an IMAP search expression on CRITERIA" |
| 1071 | ;; What sort of expression is this, eh? | 1071 | ;; What sort of expression is this, eh? |
| 1072 | (cond | 1072 | (let ((literal+ (nnimap-capability "LITERAL+"))) |
| 1073 | ;; Simple string term | 1073 | (cond |
| 1074 | ((stringp expr) | 1074 | ;; Simple string term |
| 1075 | (format "%s %S" criteria expr)) | 1075 | ((stringp expr) |
| 1076 | ;; Trivial term: and | 1076 | (format "%s %S" criteria expr)) |
| 1077 | ((eq expr 'and) nil) | 1077 | ;; Trivial term: and |
| 1078 | ;; Composite term: or expression | 1078 | ((eq expr 'and) nil) |
| 1079 | ((eq (car-safe expr) 'or) | 1079 | ;; Composite term: or expression |
| 1080 | (format "OR %s %s" | 1080 | ((eq (car-safe expr) 'or) |
| 1081 | (nnir-imap-expr-to-imap criteria (second expr)) | 1081 | (format "OR %s %s" |
| 1082 | (nnir-imap-expr-to-imap criteria (third expr)))) | 1082 | (nnir-imap-expr-to-imap criteria (second expr)) |
| 1083 | ;; Composite term: just the fax, mam | 1083 | (nnir-imap-expr-to-imap criteria (third expr)))) |
| 1084 | ((eq (car-safe expr) 'not) | 1084 | ;; Composite term: just the fax, mam |
| 1085 | (format "NOT (%s)" (nnir-imap-query-to-imap criteria (rest expr)))) | 1085 | ((eq (car-safe expr) 'not) |
| 1086 | ;; Composite term: non-ascii search term | 1086 | (format "NOT (%s)" (nnir-imap-query-to-imap criteria (rest expr)))) |
| 1087 | ((numberp (car-safe expr)) | 1087 | ;; Composite term: non-ascii search term |
| 1088 | (format "%s {%d%s}\n%s" criteria (car expr) | 1088 | ((numberp (car-safe expr)) |
| 1089 | (if literal+ "+" "") (second expr))) | 1089 | (format "%s {%d%s}\n%s" criteria (car expr) |
| 1090 | ;; Composite term: just expand it all. | 1090 | (if literal+ "+" "") (second expr))) |
| 1091 | ((and (not (null expr)) (listp expr)) | 1091 | ;; Composite term: just expand it all. |
| 1092 | (format "(%s)" (nnir-imap-query-to-imap criteria expr))) | 1092 | ((and (not (null expr)) (listp expr)) |
| 1093 | ;; Complex value, give up for now. | 1093 | (format "(%s)" (nnir-imap-query-to-imap criteria expr))) |
| 1094 | (t (error "Unhandled input: %S" expr)))) | 1094 | ;; Complex value, give up for now. |
| 1095 | (t (error "Unhandled input: %S" expr))))) | ||
| 1095 | 1096 | ||
| 1096 | 1097 | ||
| 1097 | (defun nnir-imap-parse-query (string) | 1098 | (defun nnir-imap-parse-query (string) |