]> git.neil.brown.name Git - edlib.git/commitdiff
notmuch: remove support for saved: synonym for query:
authorNeilBrown <neil@brown.name>
Wed, 12 Jul 2023 21:18:52 +0000 (07:18 +1000)
committerNeilBrown <neil@brown.name>
Wed, 12 Jul 2023 22:18:34 +0000 (08:18 +1000)
Before notmuch supported query: I was handling saved:.
For a while I've supported both, but that adds no value.
So get rid of all saved: search terms and saved. config entries.

Signed-off-by: NeilBrown <neil@brown.name>
DOC/TODO.md
python/module-notmuch.py

index 7cc12f31bf554868e1005e6b350f6538b882c100..56a2358c20bd700202df1a3831e37ca6bfe30b53 100644 (file)
@@ -559,8 +559,8 @@ Module features
 - [ ] TESTS
 - [ ] make sure Clone actually works for all panes - or remove it
 - [ ] add counter and colour for 'flagged'
-- [ ] if no 'saved:current' use "not exclude_tags"
-- [ ] change from "saved:" to "query:" after re-organizing my queries.
+- [ ] if no 'query.current' use "not exclude_tags"
+- [X] change from "saved:" to "query:" after re-organizing my queries.
 - [ ] support selection messages and applying tags
 - [ ] When changing any tag in a thread, or when opening the thread,
       assess thread tags by looking at all matched messages.
index 5180658d3262df0724b650f2541f8ea87112841f..fa229a488515642f7bcd1983e705f5f00f0a4979 100644 (file)
@@ -16,9 +16,8 @@
 # These can be all in with one pane, with sub-panes, or can sometimes
 # have a pane to themselves.
 #
-# saved search are stored in config file as "saved.foo" or in the database
-# as "query.foo". Some are special.  They are treated identically and we will
-# assume "query." below.
+# saved search are stored in config (file or database) as "query.foo"
+# Some are special.
 # "query.current" selects messages that have not been archived, and are not spam
 # "query.unread" selects messages that should be highlighted. It is normally
 # "tag:unread"
@@ -252,7 +251,7 @@ class searches:
         self.slist = {}
         for line in p.stdout:
             line = line.decode("utf-8", "ignore")
-            if not line.startswith('saved.') and not line.startswith('query.'):
+            if not line.startswith('query.'):
                 continue
             w = line[6:].strip().split("=", 1)
             self.slist[w[0]] = w[1]
@@ -338,17 +337,17 @@ class searches:
                 self.worker.pending == None and
                 self.slow_worker.pending == None)
 
-    patn = "\\b(saved|query):([-_A-Za-z0-9]*)\\b"
+    patn = "\\bquery:([-_A-Za-z0-9]*)\\b"
     def map_search(self, query):
         m = re.search(self.patn, query)
         while m:
-            s = m.group(2)
+            s = m.group(1)
             if s in self.slist:
                 q = self.slist[s]
-                query = re.sub('\\b(saved|query):' + s + '\\b',
+                query = re.sub('\\bquery:' + s + '\\b',
                                '(' + q + ')', query)
             else:
-                query = re.sub('\\b(saved|query):' + s + '\\b',
+                query = re.sub('\\bquery:' + s + '\\b',
                                'query-'+s, query)
             m = re.search(self.patn, query)
         return query
@@ -365,7 +364,7 @@ class searches:
         ret = []
         if n in self.slist:
             for s in self.slist[n].split(" "):
-                if s.startswith('saved:') or s.startswith('query:'):
+                if s.startswith('query:'):
                     ret.append(s[6:])
         return ret