unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Harald Jörg" <haj@posteo.de>
To: 24101@debbugs.gnu.org
Subject: bug#24101: This bug is ... unfixable right now
Date: Tue, 04 Jul 2023 16:16:05 +0000	[thread overview]
Message-ID: <875y6zmz3u.fsf@oook.m.uunet.de> (raw)
In-Reply-To: <8737mt48bw.fsf@zira.vinc17.org>

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





      parent reply	other threads:[~2023-07-04 16:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-29  0:05 bug#24101: 24.5; incorrect double-click selection in cperl-mode Vincent Lefevre
2016-07-29  1:09 ` Clément Pit--Claudel
2019-07-05 20:17 ` Stefan Kangas
2023-07-04 16:16 ` Harald Jörg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875y6zmz3u.fsf@oook.m.uunet.de \
    --to=haj@posteo.de \
    --cc=24101@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).