Supersearch Help
| Name: | Supersearch |
| Version: | 2.4 |
| Last update: | 2019-11-27 14:13:06 |
Alpha has a full repertoire of searching commands. This always-on
package implements Alpha's Find dialog, as well as several other
items in the Search menu. It allows single / multi-file / regexp /
batch / word-match / search / replace / replace-all / in-selection
operations from the same dialog box.
The 'Find' Bar
Search and Search & Replace operations can be performed using
the Find Bar. All the document windows have a Find Bar which can be
displayed using the Search ↣ Show Find Bar item. The bar contains a
Replace check box which can be checked in order to display the
replacement field. The popup menu (to the left of the Search field) has
items to specify various matching options (case insensitive, full
words, etc.). If a window is split into several panels, each text panel
can have its own Find Bar.
The Find Bar also supports incremental searches which can be enabled or
disabled using the Search ↣ Turn Incremental On or
Search ↣ Turn Incremental Off items respectively.
Regular expression searches are not available with the Find Bar.
Note that the Replace button is not displayed if the window is locked
(read only).
The 'Find' Dialog
The Find menu item in the Search menu brings up a Find dialog allowing the search and replacement
text to be specified. Alpha can search the active window, the current
selection or a set of files.
General search options
The Find dialog has checkboxes for the following options:
- Ignore Case
- Whether the search should match case ('a' and 'A' are different)
or not ('a' and 'A' are the same).
- Regexp
- The search and replace text are interpreted as regular expressions. See the
Regular Expressions help for more information or
documentation for the Tcl command [regexp].
Note that for searching purposes "\r" and "\n" are treated the same, i.e.
as a line ending character. Substitution strings are allowed, i.e. for
instance
"(some regexp) and (other regexp)" in the search string and "\1\2" in the
replacement string where "\1" and "\2" designate the matches corresponding
to the regexp patterns inside the parentheses.
Pressing the Regexp Help button will open a help::regexpHelpDialog
that provides a quick cheat sheet with regexp syntax notes -- if you
need more details on any of these topics, press the More Info button to
suspend the current search, and open the Regular Expressions help file.
- Batch
- When making a batch search, a list of all matches in the fileset or
current window are displayed in a new browser window. A particular match
can be displayed by moving the cursor to a line in the file of matches
and hitting return.
In the Search menu there is also a very useful command Next Match.
Regardless which window is frontmost, it brings the browser window to the
front, navigate down one line, and goes to the match of that line. Thus,
this gives you a quick way to jump to all matches without having to
manually bring the browser window to the front.
See the Browser Mode help window for more information about browser windows.
- Word Match
- Whether the search should match only complete words or not.
- Keep Capitals
- When performing Replace operations, whether the search should
check the case of the leading character of the string matched, and
attempt to ensure the replacement has the same case. This allows
you to replace hello by goodbye and Hello by Goodbye with
just one search operation.
- Ignore Spaces
- Ignore any differences in whitespace (spaces, tabs, newlines) between
the search string and the attempted match.
- Line Anchors
- If this flag is set, ^ and $ in regexp patterns match the start and end of
lines. This checkbox is enabled only if the Regexp checkbox is
selected.
- Dot Matches All
- If this flag is set, dots in regexp patterns match any character, including
line separators. This checkbox is enabled only if the Regexp
checkbox is selected.
Top window (single file) searches
For searches on just the current window, there are four extra options:
- From current pos
- If set (the default) the search will start at the current insertion
point. Otherwise the search will always start from the beginning of
the window. This option has no effect when doing multi-file searches.
- Circular
- Once the search reaches the end of the window (or the end of the
selected range, for In Selection searches), whether to continue
from the beginning (or, when doing backwards searches, when the
search reaches the beginning whether to continue searching from the
end). This option has no effect when doing multi-file searches.
- Not In Comments
- Don't match anything in commented out text. This option has no
effect when doing multi-file searches.
- In Selection
- Only search within the current selection. This option has no effect
when doing multi-file searches. The checkbox is displayed only if there is
a selection in the current window.
Multiple Files searches
To search through all files in a given file set. Selecting the Multiple
Files button allows you to choose one or more existing
filesets in which to search, or you can quickly create a new fileset
on the fly (with New Fileset), or search in a directory of your
choosing (with Dir Scan) -- this folder is also saved at the end of
the menu for future searches.
Read more about filesets in the Filesets Help.
- Exclude Matches
- This option to multiple file searches reverses the interpretation of
the search -- every file which doesn't match the given pattern is
flagged (and every file which does match is ignored). This useful
feature is only meaningful during Find operations and so is ignored
for Replace operations.
Search patterns and actions
The Find dialog also contains two useful popup menus:
- Patterns
- Alpha allows a library of useful search and replace texts to be
defined. This library is used and edited in the popup menu Patterns.
Selecting a pattern from the menu inserts the search and replace
strings in the dialog. The popup menu also remembers your 10 most
recent search patterns from this editing session.
- Actions
- The Actions popup menu contains a variety of actions to manipulate the
search and replace fields, e.g. switching the content of the two
fields, or quoting search strings for regexp searches. The Action
popup also provides control over the patterns library and the content
of the patterns popup. For example, Save This Pattern creates a new
item in the menu from the current search and replace strings, prompting
you for a name to use in the popup.
The 'Hyper Search' Dialog
The HyperSearch package performs multi-file searches and
displays the results in a separate window with hyperlinks that
allow you to jump directly to the corresponding match. This package is
always active and can be accessed through the Search ↣ Hyper Search… menu item.
For more information, see the Hyper Search Help page.
Supersearch Preferences
The Find dialog includes a button named Options -- a new dialog
will appear allowing you to set preferences associated with this
package that affect how searches are performed. This dialog can also be
displayed using the Search ↣ Searching Preferences menu item.
Click here to display the Supersearch Preferences panel
Here's a description for each of them:
- Beep On Failed Search
- To beep on a failed search, turn this item on. To remain silent on
failed searches, turn this item off.
- Flash matches
- Enable or disable the flashing visual feedback when a match is found.
- Box Heights
- Enter the number of rows of text to make room for in the Search For and
Replace With boxes in the search dialog
- Separate Search And Current Fileset:
- To remember the current search fileset separately to Alpha's current
fileset, turn this item on. To synchronise the search fileset with
Alpha's current fileset each time you open the search dialog, turn this
item off.
- Smart In Selection Flag:
- To set the in selection flag automatically if there's a selection of at
least 80 more characters than the length of the current search string,
turn this item on. To leave the in selection flag in its original
state, turn this item off.
- Side By Side Search And Replace:
- Present the Search and Replace fields side by side, rather
than vertically.
- Unlock Files During Batch Replacements:
- Unlock locked files when necessary to perform batch replacements.
Additional Search Packages
Alpha has other smart packages related to searches:
- The global Filters Menu allows
for even more complicated search and replace functions. It allows you to
perform successive Search And Replace operations. All the
operations are gathered in files called filters which you can
apply in one single command to any
text file opened in Alpha, or to an entire directory or a fileset.
- Incremental searching is also available: the Incremental Search Help page provides more information.
Known problems
Please report any problem or bug you encounter to
Alpha's Bug Tracker.
License and Disclaimer
Copyright (c) 1997-2019, Vince Darley and Contributors.
Contributors: Dominique d'Humieres, Pierre Basso, Bernard Desgraupes.
All rights reserved.
The supersearch package is free software and distributed under
the terms of the new BSD license:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of Vince Darley nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL VINCE DARLEY OR THE CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.