]> git.notmuchmail.org Git - notmuch/commitdiff
Merge branch 'release'
authorDavid Bremner <david@tethera.net>
Sat, 15 May 2021 12:10:58 +0000 (09:10 -0300)
committerDavid Bremner <david@tethera.net>
Sat, 15 May 2021 12:10:58 +0000 (09:10 -0300)
1  2 
NEWS
lib/open.cc
test/T310-emacs.sh

diff --combined NEWS
index 13eff6e0327128f4b616f1ddda5117233ec0e429,e1fa2d73ae027c8e2dfa666b3dcbde5be789ca5a..c0ae6afe9c7b4307a15350673c0714db0f53879c
--- 1/NEWS
--- 2/NEWS
+++ b/NEWS
@@@ -1,14 -1,9 +1,17 @@@
- Notmuch 0.32.1 (UNRELEASED)
 +Notmuch 0.33 (UNRELEASED)
 +=========================
 +
 +Vim
 +---
 +
 +Respect excluded tags when showing a thread.
 +
+ Notmuch 0.32.1 (2021-05-15)
  ===========================
  
+ General
+ -------
  Restore handling of relative values for `database.path` that was
  broken by 0.32. Extend this handling to `database.mail_root`,
  `database.backup_dir`, and `database.hook_dir`.
@@@ -17,6 -12,15 +20,15 @@@ Reload certain metadata from Xapian dat
  notmuch_database_reopen. This fixes a bug when adding messages to the
  database in a pre-new hook.
  
+ Fix default of `$HOME/mail` for `database.path`. In release 0.32, this
+ default worked only in "notmuch config".
+ Emacs
+ -----
+ Restore the dynamically bound variables `tag-changes` and `query` in
+ in `notmuch-before-tag-hook` and `notmuch-after-tag-hook`.
  Notmuch 0.32 (2021-05-02)
  =========================
  
diff --combined lib/open.cc
index 84b2d6b1e56d70b092b9f9d49f1f676c7f0f84bf,3325e72506cb3023911c870056265ef63b305fd5..1ca69665c4e446ce4023b90713a86376c91310ee
@@@ -209,8 -209,25 +209,25 @@@ _choose_database_path (void *ctx
        }
      }
      if (! *database_path) {
+       notmuch_status_t status;
        *database_path = _xdg_dir (ctx, "XDG_DATA_HOME", ".local/share", profile);
-       *split = true;
+       status = _db_dir_exists (*database_path, message);
+       if (status) {
+           *database_path = NULL;
+       } else {
+           *split = true;
+       }
+     }
+     if (! *database_path) {
+       notmuch_status_t status;
+       *database_path = talloc_asprintf (ctx, "%s/mail", getenv ("HOME"));
+       status = _db_dir_exists (*database_path, message);
+       if (status) {
+           *database_path = NULL;
+       }
      }
  
      if (*database_path == NULL) {
@@@ -307,6 -324,24 +324,6 @@@ _set_database_path (notmuch_database_t 
      _notmuch_config_cache (notmuch, NOTMUCH_CONFIG_DATABASE_PATH, path);
  }
  
 -static void
 -_init_libs ()
 -{
 -
 -    static int initialized = 0;
 -
 -    /* Initialize the GLib type system and threads */
 -#if ! GLIB_CHECK_VERSION (2, 35, 1)
 -    g_type_init ();
 -#endif
 -
 -    /* Initialize gmime */
 -    if (! initialized) {
 -      g_mime_init ();
 -      initialized = 1;
 -    }
 -}
 -
  static void
  _load_database_state (notmuch_database_t *notmuch)
  {
@@@ -480,7 -515,7 +497,7 @@@ notmuch_database_open_with_config (cons
      GKeyFile *key_file = NULL;
      bool split = false;
  
 -    _init_libs ();
 +    _notmuch_init ();
  
      notmuch = _alloc_notmuch ();
      if (! notmuch) {
@@@ -577,7 -612,7 +594,7 @@@ notmuch_database_create_with_config (co
      int err;
      bool split = false;
  
 -    _init_libs ();
 +    _notmuch_init ();
  
      notmuch = _alloc_notmuch ();
      if (! notmuch) {
@@@ -773,7 -808,7 +790,7 @@@ notmuch_database_load_config (const cha
      GKeyFile *key_file = NULL;
      bool split = false;
  
 -    _init_libs ();
 +    _notmuch_init ();
  
      notmuch = _alloc_notmuch ();
      if (! notmuch) {
diff --combined test/T310-emacs.sh
index e64627c6729fab8a1606730f7f036bdccd5db0ba,e648924675f6551a33414d8d70b04e30b4ea1257..851ef64eaf5cf6d14328515708203d2349f8757e
@@@ -5,7 -5,6 +5,7 @@@ test_description="emacs interface
  
  EXPECTED=$NOTMUCH_SRCDIR/test/emacs.expected-output
  
 +test_require_emacs
  add_email_corpus
  
  # syntax errors in test-lib.el cause mysterious failures
@@@ -162,6 -161,28 +162,28 @@@ test_emacs "(notmuch-show \"$os_x_darwi
  output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
  test_expect_equal "$output" "thread:XXX   2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"
  
+ test_begin_subtest "notmuch-show: before-tag-hook is run, variables are defined"
+ output=$(test_emacs '(let ((notmuch-test-tag-hook-output nil)
+                 (notmuch-before-tag-hook (function notmuch-test-tag-hook)))
+              (notmuch-show "id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com")
+              (execute-kbd-macro "+activate-hook\n")
+              (execute-kbd-macro "-activate-hook\n")
+              notmuch-test-tag-hook-output)')
+ test_expect_equal "$output" \
+ '(("id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com" "-activate-hook")
+  ("id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com" "+activate-hook"))'
+ test_begin_subtest "notmuch-show: after-tag-hook is run, variables are defined"
+ output=$(test_emacs '(let ((notmuch-test-tag-hook-output nil)
+                 (notmuch-after-tag-hook (function notmuch-test-tag-hook)))
+              (notmuch-show "id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com")
+              (execute-kbd-macro "+activate-hook\n")
+              (execute-kbd-macro "-activate-hook\n")
+              notmuch-test-tag-hook-output)')
+ test_expect_equal "$output" \
+ '(("id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com" "-activate-hook")
+  ("id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com" "+activate-hook"))'
  test_begin_subtest "Message with .. in Message-Id:"
  add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"'
  test_emacs '(notmuch-search "id:\"123..456@example\"")