aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wilkes <jancsika1@users.sourceforge.net>2013-01-21 04:37:30 +0000
committerJonathan Wilkes <jancsika1@users.sourceforge.net>2013-01-21 04:37:30 +0000
commit61121245f1756468f9e93412d9869c5691fb5a51 (patch)
treef0c1e890904eabf37d89954b4aed62bb1ea42d5c
parent67d2c157fbb08ffdd87c8e46ddd832600ae6315d (diff)
Added link to the glossary
svn path=/trunk/scripts/guiplugins/search-plugin/; revision=16927
-rw-r--r--search-plugin.tcl39
1 files changed, 26 insertions, 13 deletions
diff --git a/search-plugin.tcl b/search-plugin.tcl
index 97b255b..9889d6e 100644
--- a/search-plugin.tcl
+++ b/search-plugin.tcl
@@ -27,6 +27,7 @@ namespace eval ::dialog_helpbrowser2:: {
variable navbar {}
variable genres
variable cancelled
+ variable terms_to_match
}
################## help browser and support functions #########################
@@ -498,14 +499,32 @@ proc ::dialog_helpbrowser2::do_search { } {
variable filelist {}
variable i 0
variable cancelled 0
+ variable terms_to_match
foreach genre $genres {
lappend count 0
}
-
- # Get rid of pesky leading/trailing spaces...
+ # Get rid of any leading/trailing spaces...
set formatted_searchtext [string trim $searchtext]
# ...and double spaces between terms
regsub -all {\s+} $formatted_searchtext { } formatted_searchtext
+ if {$::dialog_helpbrowser2::matchwords == 1} {
+ # let's design our own word boundaries since tildes often
+ # end Pure Data words.
+ # custom left boundary isn't necessary, but I included it
+ # anyway just in case we need it later on.
+ set lb {(?:^|[^[:alnum:]_])}
+ set rb {(?![[:alnum:]_~])}
+ set tmplist {}
+ foreach term $formatted_searchtext {
+ lappend tmplist [join [list $lb $term $rb] ""]
+ }
+ set formatted_searchtext $tmplist
+ }
+ set terms_to_match 1
+ if { $::dialog_helpbrowser2::matchall == 1 } {
+ set terms_to_match [llength $formatted_searchtext]
+ }
+
set dirs [concat [file join $::sys_libdir doc] $::sys_searchpath $::sys_staticpath]
foreach basedir $dirs {
# Fix the directory name, this ensures the directory name is in the
@@ -616,19 +635,9 @@ proc ::dialog_helpbrowser2::directory_sort { list } {
proc ::dialog_helpbrowser2::searchfile {searchtext file_contents widget filename basedir} {
variable count
variable genres
+ variable terms_to_match
set match 0
- set terms_to_match 1
- if { $::dialog_helpbrowser2::matchall == 1 } {
- set terms_to_match [llength $searchtext]
- }
- # let's design our own word boundaries since tildes often end Pure Data words.
- # homemade left boundary isn't necessary, but makes it easy to change later
- set lb {(?:^|[^[:alnum:]_])}
- set rb {(?![[:alnum:]_~])}
foreach term $searchtext {
- if {$::dialog_helpbrowser2::matchwords == 1} {
- set term [join [list $lb $term $rb] ""]
- }
if {[regexp -nocase -- $term $filename] ||
[regexp -nocase -- $term [join $file_contents]]} {
incr match
@@ -759,6 +768,10 @@ proc ::dialog_helpbrowser2::intro { t } {
$t insert end "\n"
$t insert end [_ "External Pd libraries"] "link libdirs intro_libdirs"
$t insert end "\n"
+ $t insert end [_ "Pure Data Glossary"] "link homepage_file"
+ $t insert end [file join $::sys_libdir doc 5.reference] basedir
+ $t insert end glossary.pd filename
+ $t insert end "\n"
$t insert end [_ "Browse Introductory Topics"] homepage_title
$t insert end "\n"
set intro_docs [list \