Re: dired-move-to-filename-regexp

2004-09-23 Thread Paul Eggert
Richard Stallman [EMAIL PROTECTED] writes:

 I think a better solution is if we can turn off the new feature
 of adapting the column widths to the data.

One way would be to extend --format to allow fairly arbitrary formats
that can specify column widths.  For example, Emacs could do this:

  ls --format='%11m %2l %8o %8g %7s %12d %f'

to have ls list the mode, link, owner, group, size, date, and file
name in the traditional widths for ls -l.  This would resemble the
way ls --time-style already handles date formats.

Another possibility is to have a new option to disable the new
feature, e.g. ls --traditional-column-widths.  This would be a bit
easier to implement, but would be less general and might have problems
of its own (e.g., users and implementations don't agree on what the
traditional widths are).

I understand that some non-GNU ls implementations also adapt column
widths to data, so the Emacs problem would remain with these
implementations, regardless of how we change GNU ls.


___
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/bug-coreutils


backward-compatibility fixes for tail

2004-09-23 Thread Paul Eggert
My previous changes to tail were too drastic: they removed support
for some traditional usage that is not in POSIX 1003.2-1992 but is in
SUSv2 or in older GNU tail.  I installed the following patch as
penance.  It makes tail a bit more generous about what it supports,
though tail -10 still is rejected when in POSIX 1003.1-2001 mode
pending resolution of this issue at the Open Group level.

2004-09-23  Paul Eggert  [EMAIL PROTECTED]

* doc/coreutils.texi (tail invocation): Fix bugs in the description of
the obsolete syntax (e.g., it does not support -k or -m).  Warn
about usages like tail - and tail -c 4 that are ambigous on
older systems.
* src/tail.c (parse_obsolete_option): Bring back support
for obsolete option followed by non-obsolete, or by more
than one file.  When obsolete, conform to SUSv2 rather than
original POSIX 1003.2-1992, as SUSv2 corrected the case of
tail -c.  Add support for the SUSv2 b modifier.
* NEWS: Mention the above.
* tests/tail/Test.pm: New test case obs-b to check the above.
err-[134] no longer need _POSIX2_VERSION=199209.
Fix comments to match revised behavior.

Index: NEWS
===
RCS file: /fetish/cu/NEWS,v
retrieving revision 1.236
diff -p -u -r1.236 NEWS
--- NEWS21 Sep 2004 22:00:27 -  1.236
+++ NEWS23 Sep 2004 20:23:49 -
@@ -101,10 +101,11 @@ GNU coreutils NEWS  
 
   tail -f no longer mishandles pipes and fifos.  With no operands,
   tail now ignores -f if standard input is a pipe, as POSIX requires.
-  When conforming to POSIX 1003.2-1992, tail now handles some obscure
-  cases more correctly, e.g., tail +cl file now reads the file +cl
-  rather than reporting an error, and tail - file no longer reads
-  standard input.
+  When conforming to POSIX 1003.2-1992, tail now supports the SUSv2 b
+  modifier (e.g., tail -10b file) and it handles some obscure cases
+  more correctly, e.g., tail +cl now reads the file +cl rather
+  than reporting an error, tail -c file no longer reports an error,
+  and tail - file no longer reads standard input.
 
   tee now exits when it gets a SIGPIPE signal, as POSIX requires.
   To get tee's old behavior, use the shell command (trap '' PIPE; tee).
Index: doc/coreutils.texi
===
RCS file: /fetish/cu/doc/coreutils.texi,v
retrieving revision 1.213
diff -p -u -r1.213 coreutils.texi
--- doc/coreutils.texi  21 Sep 2004 05:56:11 -  1.213
+++ doc/coreutils.texi  23 Sep 2004 20:23:53 -
@@ -2552,15 +2552,20 @@ Always print file name headers.
 @end table
 
 On older systems, @command{tail} supports an obsolete option
[EMAIL PROTECTED]@[EMAIL PROTECTED], which is recognized only if it is
-specified first.  @var{count} is a decimal number optionally followed
-by a size letter (@samp{b}, @samp{k}, @samp{m}) as in @option{-c}, or
[EMAIL PROTECTED] to mean count by lines, or other option letters
-(@samp{cfqv}).  Some older @command{tail} implementations also support
-an obsolete option @[EMAIL PROTECTED] with the same meaning as
[EMAIL PROTECTED]@var{count}}.  @acronym{POSIX} 1003.1-2001 (@pxref{Standards
-conformance}) does not allow these options; use @option{-c
[EMAIL PROTECTED] or @option{-n @var{count}} instead.
[EMAIL PROTECTED]@var{count}[bcl][f]}, which is recognized only if it is
+specified first.  @var{count} is an optional decimal number optionally
+followed by a size letter (@samp{b}, @samp{c}, @samp{l}) to mean count
+by 512-byte blocks, bytes, or lines, optionally followed by @samp{f}
+which has the same meaning as @option{-f}.  Also, the leading @samp{-}
+can be replaced by @samp{+} with the same meaning as in counts.
[EMAIL PROTECTED] 1003.1-2001 (@pxref{Standards conformance}) does not
+allow most of these obsolete usages; use @option{-c @var{count}[b]},
[EMAIL PROTECTED] @var{count}}, and/or @option{-f} instead.
+
+On older systems, obsolete usage overrides normal usage, so portable
+shell scripts should avoid commands that can be interpreted either
+way.  For example, use @samp{tail -- - file} rather than @samp{tail -
+file}, and use @samp{tail -c4} rather than @samp{tail -c 4}.
 
 @exitstatus
 
Index: src/tail.c
===
RCS file: /fetish/cu/src/tail.c,v
retrieving revision 1.228
diff -p -u -r1.228 tail.c
--- src/tail.c  21 Sep 2004 22:26:42 -  1.228
+++ src/tail.c  23 Sep 2004 20:23:54 -
@@ -1375,14 +1375,15 @@ parse_obsolete_option (int argc, char * 
   const char *n_string;
   const char *n_string_end;
   bool obsolete_usage;
+  int default_count = DEFAULT_N_LINES;
   bool t_from_start;
   bool t_count_lines = true;
   bool t_forever = false;
-  int len;
 
   /* With the obsolete form, there is one option string and
- at most one file argument, possibly preceded by --.  */
-  if 

Re: dired-move-to-filename-regexp

2004-09-23 Thread Richard Stallman
I think a better solution is if we can turn off the new feature
of adapting the column widths to the data.  It is simple and clean.
Both this and your suggestion would only work with GNU ls, so in that
regard neither one has an advantage.

Meyering, what do you think?


___
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: dired-move-to-filename-regexp

2004-09-23 Thread Miles Bader
On Thu, Sep 23, 2004 at 12:45:31PM -0400, Richard Stallman wrote:
 I think a better solution is if we can turn off the new feature
 of adapting the column widths to the data.  It is simple and clean.

It maybe a bit less work, but it's certainly not better -- without the
auto-adjustment feature, it simply would use absurdly large amounts of
whitespace _just in case_ a file happens to be hundreds of gigabytes in size
and have thousands of links.  I'd rather reserve the limited space available
in my dired windows for filenames (which overflow often enough even with
column compression).

-Miles
-- 
Come now, if we were really planning to harm you, would we be waiting here, 
 beside the path, in the very darkest part of the forest?


___
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/bug-coreutils


chmod changes ctime even if no changes were made

2004-09-23 Thread Hans Ecke
Hi,
I noticed that chmod changes the ctime of files, even if no permissions 
are actually changed.

I ran into this because some maintenance scripts here run
   chmod -Rc ugoa+rX $directory
every night for some directories that ought to be generally accessible.
Unfortunately this also triggers some OS-provided maintenance scripts 
that see Oh, ctime has changed, let me rebuild this subsystem.. This 
is very annoying, and the users are not happy since their computers do 
pointless rebuilds, consuming CPU.

Is there any way that chmod could first see if the requested status 
change has already been fulfilled, and skip files where it would not 
change anything?

I can see that this would slow chmod down (one more stat (2) call per 
file), so making this an option would be fine...

Thanks
Hans
--
Hans Ecke   [EMAIL PROTECTED] / [EMAIL PROTECTED]
Department of Geophysicshttp://hans.ecke.ws
Colorado School of MinesTel: (USA) 303-273-3733
Golden, ColoradoFax: (USA) 303-273-3478
We must all hang together, or assuredly we shall all hang separately.
-- Benjamin Franklin
___
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: dired-move-to-filename-regexp

2004-09-23 Thread Jim Meyering
 I think a better solution is if we can turn off the new feature
 of adapting the column widths to the data.  It is simple and clean.
 Both this and your suggestion would only work with GNU ls, so in that
 regard neither one has an advantage.

 Meyering, what do you think?

Ideally ls would accept a new --format=FMT option that would
work like find's printf format string.  Then it'd be easy to
add a new option to make ls use a format string with fixed
widths to restore the old behavior.


___
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/bug-coreutils