summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-search.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/gnus/gnus-search.el')
-rw-r--r--lisp/gnus/gnus-search.el57
1 files changed, 27 insertions, 30 deletions
diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
index 39bde837b30..31573588046 100644
--- a/lisp/gnus/gnus-search.el
+++ b/lisp/gnus/gnus-search.el
@@ -132,7 +132,7 @@ transformed."
(defcustom gnus-search-ignored-newsgroups ""
"A regexp to match newsgroups in the active file that should
- be skipped when searching."
+be skipped when searching."
:version "24.1"
:type 'regexp)
@@ -172,8 +172,7 @@ This variable can also be set per-server."
:type 'regexp)
(defcustom gnus-search-swish++-raw-queries-p nil
- "If t, all Swish++ engines will only accept raw search query
- strings."
+ "If t, all Swish++ engines will only accept raw search query strings."
:type 'boolean
:version "28.1")
@@ -217,8 +216,7 @@ This variable can also be set per-server."
:version "28.1")
(defcustom gnus-search-swish-e-raw-queries-p nil
- "If t, all Swish-e engines will only accept raw search query
- strings."
+ "If t, all Swish-e engines will only accept raw search query strings."
:type 'boolean
:version "28.1")
@@ -266,8 +264,7 @@ This variable can also be set per-server."
:version "28.1")
(defcustom gnus-search-namazu-raw-queries-p nil
- "If t, all Namazu engines will only accept raw search query
- strings."
+ "If t, all Namazu engines will only accept raw search query strings."
:type 'boolean
:version "28.1")
@@ -305,14 +302,12 @@ This variable can also be set per-server."
:version "28.1")
(defcustom gnus-search-notmuch-raw-queries-p nil
- "If t, all Notmuch engines will only accept raw search query
- strings."
+ "If t, all Notmuch engines will only accept raw search query strings."
:type 'boolean
:version "28.1")
(defcustom gnus-search-imap-raw-queries-p nil
- "If t, all IMAP engines will only accept raw search query
- strings."
+ "If t, all IMAP engines will only accept raw search query strings."
:version "28.1"
:type 'boolean)
@@ -350,8 +345,7 @@ This variable can also be set per-server."
:type 'regexp)
(defcustom gnus-search-mairix-raw-queries-p nil
- "If t, all Mairix engines will only accept raw search query
- strings."
+ "If t, all Mairix engines will only accept raw search query strings."
:version "28.1"
:type 'boolean)
@@ -403,7 +397,7 @@ expressions. Key is most often a mail header, but there are
other keys. Value is a string, quoted if it contains spaces.
Key and value are separated by a colon, no space. Expressions
are implicitly ANDed; the \"or\" keyword can be used to
-OR. \"not\" will negate the following expression, or keys can be
+OR. \"not\" will negate the following expression, or keys can be
prefixed with a \"-\". The \"near\" operator will work for
engines that understand it; other engines will convert it to
\"or\". Parenthetical groups work as expected.
@@ -413,7 +407,7 @@ header.
Search keys can be expanded with TAB during entry, or left
abbreviated so long as they remain unambiguous, ie \"f\" will
-search the \"from\" header. \"s\" will raise an error.
+search the \"from\" header. \"s\" will raise an error.
Other keys:
@@ -433,7 +427,7 @@ It's also possible to use Gnus' internal marks, ie \"mark:R\"
will be interpreted as mark:read.
\"tag\" will search tags -- right now that's translated to
-\"keyword\" in IMAP, and left as \"tag\" for notmuch. At some
+\"keyword\" in IMAP, and left as \"tag\" for notmuch. At some
point this should also be used to search marks in the Gnus
registry.
@@ -572,7 +566,7 @@ nil.
If VALUE is a relative time, interpret it as relative to
REL-DATE, or (current-time) if REL-DATE is nil."
;; Time parsing doesn't seem to work with slashes.
- (let ((value (replace-regexp-in-string "/" "-" value))
+ (let ((value (string-replace "/" "-" value))
(now (append '(0 0 0)
(seq-subseq (decode-time (or rel-date
(current-time)))
@@ -980,7 +974,7 @@ Responsible for handling and, or, and parenthetical expressions.")
;; Most search engines use implicit ANDs.
(cl-defmethod gnus-search-transform-expression ((_ gnus-search-engine)
- (_expr (eql and)))
+ (_expr (eql 'and)))
nil)
;; Most search engines use explicit infixed ORs.
@@ -1090,7 +1084,8 @@ Responsible for handling and, or, and parenthetical expressions.")
Currently takes into account support for the LITERAL+ capability.
Other capabilities could be tested here."
(with-slots (literal-plus) engine
- (when literal-plus
+ (when (and literal-plus
+ (string-match-p "\n" query))
(setq query (split-string query "\n")))
(cond
((consp query)
@@ -1358,6 +1353,7 @@ Returns a list of [group article score] vectors."
server query &optional groups)
(let ((prefix (or (slot-value engine 'remove-prefix)
""))
+ (groups (mapcar #'gnus-group-short-name groups))
artlist article group)
(goto-char (point-min))
;; Prep prefix, we want to at least be removing the root
@@ -1384,7 +1380,6 @@ Returns a list of [group article score] vectors."
nil t)
nil t)
nil t))
- (setq group (gnus-group-full-name group server))
(setq article (file-name-nondirectory f-name)
article
;; TODO: Provide a cleaner way of producing final
@@ -1392,7 +1387,7 @@ Returns a list of [group article score] vectors."
(if (string-match-p "\\`[[:digit:]]+\\'" article)
(string-to-number article)
(nnmaildir-base-name-to-article-number
- (substring article 0 (string-match ":" article))
+ (substring article 0 (string-search ":" article))
group (string-remove-prefix "nnmaildir:" server))))
(when (and (numberp article)
(or (null groups)
@@ -1404,10 +1399,12 @@ Returns a list of [group article score] vectors."
(setq artlist (gnus-search-grep-search engine artlist grep-reg)))
;; Munge into the list of vectors expected by nnselect.
(mapcar (pcase-lambda (`(,_ ,article ,group ,score))
- (vector group article
- (if (numberp score)
- score
- (string-to-number score))))
+ (vector
+ (gnus-group-full-name group server)
+ article
+ (if (numberp score)
+ score
+ (string-to-number score))))
artlist)))
(cl-defmethod gnus-search-indexed-extract ((_engine gnus-search-indexed))
@@ -1667,7 +1664,7 @@ cross our fingers for the rest of it."
Mairix negation requires a \"~\" preceding string search terms,
and \"-\" before marks."
(let ((next (gnus-search-transform-expression engine (cadr expr))))
- (replace-regexp-in-string
+ (string-replace
":"
(if (eql (caadr expr) 'mark)
":-"
@@ -1861,9 +1858,9 @@ Assume \"size\" key is equal to \"larger\"."
group
(if (file-directory-p
(setq group
- (replace-regexp-in-string
- "\\." "/"
- group nil t)))
+ (string-replace
+ "." "/"
+ group)))
group))))))
(unless group
(signal 'gnus-search-config-error
@@ -2134,7 +2131,7 @@ article came from is also searched."
;; If the value contains spaces, make sure it's
;; quoted.
(when (and (memql status '(exact finished))
- (or (string-match-p " " str)
+ (or (string-search " " str)
in-string))
(unless (looking-at-p "\\s\"")
(insert "\""))