unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: fix dangling overlays in notmuch-search
@ 2022-10-13  3:20 Matt Armstrong
  2022-10-17  3:27 ` Matt Armstrong
  2022-11-05 17:17 ` David Bremner
  0 siblings, 2 replies; 3+ messages in thread
From: Matt Armstrong @ 2022-10-13  3:20 UTC (permalink / raw)
  To: notmuch; +Cc: Matt Armstrong

notmuch-search-insert-authors now sets the evaporate property on the
ellipsis overlays.  Emacs will delete them when the buffer contents
are zeroed out, which happens with `notmuch-refresh-buffer`.  This
prevents them from being collapsed to zero-width overlays in position
1.  See Emacs bug#58479.  An upcoming change in Emacs will make these
dangling overlays visible to the user.
---
 emacs/notmuch.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 26181758..6eef4af1 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -841,6 +841,7 @@ non-authors is found, assume that all of the authors match."
 	      overlay)
 	  (insert invisible-string)
 	  (setq overlay (make-overlay start (point)))
+	  (overlay-put overlay 'evaporate t)
 	  (overlay-put overlay 'invisible 'ellipsis)
 	  (overlay-put overlay 'isearch-open-invisible #'delete-overlay)))
       (insert padding))))
-- 
2.35.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] emacs: fix dangling overlays in notmuch-search
  2022-10-13  3:20 [PATCH] emacs: fix dangling overlays in notmuch-search Matt Armstrong
@ 2022-10-17  3:27 ` Matt Armstrong
  2022-11-05 17:17 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: Matt Armstrong @ 2022-10-17  3:27 UTC (permalink / raw)
  To: notmuch

Matt Armstrong <matt@rfc20.org> writes:

> See Emacs bug#58479.  An upcoming change in Emacs will make these
> dangling overlays visible to the user.

It seems that the ellipsis overlays were shown due to a bug in Emacs,
but this patch is still a reasonable idea.  Otherwise, every time a
notmuch search buffer is refreshed (by pressing 'g') the overlays from
the previous run will collapse to zero-width overlays in position 1.
They're harmless there, but removing them is what 'evaporate is for.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] emacs: fix dangling overlays in notmuch-search
  2022-10-13  3:20 [PATCH] emacs: fix dangling overlays in notmuch-search Matt Armstrong
  2022-10-17  3:27 ` Matt Armstrong
@ 2022-11-05 17:17 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2022-11-05 17:17 UTC (permalink / raw)
  To: Matt Armstrong, notmuch; +Cc: Matt Armstrong

Matt Armstrong <matt@rfc20.org> writes:

> notmuch-search-insert-authors now sets the evaporate property on the
> ellipsis overlays.  Emacs will delete them when the buffer contents
> are zeroed out, which happens with `notmuch-refresh-buffer`.  This
> prevents them from being collapsed to zero-width overlays in position
> 1.  See Emacs bug#58479.  An upcoming change in Emacs will make these
> dangling overlays visible to the user.
> ---
applied to master

d

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-05 17:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-13  3:20 [PATCH] emacs: fix dangling overlays in notmuch-search Matt Armstrong
2022-10-17  3:27 ` Matt Armstrong
2022-11-05 17:17 ` David Bremner

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).