* [PATCH] nnmh support for saving messages as seen
@ 2016-09-23 2:23 Mike Kupfer
2016-09-23 6:10 ` Katsumi Yamaoka
0 siblings, 1 reply; 10+ messages in thread
From: Mike Kupfer @ 2016-09-23 2:23 UTC (permalink / raw)
To: ding
I've found it annoying that nnmh saves messages as unseen, so I've been
carrying around variants of this patch for several years. Could it (or
some variant) be integrated into Emacs? My copyright assignment is on
file.
thanks,
mike
changeset comments:
Save messages to MH as seen or unseen.
gnus/gnus-mh.el (gnus-rcvstore-unseen): New variable.
(gnus-summary-save-in-folder): specify "-unseen" or "-nounseen" to
rcvstore, depending on gnus-rcvstore-unseen.
diff --git a/lisp/gnus/gnus-mh.el b/lisp/gnus/gnus-mh.el
--- a/lisp/gnus/gnus-mh.el
+++ b/lisp/gnus/gnus-mh.el
@@ -40,6 +40,12 @@
(defvar mh-lib-progs)
+(defcustom gnus-rcvstore-unseen t
+ "If non-nil, messages saved to MH folders will be marked as unseen."
+ :version "25.2"
+ :group 'gnus-article
+ :type 'boolean)
+
(defun gnus-summary-save-article-folder (&optional arg)
"Append the current article to an mh folder.
If N is a positive number, save the N next articles.
@@ -78,7 +84,11 @@
(widen)
(unwind-protect
(call-process-region
- (point-min) (point-max) "rcvstore" nil errbuf nil folder)
+ (point-min) (point-max) "rcvstore" nil errbuf nil
+ (if gnus-rcvstore-unseen
+ "-unseen"
+ "-nounseen")
+ folder)
(set-buffer errbuf)
(if (zerop (buffer-size))
(message "Article saved in folder: %s" folder)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] nnmh support for saving messages as seen
2016-09-23 2:23 [PATCH] nnmh support for saving messages as seen Mike Kupfer
@ 2016-09-23 6:10 ` Katsumi Yamaoka
2016-09-24 3:05 ` Mike Kupfer
0 siblings, 1 reply; 10+ messages in thread
From: Katsumi Yamaoka @ 2016-09-23 6:10 UTC (permalink / raw)
To: m.kupfer; +Cc: ding
On Thu, 22 Sep 2016 19:23:52 -0700, Mike Kupfer wrote:
> changeset comments:
> Save messages to MH as seen or unseen.
> gnus/gnus-mh.el (gnus-rcvstore-unseen): New variable.
> (gnus-summary-save-in-folder): specify "-unseen" or "-nounseen" to
> rcvstore, depending on gnus-rcvstore-unseen.
Are the -unseen and the -nounseen options generally usable?
Some web sites don't list them:
<https://www.ibm.com/support/knowledgecenter/en/ssw_aix_53/com.ibm.aix.cmds/doc/aixcmds4/rcvstore.htm>
<http://web.mit.edu/daveg/SIPB/Info/Links/Documentation/mh-book/mh/r-rcvsto.htm>
<http://www2.phys.canterbury.ac.nz/dept/docs/manuals/unix/DEC_4.0e_Docs/HTML/MAN/MAN1/0391____.HTM>
Regards,
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] nnmh support for saving messages as seen
2016-09-23 6:10 ` Katsumi Yamaoka
@ 2016-09-24 3:05 ` Mike Kupfer
2016-09-25 22:54 ` Katsumi Yamaoka
0 siblings, 1 reply; 10+ messages in thread
From: Mike Kupfer @ 2016-09-24 3:05 UTC (permalink / raw)
To: Katsumi Yamaoka; +Cc: ding
Katsumi Yamaoka wrote:
> Are the -unseen and the -nounseen options generally usable?
Good question. Some research shows that the original MH doesn't have
them. And mailutils-mh doesn't even have rcvstore.
nmh has had those options since at least version 1.2.
I suppose gnus-rcvstore-unseen could be ternary:
nil (don't add an option)
'seen
'unseen
How does that sound?
thanks,
mike
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] nnmh support for saving messages as seen
2016-09-24 3:05 ` Mike Kupfer
@ 2016-09-25 22:54 ` Katsumi Yamaoka
2016-10-02 23:01 ` Mike Kupfer
2016-11-19 20:12 ` Mike Kupfer
0 siblings, 2 replies; 10+ messages in thread
From: Katsumi Yamaoka @ 2016-09-25 22:54 UTC (permalink / raw)
To: Mike Kupfer; +Cc: ding
On Fri, 23 Sep 2016 20:05:48 -0700, Mike Kupfer wrote:
> nmh has had those options since at least version 1.2.
> I suppose gnus-rcvstore-unseen could be ternary:
> nil (don't add an option)
> 'seen
> 'unseen
> How does that sound?
Otherwise, gnus-rcvstore-options, a list of additional options,
default nil. I don't know if there are the other useful options,
though. :)
Regards,
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] nnmh support for saving messages as seen
2016-09-25 22:54 ` Katsumi Yamaoka
@ 2016-10-02 23:01 ` Mike Kupfer
2016-10-03 0:30 ` Katsumi Yamaoka
2016-11-19 20:12 ` Mike Kupfer
1 sibling, 1 reply; 10+ messages in thread
From: Mike Kupfer @ 2016-10-02 23:01 UTC (permalink / raw)
To: Katsumi Yamaoka; +Cc: ding
Katsumi Yamaoka wrote:
> On Fri, 23 Sep 2016 20:05:48 -0700, Mike Kupfer wrote:
> > I suppose gnus-rcvstore-unseen could be ternary:
>
> > nil (don't add an option)
> > 'seen
> > 'unseen
>
> > How does that sound?
>
> Otherwise, gnus-rcvstore-options, a list of additional options,
> default nil. I don't know if there are the other useful options,
> though. :)
I like the flexibility of that approach, though. I'll work on a patch
for it; hopefully I'll find time in the next couple weeks.
I noticed that the nnmh- prefix is used for variables that are specific
to nnmh, so I'll call it nnmh-rcvstore-options.
Thanks!
mike
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] nnmh support for saving messages as seen
2016-10-02 23:01 ` Mike Kupfer
@ 2016-10-03 0:30 ` Katsumi Yamaoka
0 siblings, 0 replies; 10+ messages in thread
From: Katsumi Yamaoka @ 2016-10-03 0:30 UTC (permalink / raw)
To: Mike Kupfer; +Cc: ding
On Sun, 02 Oct 2016 16:01:24 -0700, Mike Kupfer wrote:
> I noticed that the nnmh- prefix is used for variables that are specific
> to nnmh, so I'll call it nnmh-rcvstore-options.
Well, gnus-mh.el is an interface module for, if anything, mh-e
users, not Gnus (nnmh) users, I think. :)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] nnmh support for saving messages as seen
2016-09-25 22:54 ` Katsumi Yamaoka
2016-10-02 23:01 ` Mike Kupfer
@ 2016-11-19 20:12 ` Mike Kupfer
2016-11-21 6:20 ` Katsumi Yamaoka
1 sibling, 1 reply; 10+ messages in thread
From: Mike Kupfer @ 2016-11-19 20:12 UTC (permalink / raw)
To: Katsumi Yamaoka; +Cc: ding
Katsumi Yamaoka wrote:
> On Fri, 23 Sep 2016 20:05:48 -0700, Mike Kupfer wrote:
> > nmh has had those options since at least version 1.2.
>
> > I suppose gnus-rcvstore-unseen could be ternary:
>
> > nil (don't add an option)
> > 'seen
> > 'unseen
>
> > How does that sound?
>
> Otherwise, gnus-rcvstore-options, a list of additional options,
> default nil. I don't know if there are the other useful options,
> though. :)
Yes, another possible option would be to add the message to some other
MH sequence (e.g., "fromgnus").
Anyway, I finally got around to revising my patch. Please let me know
if you have any questions or other suggestions.
thanks,
mike
Changeset text:
Add a variable to pass additional options to rcvstore.
gnus/gnus-mh.el (gnus-rcvstore-options): New variable.
(gnus-summary-save-in-folder): Include gnus-rcvstore-options in the
arguments that are passed to rcvstore.
NEWS text:
*** New user option 'gnus-rcvstore-options' provides a way to
specify additional options when saving messages to an MH folder.
diff --git a/lisp/gnus/gnus-mh.el b/lisp/gnus/gnus-mh.el
--- a/lisp/gnus/gnus-mh.el
+++ b/lisp/gnus/gnus-mh.el
@@ -40,6 +40,13 @@
(defvar mh-lib-progs)
+(defcustom gnus-rcvstore-options nil
+ "Options that are passed to rcvstore, or nil.
+These are used when saving articles to an MH folder."
+ :version "26.1"
+ :group 'gnus-article
+ :type '(repeat string))
+
(defun gnus-summary-save-article-folder (&optional arg)
"Append the current article to an mh folder.
If N is a positive number, save the N next articles.
@@ -77,8 +84,12 @@
(save-restriction
(widen)
(unwind-protect
- (call-process-region
- (point-min) (point-max) "rcvstore" nil errbuf nil folder)
+ (apply
+ 'call-process-region
+ (append
+ (list (point-min) (point-max) "rcvstore" nil errbuf nil
+ folder)
+ gnus-rcvstore-options))
(set-buffer errbuf)
(if (zerop (buffer-size))
(message "Article saved in folder: %s" folder)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] nnmh support for saving messages as seen
2016-11-19 20:12 ` Mike Kupfer
@ 2016-11-21 6:20 ` Katsumi Yamaoka
2016-11-21 6:50 ` Katsumi Yamaoka
0 siblings, 1 reply; 10+ messages in thread
From: Katsumi Yamaoka @ 2016-11-21 6:20 UTC (permalink / raw)
To: Mike Kupfer; +Cc: ding
On Sat, 19 Nov 2016 12:12:04 -0800, Mike Kupfer wrote:
> Katsumi Yamaoka wrote:
>> Otherwise, gnus-rcvstore-options, a list of additional options,
>> default nil. I don't know if there are the other useful options,
>> though. :)
> Yes, another possible option would be to add the message to some other
> MH sequence (e.g., "fromgnus").
> Anyway, I finally got around to revising my patch. Please let me know
> if you have any questions or other suggestions.
Thank you for the complete changeset. Committed in Emacs master:
<http://lists.gnu.org/archive/html/emacs-diffs/2016-11/msg00170.html>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2016-11-21 15:40 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-23 2:23 [PATCH] nnmh support for saving messages as seen Mike Kupfer
2016-09-23 6:10 ` Katsumi Yamaoka
2016-09-24 3:05 ` Mike Kupfer
2016-09-25 22:54 ` Katsumi Yamaoka
2016-10-02 23:01 ` Mike Kupfer
2016-10-03 0:30 ` Katsumi Yamaoka
2016-11-19 20:12 ` Mike Kupfer
2016-11-21 6:20 ` Katsumi Yamaoka
2016-11-21 6:50 ` Katsumi Yamaoka
2016-11-21 15:40 ` Mike Kupfer
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).