Gnus development mailing list
 help / color / mirror / Atom feed
* Ephemeral notmuch search group
@ 2025-07-12 22:14 Jakub Ječmínek
  2025-07-13  5:31 ` Sean Whitton
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Ječmínek @ 2025-07-12 22:14 UTC (permalink / raw)
  To: ding

Hi, here's a little function which creates ephemeral group based on a
Notmuch search result.  I ocasionally use Notmuch to perform fast search
but I don't want to use nnmaildir or leave Gnus. Maybe it will be useful
to someone :).


(defun gnus-read-ephemeral-notmuch-search-group (query limit &optional window-conf)
  "Create an ephemeral group based on a Notmuch search.

Performs a Notmuch search using QUERY and displays them in an ephemeral
group.

If called without a prefix argument, prompts for a LIMIT value."
  (interactive (list
		(read-string "Query: ")
		(or current-prefix-arg (read-number "Limit: " 200))))
  (unless (executable-find gnus-search-notmuch-program)
    (user-error "Notmuch executable not found in PATH"))
  (unless (file-exists-p gnus-search-notmuch-config-file)
    (user-error "Notmuch config file does not exist: %s"
	   gnus-search-notmuch-config-file))
  (let* ((tmpfile (make-temp-file "notmuch-search#"))
	 (file-name (file-name-nondirectory tmpfile)))
    (with-temp-file tmpfile
      (mm-disable-multibyte)
      (call-process
       gnus-search-notmuch-program nil t nil
       (format "--config=%s" gnus-search-notmuch-config-file)
       "show" "--format=mbox" "--sort=newest-first" (format "--limit=%s" limit)
       "--" query))
      (gnus-group-read-ephemeral-group
       (concat "nndoc+ephemeral:" file-name)
       `(nndoc ,tmpfile
               (nndoc-article-type mbox))
       nil window-conf)
    (delete-file tmpfile)))


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

* Re: Ephemeral notmuch search group
  2025-07-12 22:14 Ephemeral notmuch search group Jakub Ječmínek
@ 2025-07-13  5:31 ` Sean Whitton
  2025-07-13  8:09   ` Adam Sjøgren
  2025-07-14 13:55   ` Eric S Fraga
  0 siblings, 2 replies; 4+ messages in thread
From: Sean Whitton @ 2025-07-13  5:31 UTC (permalink / raw)
  To: Jakub Ječmínek; +Cc: ding

Hello,

On Sun 13 Jul 2025 at 12:14am +02, Jakub Ječmínek wrote:

> Hi, here's a little function which creates ephemeral group based on a
> Notmuch search result.  I ocasionally use Notmuch to perform fast search
> but I don't want to use nnmaildir or leave Gnus. Maybe it will be useful
> to someone :).

Isn't notmuch only able to read maildirs?  How do you read your mail?

-- 
Sean Whitton


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

* Re: Ephemeral notmuch search group
  2025-07-13  5:31 ` Sean Whitton
@ 2025-07-13  8:09   ` Adam Sjøgren
  2025-07-14 13:55   ` Eric S Fraga
  1 sibling, 0 replies; 4+ messages in thread
From: Adam Sjøgren @ 2025-07-13  8:09 UTC (permalink / raw)
  To: ding

Sean writes:

> Isn't notmuch only able to read maildirs?  How do you read your mail?

Notmuch works fine with nnml for me.

nnmaildir was much too slow in comparison back to nnml in the 90's
when I made that choice :-)


  Best regards,

    Adam

-- 
 "It will turn into pointer equality or something           Adam Sjøgren
  ghastly like that"                                   asjo@koldfront.dk



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

* Re: Ephemeral notmuch search group
  2025-07-13  5:31 ` Sean Whitton
  2025-07-13  8:09   ` Adam Sjøgren
@ 2025-07-14 13:55   ` Eric S Fraga
  1 sibling, 0 replies; 4+ messages in thread
From: Eric S Fraga @ 2025-07-14 13:55 UTC (permalink / raw)
  To: ding

Response below/inline for email Sean Whitton wrote:
> (original email sent 13 Jul 2025 at 06:31)
> 
> Isn't notmuch only able to read maildirs?  How do you read your mail?

FTR, I use notmuch search (from gnus) for nnml groups so not just
maildir.

-- 
Eric S Fraga via gnus (Emacs 31.0.50 2025-04-23) on Debian 12.11



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

end of thread, other threads:[~2025-07-14 13:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-12 22:14 Ephemeral notmuch search group Jakub Ječmínek
2025-07-13  5:31 ` Sean Whitton
2025-07-13  8:09   ` Adam Sjøgren
2025-07-14 13:55   ` Eric S Fraga

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 NNTP newsgroup(s).