From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#60080: 28.2; Double-click selection cannot be customized Date: Thu, 15 Dec 2022 09:33:18 +0200 Message-ID: <83tu1xktoh.fsf@gnu.org> References: <6B7419C1-47D1-43FF-8E6E-C3A4898089EF@toadstyle.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27558"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60080@debbugs.gnu.org To: Sean Devlin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 15 08:34:15 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p5ikw-00071K-RQ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Dec 2022 08:34:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5ikr-0003T4-TT; Thu, 15 Dec 2022 02:34:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5ikl-0003Sh-Qv for bug-gnu-emacs@gnu.org; Thu, 15 Dec 2022 02:34:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p5ikk-0001XH-1N for bug-gnu-emacs@gnu.org; Thu, 15 Dec 2022 02:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p5ikj-0007ik-TA for bug-gnu-emacs@gnu.org; Thu, 15 Dec 2022 02:34:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Dec 2022 07:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60080 X-GNU-PR-Package: emacs Original-Received: via spool by 60080-submit@debbugs.gnu.org id=B60080.167108961829668 (code B ref 60080); Thu, 15 Dec 2022 07:34:01 +0000 Original-Received: (at 60080) by debbugs.gnu.org; 15 Dec 2022 07:33:38 +0000 Original-Received: from localhost ([127.0.0.1]:42452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5ikL-0007iS-Uj for submit@debbugs.gnu.org; Thu, 15 Dec 2022 02:33:38 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5ikK-0007iH-5E for 60080@debbugs.gnu.org; Thu, 15 Dec 2022 02:33:36 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5ikE-0001Vb-Gi; Thu, 15 Dec 2022 02:33:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Wj5dmiN1AiXpY3mNH6vPpcPCizzgU3K/DkcDLjUFDUQ=; b=C2yHpZx7i/AA 1oEgsT/tuQkRX/XkzWFzbbOwUJOOGph/o7oBCAUYGGV/oxvprHy8HEwx5UakysT78AId1z9kg4aoW Vi/7jeO4HmFJCbHs4c5HkwUguFVrJV2R+IyYf1ITEmOa5ie/VN/cTUpFNL1kBNzK6vCFmoAuHxSa6 Vv/yFOHBn0gd4NCJFYs815hvLbCClzaU035ZL+3sJaDVZYGZMaCjTmHX5rw/lY+trWICI5DOdFeYC l+OcjQiVEsaVjSSjXFudaBgxgO40FMcx2kOBOWC4W0kdX5ZYuKvSTRFAIr2dH/rDm6o0Uj2dU04YK ejIgCOnm4aorAmKEDRwINw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5ik3-0007Zg-NL; Thu, 15 Dec 2022 02:33:29 -0500 In-Reply-To: <6B7419C1-47D1-43FF-8E6E-C3A4898089EF@toadstyle.org> (message from Sean Devlin on Wed, 14 Dec 2022 19:40:22 -0500) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:251029 Archived-At: > From: Sean Devlin > 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. 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,