GNU bug report logs -
#24101
24.5; incorrect double-click selection in cperl-mode
Previous Next
Full log
View this message in rfc822 format
On 2016-07-28 20:05, Vincent Lefevre wrote:
> 1. Under X Window (so that Emacs uses its own interface), open
> a file containing:
>
> # -*- mode: cperl -*-
>
> tr/ABCDE/12345/;
>
> 2. Double-click over "4".
>
> Only "2345" is selected, instead of "12345".
The bug can still be reproduced in Emacs master (Emacs 30).
Unfortunately, it can not be fixed due to an Emacs limitation.
Background: cperl-mode treats the "match"-part and the
"replacement"-part differently. To do that, cperl-mode uses the
"generic strings" of Emacs. These need a delimiter character, but the
middle "/" can not serve as a end delimiter for the match part _and_ a
start delimiter of the replacement part. So cperl-mode "cheats" and
makes the first character of the replacement part the start delimiter,
and by doing this, it is no longer part of the following "word".
Changing that would mean dropping significant features of cperl-mode.
Therefore, this only happens for words which start immediately after the
"/" which separates match- from replacement part.
A workaround is to use paired delimiters, because in that case
cperl-mode has two characters to use as end and start delimiter.
Selecting by double-clicking (or calling word-at-point) gives the
desired result.
tr{ABCDE}{12345};
So, as of today I can still confirm the bug - but not fix it.
--
Cheers,
haj
This bug report was last modified 1 year and 346 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.