diff --git a/pkgs/racket-index/scribblings/main/private/make-search.rkt b/pkgs/racket-index/scribblings/main/private/make-search.rkt
index bae9afbd73..1ce267fa6c 100644
--- a/pkgs/racket-index/scribblings/main/private/make-search.rkt
+++ b/pkgs/racket-index/scribblings/main/private/make-search.rkt
@@ -168,7 +168,14 @@
[(exported-index-desc? desc)
(let ([libs (map lib->name (exported-index-desc-from-libs desc))])
(string-append* `("[" ,@(add-between libs ",") "]")))]
- [(module-path-index-desc? desc) "\"module\""]
+ [(module-path-index-desc? desc)
+ (cond
+ [(language-index-desc? desc)
+ "\"language\""]
+ [(reader-index-desc? desc)
+ "\"reader\""]
+ [else
+ "\"module\""])]
[else "false"]))
(and href
(string-append "[" (quote-string text) ","
diff --git a/pkgs/racket-index/scribblings/main/private/search.js b/pkgs/racket-index/scribblings/main/private/search.js
index 2ac4606b8f..7443f1b13b 100644
--- a/pkgs/racket-index/scribblings/main/private/search.js
+++ b/pkgs/racket-index/scribblings/main/private/search.js
@@ -119,10 +119,17 @@ function InitializeSearch() {
+' identifiers from modules that (partially) match'
+' “str”; “M:” by'
+' itself will restrict results to bound names only.'
+ +'
Use “H:str” to match only'
+ +' modules that implement a language'
+ +' “#lang str”.'
+ +'Use “R:str” to match only'
+ +' modules that implement a reader module'
+ +' “#reader str”.'
+'“L:str” is similar to'
+' “M:str”, but'
+' “str” should match the module name'
- +' exactly.'
+ +' exactly; “M:” by'
+ +' itself will restrict results to module names only.'
+'“T:str” restricts results to ones in'
+' the “str” manual (naming the'
+' directory where the manual is found).'
@@ -193,6 +200,8 @@ function InitializeSearch() {
+' few common choices:'
+''
+MakeContextQueryItem("M:", "Bindings")
+ +MakeContextQueryItem("H:", "Languages")
+ +MakeContextQueryItem("R:", "Reader modules")
+MakeContextQueryItem("T:reference", "Reference manual")
+MakeContextQueryItem("M:racket", "{{racket}} bindings")
+MakeContextQueryItem("M:racket/base", "{{racket/base}} bindings")
@@ -402,7 +411,7 @@ function UrlToManual(url) {
// mostly for context queries.
function CompileTerm(term) {
- var op = ((term.search(/^[NLMTQ]:/) == 0) && term.substring(0,1));
+ var op = ((term.search(/^[NLMHRTQ]:/) == 0) && term.substring(0,1));
if (op) term = term.substring(2);
term = term.toLowerCase();
switch (op) {
@@ -413,16 +422,28 @@ function CompileTerm(term) {
case "L":
return function(x) {
if (!x[3]) return C_fail;
- if (x[3] == "module") // rexact allowed, show partial module matches
+ if (x[3] == "module" || x[3] == "language" || x[3] == "reader") // rexact allowed, show partial module matches
return Compare(term,x[0]);
return (MaxCompares(term,x[3]) >= C_exact) ? C_exact : C_fail;
};
case "M":
return function(x) {
if (!x[3]) return C_fail;
- if (x[3] == "module") return Compare(term,x[0]); // rexact allowed
+ if (x[3] == "module" || x[3] == "language" || x[3] == "reader") return Compare(term,x[0]); // rexact allowed
return (MaxCompares(term,x[3]) >= C_match) ? C_exact : C_fail;
};
+ case "H":
+ return function(x) {
+ if (!x[3]) return C_fail;
+ if (x[3] == "language") return Compare(term,x[0]);
+ return (MaxCompares(term,x[3]) >= C_exact) ? C_exact : C_fail;
+ };
+ case "R":
+ return function(x) {
+ if (!x[3]) return C_fail;
+ if (x[3] == "reader") return Compare(term,x[0]);
+ return (MaxCompares(term,x[3]) >= C_exact) ? C_exact : C_fail;
+ };
case "T":
return function(x) {
if (Compare(term,UrlToManual(x[1])) < C_exact) return C_fail;
@@ -680,6 +701,8 @@ function UpdateResults() {
+ desc[j] + '';
} else if (desc == "module") {
note = 'module';
+ } else if (desc == "language") {
+ note = 'language';
}
if (show_manuals == 2 || (show_manuals == 1 && !desc)) {
var manual = UrlToManual(res[1]),