GNOME Bugzilla – Bug 156279
word_chars, customization and accented letters
Last modified: 2007-01-31 23:23:47 UTC
[This bugreport involves both vte and gnome-terminal, tested with 0.11.11 and 2. 7.3.] A set of so called "word characters" can be teached to vte, which influences the behavior of mouse double click. By default this is the empty string, which vte handles specially at the beginning of src/vte/vte_terminal_is_word_char(): all characters that are printable but not punctation or whitespace are treated as word characters. The result: words contain digits or alphabetic characters (even accented ones), this is nice, however, no other symbols are part of words, which might not fit my personal taste. If word_chars is set to some non-emtpy value, this piece of code gets skipped, and only those characters explicitely mentioned are treated as word characters. This is the default of gnome-terminal, since it initializes this field of vte to a value taken from a gconf variable, the default value is -A-Za-z0-9,./?%&#:_ The big disadvantage is that this time accented letters are not treated as part of words, which is nonsense. Okay, I can list all the accented letters of my language, but I cannot list all the accented letters of all the languages, however, if I meet a foreign accented letter in my UTF-8 terminal, I still want it to be handled as a word char. Which punctation symbols are word chars is up to my personal taste, so I'd like that one to remain configurable, however, whether a letter with an accent on it is word character is not a matter of taste, it is a fact: it _is_ a word character. With the current situation this cannot be handled properly, and also the default setting of gnome-terminal is brain-damaged since double click stops the selection at accented letters. I can either clear this field in gnome-terminal's preferences and cope with the fact that none of the punctation symbols are word chars, or I can start listing all the accented characters I meet. A quick and simple solution is to force vte to handle all alphanumeric characters as word characters. Patch follows for this solution. Then A-Za-z0-9 could be dropped from the default value of word_chars in gnome-terminal src/gnome-terminal.schemas since it becomes redundant. A more proper but more complicated solution would be to change the interface: instead of one word_chars setting of vte, it should have two fields: add_to_word_char and delete_from_word_char, so I can force a character to be a word_char and also I can force it not to be word_char, but for all the characters that are not specified in either fields, the default would be calling g_unichar_...() just like currently vte does if the word_chars field is empty. (Also please note that handling the empty set specially for a field which is a set of particular elements is generally a bad design, since there's no way to specify an emtpy set.)
Created attachment 32988 [details] [review] always treat alphanumeric characters as word characters, no matter what word_chars is set to
Hi Egmont, from a quick look, it seems Takao Fujiwara proposed a similar patch in #170668: http://bugzilla.gnome.org/attachment.cgi?id=38847&action=view Thoughts?
And later an improved patch by Takao Fujiwara was committed. *** This bug has been marked as a duplicate of 339986 ***