Function: gnus-search-imap-search-command

gnus-search-imap-search-command is a byte-compiled function defined in gnus-search.el.gz.

Signature

(gnus-search-imap-search-command ARG0 ARG &rest ARGS)

Implementations

(gnus-search-imap-search-command (ENGINE gnus-search-imap) (QUERY string)) in `gnus-search.el'.

Create the IMAP search command for QUERY. Currently takes into account support for the LITERAL+ capability. Other capabilities could be tested here.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-search.el.gz
(cl-defmethod gnus-search-imap-search-command ((engine gnus-search-imap)
					       (query string))
  "Create the IMAP search command for QUERY.
Currently takes into account support for the LITERAL+ capability.
Other capabilities could be tested here."
  (with-slots (literal-plus) engine
    (when (and literal-plus
               (string-match-p "\n" query))
      (setq query (split-string query "\n")))
    (cond
     ((consp query)
      ;; We're not really streaming, just need to prevent
      ;; `nnimap-send-command' from waiting for a response.
      (let* ((nnimap-streaming t)
	     (call
	      (nnimap-send-command
	       "UID SEARCH CHARSET UTF-8 %s"
	       (pop query))))
	(dolist (l query)
	  (process-send-string (get-buffer-process (current-buffer)) l)
	  (process-send-string (get-buffer-process (current-buffer))
			       (if (nnimap-newlinep nnimap-object)
				   "\n"
				 "\r\n")))
	(nnimap-get-response call)))
     (t (nnimap-command "UID SEARCH %s" query)))))