@node GNATS user tools
@chapter The @sc{gnats} User Tools
@cindex usage for the @sc{gnats} user tools
@cindex invoking the @sc{gnats} user tools

This chapter describes the user tools distributed with @sc{gnats}.  The
@sc{gnats} administrative and internal tools are described in
@ref{Management,,@sc{gnats} Administration}. The user tools provide
facilities for initial submission, querying and editing of Problem
Reports:

@table @code
@item send-pr
Used by anyone who has a problem with a body of work to submit a report
of the problem to the maintainers of that work
(@pxref{send-pr,,Submitting Problem Reports}).

@item query-pr
Used to query the @sc{gnats} database (@pxref{query-pr,,Querying the
database}).

@item edit-pr
Used to edit Problem Reports (to record new data, to change the
responsible party, etc.) (@pxref{edit-pr,,Editing existing Problem
Reports}).
@end table

@menu
* Environment::       Environment variables and GNATS tools
* send-pr::           Submitting Problem Reports
* edit-pr::           Editing existing Problem Reports
* query-pr::          Querying the database
* Emacs::             The Emacs interface
@end menu

@node Environment
@section Environment variables and @sc{gnats} tools
@cindex environment variables and GNATS tools
@cindex @code{GNATSDB}

All the @sc{gnats} user tools honor the @code{GNATSDB} environment
variable which is used to determine which database to use.  For a local
database, it contains the name of the database to access.

For network access via gnatsd, it contains a colon-separated list of
strings that describe the remote database in the form

@smalldisplay
@var{server:port:databasename:username:password}
@end smalldisplay

Any of the fields may be omitted except for @var{server}, but at least
one colon must appear; otherwise, the value is assumed to be the name of
a local database.

If @code{GNATSDB} is not set and no command-line options are used to
specify the database, it is assumed that the database is local and that
its name is @samp{default}.

@node send-pr
@section Submitting Problem Reports
@cindex @code{send-pr}
@cindex using @code{send-pr}
@cindex invoking @code{send-pr}
@cindex reporting problems with @code{send-pr}

Use @code{send-pr} to submit Problem Reports to the database.
@code{send-pr} is a shell script which composes a template for
submitters to complete.

@lowersections
@include s-usage.texi
@raisesections

@c ---------------------------------------------------------------
@node edit-pr
@section Editing existing Problem Reports
@cindex using @code{edit-pr}
@cindex invoking @code{edit-pr}
@cindex @code{edit-pr}

Use @code{edit-pr} to make changes to existing PRs in the database.
This tool can be invoked both from a shell prompt or from within GNU
Emacs using @samp{M-x edit-pr}.

@code{edit-pr} first examines the PR you wish to edit and locks it if it
is not already locked.  This is to prevent you from editing a PR at the
same time as another user.  If the PR you wish to edit is already in the
process of being edited, @code{edit-pr} tells you the name of the person
who owns the lock.

You may edit any non-readonly fields in the database.  We recommend that
you avoid deleting any information in the @sc{Text} and @sc{MultiText}
fields (such as @code{Description} and @code{How-To-Repeat}
(@pxref{Fields,,Problem Report format}).  We also recommend that you
record the final solution to the problem in the @code{Fix} field for
future reference.  Note that heavily customized installations of
@sc{gnats} may have differently named fields, and sites using such
installations should provide their own set of routines and instructions
regarding how PRs should be treated throughout their life span.

After the PR has been edited, it is then resubmitted to the database,
and the index is updated (@pxref{index file,,The @code{index} file}).
For information on @code{pr-edit}, the main driver for @code{edit-pr},
see @ref{Internal utils,,Internal utilities}.

If you change a field that requires a reason for the change, such as the
@code{Responsible} or @code{State} fields in the default configuration,
@code{edit-pr} prompts you to supply a reason for the change.  A message
is then appended to the @code{Audit-Trail} field of the PR with the
changed values and the change reason.

Depending on how the database is configured, editing various fields in
the PR may also cause mail to be sent concerning these changes.  In the
default configuration, any fields that generate @samp{Audit-Trail}
entries will also cause a copy of the new @samp{Audit-Trail} message to
be sent.

Mail received at the PR submission email address and recognized by
@sc{gnats} as relating to an existing PR is also appended to the
@samp{Audit-Trail} field, see @ref{follow-up via email}.

@menu
* edit-pr from the shell::  Invoking @code{edit-pr} from the shell
* follow-up via email:: Following up via direct email
@end menu

@node edit-pr from the shell
@subsection Invoking @code{edit-pr} from the shell
@cindex @code{edit-pr} from the shell

The usage for @code{edit-pr} is:

@smallexample
edit-pr [ -V | --version ] [ -h | --help ]
        [-d @var{database} | --database @var{database}] @var{PR Number}
@end smallexample

@noindent
Network-mode-only options:

@smallexample
         [--host @var{host} | -H @var{host}] [--port @var{port}]
         [--user @var{user} | -v @var{user}]
         [--passwd @var{passwd} | -w @var{passwd}]
@end smallexample

@noindent
The options have the following meaning:

@table @code
@item -h, --help
Prints a brief usage message for edit-pr.

@item -V, --version
Prints the version number for edit-pr.

@item -d @var{database}, --database @var{database}
Specifies the database containing the PR to be edited; if no database is
specified, the database named @samp{default} is assumed.  This option
overrides the database specified in the @code{GNATSDB} environment
variable.

@item --host @var{host}, -H @var{host}
Specifies the hostname of the gnatsd server to communicate with.  This
overrides the value in the @code{GNATSDB} environment variable.

@item --port @var{port}
Specifies the port number of the gnatsd server to communicate with.
This overrides the value in the @code{GNATSDB} environment variable.

@item --user @var{user}, -v @var{user}
Specifies the username to login with when connecting to the gnatsd
server.  This overrides the value in the @code{GNATSDB} environment
variable.

@item --passwd @var{passwd}, -w @var{passwd}
Specifies the password to login with when connecting to the gnatsd
server.  This overrides the value in the @code{GNATSDB} environment
variable.
@end table

@code{edit-pr} calls the editor specified in your environment variable
@code{EDITOR} on a temporary copy of that PR.  (If you don't have the
variable @code{EDITOR} defined in your environment, the default editor
@code{vi} is used.)

Edit the PR, changing any relevant fields or adding to existing
information.  When you exit the editor, @code{edit-pr} prompts you on
standard input for a reason if you have changed a field that requires
specifying a reason for the change.

@node follow-up via email
@subsection Following up via direct email
@cindex follow-up via email
@cindex subsequent mail
@cindex related mail

If you have some additional information for a PR and for some reason
do not want to (or cannot) edit the PR directly, you may append
the information to the Audit-Trail field by mailing it to the PR
submission address.

In order for GNATS to be able to recognize the mail as pertaining to an
existing PR (as opposed to a new PR, see @ref{Submitting via e-mail,,}),
the Subject mail header field must contain a reference to the PR.
GNATS matches the Subject header against the regular expression

@smallexample
\<(PR[ \t#/]?|[-[:alnum:]+.]+/)[0-9]+
@end smallexample

@noindent
to determine whether such a reference is present. Any text may precede
or follow the reference in the Subject header. If more than one reference
is present, the first is used and the rest ignored.

A PR reference matching the regular expression above has two parts. The
second is the PR number (one or more digits). The first is either the
capital letters 'PR' optionally followed by a separator character (blank,
tab, hash mark or forward slash) or the category name followed by a
forward slash. Following are some examples which match the regular
expression:

@smallexample
PR 123 PR4567 PR#890 gnats/4711
@end smallexample

The PR number and the category (if present) are checked for existence,
and if the outcome is positive, the mail is appended to the Audit-Trail
field of the PR. Note that the PR need not belong to the category because
PRs may move between categories.

Outgoing emails sent by GNATS itself may be configured to have a Subject
header field that refers to the PR in question:

@smallexample
Subject: Re: PR @var{category}/@var{gnats-id}: @var{original message subject}
@end smallexample

This makes it extremely easy to follow up on a PR by replying to such an
email, see @ref{dbconfig file,,The @code{dbconfig} file} and the sample,
default @code{dbconfig} file installed by @code{mkdb}.

@c ---------------------------------------------------------------
@node query-pr
@section Querying the database
@cindex using @code{query-pr}
@cindex invoking @code{query-pr}
@cindex @code{query-pr}
@cindex querying individual problem reports

Obtain information from the database by using the program
@w{@code{query-pr}}. @code{query-pr} uses search parameters you provide
to find matching Problem Reports in the database.  You can invoke
@code{query-pr} from the shell or from within Emacs.  @code{query-pr}
uses the same arguments whether it is invoked from the shell or from
Emacs.

PRs may be selected via the use of the @code{--expr} option, directly by
number, or by the use of the (now deprecated) field-specific query
operators.

By default, query options are connected with a logical AND.  For
example,

@smallexample
query-pr --category=foo --responsible=bar
@end smallexample

@noindent
only prints PRs which have a Category field of @samp{foo} and a Responsible
field of @samp{bar}.

The @code{--or} option may be used to connect query options with a logical
OR. For example,

@smallexample
query-pr --category=baz --or --responsible=blee
@end smallexample

@noindent
prints PRs which have either a Category field of @samp{baz} or a Responsible
field of @samp{blee}.

It should be emphasized, however, that the use of these field-specific
options is strongly discouraged, since they exist only for compatibility
with older versions of @sc{gnats} and are likely to be deleted in the next
release.  The expressions specified by the @code{--expr} option are much more
flexible (see below).

@menu
* Invoking query-pr::
* Formatting query-pr output::
* Query expressions::
* Example queries::
@end menu

@node Invoking query-pr
@subsection Invoking @code{query-pr}

From the shell, simply type @kbd{query-pr}, followed by any search
parameters you wish to exercise.  From Emacs, type @w{@kbd{M-x
query-pr}}.  @code{query-pr} prompts you for search parameters in the
minibuffer.

@cindex @code{query-pr} by mail
@code{query-pr} can also be accessed by electronic mail, if your version
of @sc{gnats} is configured for this.  To use this feature, simply send
mail to the address @w{@samp{query-pr@@@var{your-site}}} with command
line arguments or options in the @code{Subject} line of the mail header.
@sc{gnats} replies to your mail with the results of your query.  The
default settings for the @code{query-pr} mail server are

@cindex the section on query-by-mail needs to be relocated
@smallexample
--restricted --state="open|analyzed|feedback|suspended"
@end smallexample

@noindent
To override the @code{--state} parameter, specify
@w{@code{--state=@var{state}}} in the @code{Subject} line of the mail
header.  You can not query on confidential Problem Reports by mail.

The usage for @code{query-pr} is:

@smallexample
query-pr [--debug | -D] [--help | -h] [--version | -V]
         [--output @var{file} | -o @var{file}] [--list-databases]
         [--list-fields] [--list-input-fields]
         [--responsible-address @var{name}] [--field-type @var{field}]
         [--field-description @var{field}]
         [--field-flags @var{field}]
         [--adm-field @var{field}] [--adm-subfield @var{subfield}]
         [--adm-key @var{key}]
         [--valid-values @var{field}]
         [--format @var{format} | -f @var{format}]
         [--full | -F] [--summary | -q]
         [--database @var{database} | -d @var{database}] [--and | -&]
         [--or | -|] [--expr @var{expr}] [PR Number]
@end smallexample

Non-network-mode options:

@smallexample
         [--print-sh-vars] [--print-directory-for-database]
@end smallexample

Network-mode-only options:

@smallexample
         [--host @var{host} | -H @var{host}] [--port @var{port}]
         [--user @var{user} | -v @var{user}] [--passwd @var{passwd} | -w @var{passwd}]
         [--print-server-addr]
@end smallexample

Deprecated Options:
@smallexample
         [--list-categories | -j] [--list-states | -T]
         [--list-responsible | -k] [--list-submitters | -l]
         [--category @var{category} | -c @var{category}]
         [--synopsis @var{synopsis} | -y @var{synopsis}]
         [--confidential @var{confidential} | -C @var{confidential}]
         [--multitext @var{multitext} | -m @var{multitext}]
         [--originator @var{originator} | -O @var{originator}]
         [--release @var{release} | -A @var{release}]
         [--class @var{class} | -L @var{class}] [--cases @var{cases} | -E @var{cases}]
         [--quarter @var{quarter} | -Q @var{quarter}]
         [--keywords @var{keywords} | -K @var{keywords}]
         [--priority @var{priority} | -p @var{priority}]
         [--responsible @var{responsible} | -r @var{responsible}]
         [--restricted | -R] [--severity @var{severity} | -e @var{severity}]
         [--skip-closed | -x] [--sql | -i] [--sql2 | -I]
         [--state @var{state} | -s @var{state}]
         [--submitter @var{submitter} | -S @var{submitter}]
         [--text @var{text} | -t @var{text}]
         [--required-before @var{date} | -u @var{date}]
         [--required-after @var{date} | -U @var{date}]
         [--arrived-before @var{date} | -b @var{date}]
         [--arrived-after @var{date} | -a @var{date}]
         [--modified-before @var{date} | -B @var{date}]
         [--modified-after @var{date} | -M @var{date}]
         [--closed-before @var{date} | -z @var{date}]
         [--closed-after @var{date} | -Z @var{date}]
@end smallexample

The options have the following meaning:
@table @code

@item --help, -h
Prints a help message.

@item --version, -V
Displays the program version to stdout.

@item --output @var{file}, -o @var{file}
The results of the query will be placed in this file.

@item --database @var{database}, -d @var{database}
Specifies the database to be used for the query.  If no database is
specified, the database named default is assumed.  (This option
overrides the database specified in the @code{GNATSDB} environment
variable; see @ref{Environment} for more
information.)

@item --list-categories, -j
Lists the available PR categories for the selected database.

@item --list-states, -T
Lists the valid PR states for PRs in this database.

@item --list-responsible, -k
Lists the users that appear in the database's responsible list.

@item --list-submitters, -l
Lists the valid submitters for this database.
@end table

The previous --list-* options are deprecated and may be removed in
future releases of @sc{gnats}; their functionality can be replaced with

@smallexample
query-pr --valid-values @var{field}
@end smallexample

@noindent
where @var{field} is one of @code{Category}, @code{Class},
@code{Responsible}, @code{Submitter-Id}, or @code{State}.

@table @code
@item --list-databases
Lists the known databases.

@item --list-fields
Lists the entire set of field names for PRs in the selected database.

@item --list-input-fields
Lists the fields that should be provided when creating a new PR for the
currently-specified database.  The fields are listed in an order that
would make sense when used in a template or form.

@item --field-type @var{field}
Returns the data type contained in PR field @var{field}.  The current
set of data types includes @samp{text}, @samp{multitext}, @samp{enum},
@samp{multienum}, @samp{enumerated-in-file},
@samp{multi-enumerated-in-file}, @samp{date} and @samp{integer}.

@item --field-description @var{field}
Returns a human-readable description of the intended purpose of @var{field}.

@item --field-flags @var{field}
Returns the flags set for the field in the @file{dbconfig} file
associated with the database, such as @code{textsearch} and
@code{readonly}.  @xref{Individual field configuration}.

@item --adm-field @var{field}
Used together with the @code{--adm-key} option, this returns a record
from the administrative file (if any) associated with the field.  For
more material on administrative files, see @ref{administrative
files,,Enumerated field administrative files}.

@item --adm-subfield @var{subfield}
Used together with the @code{--adm-field} and @code{--adm-key} options,
this returns the contents of a particular subfield from the record
specified by @code{--adm-field} and @code{--adm-key}.  Subfields are
treated in @ref{administrative files,,Enumerated field administrative
files}.

@item --adm-key @var{key}
Used together with @code{--adm-field} to select a record from the
administrative file associated with the field specified by
@code{--adm-field}.  @xref{administrative
files,,Enumerated field administrative files}.

@item --valid-values @var{field}
For fields of type @samp{enum}, a list of valid values (one per line) is
returned.  Otherwise, a regular expression is returned that describes
the legal values in @var{field}.

@item --responsible-address @var{name}
The mail address of @var{name} is returned; @var{name} is assumed to be
a name either appearing in the database's responsible list, or is
otherwise a user on the system.

@item --print-sh-vars
A set of @file{/bin/sh} variables is returned that describe the selected
database.  They include:

@table @code
@item GNATSDB
The name of the currently-selected database.

@item GNATSDB_VALID
Set to 1 if the selected database is valid.

@item GNATSDBDIR
The directory  where  the  database  contents  are
stored.

@item DEBUG_MODE
Set to 1 if debug mode has been  enabled  for  the
database.

@item DEFAULTCATEGORY
The default category for PRs in the database.

@item DEFAULTSTATE
The default state for PRs in the database.
@end table

@item --print-server-addr
Prints the information about a remote server database in the format
suitable for the @code{GNATSDB} environment variable.  This option
works only in the network mode.

@item --print-directory-for-database
Returns the directory where the selected database is located.

@item --format @var{format}, -f @var{format}
Used to specify the format of the output PRs, See @ref{Formatting
query-pr output} for a complete description.

@item --full, -F
When printing PRs, the entre PR is displayed.  This is exactly
equivalent to

@smallexample
query-pr --format full
@end smallexample

@item --summary, -q
When printing PRs, a summary format is used.  This is exactly equivalent
to

@smallexample
query-pr --format @var{summary}
@end smallexample

@item --debug, -D
Enables debugging output for network queries.

@item --host @var{host}, -H @var{host}
Specifies the hostname of the gnatsd server to communicate with.  This
overrides the value in the @code{GNATSDB} environment variable.

@item --port @var{port}
Specifies the port number of the gnatsd server to communicate with.
This overrides the value in the @code{GNATSDB} environment variable.

@item --user @var{user}, -v @var{user}
Specifies the username to login with when connecting to the gnatsd
server.  This overrides the value in the @code{GNATSDB} environment
variable.

@item --passwd @var{passwd}, -w @var{passwd}
Specifies the password to login with when connecting to the gnatsd
server.  This overrides the value in the @code{GNATSDB} environment
variable.

@item --and, -&, --or, -|
These options are used when connecting multiple query operators
together.  They specify whether the previous and subsequent options are
to be logically ANDed or logically ORed.

@item --expr @var{expr}
Specifies a query expression to use when searching for PRs.  @xref{Query
expressions}.
@end table

The remaining deprecated options are not described here, since their use
is fairly obvious and their functionality is completely replaced by the
use of the @code{--expr} option.

@node Formatting query-pr output
@subsection Formatting @code{query-pr} output
@cindex query-pr output format

Printing formats for PRs are in one of three forms:

@table @var
@item formatname
This is a named format which is described by the database (specifically,
these formats are described in the @file{dbconfig} file associated with the
database).  The default configuration contains five such formats:
@samp{standard}, @samp{full}, @samp{summary}, @samp{sql}, and
@samp{sql2}.

The first three are the ones most commonly used when performing queries.
standard is the format used by default if no other format is specified.

Use of the latter two are discouraged; they are merely kept for
historical purposes.  Other named formats may have been added by the
database administrator.

@item fieldname
A single field name may appear here.  Only the contents of this field
will be displayed.

@item '"printf string" fieldname fieldname ...'
This provides a very flexible mechanism for formatting PR output.  (The
formatting is identical to that provided by the named formats described
by the database configuration, @xref{Named query definitions}.  The
@var{printf string} can contain the following % sequences:

@code{%[positionalspecifiers]s}: Prints the field as a string.  The
positional specifiers are similar to those of printf, as +, - and digit
qualifiers can be used to force a particular alignment of the field
contents.

@code{%[positionalspecifiers]S}: Similar to @code{%s}, except that the
field contents are terminated at the first space character.

@code{%[positionalspecifiers]d}: Similar to @code{%s}, except that the
field contents are written as a numeric value.  For integer fields, the
value is written as a number.  For enumerated fields, the field is
converted into a numeric equivalent (i.e. if the field can have two
possible values, the result will be either 1 or 2).  For date fields,
the value is written as seconds since Jan 1, 1970.

@code{%F}: The field is written as it would appear within a PR, complete
with field header.

@code{%D}: For date fields, the date is written in a standard @sc{gnats}
format.

@code{%Q}: For date fields, the date is written in an arbitrary "SQL"
format.
@end table

An example formatted query looks as follows (note that the whole format
specification should be quoted):

@smallexample
query-pr --format '"%s, %s" Synopsis State'
@end smallexample

@node Query expressions
@subsection Query expressions
@cindex query expressions

@noindent
Query expressions are used to select specific PRs based on their field
contents.  The general form is

@smallexample
fieldname|"value" operator fieldname|"value" [booleanop ...]
@end smallexample

@var{value} is a literal string or regular expression; it must be
surrounded by double quotes, otherwise it is interpreted as a fieldname.

@var{fieldname} is the name of a field in the PR.

@var{operator} is one of:

@table @code
@item =
The value of the left-hand side of the expression must exactly match the
regular expression on the right-hand side of the expression.
@xref{Regexps,,Querying using regular expressions}.

@item ~
Some portion of the left-hand side of the expression must match the
regular expression on the right-hand side.

@item ==
The value of the left-hand side must be equal to the value on the
right-hand side of the expression.

The equality of two values depends on what type of data is stored in the
field(s) being queried.  For example, when querying a field containing
integer values, literal strings are interpreted as integers.  The query
expression

@smallexample
Number == "0123"
@end smallexample

@noindent
is identical to

@smallexample
Number == "123"
@end smallexample

@noindent
as the leading zero is ignored.  If the values were treated as strings
instead of integers, then the two comparisons would return different
results.

@item !=
The not-equal operator. Produces the opposite result of the == operator.

@item <,>
The left-hand side must have a value less than or greater than the
right-hand side.  Comparisons are done depending on the type of data
being queried; in particular, integer fields and dates use a numeric
comparison, and enumerated fields are ordered depending on the numeric
equivalent of their enumerated values.
@end table

@var{booleanop} is either @samp{|} (logical or), or @samp{&} (logical
and).  The query expression

@smallexample
Category="baz" | Responsible="blee"
@end smallexample

@noindent
selects all PRs with a Category field of @samp{baz} or a Responsible
field of @samp{blee}.

The not operator @samp{!} may be used to negate a test:

@smallexample
! Category="foo"
@end smallexample

@noindent
searches for PRs where the category is not equal to the regular
expression foo.

Parentheses may be used to force a particular interpretation of the
expression:

@smallexample
!(Category="foo" & Submitter-Id="blaz")
@end smallexample

@noindent
skips PRs where the Category field is equal to @samp{foo} and the
Submitter-Id field is equal to @samp{blaz}.  Parentheses may be nested
to any arbitrary depth.

Fieldnames can be specified in several ways.  The simplest and most
obvious is just a name:

@smallexample
Category="foo"
@end smallexample

@noindent
which checks the value of the category field for the value @var{foo}.

A fieldname qualifier may be prepended to the name of the field; a colon
is used to separate the qualifier from the name.  To refer directly to a
builtin field name:

@smallexample
builtin:Number="123"
@end smallexample

In this case, @samp{Number} is interpreted as the builtin name of the
field to
check.  (This is useful if the fields have been renamed.  For further
discussion of builtin field names, see @ref{dbconfig file,,The
@code{dbconfig} file}.

To scan all fields of a particular type, the @var{fieldtype} qualifier
may be
used:

@smallexample
fieldtype:Text="bar"
@end smallexample

@noindent
This searches all text fields for the regular expression @samp{bar}.

Note that it is not required that the right-hand side of the expression
be a literal string.  To query all PRs where the PR has been modified
since it was closed, the expression

@smallexample
Last-Modified != Closed-Date
@end smallexample

@noindent
will work; for each PR, it compares the value of its Last-Modified field
against its Closed-Date field, and returns those PRs where the values
differ.  However, this query will also return all PRs with empty
Last-Modified or Closed-Date fields.  To further narrow the search:

@smallexample
Last-Modified != Closed-Date & Last-Modified != "" & Closed-Date != ""
@end smallexample

@noindent
In general, comparing fields of two different types (an integer field
against a date field, for example) will probably not do what you want.

Also, a field specifier may be followed by the name of a subfield in
braces:

@smallexample
State[type] != "closed"
@end smallexample

@noindent
or even

@smallexample
builtin:State[type] != "closed"
@end smallexample

@noindent
Subfields are further discussed in @ref{dbconfig file,,The
@code{dbconfig} file}.

@c --------------------------------------------------------

@node Example queries
@subsection Example queries
@cindex example queries

@noindent
The following simple query:

@smallexample
query-pr --expr 'Category~"rats" & State~"analyzed"
                 & Responsible~"fred"'
@end smallexample

@noindent
yields all PRs in the database which contain the field values:

@smallexample
>Category:     rats         @emph{and}
>Responsible:  fred         @emph{and}
>State:        analyzed
@end smallexample

The following query:

@smallexample
query-pr --expr 'State~"open|analyzed"'
@end smallexample

@noindent
yields all PRs in the database whose @code{State} values match either
@samp{open} or @samp{analyzed} (@pxref{Regexps,,Querying using regular
expressions}.  This search is useful as a daily report that lists all
Problem Reports which require attention.

The following query:

@smallexample
query-pr --expr 'fieldtype:Text="The quick.*brown fox"'
@end smallexample

@noindent
yields all PRs whose @sc{Text} fields contain the text @samp{The quick}
followed by @samp{brown fox} within the same field.
@xref{Regexps,,Querying using regular expressions}, which also contains
further useful examples of query expressions.

@include emacs.texi
