Re: Bash-5.1 release available

2020-12-08 Thread Benno Schulenberg


Op 08-12-2020 om 15:12 schreef Chet Ramey:
> On 12/8/20 6:18 AM, Benno Schulenberg wrote:
>> Yes, but for translators that is too far back -- too much time passes
>> before the actual release happens.
> 
> That doesn't make any sense. If there are any changed strings, the
> translators should have as much time to update as possible.

No.  Translators should have limited time: it works better, psychologically.

> It's not
> as if the translations will change dramatically before the release,
> if at all.

But *if* any string would change, the translators would like to update
their translation.  So it's better to announce closer before the release.

Benno




Re: Bash-5.1 release available

2020-12-08 Thread Benno Schulenberg


Op 07-12-2020 om 20:39 schreef Chet Ramey:
> On 12/7/20 1:47 PM, Benno Schulenberg wrote:
>> It would be nice if the Translation Project would get a CC for
>> the rc1 or rc2 release of bash, not for the final release.
> 
> I copied coordina...@translationproject.org for
> 
> bash-5.1-alpha  17 June 2020

Yes, but for translators that is too far back -- too much time passes
before the actual release happens.

> and assumed that would start the update process. The translatable
> strings change very little, if at all, after an alpha release.

That's the point: if some string *does* change, the TP would like to
be notified of the changed POT file.  So it's better not to bother
with announcing the alpha and the beta to the TP, but just the rc1.

> I can add you for release candidates as well if you'd like.

Please CC me for just the rc1.  Not for alpha or beta.

Benno




Re: Bash-5.1 release available

2020-12-07 Thread Benno Schulenberg


Hello Chet,

> The first public release of bash-5.1 is now available with the URLs
> 
> ftp://ftp.cwru.edu/pub/bash/bash-5.1.tar.gz
> ftp://ftp.gnu.org/pub/gnu/bash/bash-5.1.tar.gz

It would be nice if the Translation Project would get a CC for
the rc1 or rc2 release of bash, not for the final release.

Now the translators had no chance to update their translations
before the final release.  :|

Benno




Re: [Nano-devel] How to lock a terminal

2016-02-17 Thread Benno Schulenberg

On Wed, Feb 17, 2016, at 04:11, Bob Proulx wrote:
> Benno Schulenberg wrote:
> > For that to work, it requires having 'set suspend' in your
> > nanorc.  (Which I don't have, because it annoys me when nano
> > drops into the background when I accidentally hit ^Z.)
> 
> I do not have a nanorc file at all.  The defaults are okay for
> suspension without any specific configuration.

??  How does that work?  What version of nano are you using?

Here 'nano --help | grep sus' says:
 -z --suspend   Enable suspension
meaning that it is off by default.

Do you have an alias?  If not, then you have a strange terminal,
that catches ^Z before it reaches the running program.

Benno

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




Re: [Nano-devel] How to lock a terminal

2016-02-16 Thread Benno Schulenberg

On Tue, Feb 16, 2016, at 11:19, Bob Proulx wrote:
> [...] this is the perfect case for job control.  No need for a
> second terminal.  Here is an example.  Use Control-Z to stop the
> foreground job.

For that to work, it requires having 'set suspend' in your
nanorc.  (Which I don't have, because it annoys me when nano
drops into the background when I accidentally hit ^Z.)

Luckily one can toggle suspendability on with M-Z, but...
somehow that doesn't seem to work when nano is screenless.

When I use nano with --ignorercfiles, M-Z does work.
Maybe the colors do something strange with the pipe?

And when I use LANGUAGE=en, it works too.  Ha!
Esperanto pisses off the pipe, too.  :)

Benno

-- 
http://www.fastmail.com - IMAP accessible web-mail




inconsistent synopses in help output

2015-10-20 Thread Benno Schulenberg

In the output of the 'help' command in any bash upto and including
4.4-beta, the possible arguments in most of the commands listed are
shown in lowercase, but for some they are in uppercase.  Examples:

  alias [-p] [name[=value] ... ]
  break [n]
  case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac
  dirs [-clpv] [+N] [-N]
  enable [-a] [-dnps] [-f filename] [name ...]
  for NAME [in WORDS ... ] ; do COMMANDS; done
  help [-dms] [pattern ...]
  local [option] name[=value] ...
  while COMMANDS; do COMMANDS; done

This is inconsistent.  What's more, in the descriptions that follow
when you do 'help SOMECOMMAND', the arguments are always referred
to in uppercase.  For example in the output of 'help break' it says:
"If N is specified, break N enclosing loops."  But its synopsis line
says: "break: break [n]".  It would be much clearer if the synopsis
and the description would both use uppercase for this argument,
just like the 'dirs' command already does.

Also, using uppercase for arguments makes it much easier to see
what is a word that needs to be replaced and what is a keyword
that must be typed as is, like in the 'case' and 'for' commands.

For example:

  command [-pVv] command [arg ...]

would be clearer when written as:

  command [-pVv] COMMAND [ARG ...]

So...  I propose to write all replaceable argument words in the
help sysnopses in uppercase, just like they are in the reference
manual (the Info document).  I can make the patch, if you wish.

Benno

-- 
http://www.fastmail.com - IMAP accessible web-mail




[patches] removing empty sections and adding consistent blank lines

2015-10-19 Thread Benno Schulenberg

In the CHANGES-4.4 document, section 4. New Features in Readline
lists zero items but is immediately followed by some text, which
makes it seem that this text are the new features in readline.

In the CHANGES document, empty sections have been left out (for
the most part).  So the first attached patch does this too for
the current document.  And the second patch does this for the
historical document.  They also make some other small changes.

Benno

-- 
http://www.fastmail.com - Access all of your messages and folders
  wherever you are

From f1b2ff178cd4a743a12c1cf928a94b5be8ffcec8 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensb...@justemail.net>
Date: Mon, 19 Oct 2015 14:03:37 +0200
Subject: [PATCH 1/2] CHANGES-4.4: remove an empty section 4, and pluralize "Change"

Signed-off-by: Benno Schulenberg <bensb...@justemail.net>
---
 CHANGES-4.4 |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/CHANGES-4.4 b/CHANGES-4.4
index 01d0367..242dd12 100644
--- a/CHANGES-4.4
+++ b/CHANGES-4.4
@@ -1,7 +1,7 @@
 This document details the changes between this version, bash-4.4-beta, and
 the previous version, bash-4.4-alpha.
 
-1.  Change to Bash
+1.  Changes to Bash
 
 a.  Fixed two bugs that caused out-of-bounds reads when skipping over assignment
 statements while finding the word on which to perform programmable
@@ -160,7 +160,6 @@ d.  The `complete_fullquote' option to `shopt' changes filename completion to
 e.  The `kill' builtin now has a `-L' option, equivalent to `-l', for
 compatibility with Linux standalone versions of kill.
 
-4.  New Features in Readline
 --
 This document details the changes between this version, bash-4.4-alpha, and
 the previous version, bash-4.3-release.
-- 
1.7.0.4

From 77f6c01bc8335cebd454e0d085efdcda412b4ea4 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensb...@justemail.net>
Date: Mon, 19 Oct 2015 14:10:21 +0200
Subject: [PATCH 2/2] CHANGES: remove other empty sections, and add consistent blank lines

Also, use consistent letters instead of numbers to tag some items.

Signed-off-by: Benno Schulenberg <bensb...@justemail.net>
---
 CHANGES |   25 ++---
 1 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/CHANGES b/CHANGES
index 25c80c9..52489c1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,7 @@
 This document details the changes between this version, bash-4.4-beta, and
 the previous version, bash-4.4-alpha.
 
-1.  Change to Bash
+1.  Changes to Bash
 
 a.  Fixed two bugs that caused out-of-bounds reads when skipping over assignment
 statements while finding the word on which to perform programmable
@@ -160,7 +160,6 @@ d.  The `complete_fullquote' option to `shopt' changes filename completion to
 e.  The `kill' builtin now has a `-L' option, equivalent to `-l', for
 compatibility with Linux standalone versions of kill.
 
-4.  New Features in Readline
 --
 This document details the changes between this version, bash-4.4-alpha, and
 the previous version, bash-4.3-release.
@@ -786,6 +785,7 @@ d. Fixed a bug that caused effects made by undoing changes to a history line to
 
 a.  When creating shared libraries on Mac OS X, the pathname written into the
 library (install_name) no longer includes the minor version number.
+
 --
 This document details the changes between this version, bash-4.3-rc1, and the
 previous version, bash-4.3-beta2.
@@ -1583,10 +1583,6 @@ i.  Added code to check the return value of access(2) on Solaris systems,
 a.  Fixed a bug that caused directory names in words to be completed to not
 be dequoted correctly.
 
-3.  New Features in Bash
-
-4.  New Features in Readline
-
 --
 This document details the changes between this version, bash-4.2-beta,
 and the previous version, bash-4.2-alpha.
@@ -1990,8 +1986,6 @@ b.  There is a new `compat40' shopt option.
 c.  The < and > operators to [[ do string comparisons using the current locale
 only if the compatibility level is greater than 40 (set to 41 by default).
 
-4.  New Features in Readline
-
 --
 This document details the changes between this version, bash-4.1-alpha,
 and the previous version, bash-4.0-release.
@@ -2333,6 +2327,7 @@ b.  Reworked the signal handling to avoid calling disallowed functions from a
 3.  New Features in Bash
 
 a.  `readarray' is now a synonym for `mapfile'.
+
 --
 This document details the changes between this version, bash-4.0-rc1,
 and the previous version, bash-4.0-beta2.
@@ -2344,

a few unintended translations of command names

2015-10-19 Thread Benno Schulenberg

Hi,

In bash-4.4-beta the command names 'true' and 'false' have been
mistakenly translated in the Greek, Italian, Slovak and Indonesian
PO files.  The latter two also mistakenly translate 'times'.

As the command synopses are gettextized only in order to allow
translators to translate possible arguments, there is no need to
gettextize them when a command takes no options nor arguments.

Would it be possible to change the script that converts the *.def
files into a builtins.c in such a way that when $BUILTIN == $SHORT_DOC
the $SHORT_DOC is not gettextized?  It would prevent these mistranslations.
(Or, if it's not possible to leave out the call to gettext, to add a hint
instead: /* TRANSLATORS: This is a command name. Do not translate. */?)


Benno

-- 
http://www.fastmail.com - Access all of your messages and folders
  wherever you are




Re: Bash git repository on savannah

2011-11-28 Thread Benno Schulenberg
Chet Ramey wrote:
  I'm thinking about fairly frequent commits to a `bash-devel' sort of
  tree.  The question is whether or not enough people would be interested
  in that to make the frequency worth it.

Anyone wanting to propose a patch would like to prepare it against the
most recent state of the tree.  And afterwards they are curious to see
whether and how the patch made it into the repo.

Benno

-- 
http://www.fastmail.fm - The professional email service




[patch] a better description of \c

2008-08-12 Thread Benno Schulenberg

Hi,

The help text for echo describes the effect of the backslash escape 
\c like this:

$ help echo | grep '\\c'
\c  suppress trailing newline

But what it actually does is different:

$ echo -e before \c after \a
before $

It cancels all characters that come after it.  The printf command 
from coreutils has a nice concise description for it:

$ /usr/bin/printf --help | grep '\\c'
  \c  produce no further output

Attached patch makes bash's builtin echo use the same description.

Benno
diff -ur bash-3.2.orig/builtins/echo.def bash-3.2/builtins/echo.def
--- bash-3.2.orig/builtins/echo.def	2006-09-08 19:41:17.0 +0200
+++ bash-3.2/builtins/echo.def	2008-08-12 12:30:43.0 +0200
@@ -42,7 +42,7 @@
 following backslash-escaped characters is turned on:
 	\a	alert (bell)
 	\b	backspace
-	\c	suppress trailing newline
+	\c	produce no further output
 	\E	escape character
 	\f	form feed
 	\n	new line
diff -ur bash-3.2.orig/doc/bash.1 bash-3.2/doc/bash.1
--- bash-3.2.orig/doc/bash.1	2006-10-03 14:54:26.0 +0200
+++ bash-3.2/doc/bash.1	2008-08-12 12:28:16.0 +0200
@@ -6617,7 +6617,7 @@
 backspace
 .TP
 .B \ec
-suppress trailing newline
+produce no further output
 .TP
 .B \ee
 an escape character
diff -ur bash-3.2.orig/doc/bashref.texi bash-3.2/doc/bashref.texi
--- bash-3.2.orig/doc/bashref.texi	2006-09-28 16:25:28.0 +0200
+++ bash-3.2/doc/bashref.texi	2008-08-12 12:30:08.0 +0200
@@ -3323,7 +3323,7 @@
 @item \b
 backspace
 @item \c
-suppress trailing newline
+produce no further output
 @item \e
 escape
 @item \f


builtin printf ignores straight '\c'

2008-08-12 Thread Benno Schulenberg

Hi,

Bash's printf appears to ignore the \c backslash escape:

$ printf before \c after \a
before \c after $
$ type printf
printf is a shell builtin

Of course the Open Group's description of printf
(http://www.opengroup.org/onlinepubs/95399/utilities/printf.html) 
does not specify that \c in the format string should be interpreted, 
but the builtin echo, and the echo and printf from coreutils, do 
interpret it:

$ echo -e before \c after \a
before $
$ type echo
echo is a shell builtin

$ /bin/echo -e before \c after \a
before $
$ /usr/bin/printf before \c after \a
before $

When \c is provided via the %b conversion specifier, it is 
interpreted:

$ printf before %b after \a '\c'
before $  

It makes it seem odd that a straight \c isn't.  (Of course, a 
straight \c is less useful than an indirect one, but still.)

$ bash --version
GNU bash, version 3.2.39(1)-release (i686-pc-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.

Benno




when last output lacks \n, bash gets confused about cursor position

2008-08-12 Thread Benno Schulenberg

Hi,

When using 'echo -n' or printf without a final \n, and then using 
the Up and Down keys to walk through previous commands, bash can 
get confused about its cursor position (or rather its prompt 
position) and either leave some stray text in the middle of the 
line, or overwrite part of its prompt.

An example of the stray text is given in the attached typescript.  
It was produced with this command:

  script -t -c 'env -i bash --norc --noprofile' 2timing

and then typing: spaceecho -n some textenter, space, 
arrowup, arrowdown, arrowup, arrowdown, enter, space, 
exitenter  --  without the comma+space pairs of course.  (The 
spaces are not relevant but are to defeat a bug in the timing.)

The first arrowdown causes bash to rewrite its prompt at the start 
of the line (instead of after some text) and not outputting enough 
spaces to clear the entire line.

Benno
Script started on Tue Aug 12 19:32:29 2008
bash-3.2$  echo -n some text
some textbash-3.2$  echo -n some text
bash-3.2$ 
bash-3.2$  echo -n some text
bash-3.2$ 
bash-3.2$  
bash-3.2$  exit
exit

Script done on Tue Aug 12 19:32:57 2008
0.174879 10
0.000330 1
0.750233 1
1.468244 1
0.516277 1
0.499631 1
0.528181 1
0.474733 1
0.507721 1
0.552587 1
0.447074 1
0.581336 1
0.941345 1
0.552650 1
0.487494 1
0.491133 1
0.495713 1
0.459160 1
0.495090 1
0.458761 1
0.552680 1
0.769417 2
1.063406 9
0.000267 10
0.52 1
1.032821 19
2.756806 43
2.069310 19
2.138690 43
1.340475 2
0.728973 10
0.000175 1
2.576283 1
0.450139 1
0.458798 1
0.389751 1
0.455375 2
0.470640 6


problematic \r in msgid

2007-11-22 Thread Benno Schulenberg

Hi,

In the POT file for bash-3.2 there is one msgid that contains two
\r characters.  Are these carriage returns necessary?  If not, it 
would be better to remove them, as they are awkward for translators 
and are causing a mild indigestion on Launchpad at the moment 
(which is Launchpad's fault, but if the ^Ms aren't needed...).

Alternatively, consider ungettextizing the message, since it seems 
to be a debugging statement or an internal error -- it's nicer to 
get such bug reports with an untranslated message.

#: lib/malloc/malloc.c:314
#, c-format
msgid 
\r\n
malloc: %s:%d: assertion botched\r\n


Benno




Re: ctrl+r + left cursor + multiline PS1 = wrong cursor displaying

2007-07-21 Thread Benno Schulenberg
Xuefer wrote:
 Bash Version: 3.2
 Patch Level: 15

 expected: cursor moves in the range of echo abc, and the[n] beyond c
 actually: cursor moves in the range of $ echo ab (including b)

Please try again with patch level 17.  With bash-3.2.17 I cannot 
reproduce that behaviour here.

 Repeat-By:
   $ PSCOLOR=36
   $ export PS1='\[\e['$PSCOLOR'[EMAIL PROTECTED] 
 \[\e[34m\]\w\n\$\[\e[0m\] '
   $ echo abcdefg
   $ CTRL-r
   (reverse-i-search)`': abcleft

Benno


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: bash strangeness with utf-8

2007-07-09 Thread Benno Schulenberg
Giraud wrote:
 Hmm, interesting.

Please don't top-post.

 Yes, I do have PROMPT_COMMAND set, it appears.  However, if I
 unset it (and even  also 'export PS1=foo ' to set PS1 to a
 simple string), the problem remains.

Then look at a new typescript, and see if that strange 1034h is 
still there.  If yes, a simple 'set | grep 1034' might find the 
variable that contains it.


 How best to debug this?  tcsh and sh do not exhibit the problem,

Aha.  Then try 'env -i bash --noprofile --norc'.  If that instance 
of the shell doesn't exhibit the problem, then you know for sure 
it's something in the environment. 

If the problem remains even with an empty environment, try using an 
empty ~/.inputrc or /etc/inputrc.

Benno


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: bash strangeness with utf-8

2007-07-01 Thread Benno Schulenberg
Joe Peterson wrote:
 when using LAN=en_US.UTF-8 (anf we've verified same on
 en_GB.UTF-8).

Apart from LANG=en_US.UTF-8, what is the rest of your locale?

 There are two cases I came up with.  If you up-arrow through your
 history, hit right-arrow (i.e. going past the end - even though
 the cursor stops at the end), it takes 2 left-arrows to go back a
 character (as if there were an extra character at the end).

 Case 2 can usually be invoked by going back a character or two,
 hitting ctrl-k (to chop off the end of the line), and then
 hitting right-arrow repeatedly.  The cursor will oscillate back
 and forth at the end of the line (well, I can almost always get
 this to happen...).

Cannot reproduce either case.  Can you provide examples in the form 
of a typescript (using 'script')?

Benno


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: Composed characters + colour = strange cursor behaviour

2007-06-27 Thread Benno Schulenberg
Tristan Miller wrote:
 However, there still seems to be a problem when multibyte
 characters appear in the prompt in the last column of the
 terminal window. Specifically, when the last character in a line
 is multibyte, it is sometimes printed as ��.

 I initially thought that this was a terminal bug, but perhaps
 it's a Bash bug.  Others think so too.  See
 http://bugs.kde.org/show_bug.cgi?id=147212 for the bug report
 for konsole, including a screenshot showing the problem.

This is probably related to the problem reported here:
http://lists.gnu.org/archive/html/bug-bash/2007-05/msg00013.html

Benno



___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: Composed characters + colour = strange cursor behaviour

2007-06-26 Thread Benno Schulenberg
Tristan Miller wrote:
 Bash Version: 3.2
 Patch Level: 9

Please try again with patch level 17.  Patch 16 or 17 addresses 
multibyte characters.

 Repeat-By:
   1. PS1=\w\[\033[0m\]
   2. mkdir n̈
   (Note that the above is U+006E U+0308)
   3. cd n̈
   (At this point you will see the cursor is in the wrong place --
 it's shifted four characters to the right.)
   4. start typing anything -- the cursor flies wildly all
 over the line

With bash-3.2.17 I cannot reproduce this.

Benno



___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: Improper UTF-8 combining character handling

2007-06-10 Thread Benno Schulenberg
Sean Burke wrote:
 The Unicode normalization test data at
 http://www.unicode.org/Public/UNIDATA/NormalizationTest.txt 
 contains many sequences of this sort. 
 The first chara cter sequence, LATIN CAPITAL LETTER D WITH DOT 
 ABOVE, does produce this problem.
  Paste it into the commandline, then backspace through it. The
 problem should be  reproduced immediately.

Cannot reproduce it with bash-3.2-17.  Please retry with patch level 
17.  Patch 16 specifically addresses multibyte characters.

Benno


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: set function and special builtin set

2007-05-18 Thread Benno Schulenberg
Clive Nicolson wrote:
 Is it posible to get a user function named set to be called in
 place of the special builtin set?

 ie

 set() { echo My set $@ ;}

 set params

You haven't tried this?

$ set() { echo My set $@ ;}
$ set params
My set params

It just works.

Also read the output of 'help builtin'.

Benno


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: set function and special builtin set

2007-05-18 Thread Benno Schulenberg
Paul Jarc wrote:
 Benno Schulenberg [EMAIL PROTECTED] wrote:
  Andreas Schwab wrote:
 http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_ch
 ap02.html#tag_02_09_01_01:
 
  If a simple command results in a command name and an
  optional list of arguments, [...]
 
  But set() is not a simple command, it is a function definition,
  no?

 Right, so defining the function should work, but calling it
 should not.

Ah!  Okay.

$ export POSIXLY_CORRECT=yes
$ set() { echo My set $@ ;}
$ set params
$ unset POSIXLY_CORRECT
$ set params
My set params

Benno


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: Another bash-3.2 regression: coloured prompt confuses Ctrl+R.

2007-04-11 Thread Benno Schulenberg
Chet Ramey wrote:
 I apparently fixed
 it while making a seemingly unrelated change a couple of weeks
 ago.  Try this patch.

First hunk fails against p15.  When adjusting the patch for that 
(see attached), it solves the problem here.  Thanks.

Benno
--- lib/readline/display.c.orig	2007-04-11 11:26:08.0 +0200
+++ lib/readline/display.c	2007-04-11 11:54:09.0 +0200
@@ -1598,8 +1598,22 @@
 	  temp = nls - nfd;
 	  if (temp  0)
 	{
+	  /* If nfd begins at the prompt, or before the invisible
+		 characters in the prompt, we need to adjust _rl_last_c_pos
+		 in a multibyte locale to account for the wrap offset and
+		 set cpos_adjusted accordingly. */
 	  _rl_output_some_chars (nfd, temp);
-	  _rl_last_c_pos += _rl_col_width (nfd, 0, temp);;
+	  if (MB_CUR_MAX  1  rl_byte_oriented == 0)
+		{
+  _rl_last_c_pos += _rl_col_width (nfd, 0, temp);
+  if (current_line == 0  wrap_offset   ((nfd - new) = prompt_last_invisible))
+		{
+		  _rl_last_c_pos -= wrap_offset;
+		  cpos_adjusted = 1;
+		}
+		}
+  else
+_rl_last_c_pos += temp;
 	}
 	}
   /* Otherwise, print over the existing material. */
@@ -1607,8 +1621,20 @@
 	{
 	  if (temp  0)
 	{
+	  /* If nfd begins at the prompt, or before the invisible
+		 characters in the prompt, we need to adjust _rl_last_c_pos
+		 in a multibyte locale to account for the wrap offset and
+		 set cpos_adjusted accordingly. */
 	  _rl_output_some_chars (nfd, temp);
 	  _rl_last_c_pos += col_temp;		/* XXX */
+	  if (MB_CUR_MAX  1  rl_byte_oriented == 0)
+		{
+		  if (current_line == 0  wrap_offset   ((nfd - new) = prompt_last_invisible))
+		{
+		  _rl_last_c_pos -= wrap_offset;
+		  cpos_adjusted = 1;
+		}
+		}
 	}
 	  lendiff = (oe - old) - (ne - new);
 	  if (MB_CUR_MAX  1  rl_byte_oriented == 0)
___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: aiuto!

2007-02-16 Thread Benno Schulenberg
manuel targa wrote:
 Qual`e' il comando che mi permette di sapere in che directory mi
 trovo???

  pwd

Aŭ uzu:

  export PS1='\[\e[001;[EMAIL PROTECTED] \[\e[001;034m\]\w \$\[\e[000m\]'

por ĉiam vidi kie vi estas.

Benno



___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: one last collating sequence data point

2007-01-27 Thread Benno Schulenberg
Chet Ramey wrote:
 Bruce Korb wrote:
  $ unset LC_COLLATE

 If LC_COLLATE is unset, LC_ALL and LANG both affect the collating
 order.

Aha!  So that is where the apparent system default locale comes 
from.

$ locale | grep COLL
LC_COLLATE=POSIX

$ unset LC_COLLATE
$ locale | grep COLL
LC_COLLATE=en_GB.utf8

$ unset LANG
$ locale | grep COLL
LC_COLLATE=POSIX

Thanks, mystery solved.

Benno


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: help text per column instead of per row [patch]

2006-12-20 Thread Benno Schulenberg
Benno Schulenberg wrote:
 Attached patch prints the builtin commands alphabetically per
 column and uses a total width of 80 characters.

Here is a better patch.  It also puts a  in the last column 
position of the strings that are longer than the available width.

To find the width of the current terminal I will need some help, 
though.  Or if you think a variable width isn't worth the trouble, 
just leave out the two width-limiting lines .

The second patch improves the summary line of the 'variables' item 
a bit, especially when the column width is somewhat limited.

Benno
diff -ur bash-3.2.orig/builtins/help.def bash-3.2.new/builtins/help.def
--- bash-3.2.orig/builtins/help.def	2004-12-30 19:59:55.0 +0100
+++ bash-3.2.new/builtins/help.def	2006-12-20 18:39:20.0 +0100
@@ -175,8 +175,8 @@
 static void
 show_builtin_command_help ()
 {
-  int i, j;
-  char blurb[36];
+  int i, j, k, height, width;
+  char blurb[71];
 
   printf (
 _(These shell commands are defined internally.  Type `help' to see this list.\n\
@@ -187,21 +187,26 @@
 A star (*) next to a name means that the command is disabled.\n\
 \n));
 
-  for (i = 0; i  num_shell_builtins; i++)
+  height = (num_shell_builtins + 1) / 2;
+  width = 40;  /* XXX should use half of terminal width instead */
+  if (width  70)
+width = 70;  /* limit column width to this maximum */
+
+  for (i = 0; i  height; i++)
 {
   QUIT;
-  blurb[0] = (shell_builtins[i].flags  BUILTIN_ENABLED) ? ' ' : '*';
-  strncpy (blurb + 1, shell_builtins[i].short_doc, 34);
-  blurb[35] = '\0';
-  printf (%s, blurb);
-
-  if (i % 2)
-	printf (\n);
-  else
-	for (j = strlen (blurb); j  35; j++)
-	  putc (' ', stdout);
+  for (k = i; k  num_shell_builtins; k += height)  /* two columns */
+	{
+	  blurb[0] = (shell_builtins[k].flags  BUILTIN_ENABLED) ? ' ' : '*';
+	  strncpy (blurb + 1, shell_builtins[k].short_doc, width - 1);
+	  if (strlen (shell_builtins[k].short_doc) = width)
+	blurb[width - 1] = '';  /* indicate truncated string */
+	  blurb[width] = '\0';
+	  for (j = strlen (blurb); j  width; j++)
+	blurb[j]=' ';  /* pad out any remaining width with spaces */
+	  printf (%s, blurb);
+	}
+  printf (\n);
 }
-  if (i % 2)
-printf (\n);
 }
 #endif /* HELP_BUILTIN */
diff -ur bash-3.2.orig/builtins/reserved.def bash-3.2.new/builtins/reserved.def
--- bash-3.2.orig/builtins/reserved.def	2006-03-07 20:30:00.0 +0100
+++ bash-3.2.new/builtins/reserved.def	2006-12-20 19:08:20.0 +0100
@@ -145,7 +145,7 @@
 
 $BUILTIN variables
 $DOCNAME variable_help
-$SHORT_DOC variables - Some variable names and meanings
+$SHORT_DOC variables - Names and meanings of some variables
 BASH_VERSION	Version information for this Bash.
 CDPATH	A colon-separated list of directories to search
 		for directries given as arguments to `cd'.
___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


gettextizing more skipped messages [patch]

2006-12-11 Thread Benno Schulenberg

Attached patch gettextizes a bunch of strings that were found 
uninternationalized while skimming through all the *.def and *.c 
files.  The second patch does this also for siglist.c file.

The third patch removes the duplication of the command name from 
the output of 'help', as this duplication doesn't add anything 
and sometimes is mildly confusing, for example for 'help :' or 
'help for (('.

Benno
diff -ur bash-3.2.orig/builtins/break.def bash-3.2.new/builtins/break.def
--- bash-3.2.orig/builtins/break.def	2003-12-19 23:56:38.0 +0100
+++ bash-3.2.new/builtins/break.def	2006-12-11 14:28:09.0 +0100
@@ -70,7 +70,7 @@
 
   if (newbreak = 0)
 {
-  sh_erange (list-word-word, loop count);
+  sh_erange (list-word-word, _(loop count));
   breaking = loop_level;
   return (EXECUTION_FAILURE);
 }
@@ -105,7 +105,7 @@
 
   if (newcont = 0)
 {
-  sh_erange (list-word-word, loop count);
+  sh_erange (list-word-word, _(loop count));
   breaking = loop_level;
   return (EXECUTION_FAILURE);
 }
diff -ur bash-3.2.orig/builtins/common.c bash-3.2.new/builtins/common.c
--- bash-3.2.orig/builtins/common.c	2006-07-27 15:39:51.0 +0200
+++ bash-3.2.new/builtins/common.c	2006-12-11 14:28:09.0 +0100
@@ -100,7 +100,7 @@
   fprintf (stderr, %s: , name);
 
   if (interactive_shell == 0)
-fprintf (stderr, line %d: , executing_line_number ());
+fprintf (stderr, _(line %d: ), executing_line_number ());
 
   if (this_command_name  *this_command_name)
 fprintf (stderr, %s: , this_command_name);
@@ -117,7 +117,7 @@
 builtin_usage ()
 {
   if (this_command_name  *this_command_name)
-fprintf (stderr, %s: usage: , this_command_name);
+fprintf (stderr, _(%s: usage: ), this_command_name);
   fprintf (stderr, %s\n, current_builtin-short_doc);
   fflush (stderr);
 }
diff -ur bash-3.2.orig/builtins/evalfile.c bash-3.2.new/builtins/evalfile.c
--- bash-3.2.orig/builtins/evalfile.c	2006-07-28 03:41:43.0 +0200
+++ bash-3.2.new/builtins/evalfile.c	2006-12-11 14:28:09.0 +0100
@@ -171,7 +171,7 @@
   check_binary_file (string, (result  80) ? 80 : result))
 {
   free (string);
-  (*errfunc) (%s: cannot execute binary file, filename);
+  (*errfunc) (_(%s: cannot execute binary file), filename);
   return ((flags  FEVAL_BUILTIN) ? EX_BINARY_FILE : -1);
 }
 
diff -ur bash-3.2.orig/builtins/exit.def bash-3.2.new/builtins/exit.def
--- bash-3.2.orig/builtins/exit.def	2005-02-11 17:46:55.0 +0100
+++ bash-3.2.new/builtins/exit.def	2006-12-11 14:28:09.0 +0100
@@ -60,7 +60,7 @@
 {
   if (interactive)
 {
-  fprintf (stderr, login_shell ? logout\n : exit\n);
+  fprintf (stderr, login_shell ? _(logout\n) : _(exit\n));
   fflush (stderr);
 }
 
diff -ur bash-3.2.orig/builtins/fg_bg.def bash-3.2.new/builtins/fg_bg.def
--- bash-3.2.orig/builtins/fg_bg.def	2005-08-24 23:18:52.0 +0200
+++ bash-3.2.new/builtins/fg_bg.def	2006-12-11 14:28:09.0 +0100
@@ -137,7 +137,7 @@
   if (INVALID_JOB (job))
 {
   if (job != DUP_JOB)
-	sh_badjob (list ? list-word-word : current);
+	sh_badjob (list ? list-word-word : _(current));
 
   goto failure;
 }
diff -ur bash-3.2.orig/builtins/hash.def bash-3.2.new/builtins/hash.def
--- bash-3.2.orig/builtins/hash.def	2006-02-21 20:59:45.0 +0100
+++ bash-3.2.new/builtins/hash.def	2006-12-11 14:28:09.0 +0100
@@ -233,7 +233,7 @@
 return (0);
 
   if (fmt == 0)
-printf (hits\tcommand\n);
+printf (_(hits\tcommand\n));
   hash_walk (hashed_filenames, fmt ? print_portable_hash_info : print_hash_info);
   return (1);
 }
diff -ur bash-3.2.orig/builtins/jobs.def bash-3.2.new/builtins/jobs.def
--- bash-3.2.orig/builtins/jobs.def	2005-02-11 17:47:09.0 +0100
+++ bash-3.2.new/builtins/jobs.def	2006-12-11 14:28:09.0 +0100
@@ -261,7 +261,7 @@
 
   if (job == NO_JOB || jobs == 0 || INVALID_JOB (job))
 	{
-	  sh_badjob (list ? list-word-word : current);
+	  sh_badjob (list ? list-word-word : _(current));
 	  retval = EXECUTION_FAILURE;
 	}
   else if (nohup_only)
diff -ur bash-3.2.orig/builtins/type.def bash-3.2.new/builtins/type.def
--- bash-3.2.orig/builtins/type.def	2005-08-24 14:38:34.0 +0200
+++ bash-3.2.new/builtins/type.def	2006-12-11 14:28:09.0 +0100
@@ -227,7 +227,7 @@
   if (((dflags  CDESC_FORCE_PATH) == 0)  expand_aliases  (alias = find_alias (command)))
 {
   if (dflags  CDESC_TYPE)
-	puts (alias);
+	puts (_(alias));
   else if (dflags  CDESC_SHORTDESC)
 	printf (_(%s is aliased to `%s'\n), command, alias-value);
   else if (dflags  CDESC_REUSABLE)
@@ -248,7 +248,7 @@
   if (((dflags  CDESC_FORCE_PATH) == 0)  (i = find_reserved_word (command)) = 0)
 {
   if (dflags  CDESC_TYPE)
-	puts (keyword);
+	puts (_(keyword));
   else if (dflags  CDESC_SHORTDESC)
 	printf (_(%s is a shell keyword\n), command);
   else if (dflags  CDESC_REUSABLE)
@@ -264,7 

direct crossreferences for 'shopt'

2006-12-03 Thread Benno Schulenberg

Hi,

When doing 'info bash' and Enter, followed by '/shopt' and  twice 
Enter, one ends up in the middle of the description of 'declare', 
instead of at the top of the page.  Apparently texinfo contains a 
bug: when a node contains a reference to itself, any reference 
jumps to that reference instead of to the top of the node.

Anyway, the Bash Builtin Commands node is so big, it seems more 
useful to make each reference to one of its commands go directly to 
that command instead of dropping the user at the top of the node.  
Attached patch does this for the 'shopt' command.  In doing so it 
removes the self reference of the node, so that other references to 
Bash Builtins now go to the top of the page.

If this seems like a good idea, I can make anchors for the other 
references to this node too.

Benno
diff -ur bash-3.2.orig/doc/bashref.texi bash-3.2.new/doc/bashref.texi
--- bash-3.2.orig/doc/bashref.texi	2006-09-28 16:25:28.0 +0200
+++ bash-3.2.new/doc/bashref.texi	2006-12-03 14:08:17.0 +0100
@@ -562,7 +562,7 @@
 
 In a non-interactive shell, or an interactive shell in which the
 @code{interactive_comments} option to the @code{shopt}
-builtin is enabled (@pxref{Bash Builtins}),
+builtin is enabled (@pxref{Bash Builtin shopt}),
 a word beginning with @samp{#}
 causes that word and all remaining characters on that line to
 be ignored.  An interactive shell without the @code{interactive_comments}
@@ -848,7 +848,7 @@
 @code{case} will selectively execute the @var{command-list} corresponding to
 the first @var{pattern} that matches @var{word}.
 If the shell option @code{nocasematch}
-(see the description of @code{shopt} in @ref{Bash Builtins})
+(@pxref{Bash Builtin shopt})
 is enabled, the match is performed without regard to the case
 of alphabetic characters.
 The @samp{|} is used to separate multiple patterns, and the @samp{)}
@@ -960,7 +960,7 @@
 right of the operator is considered a pattern and matched according
 to the rules described below in @ref{Pattern Matching}.
 If the shell option @code{nocasematch}
-(see the description of @code{shopt} in @ref{Bash Builtins})
+(@pxref{Bash Builtin shopt})
 is enabled, the match is performed without regard to the case
 of alphabetic characters.
 The return value is 0 if the string matches (@samp{==}) or does not
@@ -977,7 +977,7 @@
 If the regular expression is syntactically incorrect, the conditional
 expression's return value is 2.
 If the shell option @code{nocasematch}
-(see the description of @code{shopt} in @ref{Bash Builtins})
+(@pxref{Bash Builtin shopt})
 is enabled, the match is performed without regard to the case
 of alphabetic characters.
 Substrings matched by parenthesized subexpressions within the regular
@@ -1840,7 +1840,7 @@
 matched explicitly.
 In other cases, the @samp{.} character is not treated specially.
 
-See the description of @code{shopt} in @ref{Bash Builtins},
[EMAIL PROTECTED] Builtin shopt},
 for a description of the @code{nocaseglob}, @code{nullglob},
 @code{failglob}, and @code{dotglob} options.
 
@@ -2508,7 +2508,7 @@
 to not receive @code{SIGHUP} using @code{disown -h}.
 
 If the  @code{huponexit} shell option has been set with @code{shopt}
-(@pxref{Bash Builtins}), Bash sends a @code{SIGHUP} to all jobs when
+(@pxref{Bash Builtin shopt}), Bash sends a @code{SIGHUP} to all jobs when
 an interactive login shell exits.
 
 If Bash is waiting for a command to complete and receives a signal
@@ -3014,7 +3014,7 @@
 @code{select} command, every arithmetic @code{for} command, and before
 the first command executes in a shell function.
 Refer to the description of the @code{extglob} option to the
[EMAIL PROTECTED] builtin (@pxref{Bash Builtins}) for details of its
[EMAIL PROTECTED] builtin (@pxref{Bash Builtin shopt}) for details of its
 effect on the @code{DEBUG} trap.
 If a @var{sigspec} is @code{ERR}, the command @var{arg} 
 is executed whenever a simple command has a non-zero exit status,
@@ -3250,7 +3251,7 @@
 The @option{-F} option inhibits the display of function definitions;
 only the function name and attributes are printed.
 If the @code{extdebug} shell option is enabled using @code{shopt}
-(@pxref{Bash Builtins}), the source file name and line number where
+(@pxref{Bash Builtin shopt}), the source file name and line number where
 the function is defined are displayed as well.
 @option{-F} implies @option{-f}.
 The following options can be used to restrict output to variables with
@@ -3521,6 +3522,7 @@
 
 @end table
 
[EMAIL PROTECTED] Builtin shopt}
 @item shopt
 @btindex shopt
 @example
@@ -4310,7 +4312,7 @@
 subroutine is executed, the number of parameters passed is pushed onto
 @code{BASH_ARGC}.
 The shell sets @code{BASH_ARGC} only when in extended debugging mode
-(see @ref{Bash Builtins}  
+(see @ref{Bash Builtin shopt}  
 for a description of the @code{extdebug} option to the @code{shopt}
 builtin).
 
@@ -4321,7 +4323,7 @@
 at the bottom.  When a subroutine is executed, the parameters supplied
 are 

gettextizing a few skipped messages [patch]

2006-11-24 Thread Benno Schulenberg

Hi,

While translating bash's messages, I noticed that some messages 
haven't been gettextized.  Attached patch fixes these -- just the 
ones I happened to notice, I haven't done a full inspection.

The first patch also fixes a typo, and changes a trailing space to 
a leading one (preferred by translators).

On the other hand, it looks like all of the message strings in 
lib/malloc/watch.c are debugging messages, which will never be seen 
by a normal user, and therefore do not need to be gettextized at 
all?


In many short doc strings the case of the parameters in the first 
line does not match the case in the rest of the explanation.  The 
second patch fixes this for some strings.  I can make a patch that 
fixes them all, if you agree that this is the right thing to do.

Much better than just that would be: if also the first line of the 
short doc string were gettextized (like they used to be in older 
versions of bash), so that in the explanation one doesn't have to 
use English words for the parameters but can translate also these 
to the target language.

The second patch also fixes the style (third person) and casing in  
some of the explanations, and tries to improve two others.


Please consider releasing another version of bash in a month or so, 
with the above fixes, but mainly with the superfluous N_(...) 
lines removed from caller.def and pushd.def.  Those had me puzzled 
for a day why my translation of them wasn't working.  And anyway, 
translators get discouraged just seeing such chopped up sentences.

Benno
diff -ur bash-3.2.orig/builtins/bind.def bash-3.2.new/builtins/bind.def
--- bash-3.2.orig/builtins/bind.def	2003-12-19 23:56:34.0 +0100
+++ bash-3.2.new/builtins/bind.def	2006-11-24 20:05:42.0 +0100
@@ -310,7 +310,7 @@
   function = rl_named_function (name);
   if (function == 0)
 {
-  builtin_error (`%s': unknown function name, name);
+  builtin_error (_(`%s': unknown function name), name);
   return EXECUTION_FAILURE;
 }
 
diff -ur bash-3.2.orig/builtins/hash.def bash-3.2.new/builtins/hash.def
--- bash-3.2.orig/builtins/hash.def	2006-02-21 20:59:45.0 +0100
+++ bash-3.2.new/builtins/hash.def	2006-11-24 20:05:42.0 +0100
@@ -158,7 +158,7 @@
 #ifdef EISDIR
 	  builtin_error (%s: %s, pathname, strerror (EISDIR));
 #else
-	  builtin_error (%s: is a directory, pathname);
+	  builtin_error (_(%s: is a directory), pathname);
 #endif
 	  opt = EXECUTION_FAILURE;
 	}
diff -ur bash-3.2.orig/builtins/inlib.def bash-3.2.new/builtins/inlib.def
--- bash-3.2.orig/builtins/inlib.def	2002-03-19 20:20:49.0 +0100
+++ bash-3.2.new/builtins/inlib.def	2006-11-24 20:05:42.0 +0100
@@ -64,7 +64,7 @@
 
   if (status.all != status_$ok)
 	{
-	  builtin_error (%s: inlib failed, list-word-word);
+	  builtin_error (_(%s: inlib failed), list-word-word);
 	  return_value = EXECUTION_FAILURE;
 	}
 
diff -ur bash-3.2.orig/builtins/printf.def bash-3.2.new/builtins/printf.def
--- bash-3.2.orig/builtins/printf.def	2006-09-18 14:48:42.0 +0200
+++ bash-3.2.new/builtins/printf.def	2006-11-24 20:05:42.0 +0100
@@ -540,7 +540,7 @@
 printf_erange (s)
  char *s;
 {
-  builtin_error (warning: %s: %s, s, strerror(ERANGE));
+  builtin_error (_(warning: %s: %s), s, strerror(ERANGE));
 }
 
 /* We duplicate a lot of what printf(3) does here. */
diff -ur bash-3.2.orig/builtins/pushd.def bash-3.2.new/builtins/pushd.def
--- bash-3.2.orig/builtins/pushd.def	2006-03-06 15:41:33.0 +0100
+++ bash-3.2.new/builtins/pushd.def	2006-11-24 20:05:42.0 +0100
@@ -483,9 +483,9 @@
  char *arg;
 {
   if (offset == 0)
-builtin_error (directory stack empty);
+builtin_error (_(directory stack is empty));
   else
-sh_erange (arg, directory stack index);
+sh_erange (arg, _(directory stack index));
 }
 
 static void
diff -ur bash-3.2.orig/builtins/test.def bash-3.2.new/builtins/test.def
--- bash-3.2.orig/builtins/test.def	2002-04-04 21:48:17.0 +0200
+++ bash-3.2.new/builtins/test.def	2006-11-24 20:05:42.0 +0100
@@ -131,7 +131,7 @@
 {
   if (this_command_name[0] == '['  !this_command_name[1])
 	{
-	  builtin_error (missing `]');
+	  builtin_error (_(missing `]'));
 	  return (EX_BADUSAGE);
 	}
 
diff -ur bash-3.2.orig/builtins/ulimit.def bash-3.2.new/builtins/ulimit.def
--- bash-3.2.orig/builtins/ulimit.def	2006-03-23 21:51:51.0 +0100
+++ bash-3.2.new/builtins/ulimit.def	2006-11-24 20:05:42.0 +0100
@@ -675,7 +675,7 @@
   if (get_limit (i, softlim, hardlim) == 0)
 	printone (i, (mode  LIMIT_SOFT) ? softlim : hardlim, 1);
   else if (errno != EINVAL)
-	builtin_error (%s: cannot get limit: %s, limits[i].description,
+	builtin_error (_(%s: cannot get limit: %s), limits[i].description,
 		   strerror (errno));
 }
 }
@@ -740,7 +740,7 @@
   for (retval = i = 0; limits[i].option  0; i++)
 if (set_limit (i, newlim, mode)  0)
   {
-	builtin_error (%s: cannot modify 

translations of bash, the po files

2006-11-15 Thread Benno Schulenberg

Hi,

It seems that bash has never used the translations that were made at 
http://www.iro.umontreal.ca/translation/registry.cgi?domain=bash .
At the moment Spanish and Turkish are completely up to date, and 
Estonian is halfway -- will these translations make it into the 
tarball for bash-3.3?  Or what I'm really asking: if I update the 
Dutch translation, will it get used?

And is there a publically accessible CVS or SVN repository for bash?

Benno


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: translations of bash, the po files

2006-11-15 Thread Benno Schulenberg
Chet Ramey wrote:
 I will probably not make a bash-3.3 release, but may release the
 new translations in a single package before bash-4.0 comes out.

As a separate package?  Hmm, strange, but okay.

If any of the strings change between 3.2 and 4.0, though, please 
make 4.0-pre release several weeks earlier and submit it to the TP, 
so the translators get a chance to catch up.

Regards,

Benno


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash