emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master b28c81b: lisp/gnus/nnir.el Check for literal+ capab


From: Katsumi Yamaoka
Subject: [Emacs-diffs] master b28c81b: lisp/gnus/nnir.el Check for literal+ capability in IMAP
Date: Tue, 27 Jan 2015 06:06:44 +0000

branch: master
commit b28c81bcf2c00b282cd7f25bf784563e181fc70c
Author: Lars Magne Ingebrigtsen <address@hidden>
Commit: Katsumi Yamaoka <address@hidden>

    lisp/gnus/nnir.el Check for literal+ capability in IMAP
---
 lisp/gnus/ChangeLog |    5 +++++
 lisp/gnus/nnir.el   |   47 ++++++++++++++++++++++++-----------------------
 2 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 0d105a9..7bf4a6e 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-27  Lars Ingebrigtsen  <address@hidden>
+
+       * nnir.el (nnir-imap-expr-to-imap): Check for literal+ capability in
+       IMAP.
+
 2015-01-27  Eric Abrahamsen  <address@hidden>
 
        * nnir.el (nnir-run-imap): Enable non-ASCII IMAP searches.
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el
index dcb69aa..6d111e8 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:
 (defun nnir-imap-expr-to-imap (criteria expr)
   "Convert EXPR into an IMAP search expression on CRITERIA"
   ;; What sort of expression is this, eh?
-  (cond
-   ;; Simple string term
-   ((stringp expr)
-    (format "%s %S" criteria expr))
-   ;; Trivial term: and
-   ((eq expr 'and) nil)
-   ;; Composite term: or expression
-   ((eq (car-safe expr) 'or)
-    (format "OR %s %s"
-           (nnir-imap-expr-to-imap criteria (second expr))
-           (nnir-imap-expr-to-imap criteria (third expr))))
-   ;; Composite term: just the fax, mam
-   ((eq (car-safe expr) 'not)
-    (format "NOT (%s)" (nnir-imap-query-to-imap criteria (rest expr))))
-   ;; Composite term: non-ascii search term
-   ((numberp (car-safe expr))
-    (format "%s {%d%s}\n%s" criteria (car expr)
-           (if literal+ "+" "") (second expr)))
-   ;; Composite term: just expand it all.
-   ((and (not (null expr)) (listp expr))
-    (format "(%s)" (nnir-imap-query-to-imap criteria expr)))
-   ;; Complex value, give up for now.
-   (t (error "Unhandled input: %S" expr))))
+  (let ((literal+ (nnimap-capability "LITERAL+")))
+    (cond
+     ;; Simple string term
+     ((stringp expr)
+      (format "%s %S" criteria expr))
+     ;; Trivial term: and
+     ((eq expr 'and) nil)
+     ;; Composite term: or expression
+     ((eq (car-safe expr) 'or)
+      (format "OR %s %s"
+             (nnir-imap-expr-to-imap criteria (second expr))
+             (nnir-imap-expr-to-imap criteria (third expr))))
+     ;; Composite term: just the fax, mam
+     ((eq (car-safe expr) 'not)
+      (format "NOT (%s)" (nnir-imap-query-to-imap criteria (rest expr))))
+     ;; Composite term: non-ascii search term
+     ((numberp (car-safe expr))
+      (format "%s {%d%s}\n%s" criteria (car expr)
+             (if literal+ "+" "") (second expr)))
+     ;; Composite term: just expand it all.
+     ((and (not (null expr)) (listp expr))
+      (format "(%s)" (nnir-imap-query-to-imap criteria expr)))
+     ;; Complex value, give up for now.
+     (t (error "Unhandled input: %S" expr)))))
 
 
 (defun nnir-imap-parse-query (string)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]