unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jani Nikula <jani@nikula.org>
To: notmuch@notmuchmail.org
Cc: jani@nikula.org
Subject: [PATCH 3/5] doc: use envvar directive and role for environment variables
Date: Fri, 21 May 2021 23:44:11 +0300	[thread overview]
Message-ID: <20210521204413.554563-4-jani@nikula.org> (raw)
In-Reply-To: <20210521204413.554563-1-jani@nikula.org>

Make man1/notmuch.rst the single point of truth for describing notmuch
environment variables. Use the envvar directive for that, and
reference them with the envvar role.

Drive-by cleanup configuration file and hook directory search order
documentation.
---
 doc/man1/notmuch-compact.rst   | 10 --------
 doc/man1/notmuch-config.rst    | 42 +++++++++++++++++-----------------
 doc/man1/notmuch-emacs-mua.rst | 10 ++++----
 doc/man1/notmuch.rst           | 36 +++++++++++++++++------------
 4 files changed, 49 insertions(+), 49 deletions(-)

diff --git a/doc/man1/notmuch-compact.rst b/doc/man1/notmuch-compact.rst
index 85f611bf44e5..3e3e70c532ca 100644
--- a/doc/man1/notmuch-compact.rst
+++ b/doc/man1/notmuch-compact.rst
@@ -35,16 +35,6 @@ Supported options for **compact** include
 ``--quiet``
     Do not report database compaction progress to stdout.
 
-ENVIRONMENT
-===========
-
-The following environment variables can be used to control the behavior
-of notmuch.
-
-**NOTMUCH\_CONFIG**
-    Specifies the location of the notmuch configuration file. Notmuch
-    will use ${HOME}/.notmuch-config if this variable is not set.
-
 SEE ALSO
 ========
 
diff --git a/doc/man1/notmuch-config.rst b/doc/man1/notmuch-config.rst
index 5c980a8a4bb8..129d4b810261 100644
--- a/doc/man1/notmuch-config.rst
+++ b/doc/man1/notmuch-config.rst
@@ -235,39 +235,39 @@ paths are presumed relative to `$HOME` for items in section
     :any:`notmuch-search-terms(7)` for more information about named
     queries.
 
-ENVIRONMENT
-===========
-
-The following environment variables can be used to control the behavior
-of notmuch.
-
-**NOTMUCH\_CONFIG**
-    Specifies the location of the notmuch configuration file.
-
-**NOTMUCH_PROFILE**
-    Selects among notmuch configurations.
-
 FILES
 =====
 
 CONFIGURATION
 -------------
 
-If ``NOTMUCH_CONFIG`` is unset, notmuch tries (in order)
+Notmuch configuration file search order:
 
-- ``$XDG_CONFIG_HOME/notmuch/<profile>/config`` where ``<profile>`` is
-  defined by ``$NOTMUCH_PROFILE`` or "default"
-- ``${HOME}/.notmuch-config<profile>`` where ``<profile>`` is
-  ``.$NOTMUCH_PROFILE`` or ""
+1. File specified by ``--config=FILE`` global option; see
+   :any:`notmuch(1)`.
+
+2. File specified by :envvar:`NOTMUCH_CONFIG` environment variable.
+
+3. ``$XDG_CONFIG_HOME/notmuch/<profile>/config`` where ``<profile>``
+   is defined by :envvar:`NOTMUCH_PROFILE` environment variable if
+   set, ``$XDG_CONFIG_HOME/notmuch/default/config`` otherwise.
+
+4. ``$HOME/.notmuch-config.<profile>`` where ``<profile>`` is defined
+   by :envvar:`NOTMUCH_PROFILE` environment variable if set,
+   ``$HOME/.notmuch-config`` otherwise.
 
 Hooks
 -----
 
-If ``database.hook_dir`` is unset, notmuch tries (in order)
+Notmuch hook directory search order:
+
+1. Directory specified by ``database.hook_dir`` configuration option.
+
+2. ``$XDG_CONFIG_HOME/notmuch/<profile>/hooks`` where ``<profile>``
+   is defined by :envvar:`NOTMUCH_PROFILE` environment variable if
+   set, ``$XDG_CONFIG_HOME/notmuch/default/hooks`` otherwise.
 
-- ``$XDG_CONFIG_HOME/notmuch/<profile>/hooks`` where ``<profile>`` is
-  defined by ``$NOTMUCH_PROFILE`` or "default"
-- ``<database.path>/.notmuch/hooks``
+3. ``<database.path>/.notmuch/hooks``
 
 SEE ALSO
 ========
diff --git a/doc/man1/notmuch-emacs-mua.rst b/doc/man1/notmuch-emacs-mua.rst
index a599b6ebc7bf..c0d5b1a7c476 100644
--- a/doc/man1/notmuch-emacs-mua.rst
+++ b/doc/man1/notmuch-emacs-mua.rst
@@ -72,11 +72,13 @@ Options may be specified multiple times.
 ENVIRONMENT VARIABLES
 =====================
 
-**EMACS**
-    Name of emacs command to invoke. Defaults to "emacs".
+.. envvar:: EMACS
 
-**EMACSCLIENT**
-    Name of emacsclient command to invoke. Defaults to "emacsclient".
+   Name of emacs command to invoke. Defaults to "emacs".
+
+.. envvar:: EMACSCLIENT
+
+   Name of emacsclient command to invoke. Defaults to "emacsclient".
 
 SEE ALSO
 ========
diff --git a/doc/man1/notmuch.rst b/doc/man1/notmuch.rst
index 7b84ef447935..93135bdd6abb 100644
--- a/doc/man1/notmuch.rst
+++ b/doc/man1/notmuch.rst
@@ -52,7 +52,7 @@ Supported global options for ``notmuch`` include
 
 ``--config=FILE``
     Specify the configuration file to use. This overrides any
-    configuration file specified by ${NOTMUCH\_CONFIG}. The empty
+    configuration file specified by :envvar:`NOTMUCH_CONFIG`. The empty
     string is a permitted and sometimes useful value of *FILE*, which
     tells ``notmuch`` to use only configuration metadata from the database.
 
@@ -79,7 +79,7 @@ use, (or to reconfigure it later).
 The setup command will prompt for your full name, your primary email
 address, any alternate email addresses you use, and the directory
 containing your email archives. Your answers will be written to a
-configuration file in ${NOTMUCH\_CONFIG} (if set) or
+configuration file in :envvar:`NOTMUCH_CONFIG` (if set) or
 ${HOME}/.notmuch-config . This configuration file will be created with
 descriptive comments, making it easy to edit by hand later to change the
 configuration. Or you can run **notmuch setup** again to change the
@@ -128,8 +128,8 @@ CUSTOM COMMANDS
 ---------------
 
 If the given command is not known to notmuch, notmuch tries to execute
-the external **notmuch-<subcommand>** in ${PATH} instead. This allows
-users to have their own notmuch related tools to be run via the
+the external **notmuch-<subcommand>** in :envvar:`PATH` instead. This
+allows users to have their own notmuch related tools to be run via the
 notmuch command. By design, this does not allow notmuch's own commands
 to be overridden using external commands.
 
@@ -153,18 +153,26 @@ ENVIRONMENT
 The following environment variables can be used to control the behavior
 of notmuch.
 
-**NOTMUCH\_CONFIG**
-    Specifies the location of the notmuch configuration file. Notmuch
-    will use ${HOME}/.notmuch-config if this variable is not set.
+.. envvar:: NOTMUCH_CONFIG
 
-**NOTMUCH\_TALLOC\_REPORT**
-    Location to write a talloc memory usage report. See
-    **talloc\_enable\_leak\_report\_full** in :manpage:`talloc(3)` for more
-    information.
+   Specifies the location of the notmuch configuration file. See
+   :any:`notmuch-config(1)` for details.
 
-**NOTMUCH\_DEBUG\_QUERY**
-    If set to a non-empty value, the notmuch library will print (to
-    stderr) Xapian queries it constructs.
+.. envvar:: NOTMUCH_PROFILE
+
+   Selects among notmuch configurations. See :any:`notmuch-config(1)`
+   for details.
+
+.. envvar:: NOTMUCH_TALLOC_REPORT
+
+   Location to write a talloc memory usage report. See
+   **talloc\_enable\_leak\_report\_full** in :manpage:`talloc(3)` for more
+   information.
+
+.. envvar:: NOTMUCH_DEBUG_QUERY
+
+   If set to a non-empty value, the notmuch library will print (to
+   stderr) Xapian queries it constructs.
 
 SEE ALSO
 ========
-- 
2.30.2

  parent reply	other threads:[~2021-05-21 20:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-21 20:44 [PATCH 0/5] doc: man page cleanup Jani Nikula
2021-05-21 20:44 ` [PATCH 1/5] doc: use manpage role references to external man pages Jani Nikula
2021-05-21 20:44 ` [PATCH 2/5] doc: cross-reference notmuch man pages with actual links Jani Nikula
2021-05-21 20:44 ` Jani Nikula [this message]
2021-05-21 20:44 ` [PATCH 4/5] doc: use program and option directives to document options Jani Nikula
2021-05-21 20:44 ` [PATCH 5/5] doc: example command-line option reference Jani Nikula
2021-05-22 19:51 ` [PATCH 0/5] doc: man page cleanup David Bremner
2021-05-22 22:15   ` Jani Nikula
2021-05-22 22:33     ` David Bremner
2021-05-22 22:56       ` Jani Nikula
2021-05-22 23:43         ` David Bremner
2021-05-23 11:13 ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210521204413.554563-4-jani@nikula.org \
    --to=jani@nikula.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).