bug#21571: [patches] some small message improvements

2015-09-28 Thread Benno Schulenberg

On Sun, Sep 27, 2015, at 20:14, Andreas Schwab wrote:
> Benno Schulenberg  writes:
> > Or does it just mean that when ONLRET is set that the receiving
> > end will do also a CR when a LF is received?  The tty doesn't do
> > any conversion, it just has to be aware that sending a LF causes
> > also a CR in order to be able to line things up properly?
> 
> Yes.

Hm.  But the termios layer cannot know whether the sender is
aware that NL also causes a carriage return, so it cannot take
any compensatory action on the data coming through.  So, ONLRET
by itself does not do anything at all.  Only when combined with
ONOCR does it have an effect: not only after a CR but also after
an NL any subsequent CRs are discarded, until some printable
character moves the cursor out of column zero again.  Right?

Maybe then the documentation should mention that ONLRET
is only useful in combination with ONOCR?  Because otherwise
the introduction of the "Output settings" section is somewhat
misleading: "These settings control operations on data sent to
the terminal."  As ONLRET does not cause anything to be done
with the data unless ONOCR is set.


Glibc only documents ONLCR, not OCRNL nor ONLRET nor ONOCR.
Is that just a lack of documentation?  Or does it mean that
the latter three flags are in effect nonfunctional?

Benno

-- 
http://www.fastmail.com - Access your email from home and the web






bug#21571: [patches] some small message improvements

2015-09-27 Thread Benno Schulenberg

On Sun, Sep 27, 2015, at 13:26, Andreas Schwab wrote:
> 
> 
>  [...]  If ONLRET is set, the NL character is assumed to do the
> carriage-return function; [...] Otherwise, the NL character is
> assumed to do just the line-feed function; [...]

This wording seems to faintly suggest that ONLRET is meant to
cause NL to do /also/ CR besides doing NL.  Is that whjat is
meant?

Or does it just mean that when ONLRET is set that the receiving
end will do also a CR when a LF is received?  The tty doesn't do
any conversion, it just has to be aware that sending a LF causes
also a CR in order to be able to line things up properly?

Benno

-- 
http://www.fastmail.com - Faster than the air-speed velocity of an
  unladen european swallow






bug#21571: [patches] some small message improvements

2015-09-27 Thread Benno Schulenberg

Hi,

Attached three patches (sorry, I can't do 'git send-email' from here)
make some small changes to error messages and option descriptions.

The first patch puts the words "carriage return" and "newline" a bit
wider apart, instead of gluing them together with a hyphen -- this
had confused me up to now.  And it makes the wording for the onlret
option the same as for the ocrnl and onlcr options.  If the latter
change is not correct, please suggest another wording that makes
clear how this option differs from ocrnl and onlcr.

Benno

-- 
http://www.fastmail.com - Email service worth paying for. Try it for free

From c8fa3c8dbfa58512ab7efe0aa162cb8da7ffdc09 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg 
Date: Sun, 27 Sep 2015 08:54:02 +0200
Subject: [PATCH 1/3] stty: improve the wording of the CR-LF translation options

* src/stty.c: Make the description of the onlcr option slightly clearer,
and harmonize the description of onlret with those of ocrnl and onlcr.
* doc/coreutils.texi: Likewise.
---
 doc/coreutils.texi |4 ++--
 src/stty.c |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index a029ec6..ff65b2e 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -13908,7 +13908,7 @@ Translate carriage return to newline.  Non-POSIX@.  May be negated.
 @item onlcr
 @opindex onlcr
 @cindex newline, translating to crlf
-Translate newline to carriage return-newline.  Non-POSIX@.  May be
+Translate newline to carriage return + newline.  Non-POSIX@.  May be
 negated.
 
 @item onocr
@@ -13918,7 +13918,7 @@ May be negated.
 
 @item onlret
 @opindex onlret
-Newline performs a carriage return.  Non-POSIX@.  May be negated.
+Translate newline to carriage return.  Non-POSIX@.  May be negated.
 
 @item ofill
 @opindex ofill
diff --git a/src/stty.c b/src/stty.c
index c0057f2..0833475 100644
--- a/src/stty.c
+++ b/src/stty.c
@@ -755,12 +755,12 @@ Output settings:\n\
 #endif
 #ifdef ONLCR
   fputs (_("\
- * [-]onlcr  translate newline to carriage return-newline\n\
+ * [-]onlcr  translate newline to carriage return + newline\n\
 "), stdout);
 #endif
 #ifdef ONLRET
   fputs (_("\
- * [-]onlret newline performs a carriage return\n\
+ * [-]onlret translate newline to carriage return\n\
 "), stdout);
 #endif
 #ifdef ONOCR
-- 
1.7.0.4

From 44d122b9213a7c08959f5d6c162bf1687f9e7478 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg 
Date: Sun, 27 Sep 2015 09:01:42 +0200
Subject: [PATCH 2/3] stty: remove an inconsistent newline from an error message

* src/stty.c: Remove an inappropriate \n from within an error message.
---
 src/stty.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/stty.c b/src/stty.c
index 0833475..d8cd739 100644
--- a/src/stty.c
+++ b/src/stty.c
@@ -1151,7 +1151,7 @@ main (int argc, char **argv)
   /* Specifying both -a and -g gets an error.  */
   if (verbose_output && recoverable_output)
 error (EXIT_FAILURE, 0,
-   _("the options for verbose and stty-readable output styles are\n"
+   _("the options for verbose and stty-readable output styles are "
  "mutually exclusive"));
 
   /* Specifying any other arguments with -a or -g gets an error.  */
-- 
1.7.0.4

From 5fcad7706af3a84a66b2b3a7aa37fa6bb6c5525a Mon Sep 17 00:00:00 2001
From: Benno Schulenberg 
Date: Sun, 27 Sep 2015 09:19:52 +0200
Subject: [PATCH 3/3] sync: slightly improve the usage text

* src/sync.c: Indicate that more than one option is possible, and
add a period at the end of the docstring.
---
 src/sync.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/sync.c b/src/sync.c
index 5e1dbb8..910baad 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -61,9 +61,9 @@ usage (int status)
 emit_try_help ();
   else
 {
-  printf (_("Usage: %s [OPTION] [FILE]...\n"), program_name);
+  printf (_("Usage: %s [OPTION]... [FILE]...\n"), program_name);
   fputs (_("\
-Synchronize cached writes to persistent storage\n\
+Synchronize cached writes to persistent storage.\n\
 \n\
 If one or more files are specified, sync only them,\n\
 or their containing file systems.\n\
-- 
1.7.0.4



bug#21571: [patches] some small message improvements

2015-09-27 Thread Pádraig Brady
On 27/09/15 08:58, Benno Schulenberg wrote:
> @item onlcr
> @opindex onlcr
> @cindex newline, translating to crlf
> -Translate newline to carriage return-newline.  Non-POSIX@.  May be
> +Translate newline to carriage return + newline.  Non-POSIX@.  May be
>  negated.

Better thanks.

>  @item onocr
> @@ -13918,7 +13918,7 @@ May be negated.
>  
>  @item onlret
>  @opindex onlret
> -Newline performs a carriage return.  Non-POSIX@.  May be negated.
> +Translate newline to carriage return.  Non-POSIX@.  May be negated.

While this new wording doesn't overlaps with other descriptions,
the original wording comes from POSIX.  I don't know that the distinction
here is TBH. Perhaps onlret relates to input while onlcr relates to output?

thanks,
Pádraig.





bug#21571: [patches] some small message improvements

2015-09-27 Thread Andreas Schwab
Pádraig Brady  writes:

> While this new wording doesn't overlaps with other descriptions,
> the original wording comes from POSIX.  I don't know that the distinction
> here is TBH. Perhaps onlret relates to input while onlcr relates to output?



 If ONLCR is set, the NL character shall be transmitted as the CR-NL
 character pair. If OCRNL is set, the CR character shall be transmitted
 as the NL character. If ONOCR is set, no CR character shall be
 transmitted when at column 0 (first position). If ONLRET is set, the NL
 character is assumed to do the carriage-return function; the column
 pointer shall be set to 0 and the delays specified for CR shall be
 used. Otherwise, the NL character is assumed to do just the line-feed
 function; the column pointer remains unchanged. The column pointer
 shall also be set to 0 if the CR character is actually transmitted.

So ONLRET is mostly about properly keeping track of the column.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





bug#21571: [patches] some small message improvements

2015-09-27 Thread Andreas Schwab
Pádraig Brady  writes:

> On 27/09/15 08:58, Benno Schulenberg wrote:
>> @item onlcr
>> @opindex onlcr
>> @cindex newline, translating to crlf
>> -Translate newline to carriage return-newline.  Non-POSIX@.  May be
>> +Translate newline to carriage return + newline.  Non-POSIX@.  May be
>>  negated.
>
> Better thanks.
>
>>  @item onocr
>> @@ -13918,7 +13918,7 @@ May be negated.
>>  
>>  @item onlret
>>  @opindex onlret
>> -Newline performs a carriage return.  Non-POSIX@.  May be negated.
>> +Translate newline to carriage return.  Non-POSIX@.  May be negated.

BTW, non-POSIX is misleading.  Most of those extensions are now part of
POSIX, but XSI shaded.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."