mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
Revert "emacs: Fix saved-search buffer titles"
This reverts commit bc98920917
.
This was applied unintentionally to master while still under discussion.
This commit is contained in:
parent
bf9b9fe046
commit
4e85abda15
1 changed files with 11 additions and 14 deletions
|
@ -973,20 +973,17 @@ unthreaded) and whether it's SAVED (t or nil)."
|
||||||
(defun notmuch-search-buffer-title (query &optional type)
|
(defun notmuch-search-buffer-title (query &optional type)
|
||||||
"Returns the title for a buffer with notmuch search results."
|
"Returns the title for a buffer with notmuch search results."
|
||||||
(let* ((saved-search
|
(let* ((saved-search
|
||||||
(cl-loop with match
|
(let (longest
|
||||||
with match-length = 0
|
(longest-length 0))
|
||||||
for candidate in notmuch-saved-searches
|
(cl-loop for tuple in notmuch-saved-searches
|
||||||
for length = (let* ((query* (notmuch-saved-search-get
|
if (let ((quoted-query
|
||||||
candidate
|
(regexp-quote
|
||||||
:query))
|
(notmuch-saved-search-get tuple :query))))
|
||||||
(regexp (concat "^"
|
(and (string-match (concat "^" quoted-query) query)
|
||||||
(regexp-quote query*))))
|
(> (length (match-string 0 query))
|
||||||
(and (string-match regexp query)
|
longest-length)))
|
||||||
(length (match-string 0 query))))
|
do (setq longest tuple))
|
||||||
if (and length (> length match-length))
|
longest))
|
||||||
do (setq match candidate
|
|
||||||
match-length length)
|
|
||||||
finally return match))
|
|
||||||
(saved-search-name (notmuch-saved-search-get saved-search :name))
|
(saved-search-name (notmuch-saved-search-get saved-search :name))
|
||||||
(saved-search-type (notmuch-saved-search-get saved-search :search-type))
|
(saved-search-type (notmuch-saved-search-get saved-search :search-type))
|
||||||
(saved-search-query (notmuch-saved-search-get saved-search :query)))
|
(saved-search-query (notmuch-saved-search-get saved-search :query)))
|
||||||
|
|
Loading…
Reference in a new issue