commit-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Mailutils branch, master, updated. release-2.2-220-gc3b9cfe


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-220-gc3b9cfe
Date: Wed, 24 Nov 2010 20:50:24 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=c3b9cfe405a73936906f5c81d83a1fa190c932f8

The branch, master has been updated
       via  c3b9cfe405a73936906f5c81d83a1fa190c932f8 (commit)
      from  e53b55870dd3c4166ea6658ea679d608e500172a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c3b9cfe405a73936906f5c81d83a1fa190c932f8
Author: Sergey Poznyakoff <address@hidden>
Date:   Wed Nov 24 22:45:47 2010 +0200

    mh: minor changes in forw and repl; provide a set of traditional scan 
formats.
    
    * mh/.gitignore: Update.
    * mh/compcommon.c (mh_comp_draft): Rewrite using mh_find_file and
    simplify.  All callers changed.
    * mh/mh.h (mh_comp_draft): Change signature.
    * mh/comp.c (opt_handler) <ARGP_KEY_FINI>: Make sure formfile is
    initialized.
    * mh/forw.c: Likewise.
    * mh/repl.c (opt_handler): Remove unused variable.
    * mh/tests/comp.at (compcmd): Remove -form.
    * mh/tests/forw.at (forwcmd): Likewise.
    
    * mh/etc/.gitignore: New file.
    * mh/etc/Makefile.am: New file.
    * mh/etc/forwcomps: New file.
    * mh/etc/scan.default: New file.
    * mh/etc/scan.mailx: New file.
    * mh/etc/scan.size: New file.
    * mh/etc/scan.time: New file.
    * mh/etc/scan.timely: New file.

-----------------------------------------------------------------------

Summary of changes:
 mh/.gitignore                                  |    3 -
 mh/comp.c                                      |    7 ++-
 mh/compcommon.c                                |   61 ++++++++++--------------
 mh/etc/.gitignore                              |    3 +
 {libmu_sieve/extensions => mh/etc}/Makefile.am |   45 ++++++++++-------
 mh/etc/{components => forwcomps}               |    2 +-
 mh/etc/scan.default                            |   18 +++++++
 mh/etc/scan.mailx                              |   17 +++++++
 mh/etc/scan.size                               |   19 +++++++
 mh/etc/scan.time                               |   19 +++++++
 mh/etc/scan.timely                             |   22 +++++++++
 mh/forw.c                                      |    7 ++-
 mh/mh.h                                        |    3 +-
 mh/repl.c                                      |    2 -
 mh/tests/comp.at                               |    4 +-
 mh/tests/forw.at                               |    4 +-
 16 files changed, 166 insertions(+), 70 deletions(-)
 create mode 100644 mh/etc/.gitignore
 copy {libmu_sieve/extensions => mh/etc}/Makefile.am (54%)
 copy mh/etc/{components => forwcomps} (68%)
 create mode 100644 mh/etc/scan.default
 create mode 100644 mh/etc/scan.mailx
 create mode 100644 mh/etc/scan.size
 create mode 100644 mh/etc/scan.time
 create mode 100644 mh/etc/scan.timely

diff --git a/mh/.gitignore b/mh/.gitignore
index fecc9d2..0d106bb 100644
--- a/mh/.gitignore
+++ b/mh/.gitignore
@@ -8,14 +8,11 @@ ali
 anno
 burst
 comp
-elc-stamp
 fmtcheck
 folder
 forw
 inc
 install-mh
-mailutils-mh.el
-mailutils-mh.elc
 mark
 mh_alias.h
 mh_alias_gram.c
diff --git a/mh/comp.c b/mh/comp.c
index 7b62b95..cdb5c5a 100644
--- a/mh/comp.c
+++ b/mh/comp.c
@@ -146,6 +146,11 @@ opt_handler (int key, char *arg, struct argp_state *state)
       whatnowproc = NULL;
       break;
 
+    case ARGP_KEY_FINI:
+      if (!formfile)
+       mh_find_file ("components", &formfile);
+      break;
+         
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -294,7 +299,7 @@ main (int argc, char **argv)
          
        case DISP_REPLACE:
          unlink (wh_env.draftfile);
-         mh_comp_draft (formfile, "components", wh_env.file);
+         mh_comp_draft (formfile, wh_env.file);
        }
     }
   
diff --git a/mh/compcommon.c b/mh/compcommon.c
index 83890c6..95facea 100644
--- a/mh/compcommon.c
+++ b/mh/compcommon.c
@@ -27,53 +27,44 @@ static char *default_format_str =
 "--------\n";
 
 void
-mh_comp_draft (const char *formfile, const char *defformfile,
-              const char *draftfile)
+mh_comp_draft (const char *formfile, const char *draftfile)
 {
-  char *s = NULL;
-  if (formfile)
+  char *s;
+
+  if (mh_find_file (formfile, &s) == 0)
     {
-      s = mh_expand_name (MHLIBDIR, formfile, 0);
       if (mh_file_copy (s, draftfile))
        exit (1);
+      free (s);
     }
   else
     {
-      s = mh_expand_name (MHLIBDIR, defformfile, 0);
-      if (access (s, R_OK) == 0)
+      /* I doubt if we need that: */
+      int rc;
+      mu_stream_t stream;
+      
+      if ((rc = mu_file_stream_create (&stream,
+                                      draftfile,
+                                      MU_STREAM_WRITE|MU_STREAM_CREAT)))
        {
-         if (mh_file_copy (s, draftfile))
-           exit (1);
+         mu_error (_("cannot open output file \"%s\": %s"),
+                   draftfile, mu_strerror (rc));
+         exit (1);
        }
-      else
+      
+      rc = mu_stream_write (stream, 
+                           default_format_str,
+                           strlen (default_format_str), NULL);
+      mu_stream_close (stream);
+      mu_stream_destroy (&stream);
+      
+      if (rc)
        {
-         int rc;
-         mu_stream_t stream;
-         
-         if ((rc = mu_file_stream_create (&stream,
-                                       draftfile,
-                                       MU_STREAM_WRITE|MU_STREAM_CREAT)))
-           {
-             mu_error (_("cannot open output file \"%s\": %s"),
-                       draftfile, mu_strerror (rc));
-             exit (1);
-           }
-         
-         rc = mu_stream_write (stream, 
-                               default_format_str,
-                               strlen (default_format_str), NULL);
-         mu_stream_close (stream);
-         mu_stream_destroy (&stream);
-
-         if (rc)
-           {
-             mu_error (_("error writing to \"%s\": %s"),
-                       draftfile, mu_strerror (rc));
-             exit (1);
-           }
+         mu_error (_("error writing to \"%s\": %s"),
+                   draftfile, mu_strerror (rc));
+         exit (1);
        }
     }
-  free (s);
 }
 
 int 
diff --git a/mh/etc/.gitignore b/mh/etc/.gitignore
new file mode 100644
index 0000000..b250ab2
--- /dev/null
+++ b/mh/etc/.gitignore
@@ -0,0 +1,3 @@
+elc-stamp
+mailutils-mh.el
+mailutils-mh.elc
diff --git a/libmu_sieve/extensions/Makefile.am b/mh/etc/Makefile.am
similarity index 54%
copy from libmu_sieve/extensions/Makefile.am
copy to mh/etc/Makefile.am
index 391d191..f8c0f3c 100644
--- a/libmu_sieve/extensions/Makefile.am
+++ b/mh/etc/Makefile.am
@@ -1,5 +1,5 @@
 ## This file is part of GNU Mailutils.
-## Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Free Software
+## Copyright (C) 2001, 2002, 2003, 2007, 2009, 2010 Free Software
 ## Foundation, Inc.
 ##
 ## GNU Mailutils is free software; you can redistribute it and/or
@@ -15,28 +15,35 @@
 ## You should have received a copy of the GNU General Public License
 ## along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>. 
 
address@hidden@
-mod_LTLIBRARIES = \
- list.la\
- moderator.la\
- pipe.la\
- spamd.la\
- timestamp.la\
- vacation.la
+mhlibdir   = $(pkgdatadir)/mh
 
-INCLUDES = @MU_APP_COMMON_INCLUDES@ 
+LISPSRC    = mailutils-mh.el
+lisp_LISP  = @lisp_LISP@
+EXTRA_LISP = mailutils-mh.el
 
-AM_LDFLAGS = -module -avoid-version -no-undefined -rpath '$(moddir)' 
+MH_FILES   = \
+ components\
+ forwcomps\
+ mhl.format\
+ mhl.forward\
+ mhl.repl\
+ mhl.usenet\
+ replcomps\
+ replgroupcomps\
+ scan.default\
+ scan.mailx\
+ scan.size\
+ scan.time\
+ scan.timely
 
-list_la_SOURCES = list.c
-LIBS = ../libmu_sieve.la 
+mhlib_DATA = $(MH_FILES) $(LISPSRC)
 
-moderator_la_SOURCES = moderator.c
+EXTRA_DIST = $(MH_FILES) mailutils-mh.eli
+DISTCLEANFILES = mailutils-mh.el
 
-spamd_la_SOURCES = spamd.c
+SUFFIXES = .eli .el
+mailutils-mh.el: mailutils-mh.eli
 
-timestamp_la_SOURCES = timestamp.c
+.eli.el:
+       sed "s,BINDIR,$(bindir),g;s,MHLIBDIR,$(mhlibdir),g" $< > $@
 
-vacation_la_SOURCES = vacation.c
-
-pipe_la_SOURCES = pipe.c
diff --git a/mh/etc/components b/mh/etc/forwcomps
similarity index 68%
copy from mh/etc/components
copy to mh/etc/forwcomps
index 512352e..7926e6f 100644
--- a/mh/etc/components
+++ b/mh/etc/forwcomps
@@ -1,4 +1,4 @@
-;; Default components file for GNU MH.
+;; Default forward components file for GNU MH.
 ;; Lines beginning with ; are ignored.  Rest of lines is copied verbatim.
 To:
 cc:
diff --git a/mh/etc/scan.default b/mh/etc/scan.default
new file mode 100644
index 0000000..c0fbf8a
--- /dev/null
+++ b/mh/etc/scan.default
@@ -0,0 +1,18 @@
+%; Default scan format GNU MH.
+%;
+%; GNU Mailutils -- a suite of utilities for electronic mail
+%; Copyright (C) 2003, 2010 Free Software Foundation, Inc.
+%; Distributed under GPLv3+.  See <http://gnu.org/licenses/gpl.html>.
+%;
+%; NOTE: This file is not actually used and is supplied for your reference
+%;       only.  It shows the default format string, which is compiled into
+%;       "scan".
+%4(msg)\
+%<(cur)+%| %>\
+%<{replied}-%?{encrypted}E%| %>\
+%02(mon{date})/%02(mday{date})\
+%<{date} %|*%>\
+%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\
+%<(zero)%17(decode(friendly{from}))%>\
+  %(decode{subject})%<{body}<<%{body}>>%>
+%; End of scan.default
diff --git a/mh/etc/scan.mailx b/mh/etc/scan.mailx
new file mode 100644
index 0000000..dd92509
--- /dev/null
+++ b/mh/etc/scan.mailx
@@ -0,0 +1,17 @@
+%; Mimic the mailx(1) output.
+%;
+%; GNU Mailutils -- a suite of utilities for electronic mail
+%; Copyright (C) 2003, 2010 Free Software Foundation, Inc.
+%; Distributed under GPLv3+.  See <http://gnu.org/licenses/gpl.html>.
+%;
+%<(cur)>%| %>\
+%<{status} %|N%>\
+%<{replied}R%?{encrypted}E%| %>\
+%4(msg) \
+%<(mymbox{from})%<{to}To: %13(decode(friendly{to}))%>%>\
+%<(zero)%17(decode(friendly{from}))%> \
+%3(day{date}) %3(month{date}) %02(mday{date}) \
+%02(hour{date}):%02(min{date}) \
+%(decode{subject})
+%; End of scan.mailx
+
diff --git a/mh/etc/scan.size b/mh/etc/scan.size
new file mode 100644
index 0000000..097567e
--- /dev/null
+++ b/mh/etc/scan.size
@@ -0,0 +1,19 @@
+%; "Size"-format for GNU MH scan.
+%;
+%; GNU Mailutils -- a suite of utilities for electronic mail
+%; Copyright (C) 2003, 2010 Free Software Foundation, Inc.
+%; Distributed under GPLv3+.  See <http://gnu.org/licenses/gpl.html>.
+%;
+%; This format is similar to scan.default, except that it prints the
+%; size of the message before the sender name column.
+%;
+%4(msg)\
+%<(cur)+%| %>\
+%<{replied}-%?{encrypted}E%| %>\
+%02(mon{date})/%02(mday{date})\
+%<{date} %|*%>\
+%5(size) \
+%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\
+%<(zero)%17(decode(friendly{from}))%>\
+  %(decode{subject})%<{body}<<%{body}%>
+%; End of scan.size
diff --git a/mh/etc/scan.time b/mh/etc/scan.time
new file mode 100644
index 0000000..83863ad
--- /dev/null
+++ b/mh/etc/scan.time
@@ -0,0 +1,19 @@
+%; "Time"-format for GNU MH scan.
+%;
+%; GNU Mailutils -- a suite of utilities for electronic mail
+%; Copyright (C) 2003, 2010 Free Software Foundation, Inc.
+%; Distributed under GPLv3+.  See <http://gnu.org/licenses/gpl.html>.
+%;
+%; This format is similar to scan.default, except that it prints the
+%; date in 1-minute resolution and adds a timezone.
+%;
+%4(msg)\
+%<(cur)+%| %>\
+%<{replied}-%?{encrypted}E%| %>\
+%02(mon{date})/%02(mday{date})\
+ %02(hour{date}):%02(min{date})%3(tzone{date})\
+%<{date} %|*%>\
+%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\
+%<(zero)%17(decode(friendly{from}))%>\
+  %(decode{subject})%<{body}<<%{body}%>
+%; End of scan.time
diff --git a/mh/etc/scan.timely b/mh/etc/scan.timely
new file mode 100644
index 0000000..5256565
--- /dev/null
+++ b/mh/etc/scan.timely
@@ -0,0 +1,22 @@
+%; "Timely"-format for GNU MH scan.
+%;
+%; GNU Mailutils -- a suite of utilities for electronic mail
+%; Copyright (C) 2003, 2010 Free Software Foundation, Inc.
+%; Distributed under GPLv3+.  See <http://gnu.org/licenses/gpl.html>.
+%;
+%; The time output in this format depends on the time difference between
+%; the current time and the time being printed.
+%;
+%4(msg)\
+%<(cur)+%| %>\
+%<{replied}-%?{encrypted}E%| %>\
+%(void(rclock{date}))\
+%<(gt 15768000)%03(month{date})%(void(year{date}))%02(modulo 100)\
+%?(gt 604800)%02(mday{date})%03(month{date})\
+%?(gt 86400) %(day{date}) %|\
+%02(hour{date}):%02(min{date})%>\
+%<{date} %|*%>\
+%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\
+%<(zero)%17(decode(friendly{from}))%>\
+  %(decode{subject})%<{body}<<%{body}%>
+%; End of scan.timely
\ No newline at end of file
diff --git a/mh/forw.c b/mh/forw.c
index 60baaaf..7539176 100644
--- a/mh/forw.c
+++ b/mh/forw.c
@@ -225,6 +225,11 @@ opt_handler (int key, char *arg, struct argp_state *state)
       whatnowproc = NULL;
       break;
 
+    case ARGP_KEY_FINI:
+      if (!formfile)
+       mh_find_file ("forwcomps", &formfile);
+      break;
+      
     default:
       return ARGP_ERR_UNKNOWN;
     }
@@ -522,7 +527,7 @@ main (int argc, char **argv)
       
     case DISP_REPLACE:
       unlink (wh_env.draftfile);
-      mh_comp_draft (formfile, "forwcomps", wh_env.file);
+      mh_comp_draft (formfile, wh_env.file);
       finish_draft ();
     }
   
diff --git a/mh/mh.h b/mh/mh.h
index 21be165..07cb096 100644
--- a/mh/mh.h
+++ b/mh/mh.h
@@ -378,8 +378,7 @@ int mh_seq_delete (mu_mailbox_t mbox, const char *name, 
mh_msgset_t *mset,
                   int flags);
 const char *mh_seq_read (mu_mailbox_t mbox, const char *name, int flags);
 
-void mh_comp_draft (const char *formfile, const char *defformfile,
-                   const char *draftfile);
+void mh_comp_draft (const char *formfile, const char *draftfile);
 int check_draft_disposition (struct mh_whatnow_env *wh, int use_draft);
 
 void ali_parse_error (const char *fmt, ...) MU_PRINTFLIKE(1,2); 
diff --git a/mh/repl.c b/mh/repl.c
index c7ca5b3..ca76f1b 100644
--- a/mh/repl.c
+++ b/mh/repl.c
@@ -139,8 +139,6 @@ decode_cc_flag (const char *opt, const char *arg)
 static error_t
 opt_handler (int key, char *arg, struct argp_state *state)
 {
-  char *s;
-  
   switch (key)
     {
     case ARGP_KEY_INIT:
diff --git a/mh/tests/comp.at b/mh/tests/comp.at
index 4ffa81b..fee2040 100644
--- a/mh/tests/comp.at
+++ b/mh/tests/comp.at
@@ -15,9 +15,7 @@
 # along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
 
 m4_pushdef([MH_KEYWORDS],[comp])
-m4_pushdef([compcmd],[comp dnl
--form components dnl
--editor $abs_top_srcdir/mh/tests/mhed])
+m4_pushdef([compcmd],[comp -editor $abs_top_srcdir/mh/tests/mhed])
 
 MH_CHECK([comp -file],[comp00 comp-file],[
 dir=`pwd`
diff --git a/mh/tests/forw.at b/mh/tests/forw.at
index 16c83da..0b68122 100644
--- a/mh/tests/forw.at
+++ b/mh/tests/forw.at
@@ -15,9 +15,7 @@
 # along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
 
 m4_pushdef([MH_KEYWORDS],[forw])
-m4_pushdef([forwcmd],[forw dnl
--form components dnl
--editor $abs_top_srcdir/mh/tests/mhed])
+m4_pushdef([forwcmd],[forw -editor $abs_top_srcdir/mh/tests/mhed])
 
 MH_CHECK([forw msg],[forw00 forw-msg],[
 mkdir Mail/inbox


hooks/post-receive
-- 
GNU Mailutils



reply via email to

[Prev in Thread] Current Thread [Next in Thread]