From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: finger-pointer curser as default for mouse-face text Date: Sun, 24 Oct 2004 21:59:57 +0200 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1098648025 10147 80.91.229.6 (24 Oct 2004 20:00:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 24 Oct 2004 20:00:25 +0000 (UTC) Cc: rms@gnu.org, drew.adams@oracle.com, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 24 22:00:15 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CLoXG-0001rS-00 for ; Sun, 24 Oct 2004 22:00:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CLoes-0007I9-Fo for ged-emacs-devel@m.gmane.org; Sun, 24 Oct 2004 16:08:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CLoei-0007I1-To for emacs-devel@gnu.org; Sun, 24 Oct 2004 16:07:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CLoei-0007Hp-Eo for emacs-devel@gnu.org; Sun, 24 Oct 2004 16:07:56 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CLoei-0007Hm-B1 for emacs-devel@gnu.org; Sun, 24 Oct 2004 16:07:56 -0400 Original-Received: from [195.41.46.237] (helo=pfepc.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CLoWt-0006B1-T3; Sun, 24 Oct 2004 15:59:52 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx3.adsl-dhcp.tele.dk [80.62.38.68]) by pfepc.post.tele.dk (Postfix) with SMTP id 200502628D1; Sun, 24 Oct 2004 21:59:50 +0200 (CEST) Original-To: David Kastrup In-Reply-To: (David Kastrup's message of "Sun, 24 Oct 2004 15:10:37 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:28847 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28847 David Kastrup writes: > storm@cua.dk (Kim F. Storm) writes: > >> So a "fast" click follows the link, a slightly slower click sets the >> point (or whatever mouse-1 does). Dragging the mouse also inhibits >> following the link. > > Actually, for me this is somewhat backward: I use a touchpad, and > setting the cursor is naturally done by tapping (which is short), > while following a link currently is done by pressing both mouse keys > together (which by necessity is longer). Since setting the cursor is > usually followed by typing ahead soon, one wants to continue fast > (because you continue at the point at which you usually look). > Whereas if you follow the link, you are waiting for something to > happen. Normally, I would not expect a user to type anything in the middle of a link, but YMMV. > So I'd very much prefer making the long press follow the link, even > though a long press is more likely to get interpreted as a drag > instead. > > Perhaps the sign of that variable can be used for specifying whether > the long or the short duration means following the link? Positive > means longer than given duration, negative means shorter? Like this: Index: mouse.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/mouse.el,v retrieving revision 1.251 diff -c -r1.251 mouse.el *** mouse.el 18 Oct 2004 09:29:26 -0000 1.251 --- mouse.el 24 Oct 2004 19:06:25 -0000 *************** *** 48,53 **** --- 48,72 ---- :type 'boolean :group 'mouse) + (defcustom mouse-1-click-follows-link 300 + "Non-nil means that clicking mouse-1 on a link follows the link. + This is only done for links which have the mouse-face property. + + If value is an positive integer, it specifies the maximum duration in + milli-seconds of the mouse-1 click to be recognized as a mouse-2 click. + If the time between pressing and releasing the mouse button is + longer, the normal mouse-1 action (typically set point) is performed. + + If value is an negative integer, its absolute value specifies the + minimum duration in milli-seconds of the mouse-1 click to be recognized + as a mouse-2 click. If the time between pressing and releasing the + mouse button is longer, the normal mouse-1 action is performed." + :version "21.4" + :type '(choice (const :tag "Disabled" nil) + (number :tag "Click time limit" :value 300) + (other :tag "Enabled" t)) + :group 'mouse) + ;; Provide a mode-specific menu on a mouse button. *************** *** 877,882 **** --- 896,914 ---- (or end-point (= (window-start start-window) start-window-start))) + (if (and mouse-1-click-follows-link + (not end-point) + (consp event) + (get-char-property start-point 'mouse-face) + (or (not (integerp mouse-1-click-follows-link)) + (let ((t0 (posn-timestamp (event-start start-event))) + (t1 (posn-timestamp (event-end event)))) + (and (integerp t0) (integerp t1) + (if (> mouse-1-click-follows-link 0) + (<= (- t1 t0) mouse-1-click-follows-link) + (< (- t0 t1) mouse-1-click-follows-link)))))) + + (setcar event 'mouse-2)) (setq unread-command-events (cons event unread-command-events))))) (delete-overlay mouse-drag-overlay))))) -- Kim F. Storm http://www.cua.dk