From owner-freebsd-standards Sun Dec 23 22:46:54 2001 Delivered-To: freebsd-standards@freebsd.org Received: from mta0x15.coxmail.com (cm-fe1.coxmail.com [206.157.225.48]) by hub.freebsd.org (Postfix) with ESMTP id BA05537B41C for ; Sun, 23 Dec 2001 22:46:51 -0800 (PST) Received: from enterprise.muriel.penguinpowered.com ([209.249.174.31]) by mta0x15.coxmail.com (InterMail vK.4.03.04.01 201-232-130-101 license c271d808eeaddc9d652e7c0b1383e8cc) with ESMTP id <20011224064639.RBNY848.mta0x15@enterprise.muriel.penguinpowered.com> for ; Mon, 24 Dec 2001 01:46:39 -0500 Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="_=XFMail.1.5.2.FreeBSD:20011224014631:189=_"; micalg=pgp-md5; protocol="application/pgp-signature" Date: Mon, 24 Dec 2001 01:46:31 -0500 (EST) Reply-To: Mike Heffner From: Mike Heffner To: freebsd-standards@freebsd.org Subject: linking mail to mailx Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This message is in MIME format --_=XFMail.1.5.2.FreeBSD:20011224014631:189=_ Content-Type: text/plain; charset=us-ascii Does anyone have any objections to linking mail to mailx? While our mail(1) is not 100% compliant to POSIX mailx requirements, it has support for a large portion of the required options and I'm in the process of implementing the rest of the required options. Currently, both OpenBSD and NetBSD install mail as mailx as well. Thanks, Mike P.S. Please keep me on CC as my list subscription is currently in limbo. -- Mike Heffner Fredericksburg, VA --_=XFMail.1.5.2.FreeBSD:20011224014631:189=_ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE8Js9GFokZQs3sv5kRAphaAJ4o042K5URRbx1IpwYhHDVDDJGKbACgji/e qxD2oneClCUDXgFoQMZ4xMw= =enYb -----END PGP SIGNATURE----- --_=XFMail.1.5.2.FreeBSD:20011224014631:189=_-- End of MIME message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Thu Dec 27 7:32:15 2001 Delivered-To: freebsd-standards@freebsd.org Received: from hfep04.dion.ne.jp (hfep04.dion.ne.jp [203.181.105.70]) by hub.freebsd.org (Postfix) with ESMTP id 3933A37B405 for ; Thu, 27 Dec 2001 07:32:13 -0800 (PST) Received: from localhost ([211.5.28.170]) by hfep04.dion.ne.jp with ESMTP id <20011227153211478.PULZ@hfep04.dion.ne.jp>; Fri, 28 Dec 2001 00:32:11 +0900 To: mheffner@vt.edu, mheffner@novacoxmail.com Cc: freebsd-standards@freebsd.org Subject: Re: linking mail to mailx In-Reply-To: References: X-Mailer: Mew version 1.94.1 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20011228003028I.haro@h4.dion.ne.jp> Date: Fri, 28 Dec 2001 00:30:28 +0900 From: Munehiro Matsuda X-Dispatcher: imput version 20000228(IM140) Lines: 28 Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG From: Mike Heffner Date: Mon, 24 Dec 2001 01:46:31 -0500 (EST) ::Does anyone have any objections to linking mail to mailx? While our ::mail(1) is not 100% compliant to POSIX mailx requirements, it has support ::for a large portion of the required options and I'm in the process of ::implementing the rest of the required options. Currently, both OpenBSD and ::NetBSD install mail as mailx as well. :: ::Thanks, :: ::Mike Hello Mike, How different from ports/mail/mailx? I thought ports/mail/mailx was also based on BSD mail command. Thanks, Haro =------------------------------------------------------------------------------ _ _ Munehiro (haro) Matsuda -|- /_\ |_|_| Business Incubation Dept., Kubota Corp. /|\ |_| |_|_| 1-3 Nihonbashi-Muromachi 3-Chome Chuo-ku Tokyo 103-8310, Japan Tel: +81-3-3245-3318 Fax: +81-3-3245-3315 Email: haro@kubota.co.jp To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Thu Dec 27 10:22:53 2001 Delivered-To: freebsd-standards@freebsd.org Received: from mta0x15.coxmail.com (cm-fe1.coxmail.com [206.157.225.48]) by hub.freebsd.org (Postfix) with ESMTP id 67A9E37B417 for ; Thu, 27 Dec 2001 10:22:48 -0800 (PST) Received: from enterprise.muriel.penguinpowered.com ([209.249.174.31]) by mta0x15.coxmail.com (InterMail vK.4.03.04.01 201-232-130-101 license c271d808eeaddc9d652e7c0b1383e8cc) with ESMTP id <20011227182235.UDHE848.mta0x15@enterprise.muriel.penguinpowered.com>; Thu, 27 Dec 2001 13:22:35 -0500 Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="_=XFMail.1.5.2.FreeBSD:20011227132232:5796=_"; micalg=pgp-md5; protocol="application/pgp-signature" In-Reply-To: <20011228003028I.haro@h4.dion.ne.jp> Date: Thu, 27 Dec 2001 13:22:32 -0500 (EST) Reply-To: Mike Heffner From: Mike Heffner To: Munehiro Matsuda Subject: Re: linking mail to mailx Cc: freebsd-standards@FreeBSD.ORG Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This message is in MIME format --_=XFMail.1.5.2.FreeBSD:20011227132232:5796=_ Content-Type: text/plain; charset=us-ascii On 27-Dec-2001 Munehiro Matsuda wrote: | From: Mike Heffner | Date: Mon, 24 Dec 2001 01:46:31 -0500 (EST) |::Does anyone have any objections to linking mail to mailx? While our |::mail(1) is not 100% compliant to POSIX mailx requirements, it has |::support |::for a large portion of the required options and I'm in the process of |::implementing the rest of the required options. Currently, both OpenBSD |::and |::NetBSD install mail as mailx as well. |:: |::Thanks, |:: |::Mike | | Hello Mike, | | How different from ports/mail/mailx? | I thought ports/mail/mailx was also based on BSD mail command. | The mail/mailx port appears to be a subset of the -current version of mail(1). I think the mailx port added some options for specifying bcc addresses and added some tilde escapes, but these have since been added to -current mail(1) Mike -- Mike Heffner Fredericksburg, VA --_=XFMail.1.5.2.FreeBSD:20011227132232:5796=_ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE8K2boFokZQs3sv5kRAlsEAJ90JjLtcL31qQOEHEXoI66mk0INPACfRdR4 Hh8VEGU0wLPE/z9vT52uh9I= =rVk9 -----END PGP SIGNATURE----- --_=XFMail.1.5.2.FreeBSD:20011227132232:5796=_-- End of MIME message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Thu Dec 27 14:14:50 2001 Delivered-To: freebsd-standards@freebsd.org Received: from hfep06.dion.ne.jp (hfep06.dion.ne.jp [203.181.105.72]) by hub.freebsd.org (Postfix) with ESMTP id 3EEBE37B426 for ; Thu, 27 Dec 2001 14:14:46 -0800 (PST) Received: from localhost ([211.5.23.87]) by hfep06.dion.ne.jp with ESMTP id <20011227221443835.HGUB@hfep06.dion.ne.jp>; Fri, 28 Dec 2001 07:14:43 +0900 To: mheffner@vt.edu, mheffner@novacoxmail.com Cc: haro@h4.dion.ne.jp, freebsd-standards@FreeBSD.ORG Subject: Re: linking mail to mailx In-Reply-To: References: <20011228003028I.haro@h4.dion.ne.jp> X-Mailer: Mew version 1.94.1 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20011228071300N.haro@h4.dion.ne.jp> Date: Fri, 28 Dec 2001 07:13:00 +0900 From: Munehiro Matsuda X-Dispatcher: imput version 20000228(IM140) Lines: 43 Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG From: Mike Heffner Date: Thu, 27 Dec 2001 13:22:32 -0500 (EST) :: ::On 27-Dec-2001 Munehiro Matsuda wrote: ::| From: Mike Heffner ::| Date: Mon, 24 Dec 2001 01:46:31 -0500 (EST) ::|::Does anyone have any objections to linking mail to mailx? While our ::|::mail(1) is not 100% compliant to POSIX mailx requirements, it has ::|::support ::|::for a large portion of the required options and I'm in the process of ::|::implementing the rest of the required options. Currently, both OpenBSD ::|::and ::|::NetBSD install mail as mailx as well. ::|:: ::|::Thanks, ::|:: ::|::Mike ::| ::| Hello Mike, ::| ::| How different from ports/mail/mailx? ::| I thought ports/mail/mailx was also based on BSD mail command. ::| :: :: ::The mail/mailx port appears to be a subset of the -current version of ::mail(1). I think the mailx port added some options for specifying bcc ::addresses and added some tilde escapes, but these have since been added to ::-current mail(1) Aah, ok. Thanks for clarifying. # me runs off to pkg_delete-ing mailx port from my -current system... :-) Regards, Haro =------------------------------------------------------------------------------ _ _ Munehiro (haro) Matsuda -|- /_\ |_|_| Business Incubation Dept., Kubota Corp. /|\ |_| |_|_| 1-3 Nihonbashi-Muromachi 3-Chome Chuo-ku Tokyo 103-8310, Japan Tel: +81-3-3245-3318 Fax: +81-3-3245-3315 Email: haro@kubota.co.jp To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Dec 28 0:17:56 2001 Delivered-To: freebsd-standards@freebsd.org Received: from espresso.q9media.com (espresso.q9media.com [216.254.138.122]) by hub.freebsd.org (Postfix) with ESMTP id 5181337B416 for ; Fri, 28 Dec 2001 00:17:46 -0800 (PST) Received: (from mike@localhost) by espresso.q9media.com (8.11.6/8.11.6) id fBS8Fbf23518; Fri, 28 Dec 2001 03:15:37 -0500 (EST) (envelope-from mike) Date: Fri, 28 Dec 2001 03:15:37 -0500 From: Mike Barcroft To: Joe Halpin Cc: "standards@FreeBSD.ORG" Subject: Re: at utility changes Message-ID: <20011228031537.B99161@espresso.q9media.com> References: <3C200BBA.9D26ED93@attbi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3C200BBA.9D26ED93@attbi.com>; from joe.halpin@attbi.com on Tue, Dec 18, 2001 at 09:38:34PM -0600 Organization: The FreeBSD Project Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Joe Halpin writes: > I'm attaching the diff file for the changes I made to the at utility, in > order to add the -r and -t options. Thanks to Mike for his help in > getting my head into the procedures. Sorry for the delay in my review. > Index: at/at.c > =================================================================== > RCS file: /home/ncvs/src/usr.bin/at/at.c,v > retrieving revision 1.23 > diff -u -r1.23 at.c > --- at/at.c 2001/12/10 21:13:01 1.23 > +++ at/at.c 2001/12/19 03:30:02 > @@ -121,6 +121,8 @@ > static void writefile(time_t runtimer, char queue); > static void list_jobs(void); > static long nextjob(void); > +static time_t ttime(const char *argtime); > +static inline int checkint(const char *numstr); > > /* Signal catching functions */ > > @@ -592,6 +594,134 @@ > } > } /* delete_jobs */ > > + Please remove the extra vertical space here. > +static inline int checkint(const char *numstr) > +{ > + if((!isdigit(numstr[0])) || (!isdigit(numstr[1]))) > + panic("non-numeric character(s) in date"); > + > + return (int) strtol(numstr, 0, 10); > +} This file has fairly inconsistent style which makes it hard to read. I would suggest you try to follow style(9), with the exception of tabbing. This means `if(...)' should become `if (...)', `return ...;' should become `return (...);'. The tabbing appears to be 4 space, then a tab for further indentation. I would recommend following this in your patch. Additionally, there are some gratuitous parens around `!isdigit(...)' here. > + > +static time_t ttime(const char *argtime) > +{ > + /* > + * -t format: [[CC]YY]MMDDhhmm[.SS] > + */ > + > + time_t nowtimer, runtimer; > + struct tm nowtime, runtime; > + int arglen; > + char *cp; > + char workstr[16]; > + int C = -1; > + int Y = -1; > + int M = -1; > + int D = -1; > + int h = -1; > + int m = -1; > + int s = 0; > + > + arglen = strlen(argtime); > + if(arglen < 8 || arglen > 15) > + panic("Invalid time format"); > + > + strcpy(workstr, argtime); > + if((cp = strchr(workstr, '.')) != NULL) > + ++cp; > + > + if(cp) { > + if(arglen < 11) > + panic("invalid time format"); > + > + s = checkint(cp); *(--cp) = 0; cp -= 2; > + m = checkint(cp); *cp = 0; cp -= 2; > + h = checkint(cp); *cp = 0; cp -= 2; > + D = checkint(cp); *cp = 0; cp -= 2; > + M = checkint(cp); *cp = 0; > + > + if(arglen == 12) > + panic("invalid time format"); > + > + if(arglen >= 13) { > + cp -= 2; > + Y = checkint(cp); > + *cp = 0; > + } > + > + if(arglen == 14) > + panic("invalid time format"); > + > + if(arglen == 15) { > + cp -= 2; > + C = checkint(cp); > + } > + } > + > + else { > + if(arglen < 8) > + panic("invalid date format"); > + > + cp = workstr + arglen - 2; > + m = checkint(cp); *cp = 0; cp -= 2; > + h = checkint(cp); *cp = 0; cp -= 2; > + D = checkint(cp); *cp = 0; cp -= 2; > + M = checkint(cp); *cp = 0; > + > + if(arglen == 9) > + panic("invalid time format"); > + > + if(arglen >= 10) { > + cp -= 2; > + Y = checkint(cp); > + *cp = 0; > + } > + > + if(arglen == 11) > + panic("invalid time format"); > + > + if(arglen == 12) { > + cp -= 2; > + C = checkint(cp); > + } > + } > + > + if(Y > -1) { > + /* Since we're past Y2K now, add 100 to the year (or whatever the > + * century given is). > + */ > + if(C > -1) > + Y = ((C * 100) + Y) - 1900; > + else > + Y += 100; > + } > + > + nowtimer = time(NULL); > + nowtime = *localtime(&nowtimer); > + > + runtime = nowtime; > + runtime.tm_sec = s; > + runtime.tm_min = m; > + runtime.tm_hour = h; > + runtime.tm_mday = D; > + runtime.tm_mon = M - 1; > + runtime.tm_year = Y >= 0 ? Y : runtime.tm_year; > + runtime.tm_wday = -1; > + runtime.tm_yday = -1; > + runtime.tm_isdst = -1; > + > + runtimer = mktime(&runtime); > + > + if(runtimer < 0) > + panic("invalid time"); > + > + if(nowtimer > runtimer) > + panic("trying to travel back in time"); > + > + return runtimer; > +} This function seems needlessly complicated. Why not just adapt the stime_arg2() function from touch(1)? I didn't give a full review of this function. If you decide to use your version, let me know and I'll give a more detailed review of this function. > + > + One line is enough. > int > main(int argc, char **argv) > { > @@ -601,9 +731,9 @@ > char *pgm; > > int program = AT; /* our default program */ > - const char *options = "q:f:mvldbVc";/* default options for at */ > + const char *options = "q:f:t:mvlrdbVc";/* default options for at */ > int disp_version = 0; > - time_t timer; > + time_t timer = (time_t) -1; The initialization should be moved below the declaration; see style(9). Also, there is no need to cast -1 here. > > RELINQUISH_PRIVS > > @@ -660,6 +790,9 @@ > break; > > case 'd': > + warnx("-d is deprecated; you should use -r in the future"); I like this. > + /* fall through to 'r' */ > + case 'r': > if (program != AT) > usage(); > > @@ -667,6 +800,12 @@ > options = "V"; > break; > > + case 't': > + program = AT; > + options = "V"; > + timer = ttime(optarg); > + break; > + > case 'l': > if (program != AT) > usage(); > @@ -729,7 +868,13 @@ > break; > > case AT: > - timer = parsetime(argc, argv); > + /* > + * If timer is > -1, then the user gave the time with -t. > + * In that case, it's already been set. If not, set it now. > + */ > + if(timer == (time_t) -1) > + timer = parsetime(argc, argv); Again, -1 doesn't need a cast here. > + Gratuitous vertical space. > if (atverify) > { > struct tm *tm = localtime(&timer); > Index: at/at.man > =================================================================== > RCS file: /home/ncvs/src/usr.bin/at/at.man,v > retrieving revision 1.22 > diff -u -r1.22 at.man > --- at/at.man 2001/11/20 15:43:25 1.22 > +++ at/at.man 2001/12/19 03:30:03 > @@ -115,6 +115,8 @@ > and to run a job at 1am tomorrow, you would do > .Nm at Ar 1am tomorrow . > .Pp > +You may also use the POSIX time format (see -t argument) > +.Pp > For both > .Nm > and > @@ -214,7 +216,7 @@ > .Nm atq . > .It Fl d > Is an alias for > -.Nm atrm . > +.Nm atrm (this option is deprecated; use -r instead) . > .It Fl b > Is an alias for > .Nm batch . > @@ -225,6 +227,12 @@ > shows the time the job will be executed. > .It Fl c > Cat the jobs listed on the command line to standard output. > +.It Fl r > +Remove specified job(s). > +.It Fl t > +Give the job time using the POSIX time format, which is described in the > +touch(1) man page. > +Note that giving a date past 2038 may not work on 32-bit systems. > .El > .Sh FILES > .Bl -tag -width _ATJOB_DIR/_LOCKFILE -compact > @@ -272,3 +280,5 @@ > .An Thomas Koenig Aq ig25@rz.uni-karlsruhe.de . > The time parsing routines are by > .An David Parsons Aq orc@pell.chi.il.us . The period should be changed to a comma. > +and This could be better written, "and latter enhanced by..." > +.An Joe Halpin Aq joe.halpin@attbi.com . Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Dec 28 8:45:42 2001 Delivered-To: freebsd-standards@freebsd.org Received: from rwcrmhc51.attbi.com (rwcrmhc51.attbi.com [204.127.198.38]) by hub.freebsd.org (Postfix) with ESMTP id B4D1F37B428; Fri, 28 Dec 2001 08:45:41 -0800 (PST) Received: from attbi.com ([12.237.33.57]) by rwcrmhc51.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20011228164541.MTIZ1920.rwcrmhc51.attbi.com@attbi.com>; Fri, 28 Dec 2001 16:45:41 +0000 Message-ID: <3C2CA1CE.34BE2A3D@attbi.com> Date: Fri, 28 Dec 2001 10:46:06 -0600 From: Joe Halpin X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686) X-Accept-Language: en MIME-Version: 1.0 To: Mike Barcroft Cc: "standards@FreeBSD.ORG" Subject: Re: at utility changes References: <3C200BBA.9D26ED93@attbi.com> <20011228031537.B99161@espresso.q9media.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Mike, Sorry, for the style errors, I'll get those fixed. I didn't know about the stime_arg2() function from touch, but I'll adapt that. Joe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Dec 28 9: 4:53 2001 Delivered-To: freebsd-standards@freebsd.org Received: from rwcrmhc53.attbi.com (rwcrmhc53.attbi.com [204.127.198.39]) by hub.freebsd.org (Postfix) with ESMTP id 0BA9037B419 for ; Fri, 28 Dec 2001 09:04:52 -0800 (PST) Received: from attbi.com ([12.237.33.57]) by rwcrmhc53.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20011228170451.ZER20122.rwcrmhc53.attbi.com@attbi.com> for ; Fri, 28 Dec 2001 17:04:51 +0000 Message-ID: <3C2CA64C.663F8943@attbi.com> Date: Fri, 28 Dec 2001 11:05:16 -0600 From: Joe Halpin X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686) X-Accept-Language: en MIME-Version: 1.0 Cc: "standards@FreeBSD.ORG" Subject: Emacs and style(9) References: <3C200BBA.9D26ED93@attbi.com> <20011228031537.B99161@espresso.q9media.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Is there a commonly used c-mode hook for emacs that's setup to comply with style(9)? My "natural" style is quite different from what the manpage wants. If not, I'll try to come up with one and post it here. Joe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Dec 28 9:46:10 2001 Delivered-To: freebsd-standards@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id 9615537B419 for ; Fri, 28 Dec 2001 09:46:08 -0800 (PST) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.11.4/8.11.4) id fBSHk6n58428; Fri, 28 Dec 2001 12:46:06 -0500 (EST) (envelope-from wollman) Date: Fri, 28 Dec 2001 12:46:06 -0500 (EST) From: Garrett Wollman Message-Id: <200112281746.fBSHk6n58428@khavrinen.lcs.mit.edu> To: Joe Halpin Cc: "standards@FreeBSD.ORG" Subject: Emacs and style(9) In-Reply-To: <3C2CA64C.663F8943@attbi.com> References: <3C200BBA.9D26ED93@attbi.com> <20011228031537.B99161@espresso.q9media.com> <3C2CA64C.663F8943@attbi.com> Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG < said: > Is there a commonly used c-mode hook for emacs that's setup to comply > with style(9)? My "natural" style is quite different from what the > manpage wants. If not, I'll try to come up with one and post it here. I have used the following (in Emacs 19) for ever and ever. It does not quite meet with the official standard, but to the extent that I care it's not so hard to touch things up manually after the fact. (defun my-c-mode-common-hook () (c-set-style "bsd") (setq c-basic-offset 8)) -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Dec 28 11: 3:28 2001 Delivered-To: freebsd-standards@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 5F65137B425 for ; Fri, 28 Dec 2001 11:03:25 -0800 (PST) Received: from localhost (imp@dhcp30.timing.com [206.168.13.252]) by rover.village.org (8.11.3/8.11.3) with ESMTP id fBSJ3Il21754; Fri, 28 Dec 2001 12:03:18 -0700 (MST) (envelope-from imp@village.org) Date: Fri, 28 Dec 2001 12:03:17 -0700 (MST) Message-Id: <20011228.120317.105126127.imp@village.org> To: wollman@khavrinen.lcs.mit.edu Cc: joe.halpin@attbi.com, standards@FreeBSD.ORG Subject: Re: Emacs and style(9) From: "M. Warner Losh" In-Reply-To: <200112281746.fBSHk6n58428@khavrinen.lcs.mit.edu> References: <20011228031537.B99161@espresso.q9media.com> <3C2CA64C.663F8943@attbi.com> <200112281746.fBSHk6n58428@khavrinen.lcs.mit.edu> X-Mailer: Mew version 2.1 on Emacs 21.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG : I have used the following (in Emacs 19) for ever and ever. It does : not quite meet with the official standard, but to the extent that I : care it's not so hard to touch things up manually after the fact. : : (defun my-c-mode-common-hook () : (c-set-style "bsd") : (setq c-basic-offset 8)) I thought there was a style thing in /usr/share/examples, but can't find it now... Warner P.S. Here's what I have, but it isn't exactly perfect... (defun bsd-c-mode-user-setup () "Hacks" (interactive) (c-set-style "bsd") (setq c-basic-offset 8 c-conditional-key c-C++-conditional-key indent-tabs-mode t c-tab-always-indent nil) (setq c-cleanup-list (append c-cleanup-list (list 'brace-else-brace))) (c-set-offset 'arglist-close 0) (c-set-offset 'arglist-cont-nonempty 4) (c-set-offset 'inline-open 0) (c-set-offset 'case-label 0) (c-set-offset 'statement-cont 4) (c-toggle-auto-state 1)) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Dec 29 8:46:31 2001 Delivered-To: freebsd-standards@freebsd.org Received: from rwcrmhc51.attbi.com (rwcrmhc51.attbi.com [204.127.198.38]) by hub.freebsd.org (Postfix) with ESMTP id 862CD37B41F; Sat, 29 Dec 2001 08:46:23 -0800 (PST) Received: from attbi.com ([12.237.33.57]) by rwcrmhc51.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20011229164622.OYUX1920.rwcrmhc51.attbi.com@attbi.com>; Sat, 29 Dec 2001 16:46:22 +0000 Message-ID: <3C2DF35D.1F54BBC3@attbi.com> Date: Sat, 29 Dec 2001 10:46:21 -0600 From: Joe Halpin X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686) X-Accept-Language: en MIME-Version: 1.0 To: Mike Barcroft Cc: "standards@FreeBSD.ORG" Subject: Re: at utility changes References: <3C200BBA.9D26ED93@attbi.com> <20011228031537.B99161@espresso.q9media.com> Content-Type: multipart/mixed; boundary="------------7020D9F4C691EBEDED4EE04C" Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------7020D9F4C691EBEDED4EE04C Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Here are a new set of changes. I think I got the style more or less right this time, and cloned the stime_arg1() function from touch. Joe --------------7020D9F4C691EBEDED4EE04C Content-Type: text/plain; charset=us-ascii; name="at.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="at.diff" Index: at/at.c =================================================================== RCS file: /home/ncvs/src/usr.bin/at/at.c,v retrieving revision 1.18.2.1 diff -u -r1.18.2.1 at.c --- at/at.c 2001/08/02 00:55:58 1.18.2.1 +++ at/at.c 2001/12/29 16:41:19 @@ -121,6 +121,7 @@ static char *cwdname(void); static void writefile(time_t runtimer, char queue); static void list_jobs(void); +static time_t ttime(const char *arg); /* Signal catching functions */ @@ -588,6 +589,80 @@ } } /* delete_jobs */ +#define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2; + +static time_t +ttime(const char *arg) +{ + /* + * This is pretty much a copy of stime_arg1() from touch.c. I changed + * the return value and the argument list because it's more convenient + * (IMO) to do everything in one place. - Joe Halpin + */ + struct timeval tv[2]; + time_t now; + struct tm *t; + int yearset; + char *p; + + if (gettimeofday(&tv[0], NULL)) + panic("Cannot get current time"); + + /* Start with the current time. */ + now = tv[0].tv_sec; + if ((t = localtime(&now)) == NULL) + panic("localtime"); + /* [[CC]YY]MMDDhhmm[.SS] */ + if ((p = strchr(arg, '.')) == NULL) + t->tm_sec = 0; /* Seconds defaults to 0. */ + else { + if (strlen(p + 1) != 2) + goto terr; + *p++ = '\0'; + t->tm_sec = ATOI2(p); + } + + yearset = 0; + switch(strlen(arg)) { + case 12: /* CCYYMMDDhhmm */ + t->tm_year = ATOI2(arg); + t->tm_year *= 100; + yearset = 1; + /* FALLTHROUGH */ + case 10: /* YYMMDDhhmm */ + if (yearset) { + yearset = ATOI2(arg); + t->tm_year += yearset; + } else { + yearset = ATOI2(arg); + if (yearset < 69) + t->tm_year = yearset + 2000; + else + t->tm_year = yearset + 1900; + } + t->tm_year -= 1900; /* Convert to UNIX time. */ + /* FALLTHROUGH */ + case 8: /* MMDDhhmm */ + t->tm_mon = ATOI2(arg); + --t->tm_mon; /* Convert from 01-12 to 00-11 */ + t->tm_mday = ATOI2(arg); + t->tm_hour = ATOI2(arg); + t->tm_min = ATOI2(arg); + break; + default: + goto terr; + } + + t->tm_isdst = -1; /* Figure out DST. */ + tv[0].tv_sec = tv[1].tv_sec = mktime(t); + if (tv[0].tv_sec != -1) + return tv[0].tv_sec; + else + terr: + panic("out of range or illegal time specification: [[CC]YY]MMDDhhmm[.SS]"); + return -1; /* get rid of "control reaches end of non-void function" msg */ +} + int main(int argc, char **argv) { @@ -598,10 +673,12 @@ enum { ATQ, ATRM, AT, BATCH, CAT }; /* what program we want to run */ int program = AT; /* our default program */ - char *options = "q:f:mvldbVc"; /* default options for at */ + char *options = "q:f:t:rmvldbVc"; /* default options for at */ int disp_version = 0; time_t timer; + timer = -1; + RELINQUISH_PRIVS /* Eat any leading paths @@ -655,6 +732,9 @@ break; case 'd': + warnx("-d is deprecated; you should use -r in the future"); + /* fall through to 'r' */ + case 'r': if (program != AT) usage(); @@ -662,6 +742,14 @@ options = "V"; break; + case 't': + if (program != AT) + usage(); + + options = "V"; + timer = ttime(optarg); + break; + case 'l': if (program != AT) usage(); @@ -696,7 +784,7 @@ if (disp_version) fprintf(stderr, "at version " VERSION "\n" - "Bug reports to: ig25@rz.uni-karlsruhe.de (Thomas Koenig)\n"); + "Bug reports to: ig25@rz.uni-karlsruhe.de (Thomas Koenig)\n"); /* select our program */ @@ -723,7 +811,14 @@ break; case AT: - timer = parsetime(argc, argv); + + /* + * If timer is > -1, then the user gave the time with -t. + * In that case, it's already been set. If not, set it now. + */ + if (timer == -1) + timer = parsetime(argc, argv); + if (atverify) { struct tm *tm = localtime(&timer); Index: at/at.man =================================================================== RCS file: /home/ncvs/src/usr.bin/at/at.man,v retrieving revision 1.13.2.7 diff -u -r1.13.2.7 at.man --- at/at.man 2001/12/14 15:53:29 1.13.2.7 +++ at/at.man 2001/12/29 16:41:19 @@ -115,6 +115,8 @@ and to run a job at 1am tomorrow, you would do .Nm at Ar 1am tomorrow . .Pp +You may also use the POSIX time format (see -t argument) +.Pp For both .Nm and @@ -214,7 +216,7 @@ .Nm atq . .It Fl d Is an alias for -.Nm atrm . +.Nm atrm (this option is deprecated; use -r instead) . .It Fl b Is an alias for .Nm batch . @@ -225,6 +227,12 @@ shows the time the job will be executed. .It Fl c Cat the jobs listed on the command line to standard output. +.It Fl r +Remove specified job(s). +.It Fl t +Give the job time using the POSIX time format, which is described in the +touch(1) man page. +Note that giving a date past 2038 may not work on 32-bit systems. .El .Sh FILES .Bl -tag -width _ATJOB_DIR/_LOCKFILE -compact @@ -271,4 +279,6 @@ At was mostly written by .An Thomas Koenig Aq ig25@rz.uni-karlsruhe.de . The time parsing routines are by -.An David Parsons Aq orc@pell.chi.il.us . +.An David Parsons Aq orc@pell.chi.il.us , +with minor enhancement by +.An Joe Halpin Aq joe.halpin@attbi.com . --------------7020D9F4C691EBEDED4EE04C-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Dec 29 9:58:18 2001 Delivered-To: freebsd-standards@freebsd.org Received: from gw.nectar.cc (gw.nectar.cc [208.42.49.153]) by hub.freebsd.org (Postfix) with ESMTP id 3DCC837B41A for ; Sat, 29 Dec 2001 09:58:16 -0800 (PST) Received: from madman.nectar.cc (madman.nectar.cc [10.0.1.111]) by gw.nectar.cc (Postfix) with ESMTP id 1E0AE2D; Sat, 29 Dec 2001 11:58:15 -0600 (CST) Received: (from nectar@localhost) by madman.nectar.cc (8.11.6/8.11.6) id fBTHwD242964; Sat, 29 Dec 2001 11:58:13 -0600 (CST) (envelope-from nectar) Date: Sat, 29 Dec 2001 11:58:13 -0600 From: "Jacques A. Vidrine" To: "M. Warner Losh" Cc: wollman@khavrinen.lcs.mit.edu, joe.halpin@attbi.com, standards@FreeBSD.ORG Subject: Re: Emacs and style(9) Message-ID: <20011229175813.GA42892@madman.nectar.cc> References: <20011228031537.B99161@espresso.q9media.com> <3C2CA64C.663F8943@attbi.com> <200112281746.fBSHk6n58428@khavrinen.lcs.mit.edu> <20011228.120317.105126127.imp@village.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011228.120317.105126127.imp@village.org> User-Agent: Mutt/1.3.23.1i X-Url: http://www.nectar.cc/ Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Here's how I do it in xemacs. Perhaps someone will take all of these posts and come up with the One Perfect Way. (defconst knf-c-style '((c-basic-offset . 8) (c-indent-level . 8) (c-continued-statement-offset . 8) (c-brace-offset . -8) (c-argdecl-indent . 8) (c-label-offset . -8) (c-offsets-alist . ((knr-argdecl-intro . +) (knr-argdecl . 0) (block-open . -) (label . -) (statement-cont . 4) (arglist-cont . 4) (arglist-cont-nonempty 4)))) "BSD KNF") (c-add-style "knf" knf-c-style) (custom-set-variables '(c-default-style "knf")) If I recall correctly, the stuff besides `c-offsets-alist' and `c-basic-offset' is just for old c-mode compatibility and is probably not needed. Cheers, -- Jacques A. Vidrine http://www.nectar.cc/ NTT/Verio SME . FreeBSD UNIX . Heimdal Kerberos jvidrine@verio.net . nectar@FreeBSD.org . nectar@kth.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Dec 29 11: 7:50 2001 Delivered-To: freebsd-standards@freebsd.org Received: from rwcrmhc51.attbi.com (rwcrmhc51.attbi.com [204.127.198.38]) by hub.freebsd.org (Postfix) with ESMTP id 4B5C037B416 for ; Sat, 29 Dec 2001 11:07:46 -0800 (PST) Received: from attbi.com ([12.237.33.57]) by rwcrmhc51.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20011229190745.RVVN1920.rwcrmhc51.attbi.com@attbi.com> for ; Sat, 29 Dec 2001 19:07:45 +0000 Message-ID: <3C2E1481.75D70CE1@attbi.com> Date: Sat, 29 Dec 2001 13:07:45 -0600 From: Joe Halpin X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686) X-Accept-Language: en MIME-Version: 1.0 Cc: standards@FreeBSD.ORG Subject: Re: Emacs and style(9) References: <20011228031537.B99161@espresso.q9media.com> <3C2CA64C.663F8943@attbi.com> <200112281746.fBSHk6n58428@khavrinen.lcs.mit.edu> <20011228.120317.105126127.imp@village.org> <20011229175813.GA42892@madman.nectar.cc> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG "Jacques A. Vidrine" wrote: > > Here's how I do it in xemacs. Perhaps someone will take all of these > posts and come up with the One Perfect Way. > > (defconst knf-c-style > '((c-basic-offset . 8) > (c-indent-level . 8) > (c-continued-statement-offset . 8) Shouldn't things like this be 4 rather than 8? The style manpage says "Indentation is an 8 character tab. Second level indents are four spaces.". That's what I've been having the most trouble with. If I define c-basic-offset to be 8, and then define other offsets to be 4, it doesn't work for me. I don't really speak emacs lisp very well though, so maybe my accent is screwing things up. [...] > If I recall correctly, the stuff besides `c-offsets-alist' and > `c-basic-offset' is just for old c-mode compatibility and is probably > not needed. Maybe that's my problem. Any way to do what the style manpage wants? Joe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Dec 29 11:12:48 2001 Delivered-To: freebsd-standards@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 6436437B405 for ; Sat, 29 Dec 2001 11:12:46 -0800 (PST) Received: from localhost (imp@69.imp.village.org [10.0.0.69]) by rover.village.org (8.11.3/8.11.3) with ESMTP id fBTJChl28377; Sat, 29 Dec 2001 12:12:43 -0700 (MST) (envelope-from imp@village.org) Date: Sat, 29 Dec 2001 12:12:28 -0700 (MST) Message-Id: <20011229.121228.41633246.imp@village.org> To: joe.halpin@attbi.com Cc: standards@FreeBSD.ORG Subject: Re: Emacs and style(9) From: "M. Warner Losh" In-Reply-To: <3C2E1481.75D70CE1@attbi.com> References: <20011228.120317.105126127.imp@village.org> <20011229175813.GA42892@madman.nectar.cc> <3C2E1481.75D70CE1@attbi.com> X-Mailer: Mew version 2.1 on Emacs 21.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG From: Joe Halpin Subject: Re: Emacs and style(9) Date: Sat, 29 Dec 2001 13:07:45 -0600 : "Jacques A. Vidrine" wrote: : > : > Here's how I do it in xemacs. Perhaps someone will take all of these : > posts and come up with the One Perfect Way. : > : > (defconst knf-c-style : > '((c-basic-offset . 8) : > (c-indent-level . 8) : > (c-continued-statement-offset . 8) : : Shouldn't things like this be 4 rather than 8? The style manpage says : "Indentation is an 8 character tab. Second level indents are four : spaces.". No, these should be 8. Second level indents means statement continuation. I have some additional tweaks I've done that I'll post later. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Dec 29 12:35:56 2001 Delivered-To: freebsd-standards@freebsd.org Received: from espresso.q9media.com (espresso.q9media.com [216.254.138.122]) by hub.freebsd.org (Postfix) with ESMTP id DC83137B405 for ; Sat, 29 Dec 2001 12:35:44 -0800 (PST) Received: (from mike@localhost) by espresso.q9media.com (8.11.6/8.11.6) id fBTKXS944079; Sat, 29 Dec 2001 15:33:28 -0500 (EST) (envelope-from mike) Date: Sat, 29 Dec 2001 15:33:28 -0500 From: Mike Barcroft To: Joe Halpin Cc: "standards@FreeBSD.ORG" Subject: Re: at utility changes Message-ID: <20011229153328.D99161@espresso.q9media.com> References: <3C200BBA.9D26ED93@attbi.com> <20011228031537.B99161@espresso.q9media.com> <3C2DF35D.1F54BBC3@attbi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3C2DF35D.1F54BBC3@attbi.com>; from joe.halpin@attbi.com on Sat, Dec 29, 2001 at 10:46:21AM -0600 Organization: The FreeBSD Project Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Joe Halpin writes: > Here are a new set of changes. I think I got the style more or less > right this time, and cloned the stime_arg1() function from touch. I like this version much better. It only needs a few changes. > Index: at/at.c > =================================================================== > RCS file: /home/ncvs/src/usr.bin/at/at.c,v > retrieving revision 1.18.2.1 > diff -u -r1.18.2.1 at.c > --- at/at.c 2001/08/02 00:55:58 1.18.2.1 > +++ at/at.c 2001/12/29 16:41:19 > @@ -121,6 +121,7 @@ > static char *cwdname(void); > static void writefile(time_t runtimer, char queue); > static void list_jobs(void); > +static time_t ttime(const char *arg); > > /* Signal catching functions */ > > @@ -588,6 +589,80 @@ > } > } /* delete_jobs */ > > +#define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2; > + > +static time_t > +ttime(const char *arg) > +{ > + /* > + * This is pretty much a copy of stime_arg1() from touch.c. I changed This needs a second space after the period. > + * the return value and the argument list because it's more convenient > + * (IMO) to do everything in one place. - Joe Halpin > + */ > + struct timeval tv[2]; > + time_t now; > + struct tm *t; > + int yearset; > + char *p; > + > + if (gettimeofday(&tv[0], NULL)) > + panic("Cannot get current time"); > + > + /* Start with the current time. */ > + now = tv[0].tv_sec; > + if ((t = localtime(&now)) == NULL) > + panic("localtime"); > + /* [[CC]YY]MMDDhhmm[.SS] */ > + if ((p = strchr(arg, '.')) == NULL) > + t->tm_sec = 0; /* Seconds defaults to 0. */ > + else { > + if (strlen(p + 1) != 2) > + goto terr; > + *p++ = '\0'; > + t->tm_sec = ATOI2(p); > + } > + > + yearset = 0; > + switch(strlen(arg)) { > + case 12: /* CCYYMMDDhhmm */ > + t->tm_year = ATOI2(arg); > + t->tm_year *= 100; > + yearset = 1; > + /* FALLTHROUGH */ > + case 10: /* YYMMDDhhmm */ > + if (yearset) { > + yearset = ATOI2(arg); > + t->tm_year += yearset; > + } else { > + yearset = ATOI2(arg); > + if (yearset < 69) > + t->tm_year = yearset + 2000; > + else > + t->tm_year = yearset + 1900; > + } The else section can be reduced to something like: %%% yearset = ATOI2(arg); t->tm_year = yearset + 2000; %%% ...since it's impossible to schedule events to take place in the past. > + t->tm_year -= 1900; /* Convert to UNIX time. */ > + /* FALLTHROUGH */ > + case 8: /* MMDDhhmm */ > + t->tm_mon = ATOI2(arg); > + --t->tm_mon; /* Convert from 01-12 to 00-11 */ > + t->tm_mday = ATOI2(arg); > + t->tm_hour = ATOI2(arg); > + t->tm_min = ATOI2(arg); > + break; > + default: > + goto terr; > + } > + > + t->tm_isdst = -1; /* Figure out DST. */ > + tv[0].tv_sec = tv[1].tv_sec = mktime(t); > + if (tv[0].tv_sec != -1) > + return tv[0].tv_sec; > + else > + terr: > + panic("out of range or illegal time specification: [[CC]YY]MMDDhhmm[.SS]"); > + return -1; /* get rid of "control reaches end of non-void function" msg */ The panic and return line should probably be indented more since they apply to the else case in normal operation. Return values should be wrapped in parens. > +} > + > int > main(int argc, char **argv) > { > @@ -598,10 +673,12 @@ > > enum { ATQ, ATRM, AT, BATCH, CAT }; /* what program we want to run */ > int program = AT; /* our default program */ > - char *options = "q:f:mvldbVc"; /* default options for at */ > + char *options = "q:f:t:rmvldbVc"; /* default options for at */ > int disp_version = 0; > time_t timer; > > + timer = -1; Much better. > + Gratuitous vertical space. > RELINQUISH_PRIVS > > /* Eat any leading paths > @@ -655,6 +732,9 @@ > break; > > case 'd': > + warnx("-d is deprecated; you should use -r in the future"); > + /* fall through to 'r' */ > + case 'r': > if (program != AT) > usage(); > > @@ -662,6 +742,14 @@ > options = "V"; > break; > > + case 't': > + if (program != AT) > + usage(); > + This vertical space isn't needed either. > + options = "V"; > + timer = ttime(optarg); > + break; > + > case 'l': > if (program != AT) > usage(); > @@ -696,7 +784,7 @@ > > if (disp_version) > fprintf(stderr, "at version " VERSION "\n" > - "Bug reports to: ig25@rz.uni-karlsruhe.de (Thomas Koenig)\n"); > + "Bug reports to: ig25@rz.uni-karlsruhe.de (Thomas Koenig)\n"); I wonder if the author accepts bug reports on customized versions of his software. > > /* select our program > */ > @@ -723,7 +811,14 @@ > break; > > case AT: > - timer = parsetime(argc, argv); > + Gratuitous vertical space. > + /* > + * If timer is > -1, then the user gave the time with -t. > + * In that case, it's already been set. If not, set it now. > + */ Comments should go to 80 columns, then wrap. Also, this requires a second space after the period. > + if (timer == -1) > + timer = parsetime(argc, argv); > + > if (atverify) > { > struct tm *tm = localtime(&timer); usage() needs to be updated to reflect the new options. It's hidden away in panic.c. > Index: at/at.man > =================================================================== > RCS file: /home/ncvs/src/usr.bin/at/at.man,v > retrieving revision 1.13.2.7 > diff -u -r1.13.2.7 at.man > --- at/at.man 2001/12/14 15:53:29 1.13.2.7 > +++ at/at.man 2001/12/29 16:41:19 The SYNOPSIS sections needs to be updated to reflect the new options. > @@ -115,6 +115,8 @@ > and to run a job at 1am tomorrow, you would do > .Nm at Ar 1am tomorrow . > .Pp > +You may also use the POSIX time format (see -t argument) Periods complete sentences. > +.Pp > For both > .Nm > and > @@ -214,7 +216,7 @@ > .Nm atq . > .It Fl d > Is an alias for > -.Nm atrm . > +.Nm atrm (this option is deprecated; use -r instead) . Please add a new line between `atrm' and `(this', otherwise the whole section is sent to the macro. > .It Fl b > Is an alias for > .Nm batch . > @@ -225,6 +227,12 @@ > shows the time the job will be executed. > .It Fl c > Cat the jobs listed on the command line to standard output. > +.It Fl r > +Remove specified job(s). > +.It Fl t > +Give the job time using the POSIX time format, which is described in the `Give' should be changed to `Specify'. > +touch(1) man page. This should be changed to: %%% .Xr touch 1 manual. %%% (I prefer manual over man page, but that's an optional change.) > +Note that giving a date past 2038 may not work on 32-bit systems. This should be under the BUGS section. It also applies to the Alpha architecture, so it's probably wise to replace `32-bit' with `some'. > .El > .Sh FILES > .Bl -tag -width _ATJOB_DIR/_LOCKFILE -compact > @@ -271,4 +279,6 @@ > At was mostly written by > .An Thomas Koenig Aq ig25@rz.uni-karlsruhe.de . > The time parsing routines are by > -.An David Parsons Aq orc@pell.chi.il.us . > +.An David Parsons Aq orc@pell.chi.il.us , > +with minor enhancement by This should say either "with a minor enhancement by" or "with minor enhancements by". I prefer the latter. > +.An Joe Halpin Aq joe.halpin@attbi.com . A `STANDARDS' section should be added under `SEE ALSO': %%% .Sh STANDARDS The .Nm utility conforms with .St -p1003.1-2001 . %%% (Would you please verify this? I only glanced at the POSIX.1-2001 requirements.) Once you get those problems fixed I should be able to test and commit this for you. Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Dec 29 21:17:22 2001 Delivered-To: freebsd-standards@freebsd.org Received: from gw.nectar.cc (gw.nectar.cc [208.42.49.153]) by hub.freebsd.org (Postfix) with ESMTP id BD73837B41D for ; Sat, 29 Dec 2001 21:17:17 -0800 (PST) Received: from madman.nectar.cc (madman.nectar.cc [10.0.1.111]) by gw.nectar.cc (Postfix) with ESMTP id 1E4EF2E; Sat, 29 Dec 2001 23:17:17 -0600 (CST) Received: (from nectar@localhost) by madman.nectar.cc (8.11.6/8.11.6) id fBU5HGZ80323; Sat, 29 Dec 2001 23:17:16 -0600 (CST) (envelope-from nectar) Date: Sat, 29 Dec 2001 23:17:16 -0600 From: "Jacques A. Vidrine" To: Joe Halpin Cc: standards@FreeBSD.ORG Subject: Re: Emacs and style(9) Message-ID: <20011230051716.GA80312@madman.nectar.cc> References: <20011228031537.B99161@espresso.q9media.com> <3C2CA64C.663F8943@attbi.com> <200112281746.fBSHk6n58428@khavrinen.lcs.mit.edu> <20011228.120317.105126127.imp@village.org> <20011229175813.GA42892@madman.nectar.cc> <3C2E1481.75D70CE1@attbi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3C2E1481.75D70CE1@attbi.com> User-Agent: Mutt/1.3.23.1i X-Url: http://www.nectar.cc/ Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Dec 29, 2001 at 01:07:45PM -0600, Joe Halpin wrote: > "Jacques A. Vidrine" wrote: > > > > Here's how I do it in xemacs. Perhaps someone will take all of these > > posts and come up with the One Perfect Way. > > > > (defconst knf-c-style > > '((c-basic-offset . 8) > > (c-indent-level . 8) > > (c-continued-statement-offset . 8) > > Shouldn't things like this be 4 rather than 8? Well, c-continued-statement-offset probably should be 4. This was left over from days past, and isn't used by cc-mode actually (thus my comment about dumping them). Shortly after my post I got rid of that crud and so I'm left with just: (defconst knf-c-style '((c-basic-offset . 8) (c-offsets-alist . ((knr-argdecl-intro . +) (knr-argdecl . 0) (block-open . -) (label . -) (statement-cont . 4) (arglist-cont . 4) (arglist-cont-nonempty 4)))) "BSD KNF") Notice that the 4 space indent is used for continuation. > The style manpage says > "Indentation is an 8 character tab. Second level indents are four > spaces.". > > That's what I've been having the most trouble with. If I define > c-basic-offset to be 8, and then define other offsets to be 4, it > doesn't work for me. I don't really speak emacs lisp very well though, > so maybe my accent is screwing things up. > > [...] > > > If I recall correctly, the stuff besides `c-offsets-alist' and > > `c-basic-offset' is just for old c-mode compatibility and is probably > > not needed. > > Maybe that's my problem. Any way to do what the style manpage wants? Have you tried what I posted previously? Works for me. Cheers, -- Jacques A. Vidrine http://www.nectar.cc/ NTT/Verio SME . FreeBSD UNIX . Heimdal Kerberos jvidrine@verio.net . nectar@FreeBSD.org . nectar@kth.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Dec 29 21:32:20 2001 Delivered-To: freebsd-standards@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id ADF1B37B417 for ; Sat, 29 Dec 2001 21:32:18 -0800 (PST) Received: from localhost (imp@69.imp.village.org [10.0.0.69]) by rover.village.org (8.11.3/8.11.3) with ESMTP id fBU5W9l29861; Sat, 29 Dec 2001 22:32:10 -0700 (MST) (envelope-from imp@village.org) Date: Sat, 29 Dec 2001 22:32:08 -0700 (MST) Message-Id: <20011229.223208.105169321.imp@village.org> To: n@nectar.cc Cc: joe.halpin@attbi.com, standards@FreeBSD.ORG Subject: Re: Emacs and style(9) From: "M. Warner Losh" In-Reply-To: <20011230051716.GA80312@madman.nectar.cc> References: <20011229175813.GA42892@madman.nectar.cc> <3C2E1481.75D70CE1@attbi.com> <20011230051716.GA80312@madman.nectar.cc> X-Mailer: Mew version 2.1 on Emacs 21.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * means c-basic-offset / 2, so (defconst knf-c-style '((c-basic-offset . 8) (c-offsets-alist . ((knr-argdecl-intro . +) (knr-argdecl . 0) (block-open . -) (label . -) (statement-cont . *) (arglist-cont . *) (arglist-cont-nonempty *)))) "BSD KNF") might be better, espeically if you have to work on code that has c-basic-offset set to 4 once and a while. :-) Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message