Skip to content

Commit 1fc1e1a

Browse files
committed
feat!: Update search shortcuts with t for type and T for topic
1 parent f5a8a82 commit 1fc1e1a

4 files changed

Lines changed: 25 additions & 24 deletions

File tree

docs/bone-manual.org

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -757,24 +757,24 @@ The regexp is always the whole value -- a =,= loses its meaning
757757
inside, and =|= being a clause separator, regexp alternation cannot
758758
appear either: to OR two regexps, use two clauses (=s:/a/ | s:/b/=).
759759

760-
| Long form | Short | Matches |
761-
|---------------------------------+----------+--------------------------------------------|
762-
| =from:bzg= | =f:= | from address or name |
763-
| =subject:crash,latex= | =s:= | subject (a bare word matches subject) |
764-
| =similar:a+b+c= | | subjects sharing 3 of the =+=-joined words |
765-
| =topic:agenda= | =t:= =T:= | any of the report's topics |
766-
| =source:emacs= | =S:= | source name (one char: exact) |
767-
| =type:patch= | | report type |
768-
| =priority:2= | =p:= | exact priority (0-3) |
769-
| =mid:<...>= | =m:= | message-id |
770-
| =acked:bzg= =owned:*= =closed:*= | =a: o: c:= | by person (or =*= for any) |
771-
| =urgent:*= =important:false= | =u: i:= | marks (set or not) |
772-
| =flags:AO= | =F:= | Flags letters, all required (A O C R E S) |
773-
| =att:~+= | =A:= | Att glyphs, all required (. ~ + x @ #) |
774-
| =date:3d= =date:A..B= | =d:= | created (durations =Nd/Nw/Nm=, ranges) |
775-
| =deadline:2m= | =D:= | due within / on (forward) |
776-
| =expired:10d= | =e:= | expiring within (forward) |
777-
| =closed:true= | =c:true= | include closed reports (transient) |
760+
| Long form | Short | Matches |
761+
|----------------------------+----------+-------------------------------------------|
762+
| =from:bzg= | =f:= | from address or name |
763+
| =subject:crash,latex= | =s:= | subject (a bare word matches subject) |
764+
| =similar:a+b+c= | | subjects sharing 3 of the =+=-joined words |
765+
| =topic:agenda= | =T:= | any of the report's topics |
766+
| =source:emacs= | =S:= | source name (one char: exact) |
767+
| =type:patch= | =t:= | report type |
768+
| =priority:2= | =p:= | exact priority (0-3) |
769+
| =mid:<...>= | =m:= | message-id |
770+
| =acked:bzg= =owned:*= =closed:*= | =a: o: c:= | by person (or =*= for any) |
771+
| =urgent:*= =important:false= | =u: i:= | marks (set or not) |
772+
| =flags:AO= | =F:= | Flags letters, all required (A O C R E S) |
773+
| =att:~+= | =A:= | Att glyphs, all required (. ~ + x @ #) |
774+
| =date:3d= =date:A..B= | =d:= | created (durations =Nd/Nw/Nm=, ranges) |
775+
| =deadline:2m= | =D:= | due within / on (forward) |
776+
| =expired:10d= | =e:= | expiring within (forward) |
777+
| =closed:true= | =c:true= | include closed reports (transient) |
778778

779779
Durations: =Nd= (days), =Nw= (weeks), =Nm= (months). A lone date is
780780
that exact day; open range ends stay open (=date:2026-01-01..= has no

resources/bone-search.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// token = [-]key:value | [-]bare-word | "quoted subject phrase"
1515
// value = alt,alt,... (comma = OR; a "…" or /re/ value
1616
// stays whole and may contain commas)
17-
// keys = from/f subject/s similar topic/t/T source/S type
17+
// keys = from/f subject/s similar topic/T source/S type/t
1818
// priority/p mid/m acked/a owned/o closed/c urgent/u
1919
// important/i flags/F att/attributes/A date/d deadline/D
2020
// expired/e
@@ -263,7 +263,7 @@ function compileKey(token) {
263263
case 'subject': case 's':
264264
return fieldMatcher(val, textMatcher,
265265
[function(r) { return r.subject; }]);
266-
case 'topic': case 't': case 'T':
266+
case 'topic': case 'T':
267267
// Topics are whitespace-free tokens; match any of the report's.
268268
return (function() {
269269
var ms = queryVals(val).map(textMatcher);
@@ -296,7 +296,7 @@ function compileKey(token) {
296296
var d = v.toLowerCase();
297297
return function(s) { return s === d; };
298298
}, [function(r) { return r.source; }]);
299-
case 'type':
299+
case 'type': case 't':
300300
// A closed set compared whole: no *, regexp or quotes here, and
301301
// type:* matches nothing.
302302
return (function() {

resources/docs-tpl.org

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ Important.
9494
The search box filters with =key:value= tokens: space is AND, =|= is OR
9595
between clauses, a comma ORs values, a leading =-= negates a token, ="…"=
9696
keeps a phrase literal and =/re/= matches as a regexp. Keys (alias in
97-
parens): =from= (=f=), =subject= (=s=), =similar=, =topic= (=t= =T=), =source= (=S=),
98-
=type=, =priority= (=p=), =mid= (=m=), =acked= (=a=), =owned= (=o=), =closed= (=c=), =urgent=
97+
parens): =from= (=f=), =subject= (=s=), =similar=, =topic= (=T=), =source= (=S=),
98+
=type= (=t=), =priority= (=p=), =mid= (=m=), =acked= (=a=), =owned= (=o=), =closed= (=c=), =urgent=
9999
(=u=), =important= (=i=), =flags= (=F=), =att= (=A=), =date= (=d=), =deadline= (=D=),
100100
=expired= (=e=). Durations are =Nd/Nw/Nm=; =closed:true= transiently includes
101101
the closed reports.

test/bone-search-conformance.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ var cases = [
6767
['"shuffling in"', ['<req@emacs>']],
6868
// Clauses: | is OR, comma inside a value is OR, space is AND.
6969
['latex | agenda', ['<crash@org>', '<patch@org>', '<req@emacs>', '<done@emacs>']],
70-
['t:latex s:crash', ['<done@emacs>']],
70+
['T:latex s:crash', ['<done@emacs>']],
7171
['topic:latex,agenda', ['<crash@org>', '<patch@org>', '<req@emacs>', '<done@emacs>']],
7272
// Negation covers the whole token, alternatives included.
7373
['-topic:latex,agenda', []],
@@ -104,6 +104,7 @@ var cases = [
104104
['u:whoever', []], // only */true/false mean anything
105105
// Closed sets, compared whole: no *, quotes or regexps.
106106
['type:patch', ['<patch@org>']],
107+
['t:patch', ['<patch@org>']],
107108
['type:bug,request', ['<crash@org>', '<req@emacs>', '<done@emacs>']],
108109
['type:*', []],
109110
['flags:AO', ['<crash@org>'], false],

0 commit comments

Comments
 (0)