Re: notmuch-dired-search contribution

Subject: Re: notmuch-dired-search contribution

Date: Wed, 12 Mar 2025 00:00:17 +0200

To: Stephen J Eglen, notmuch@notmuchmail.org

Cc:

From: Tomi Ollila


On Mon, Mar 10 2025, Stephen J. Eglen wrote:

> Hello,
>
> Thank you all for notmuch.
>
> I just thought I'd share this short little defun.  My normal use case is
> for permanently deleting emails from my index.

Great stuff. I got it giving me "let*: End of file during parsing", I don't
see why - examined in *scratch* buffer - maybe I try later. 
(but as I have other uses for similar code, just for viewing and deleting
files,) I thought all the files for dired have to be in same directory
- which I now tested separately as *not* to be the case (that could have
been problematic w/ message (email) files scattered in multiple folders).

Tomi

>
> (defun notmuch-dired-search ()
>   "Convert current notmuch search buffer to dired listing."
>   (interactive)
>   (if (not notmuch-search-query-string)
>       (message "No search query could be found.")
>     (let*
> 	((listing (make-temp-file "listing-"))
> 	 (cmd (format "notmuch search  --output=files --format=sexp %s > %s"
> 		      notmuch-search-query-string
> 		      listing))
> 	 (temp1 (shell-command-to-string cmd))
> 	 (files (read (with-temp-buffer
> 			(insert-file-contents listing)
> 			(buffer-string)))))
>       (push "*notmuch-dired*" files)
>       (dired files))))
>
>
> Best wishes,
>
> Stephen
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: