Martin Neitzel | 8 Feb 2007 19:42
Picon
Favicon

tiny quote error in makeconfig (w/ patch)

The makeconfig script has a tiny error at the end, namely the
autoconfiguration summary output.  The C preprocessor may complain about
the single apostrophy quote.  A unidiff with a suggested rewording fixing
that is below.

This error will only show up at the end of the config.log and is not
really crucial -- the config.h has already been written at this point.

[makeconfig is an excellent configuration script -- straight forward
and easy to debug.  Soooo much more sensible than GNU's autohell.]

							Martin

Index: makeconfig
===================================================================
RCS file: /cvsroot/nail/nail/makeconfig,v
retrieving revision 1.12
diff -u -r1.12 makeconfig
--- makeconfig	4 Mar 2006 00:32:16 -0000	1.12
+++ makeconfig	8 Feb 2007 18:21:01 -0000
 <at>  <at>  -459,8 +459,8  <at>  <at> 
 #endif
 #ifndef	HAVE_FCHDIR
 : * The function fchdir() could not be found. mailx will be compiled to use
-: chdir() instead. This is not a problem unless mailx's current working
-: directory is moved while the IMAP cache is used.
+: chdir() instead. This is not a problem unless the current working
+: directory of mailx is moved while the IMAP cache is used.
 #endif
 :
(Continue reading)

Gunnar Ritter | 8 Feb 2007 23:55
Picon
Favicon

Re: tiny quote error in makeconfig (w/ patch)

Martin Neitzel <neitzel@...> wrote:

> The makeconfig script has a tiny error at the end, namely the
> autoconfiguration summary output.  The C preprocessor may complain about
> the single apostrophy quote.  A unidiff with a suggested rewording fixing
> that is below.

Thanks! I have applied this in the CVS repository.

> [makeconfig is an excellent configuration script -- straight forward
> and easy to debug.  Soooo much more sensible than GNU's autohell.]

Sure, I have dropped the latter a few years ago and
have been very satisfied since then.

	Gunnar

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
MJ Ray | 10 Feb 2007 10:50
Gravatar

New headline specifiers

I can be reached by various email aliases and I'm on several mailing
lists.  It's quite useful to see how something reached me.  So, I've
hacked into mailx support for two new headline format specifiers:

  %T - the To address of the email
  %I - the List-Id of the email if present, else the To address

There also seems to be another specifier not in the man page:

  %U  The unique identifier of the message.

Attached are a patch for cmd1.c and one for mailx.1

Hope that helps,
--

-- 
MJ Ray - see/vidu http://mjr.towers.org.uk/email.html
Somerset, England. Work/Laborejo: http://www.ttllp.co.uk/
IRC/Jabber/SIP: on request/peteble.
--- cmd1.c.orig	2007-02-10 03:02:58.000000000 +0000
+++ cmd1.c	2007-02-10 09:39:42.000000000 +0000
 <at>  <at>  -518,6 +518,22  <at>  <at> 
 						colalign(name, fromlen, 1));
 				subjlen -= n;
 				break;
+			case 'I':
+				if (n <= 0)
+					n = 18;
+				if ((cp = hfield("list-id", mp)) != NULL) {
(Continue reading)

Gunnar Ritter | 10 Feb 2007 13:54
Picon
Favicon

Re: New headline specifiers

MJ Ray <mjr@...> wrote:

> I can be reached by various email aliases and I'm on several mailing
> lists.  It's quite useful to see how something reached me.  So, I've
> hacked into mailx support for two new headline format specifiers:
>
>   %T - the To address of the email
>   %I - the List-Id of the email if present, else the To address

I would be fine with %T, however "List-Id" seems too specific.
In general, it would be more useful to have generic support
for headers fields, e.g. %(header-field), so you could use
%(To) or %(list-id), and nobody would have to change the code
anymore if he likes to display some other field. Would you be
willing to contribute code for that as well?

> There also seems to be another specifier not in the man page:
>
>   %U  The unique identifier of the message.

This is intentionally left undocumented; it may be helpful
for debugging the IMAP code, but is not generally useful.

	Gunnar

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
(Continue reading)

MJ Ray | 10 Feb 2007 19:23
Gravatar

Re: New headline specifiers

Gunnar Ritter <gunnarr@...> wrote:
> MJ Ray <mjr@...> wrote:
> >   %T - the To address of the email
> >   %I - the List-Id of the email if present, else the To address
>
> I would be fine with %T, however "List-Id" seems too specific.

Why?  List-Id is from RFC-2919 and seems like a good alternative to To
if present.

> In general, it would be more useful to have generic support
> for headers fields, e.g. %(header-field), so you could use
> %(To) or %(list-id), and nobody would have to change the code
> anymore if he likes to display some other field. Would you be
> willing to contribute code for that as well?

It would be even more useful to have %(list-id|to) but I'm not sure
how to code that.  Iterate over the format string, I guess.  Seems
a bit messy with lots of potential error cases.  A first hack is
attached.  I've re-used pbuf and B, added fpp and I don't understand
why I don't need to decrease subjlen.

> > There also seems to be another specifier not in the man page:
> >
> >   %U  The unique identifier of the message.
>
> This is intentionally left undocumented; it may be helpful
> for debugging the IMAP code, but is not generally useful.

It's there, it's a feature, even if a niche.  Don't be shy!
(Continue reading)

Gunnar Ritter | 10 Feb 2007 20:55
Picon
Favicon

Re: New headline specifiers

MJ Ray <mjr@...> wrote:

> It would be even more useful to have %(list-id|to) but I'm not sure
> how to code that.  Iterate over the format string, I guess.  Seems
> a bit messy with lots of potential error cases.  A first hack is
> attached.

Please write real code, including proper formatting (cf. other
mailx code). A hack is useless for me.

> I've re-used pbuf

No, this loses data.

> and B, added fpp and I don't understand why I don't need to
> decrease subjlen.

Who said that? Do it.

	Gunnar

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
MJ Ray | 10 Feb 2007 23:49
Gravatar

Re: New headline specifiers

Gunnar Ritter <gunnarr@...> wrote:
> MJ Ray <mjr@...> wrote:
> > It would be even more useful to have %(list-id|to) but I'm not sure
> > how to code that.  Iterate over the format string, I guess.  Seems
> > a bit messy with lots of potential error cases.  A first hack is
> > attached.
>
> Please write real code, including proper formatting (cf. other
> mailx code). A hack is useless for me.

I spend bloody ages trying to decipher a comment-free chunk of cmd1.c
code and all I get is rudeness in return?  Sod that for a game of
soldiers.

> > I've re-used pbuf
>
> No, this loses data.

Smells like bad coupling between cmd1 and head. I've declared a fbuf
too instead.  I'm not sending a new patch yet because I still don't
know what indent settings will avoid getting flamed.  I don't see how
the formatting of the last patch differs from existing code apart from
omitted spaces around one of the = signs.  If there was a useful
description or suggested indent settings in a HACKING file, maybe a
flame could be justified, but I think it's a bit unreasonable to flame
patchers for not guessing undocumented preferences.

> > and B, added fpp and I don't understand why I don't need to
> > decrease subjlen.
>
(Continue reading)

Gunnar Ritter | 11 Feb 2007 01:44
Picon
Favicon

Re: New headline specifiers

MJ Ray <mjr@...> wrote:

> Gunnar Ritter <gunnarr@...> wrote:
> > MJ Ray <mjr@...> wrote:
> > > It would be even more useful to have %(list-id|to) but I'm not sure
> > > how to code that.  Iterate over the format string, I guess.  Seems
> > > a bit messy with lots of potential error cases.  A first hack is
> > > attached.
> >
> > Please write real code, including proper formatting (cf. other
> > mailx code). A hack is useless for me.
>
> I spend bloody ages trying to decipher a comment-free chunk of cmd1.c
> code and all I get is rudeness in return?  Sod that for a game of
> soldiers.

Hey, you are the one who wants to have that feature
in mailx, not me. Also, you are the one who called
your code a hack.

All I insist is that you solve a problem such that
it also helps other people who have similar wishes,
and that you deliver code as good as you can. If
you speak of it as a hack, you clearly missed the
latter. I am willing to review and integrate your
code but not until it is ready in your own opinion.

Regarding comments, people who write C code should
be able to read C code. So I find most of the comments
in your patch superfluous since what they state is
(Continue reading)

MJ Ray | 11 Feb 2007 17:08
Gravatar

Re: New headline specifiers

Gunnar Ritter <gunnarr@...> wrote:
> MJ Ray <mjr@...> wrote:
> > I spend bloody ages trying to decipher a comment-free chunk of cmd1.c
> > code and all I get is rudeness in return?  Sod that for a game of
> > soldiers.
>
> Hey, you are the one who wants to have that feature
> in mailx, not me. Also, you are the one who called
> your code a hack.

No, I wanted a similar feature (%I) and you asked me to code this one.

Now I have this feature in my mailx and I'll have no problem maintaining
it as a one-distribution patch until something similar appears.

> All I insist is that you solve a problem such that
> it also helps other people who have similar wishes,
> and that you deliver code as good as you can. If
> you speak of it as a hack, you clearly missed the
> latter. I am willing to review and integrate your
> code but not until it is ready in your own opinion.

If it was not ready for review in my opinion, I would not have mailed
it.  However, I know it will contain errors, because the mailx code is
underdocumented ye olde worlde C which is about as old as I am: a very
different style of C to that which I learnt.

I feel it's rudeness calling hacks useless and unreal.  That first
public draft is a hack, but I think it's a useful hack.

(Continue reading)

Gunnar Ritter | 11 Feb 2007 17:55
Picon
Favicon

Re: New headline specifiers

MJ Ray <mjr@...> wrote:

> Gunnar Ritter <gunnarr@...> wrote:
> > Regarding comments, people who write C code should
> > be able to read C code. So I find most of the comments
> > in your patch superfluous since what they state is
> > obvious from the code anyway.
>
> They're signposts for people who follow me.  Names like B and fp are
> not descriptive.  The comments may be stating the obvious to someone
> who knows the code, but road signs state the obvious to someone who
> knows the road but I'd still put road signs when I built a road.

If you want to submit a patch, please also stick with
the conventions concerning comments. Comments of that
kind are not normally used in mailx, your code should
not make an exception.

Just try to format your code such that it cannot be
distinguished from the surrounding code once the patch
has been applied. This is neither particularly difficult,
nor is it an unusual demand in open source projects.

> > See, you found one point yourself. There are more
> > missing spaces. Also, you are using C++/C99 comments.
> > Code should not exceed 80 character columns, and
> > there should be no more than one statement on a line
> > unless there is a very special reason for that.
>
> The reason was that i and pf must keep step, else the code that
(Continue reading)


Gmane