summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS6
-rw-r--r--doc/texinfo/programs/mail.texi4
-rw-r--r--mail/Makefile.am1
-rw-r--r--mail/mail.h1
-rw-r--r--mail/table.c2
-rw-r--r--mail/unread.c36
6 files changed, 49 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index e49fa0eb6..f1c8ef510 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-GNU mailutils NEWS -- history of user-visible changes. 2021-08-25
+GNU mailutils NEWS -- history of user-visible changes. 2021-11-13
See the end of file for copying conditions.
Please send mailutils bug reports to <bug-mailutils@gnu.org>.
@@ -13,6 +13,10 @@ This statement sets timeout in seconds for TLS handshake operations in
daemons. Default timeout it 10 seconds.
* Fix idle timeout handling (imap4d and pop3d daemons)
+
+* mail utility
+
+** new command: unread (U)
Version 3.13, 2021-08-05
diff --git a/doc/texinfo/programs/mail.texi b/doc/texinfo/programs/mail.texi
index 9a0af24cb..dd44caaf6 100644
--- a/doc/texinfo/programs/mail.texi
+++ b/doc/texinfo/programs/mail.texi
@@ -827,6 +827,10 @@ Marks each message to be held in user's system mailbox. This command
does not override the effect of @code{delete} command.
@end deffn
+@deffn {Mail command} unread [@var{msglist}]
+Marks each message from the @var{msglist} as not having been read.
+@end deffn
+
@node Disposing of Messages
@subsubsection Disposing of Messages
diff --git a/mail/Makefile.am b/mail/Makefile.am
index a06979532..5dc5c11b0 100644
--- a/mail/Makefile.am
+++ b/mail/Makefile.am
@@ -84,6 +84,7 @@ mail_SOURCES = \
touch.c\
unalias.c\
undelete.c\
+ unread.c\
unset.c\
util.c\
version.c\
diff --git a/mail/mail.h b/mail/mail.h
index a494e8fe3..48b56f578 100644
--- a/mail/mail.h
+++ b/mail/mail.h
@@ -306,6 +306,7 @@ int mail_touch (int argc, char **argv);
int mail_unalias (int argc, char **argv);
int mail_undelete (int argc, char **argv);
int mail_unfold (int argc, char **argv);
+int mail_unread (int argc, char **argv);
int mail_unset (int argc, char **argv);
int mail_version (int argc, char **argv);
int mail_visual (int argc, char **argv);
diff --git a/mail/table.c b/mail/table.c
index 1038702e5..3ea533ca7 100644
--- a/mail/table.c
+++ b/mail/table.c
@@ -152,6 +152,8 @@ static const struct mail_command_entry mail_command_table[] = {
mail_print, msglist_compl },
{ "una", "unalias", "una[lias] [alias]...", 0,
mail_unalias, NULL },
+ { "U", "unread", "unread [msglist]", 0,
+ mail_unread, msglist_compl },
{ "u", "undelete", "u[ndelete] [msglist]", 0,
mail_undelete, msglist_compl },
{ "unf", "unfold", "unf[old] [header-field]", 0,
diff --git a/mail/unread.c b/mail/unread.c
new file mode 100644
index 000000000..2787cb8a8
--- /dev/null
+++ b/mail/unread.c
@@ -0,0 +1,36 @@
+/* GNU Mailutils -- a suite of utilities for electronic mail
+ Copyright (C) 1999-2021 Free Software Foundation, Inc.
+
+ GNU Mailutils is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GNU Mailutils is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "mail.h"
+
+static int
+unread0 (msgset_t *mspec, mu_message_t msg, void *data)
+{
+ mu_attribute_t attr;
+
+ mu_message_get_attribute (msg, &attr);
+ mu_attribute_unset_read (attr);
+ mu_attribute_unset_userflag (attr, MAIL_ATTRIBUTE_SHOWN);
+ cond_page_invalidate (msgset_msgno (mspec));
+
+ return 0;
+}
+
+int
+mail_unread (int argc, char **argv)
+{
+ return util_foreach_msg (argc, argv, MSG_ALL, unread0, NULL);
+}

Return to:

Send suggestions and report system problems to the System administrator.