From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Semyonov Newsgroups: gmane.emacs.devel Subject: [PATCH] Two patches for mairix.el Date: Sat, 01 May 2021 17:30:43 +0300 Message-ID: <87sg36le5o.fsf@dsemy.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24037"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 01 16:31:44 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lcqel-0006AE-On for ged-emacs-devel@m.gmane-mx.org; Sat, 01 May 2021 16:31:43 +0200 Original-Received: from localhost ([::1]:37216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcqek-0000pX-SI for ged-emacs-devel@m.gmane-mx.org; Sat, 01 May 2021 10:31:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45996) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcqe8-0000Nj-2e for emacs-devel@gnu.org; Sat, 01 May 2021 10:31:04 -0400 Original-Received: from mout-p-202.mailbox.org ([80.241.56.172]:58480) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1lcqe4-0001Be-R7 for emacs-devel@gnu.org; Sat, 01 May 2021 10:31:03 -0400 Original-Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4FXWqr51WnzQk1c for ; Sat, 1 May 2021 16:30:48 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dsemy.com; s=MBO0001; t=1619879446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=0MbDgfh5tKCpIIk20KZ6ZisWQx5zeI0VTEp2DiOxW4U=; b=Nw8bU/zFMLRxWAn8bdnDzbC9F8Lcol7Ls54qBDn4/t2ftYPt9k+wTrLZEQvdx2bHa+Fc9J eOEYivis8k7sFX1PACzeJMp2sqoLrL41x6LJOOV9GciTaEdX6YeCr9kka6qdqBRdZ6NW77 rcPrHX+jM2vqkDBzs3p0tFRoyYKpJ0TrctnurKgxJtt+1jtmpZhyNL4lMr8dfv2grQwJks UNL7x0+f0bnykzDyAiJupm9l27UWfZ03sLNtugYKoxtQxfbqyhmrl3gF/PKG9bSKzOwYJ7 wvVDyygsMf62NuRpUuackyf08oL9Dgh7xeigVKpLF6sNJa2qv4DUZf38kIcecA== Original-Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id RtFqy__uvh1d for ; Sat, 1 May 2021 16:30:45 +0200 (CEST) X-Rspamd-Score: -5.97 / 15.00 / 15.00 X-Rspamd-Queue-Id: BA3A71404 X-Rspamd-UID: 7fc239 Received-SPF: pass client-ip=80.241.56.172; envelope-from=cmstr@dsemy.com; helo=mout-p-202.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:268713 Archived-At: --=-=-= Content-Type: text/plain Hi, I've recently begun to use Emacs' interface for mairix(1) for indexing and searching through my mail, and have noticed two small issues. The first one is that the main interactive entry points for mairix.el aren't autoloaded (I'm guessing the present mechanism for autoloading wasn't available when it was written?). The first patch adds appropriate ';;;###autoload' lines before commands which can serve as such. The second is that `mairix-search-options' isn't actually used, even though both the manual and the docstring seem to indicate that it should be. The second patch modifies `mairix-call-mairix' slightly to add the options specified. Note: I haven't completed copyright assignment yet (I need to get a disclaimer from my university still, might take a while), but I hope those changes are trivial enough to be accepted without it. Also, apologies in advance if I should've sent these patches separately (they seemed trivial enough to be sent together). Regards, Daniel --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-lisp-net-mairix.el-Autoload-main-interactive-functio.patch Content-Description: first patch >From 35a8992135bf580fdfee2204f3d0251129d7c165 Mon Sep 17 00:00:00 2001 From: Daniel Semyonov Date: Sat, 1 May 2021 17:01:22 +0300 Subject: [PATCH] * lisp/net/mairix.el: Autoload main interactive functions. --- lisp/net/mairix.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lisp/net/mairix.el b/lisp/net/mairix.el index 024d118f2d..adc41b6068 100644 --- a/lisp/net/mairix.el +++ b/lisp/net/mairix.el @@ -328,6 +328,7 @@ mairix-vm-fetch-field ;;;; Main interactive functions +;;;###autoload (defun mairix-search (search threads) "Call Mairix with SEARCH. If THREADS is non-nil, also display whole threads of found @@ -342,6 +343,7 @@ mairix-search threads) (mairix-show-folder mairix-search-file))) +;;;###autoload (defun mairix-use-saved-search () "Use a saved search for querying Mairix." (interactive) @@ -374,6 +376,7 @@ mairix-save-search (setcdr (assoc name mairix-saved-searches) mairix-last-search)))) (mairix-select-save)) +;;;###autoload (defun mairix-edit-saved-searches-customize () "Edit the list of saved searches in a customization buffer." (interactive) @@ -386,6 +389,8 @@ mairix-edit-saved-searches-customize (make-string 65 ?=) "\n"))) (autoload 'mail-strip-quoted-names "mail-utils") + +;;;###autoload (defun mairix-search-from-this-article (threads) "Search messages from sender of the current article. This is effectively a shortcut for calling `mairix-search' with @@ -402,6 +407,7 @@ mairix-search-from-this-article threads) (error "No function for obtaining mail header specified")))) +;;;###autoload (defun mairix-search-thread-this-article () "Search thread for the current article. This is effectively a shortcut for calling `mairix-search' @@ -423,12 +429,14 @@ mairix-search-thread-this-article (mairix-search (format "m:%s" mid) t))) +;;;###autoload (defun mairix-widget-search-based-on-article () "Create mairix query based on current article using widgets." (interactive) (mairix-widget-search (mairix-widget-get-values))) +;;;###autoload (defun mairix-edit-saved-searches () "Edit current mairix searches." (interactive) @@ -441,6 +449,7 @@ mairix-edit-saved-searches (defvar mairix-widgets) +;;;###autoload (defun mairix-widget-search (&optional mvalues) "Create mairix query interactively using graphical widgets. MVALUES may contain values from current article." @@ -470,6 +479,7 @@ mairix-widget-search (widget-setup) (goto-char (point-min))) +;;;###autoload (defun mairix-update-database () "Call mairix for updating the database for SERVERS. Mairix will be called asynchronously unless -- 2.31.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-lisp-net-mairix.el-Use-mairix-search-options-as-docu.patch Content-Description: second patch >From 703796d033c6c0579dd7be1939087e6cf5cbe679 Mon Sep 17 00:00:00 2001 From: Daniel Semyonov Date: Sat, 1 May 2021 17:03:07 +0300 Subject: [PATCH] * lisp/net/mairix.el: Use `mairix-search-options' as documented. `mairix-search' is documented to call `mairix-command' together with the options specified in `mairix-search-options'. However, the previous implementation made no use of `mairix-search-options', requiring the user to customize `mairix-command' in order to pass options to mairix(1). --- lisp/net/mairix.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/net/mairix.el b/lisp/net/mairix.el index adc41b6068..e1d35c2a85 100644 --- a/lisp/net/mairix.el +++ b/lisp/net/mairix.el @@ -531,8 +531,11 @@ mairix-call-mairix If FILE is nil, use default. If THREADS is non-nil, also return whole threads. Function returns t if messages were found." (let* ((commandsplit (split-string mairix-command)) - (args (cons (car commandsplit) - `(nil ,(get-buffer-create mairix-output-buffer) nil))) + (args (cons + (car commandsplit) + (append + `(nil ,(get-buffer-create mairix-output-buffer) nil) + mairix-search-options))) rval) (with-current-buffer mairix-output-buffer (erase-buffer)) -- 2.31.1 --=-=-=--