Marc Lehmann writes:

> First, what's a "multiline echo string output"? simply some long string
> that spans multiple lines in a narrow-enough terminal, or an echo string
> with embedded newlines?
> 
> I tried both, but double-clicking didn't come up with anything
> "unexpected" (it selected the word I double-clicked). Maybe my
> expectations are off?

AFAICT, the problem does not have anything to do with output spanning
multiple lines. You can echo something like

    single line `echo' string shows bug's behavior

And, if I double click on the word "shows", instead of that word being
selected I get the entirety of what matches the shell-quoting rule,
which is

   `echo' string shows bug's

(which, if you ignore the fact that backquote is special, is all one
word for shell word-splitting purposes, so that's of course correct.
Whether it's desirable, I'm not entirely sure: it seems unintuitive for
English text. I suppose this should be up to the user to change if
that's what they want, though.)

The problem is that no rule ever matches the single word "shows", which
is the first thing we want to extend (so to speak... since we're
starting from no selection here) to... it should take another click to
get the whole chunk.

After messing around with various parts of the Perl, I realized it was
actually a simple problem: I don't have a cutchars resource set, and
presumably Martin doesn't either but you do. If there is no resource
set, then no just-match-a-word pattern is pushed in on_init.

Here is the patch I'm adding, which, if no cutchars are otherwise set,
uses the default documented in the man page. If you have any thoughts on
a better way of doing this (having to update the list in yet another
place if you decide to change it is obviously a loss) please let me
know.

--
things change.
[EMAIL PROTECTED]
Index: rxvt-unicode-7.8/src/perl/selection
===================================================================
--- rxvt-unicode-7.8.orig/src/perl/selection    2006-07-27 14:34:36.000000000 
-0400
+++ rxvt-unicode-7.8/src/perl/selection 2006-07-28 02:34:07.000000000 -0400
@@ -12,11 +12,13 @@
 sub on_init {
    my ($self) = @_;
 
+   my $cutchars = '\\‘"’&()*,;<=>[EMAIL PROTECTED]|}';
    if (defined (my $res = $self->resource ("cutchars"))) {
-      $res = $self->locale_decode ($res);
-      push @{ $self->{patterns} }, qr{\G [\Q$res\E[:space:]]* 
([^\Q$res\E[:space:]]+) }x;
+      $cutchars = $self->locale_decode ($res);
    }
 
+   push @{ $self->{patterns} }, qr{\G [\Q$cutchars\E[:space:]]* 
([^\Q$cutchars\E[:space:]]+) }x;
+
    for (my $idx = 0; defined (my $res = $self->x_resource 
("selection.pattern-$idx")); $idx++) {
       $res = $self->locale_decode ($res);
       utf8::encode $res;

Reply via email to