emacs: remove variable notmuch-search-disjunctive-regexp

The value is the only possible value, it is only used in one
place, and using a global variable serves no purpose but to
make things more complicated.
This commit is contained in:
Jonas Bernoulli 2021-01-10 15:01:02 +01:00 committed by David Bremner
parent 692acdf9da
commit b614ea7563

View file

@ -232,8 +232,6 @@ there will be called at other points of notmuch execution."
(defvar notmuch-search-target-thread) (defvar notmuch-search-target-thread)
(defvar notmuch-search-target-line) (defvar notmuch-search-target-line)
(defvar notmuch-search-disjunctive-regexp "\\<[oO][rR]\\>")
;;; Movement ;;; Movement
(defun notmuch-search-scroll-up () (defun notmuch-search-scroll-up ()
@ -1079,10 +1077,8 @@ default sort order is defined by `notmuch-search-oldest-first'."
(defun notmuch-group-disjunctive-query-string (query-string) (defun notmuch-group-disjunctive-query-string (query-string)
"Group query if it contains a complex expression. "Group query if it contains a complex expression.
Enclose QUERY-STRING in parentheses if contains \"OR\" operators."
Enclose QUERY-STRING in parentheses if it matches (if (string-match-p "\\<[oO][rR]\\>" query-string)
`notmuch-search-disjunctive-regexp'."
(if (string-match-p notmuch-search-disjunctive-regexp query-string)
(concat "( " query-string " )") (concat "( " query-string " )")
query-string)) query-string))