From 45e5887f5b33e5f30d3c16187bb5d6e707983804 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 3 Aug 2026 20:53:49 +0200 Subject: feat(config): add completion_on_focus and extra_mimetypes Mimetypes are the one completion list with no enumerator, so the user can extend it. Entries append to the built-ins and a malformed one is skipped with a problem recorded rather than dropping the whole list. Co-Authored-By: Claude Opus 5 --- src/config.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/config.h') diff --git a/src/config.h b/src/config.h index f3f1706..63fa541 100644 --- a/src/config.h +++ b/src/config.h @@ -23,6 +23,8 @@ #include #include +#include "completionentry.h" + /// One mail account. notmuch has no concept of accounts; it sees a single flat /// tree. An account is therefore a path prefix within that tree plus an /// identity. @@ -95,6 +97,19 @@ public: /// ever the default. Clamped by MessageView::clampZoom() on use. qreal messageZoom() const { return m_messageZoom; } + /// Whether focusing an empty query bar opens the completion popup. Off by + /// default: it is helpful when learning the query language and intrusive + /// once it is known. The manual trigger works regardless. + bool completionOnFocus() const { return m_completionOnFocus; } + + /// User-supplied mimetype completions, APPENDED to the built-in list. + /// Appending rather than replacing means a typo cannot leave completion + /// worse off than the defaults. Mimetypes are the only completion list a + /// user can extend, because they are the only one with no enumerator and + /// an open-ended set: prefixes are fixed, paths come from the configured + /// accounts, dates are closed, tags come from the database. + QList extraMimetypes() const { return m_extraMimetypes; } + /// Every non-fatal problem, both kinds below. Shown in the status bar. QStringList warnings() const { return m_warnings; } @@ -119,6 +134,8 @@ private: QString m_syncCommand; QString m_notmuchConfig; qreal m_messageZoom = 1.0; + bool m_completionOnFocus = false; + QList m_extraMimetypes; QString m_startupQuery = QStringLiteral("Unread"); /// Whether startup_query came from the config rather than being the -- cgit v1.2.3