Bug 188037 - Double-click word selection has regressed
Summary: Double-click word selection has regressed
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: xterm
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jason Vas Dias
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-04-05 15:04 UTC by David A. De Graaf
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version: xterm-212-1.FC5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-04-13 20:33:01 UTC
Type: ---


Attachments (Terms of Use)

Description David A. De Graaf 2006-04-05 15:04:46 UTC
Description of problem:
  The definition of a "word" selected by double-clicking now includes only
contiguous alphanumerics.  It used to be smarter.


Version-Release number of selected component (if applicable):
  xterm-211-1.FC5


How reproducible:
  Annoyingly constant.


Steps to Reproduce:
1.  Pick a bit of text like   xterm-211-1.FC5   and double click on it.
2.
3.
  
Actual results:
  Only a fragment such as 211, or -, or 1 is highlighted instead of the entire
filename.


Expected results:
  Previously, the entire filename with punctuation was selected.  Even when the
item selected was a URL enclosed in <> brackets, the URL was selected.
That is what's expected; that's what is useful.


Additional info:
  This entire problem is due to an unfortunately included ! mark.  In
/usr/share/X11/app-defaults/XTerm a crucial line is commented out:
! Here is a pattern that is useful for double-clicking on a URL:
!*charClass: 33:48,35:48,37-38:48,43-47:48,58:48,61:48,63-64:48,126:48

If the line defining *charClass is restored, double-clicking works again.

Why someone chose to comment out this crucial definition in FC5 is
unfathomable.  Since this function is hopelessly obscure to most users,
it is crucially important that the default behaviour be what works correctly.
Please remove the villainous exclamation mark.

Comment 1 Jason Vas Dias 2006-04-05 15:46:59 UTC
Actually, this is a hotly debated topic, with many people taking the opposite
point of view to yours - they consider that uncommenting the example charClass
definition was a regression - see: Bug 186170, Debian bug 348384 :
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=348384 .

Prior to xterm-208, all xterm releases had no charClass definition or that
charClass definition commented out - this has always been xterm's default
legacy behaviour, which many users have come to rely on.

This really is a matter of user preference .  Yes, I agree that this feature
is poorly understood by the average user and poorly documented.

So I propose the following:
 o The default behaviour should be as it always was in pre xterm-208 releases:
   no charClass definition.
 o There should be a menu item and an X resource to easily enable the 
   extended charClass definition - say something like 'vt100*smartSelection:1'
   or 'Smart Selection'.
 o These options should be better documented in the man-page.
I'll look into implementing this in the next release, if the next upstream
release does not do so .

Comment 2 Thomas E. Dickey 2006-04-05 16:22:14 UTC
I changed this in #209 (#211 is current, am working on #212):
add a new selection feature: regular expressions, and new resources which 
specify what happens on multiple mouse clicks: on2Clicks, on3Clicks, on4Clicks 
and on5Clicks. 
revert the XTerm.ad change from patch #208 (Debian #348384).

Comment 3 David A. De Graaf 2006-04-06 17:37:12 UTC
OK, I can see there's more than enough room for controversy in
specifiying a charClass, so I regret reopening this can of worms.
It's impossible to add a single set of characters to the alphanumerics
so that double-clicking will perfectly satisfy all users and all purposes.

If your goal is to select full pathnames, you'd want:
    + , - . _ /

but if you want to choose only the filename portion, you'd have to
omit the /

Both of these conflict with the best choice for selecting URLs:
    + , - . _ / ! # % & : = ? @ ~

The characters that would probably never be considered equivalent:
    " $ ' ( ) ; < > [ \ ] ^ ` { | }

although I'm sure someone might have a preference for some of them.


So, yes, keep the traditional behaviour as the default.  This is
well-documented by the table of the built-in charClass table in the
man page (once you discover it, and read it).

But please add more prominent examples of how and why one can use local
extensions of the definition, and keep several possible examples,
commented out, in the /usr/share/X11/app-defaults/XTerm file.
Displaying the characters along with the cryptic code might help, eg

! Here is a pattern that is useful for double-clicking on a URL:
! This includes the characters    ! # % &  + , - . /  : = ? @ ~
!*charClass: 33:48,35:48,37-38:48,43-47:48,58:48,61:48,63-64:48,126:48


Note that my examples above add the _ (underscore) character.
Shouldn't that be included to allow selecting filenames and variable
names that use it?   See? - everyone's got their own opinion.   :-)


Comment 4 Jason Vas Dias 2006-04-13 20:33:01 UTC
The charClass definition is commented out in all current releases 
( xterm-212-1.FC6, xterm-212-1.FC5, xterm-212-1.FC4 ). 
The commented out definitions work and make sense when uncommented.
Closing as 'CURRENTRELEASE'.




Note You need to log in before you can comment on or make changes to this bug.