unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Two patches for mairix.el
@ 2021-05-01 14:30 Daniel Semyonov
  2021-05-01 14:40 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Semyonov @ 2021-05-01 14:30 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 990 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: first patch --]
[-- Type: text/x-patch, Size: 2702 bytes --]

From 35a8992135bf580fdfee2204f3d0251129d7c165 Mon Sep 17 00:00:00 2001
From: Daniel Semyonov <cmstr@dsemy.com>
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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: second patch --]
[-- Type: text/x-patch, Size: 1327 bytes --]

From 703796d033c6c0579dd7be1939087e6cf5cbe679 Mon Sep 17 00:00:00 2001
From: Daniel Semyonov <cmstr@dsemy.com>
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


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

* Re: [PATCH] Two patches for mairix.el
  2021-05-01 14:30 [PATCH] Two patches for mairix.el Daniel Semyonov
@ 2021-05-01 14:40 ` Eli Zaretskii
  2021-05-01 15:19   ` Daniel Semyonov
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2021-05-01 14:40 UTC (permalink / raw)
  To: Daniel Semyonov; +Cc: emacs-devel

> From: Daniel Semyonov <cmstr@dsemy.com>
> Date: Sat, 01 May 2021 17:30:43 +0300
> 
> 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.

The changes are indeed small enough for us to accept them, but could
you please reformat the log message(s) according to our conventions?
You will find the conventions described in CONTRIBUTE, and I suggest
to use "git log" to look at the log messages as examples.

Thanks.



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

* Re: [PATCH] Two patches for mairix.el
  2021-05-01 14:40 ` Eli Zaretskii
@ 2021-05-01 15:19   ` Daniel Semyonov
  2021-05-01 15:29     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Semyonov @ 2021-05-01 15:19 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 332 bytes --]

> The changes are indeed small enough for us to accept them, but could
> you please reformat the log message(s) according to our conventions?

Of course, I've attached the fixed patches.

> You will find the conventions described in CONTRIBUTE, and I suggest
> to use "git log" to look at the log messages as examples.
> 
> Thanks.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: first patch --]
[-- Type: text/x-patch, Size: 3033 bytes --]

From bc65d635c45241f0e5942b8318ca62ed07662408 Mon Sep 17 00:00:00 2001
From: Daniel Semyonov <cmstr@dsemy.com>
Date: Sat, 1 May 2021 17:01:22 +0300
Subject: [PATCH] Mairix: autoload main interactive functions

* lisp/net/mairix.el (mairix-search, mairix-use-saved-search)
(mairix-edit-saved-searches-customize, mairix-search-from-this-article)
(mairix-search-thread-this-article, mairix-widget-search-based-on-article)
(mairix-edit-saved-searches, mairix-widget-search, mairix-update-database):
Add magic autoload comment.

Copyright-paperwork-exempt: yes
---
 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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: second patch --]
[-- Type: text/x-patch, Size: 1169 bytes --]

From 22246945b5a3b144be0ee14c9c07bedaa63df179 Mon Sep 17 00:00:00 2001
From: Daniel Semyonov <cmstr@dsemy.com>
Date: Sat, 1 May 2021 17:03:07 +0300
Subject: [PATCH] Mairix: use 'mairix-search-options' as documented

* lisp/net/mairix.el (mairix-call-mairix): Append
'mairix-search-options' to the arguments passed to mairix.

Copyright-paperwork-exempt: yes
---
 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


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

* Re: [PATCH] Two patches for mairix.el
  2021-05-01 15:19   ` Daniel Semyonov
@ 2021-05-01 15:29     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2021-05-01 15:29 UTC (permalink / raw)
  To: Daniel Semyonov; +Cc: emacs-devel

> From: Daniel Semyonov <cmstr@dsemy.com>
> Cc: emacs-devel@gnu.org
> Date: Sat, 01 May 2021 18:19:56 +0300
> 
> Of course, I've attached the fixed patches.

Thanks.  I will install in a few days, barring any further comments.



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

end of thread, other threads:[~2021-05-01 15:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-01 14:30 [PATCH] Two patches for mairix.el Daniel Semyonov
2021-05-01 14:40 ` Eli Zaretskii
2021-05-01 15:19   ` Daniel Semyonov
2021-05-01 15:29     ` Eli Zaretskii

unofficial mirror of emacs-devel@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/emacs-devel/0 emacs-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 emacs-devel emacs-devel/ https://yhetil.org/emacs-devel \
		emacs-devel@gnu.org
	public-inbox-index emacs-devel

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.devel
	nntp://news.gmane.io/gmane.emacs.devel


code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs.git

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git