GNU bug report logs -
#60080
28.2; Double-click selection cannot be customized
Previous Next
Reported by: Sean Devlin <spd <at> toadstyle.org>
Date: Thu, 15 Dec 2022 00:41:02 UTC
Severity: normal
Found in version 28.2
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi Eli,
> On Dec 15, 2022, at 2:33 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
>
>> From: Sean Devlin <spd <at> toadstyle.org>
>> Date: Wed, 14 Dec 2022 19:40:22 -0500
>>
>> I'd like to customize Emacs such that when I double-click on a word,
>> the entire enclosing symbol is selected. In other words, it should
>> behave more like the latter case of double-clicking on a character with
>> symbol syntax.
>
> Does the patch below do what you want?
>
> If it does, we could provide this as an optional behavior, conditioned
> by some new user option.
Yes, this seems to do the trick.
I agree that a user option would make sense.
Thanks for looking at this so quickly!
>
> diff --git a/lisp/mouse.el b/lisp/mouse.el
> index f72ab4f..ced7a92 100644
> --- a/lisp/mouse.el
> +++ b/lisp/mouse.el
> @@ -1803,7 +1803,11 @@ mouse-skip-word
> If DIR is positive skip forward; if negative, skip backward."
> (let* ((char (following-char))
> (syntax (char-to-string (char-syntax char))))
> - (cond ((string= syntax "w")
> + (cond ((bounds-of-thing-at-point 'symbol)
> + (goto-char (if (< dir 0)
> + (car (bounds-of-thing-at-point 'symbol))
> + (cdr (bounds-of-thing-at-point 'symbol)))))
> + ((string= syntax "w")
> ;; Here, we can't use skip-syntax-forward/backward because
> ;; they don't pay attention to word-separating-categories,
> ;; and thus they will skip over a true word boundary. So,
This bug report was last modified 2 years and 154 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.