[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-readline] How does readline know where words end (psql and yank
Re: [Bug-readline] How does readline know where words end (psql and yank-last-arg use case)?
Fri, 08 Jul 2011 12:00:31 -0400
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:188.8.131.52) Gecko/20110616 Thunderbird/3.1.11
On 7/6/11 8:33 AM, Alexander Shulgin wrote:
> On Wed, Jul 6, 2011 at 14:40, Chet Ramey <address@hidden> wrote:
>>> I'm just wondering how does readline know where any given word ends
>>> and another one starts?
>> In this case, since you're yanking from the history, it uses the history
>> library's set of word delimiters. In general, it uses the notion of
>> characters that break words.
>> The history library's set of word delimiters is a subset of the shell's:
>> ` \t\n;&()|<>', with quoting honored.
>> There aren't any hooks to modify this from outside the history library.
> OK, I see this line in histexpand.c:
> 51: #define HISTORY_WORD_DELIMITERS " \t\n;&()|<>"
> Any reason (e.g. security) we couldn't patch it to get this from an
> environment variable?
I don't see why not. How about something like HIST_WORDBREAKS? I'd have
to see about how to implement it so it would work in both bash (which
maintains its own environment) and other applications that look in the
global process environment.
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/