Projects STRLCPY neomutt Commits 1ce925cf
🤬
  • feat(notmuch): allow usage of notmuch profiles

    Introduce the `nm_config_profile` option for users to use notmuch
    profiles. It has a default of an empty string so notmuch will try
    `NOTMUCH_PROFILE` or the default value (`default` for directories, empty
    string for config files.)
  • Loading...
  • Austin Ray committed with Richard Russon 2 years ago
    1ce925cf
    1 parent ecc8075f
  • ■ ■ ■ ■ ■ ■
    docs/manual.xml.head
    skipped 16248 lines
    16249 16249   </entry>
    16250 16250   </row>
    16251 16251   <row>
     16252 + <entry><literal>nm_config_profile</literal></entry>
     16253 + <entry>string</entry>
     16254 + <entry>(empty)</entry>
     16255 + <entry>
     16256 + Configuration profile for the notmuch database. Only useful
     16257 + for notmuch 0.32+.
     16258 + </entry>
     16259 + </row>
     16260 + <row>
    16252 16261   <entry><literal>nm_db_limit</literal></entry>
    16253 16262   <entry>number</entry>
    16254 16263   <entry><literal>0</literal></entry>
    skipped 4176 lines
  • ■ ■ ■ ■ ■ ■
    notmuch/config.c
    skipped 98 lines
    99 99   { "nm_config_file", DT_PATH, IP "auto", 0, NULL,
    100 100   "(notmuch) Configuration file for notmuch. Use 'auto' to detect configuration."
    101 101   },
     102 + { "nm_config_profile", DT_STRING, 0, 0, NULL,
     103 + "(notmuch) Configuration profile for notmuch."
     104 + },
    102 105   { "nm_db_limit", DT_NUMBER|DT_NOT_NEGATIVE, 0, 0, NULL,
    103 106   "(notmuch) Default limit for Notmuch queries"
    104 107   },
    skipped 69 lines
  • ■ ■ ■ ■
    notmuch/db.c
    skipped 126 lines
    127 127  #if LIBNOTMUCH_CHECK_VERSION(5, 4, 0)
    128 128   // notmuch 0.32-0.32.2 didn't bump libnotmuch version to 5.4.
    129 129   const char *config_file = get_nm_config_file();
     130 + const char *const config_profile = cs_subset_string(NeoMutt->sub, "nm_config_profile");
    130 131   
    131  - st = notmuch_database_open_with_config(filename, mode, config_file, NULL, &db, &msg);
     132 + st = notmuch_database_open_with_config(filename, mode, config_file,
     133 + config_profile, &db, &msg);
    132 134   
    133 135   // Attempt opening database without configuration file. Don't if the user specified no config.
    134 136   if (st == NOTMUCH_STATUS_NO_CONFIG && !mutt_str_equal(config_file, ""))
    skipped 51 lines
    186 188   mutt_clear_error();
    187 189   }
    188 190   }
     191 + 
    189 192   return db;
    190 193  }
    191 194   
    skipped 204 lines
Please wait...
Page is in error, reload to recover