Instead of trying to guess in which modes this is safe not to set in,
let's just set it in all of them.
Background (added by db):
untrusted-content was added in Emacs 29.3 and is currently set by Gnus
and used by org-mode to prevent certain unsafe operations. I think the
intent is to use it for blocking more unsafe operations in the future.
The cffi bindings raise a LookupError in case a header is not present.
Adjust the docstring to say so.
The legacy bindings behaved differently, and this is one of the things
to be aware of when migrating to the cffi bindings.
Debian developers with the pure GTK+ variant of emacs (which does not
support X11 at all, as it builds entirely against the GTK Wayland
backend) should also be able to treat the build-dependencies as
satisfied.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
This removes the visual gap/stutter between when the screen fills and
when the hl-line "cursor" is drawn. It is not obviously how to
robustly test this, since it the observable effect is purely a matter
of timing.
There is a a perceptible gap between when the tree shows up and when
the hl-line is visible, but this is better than the previous state
where the line did not show up at all until the user moved the cursor.
It isn't clear that this call to hl-line-mode will survive the coming
re-organization to stop relying on hooks, but incrementally this at
least makes the disabling behaviour consistent.
In the thread at id:87fsfuuxwn.fsf@thinkbox, a bug is discussed where
the point and hl-line overlay get out of sync, leading the user to
open the wrong message. As far as I can tell this is caused by
notmuch-hl-mode being invoked too early.
This change bypasses the logic preventing notmuch-search-hook being
called only once, so that the overlay is updated later after the
buffer is full(er).
This change may lead to the overlay being updated multiple times; if
this is annoying we can add a similar buffer local variable to ensure
it is only called once.
The extra logic to check notmuch-search-target-line reduces the
flicker somewhat by not highlighting the first line every time.
Most of the known broken tests replicate (my intepretation of) the bug
reported at id:87fsfuuxwn.fsf@thinkbox (or some unreported, but
probably related bugs in tree/unthreaded view). The last 3 broken
tests are just unimplimented planned functionality.
Ruby 3.2 introduced a warning when C-extensions use structs without
redefining the allocation default allocation routine meant for objects.
See https://bugs.ruby-lang.org/issues/18007 for details.
In the Ruby bindings this happens at `Data_Wrap_Notmuch_Object` call
sites, so the object types used there needed to update their allocation.
This ruby code (given a database at the hardcoded path with messages
matching `tag:tmp`) exercise all the ruby objects:
require 'notmuch'
Notmuch::Database.open File.expand_path("~/mail") do |db|
db.get_directory("/tmp")
db.query("tag:tmp").search_threads.each do |t|
t.messages.each do |m|
puts m.header("Subject")
end
end
end
Before these changes with ruby 3.2.5 and notmuch 0.38.3 it outputs:
notmuch.rb:5: warning: undefining the allocator of T_DATA class Notmuch::Query
notmuch.rb:5: warning: undefining the allocator of T_DATA class Notmuch::Threads
notmuch.rb:5: warning: undefining the allocator of T_DATA class Notmuch::Thread
notmuch.rb:6: warning: undefining the allocator of T_DATA class Notmuch::Messages
notmuch.rb:6: warning: undefining the allocator of T_DATA class Notmuch::Message
notmuch release 0.38.3 now available
(the last line is the message I tagged with tmp), and after the changes:
notmuch release 0.38.3 now available
These days, `nmbug` is `notmuch-git` with special defaults, so avoid the
term `nmbug` in the doc when we talk about `notmuch-git` in general.
Also, spell git in lower case (as we do for notmuch) except for the one
case where we name the beast.
We have traditionally expected a signature to show up as "revoked"
when the signing key is revoked. However, GnuPG's recent fix to avoid
a denial of service against legitimate signatures appears to have
changed the status of signature verification from keys which happen to
have been revoked.
See https://bugs.debian.org/1098995 and https://dev.gnupg.org/T7547
This change makes the test suite a little bit less brittle while we
look for a resolution from upstream. It should probably also be
backported to debian unstable unless a notmuch release to unstable is
imminent.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
(cherry picked from commit d330971b8b)
We have traditionally expected a signature to show up as "revoked"
when the signing key is revoked. However, GnuPG's recent fix to avoid
a denial of service against legitimate signatures appears to have
changed the status of signature verification from keys which happen to
have been revoked.
See https://bugs.debian.org/1098995 and https://dev.gnupg.org/T7547
This change makes the test suite a little bit less brittle while we
look for a resolution from upstream. It should probably also be
backported to debian unstable unless a notmuch release to unstable is
imminent.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
The messageidb attribute does not exist. The returned BinString type
already allows use as both strings and binary. Presumably this was
written before that type was adopted.
Normally this would be done as part of the release process, rather
than committed intially to master, but in this case I want to test the
change to python bindings version handling in the previous commit.
Inspired by a suggestion of Xiyue Deng, this change ensures that
the python bindings have a version that recent setuptools is happy
with.
This will have the unfortunate side effect of the python view of the
version number differing from the rest of notmuch for the
pre-releases. The alternative would be to transform the version
numbers for the Debian packages for the pre-releases, as there is now
no version scheme that works for both, since setuptools started
rejecting versions with "~" in them. If we decide to go the latter
way in the future, this change is easy to revert.
This forces us to verify the build and test suite completes without
the legacy python bindings.
As of this commit the legacy python bindings are unsupported by
notmuch. They are provided in contrib/ for now, but will most likely
eventually be removed from there as well. We recommend that
downstream/distro packagers phase out their packages for the legacy
python bindings.
One test is deleted since that method is not provided by the new
bindings. Similar things can be done by accessing the PropertiesMap
returned by properties.
This change is a prelude to removing the legacy bindings from the build.
The new python bindings do not support modifying query objects, so
convert to C. There is a bit more boilerplate to handle errors but
otherwise it is essentially a line by line translation.
The previous version of
notmuch-show-imenu-prev-index-position-function was calling
notmuch-show-previous-message which was recentering the window. This
is a problem when which-func-mode is active because which-func-mode is
called each time the user moves point around.
Because this function is only meant to be executed by imenu, there is
no reason to recenter the window. For the same reason, the new
implementation doesn't have to follow strictly how
notmuch-show-previous-message is implemented because imenu only places
point at very specific locations before calling
notmuch-show-imenu-prev-index-position-function.
Several iterators in the Python cFFI API destroyed the objects they iterated
over too early (when the iterator was exhausted), causing subsequent segfaults
in common cases like creating a list from the iterator. This patch fixes the
segfaults and add tests to ensure that they don't happen again.