1 Dec 19:29
RE: change "word" definition (syntax table) for double-click?
From: Drew Adams <drew.adams <at> oracle.com>
Subject: RE: change "word" definition (syntax table) for double-click?
Newsgroups: gmane.emacs.help
Date: 2008-12-01 18:29:53 GMT
Subject: RE: change "word" definition (syntax table) for double-click?
Newsgroups: gmane.emacs.help
Date: 2008-12-01 18:29:53 GMT
> What I want is for double-clicking with the mouse to highlight, > as a word, all contiguous non-whitespace characters. By "highlight", I think you mean "select", as in setting the active region to that text. > Some sample applications I want this for are: > o Double-clicking in the middle of URLs. > o Double-clicking in the middle of RFC822-compliant email addresses. > o Double-clicking in the middle of passwords and other strings > having non-alphanumeric characters. Easy solution: `M-x goto-address'. That will put links on URLs and email addresses, which you can then click (single-click) with mouse-2 (and mouse-1, if `mouse-1-click-follows-link' is non-nil). See the Emacs manual, node Hyperlinking, and its subnodes. If you don't like that for some reason, and you really want to change double-clicking mouse-2 so that it selects such things, then read on. Emacs already does that too, at least for many URLs etc. and at least in some modes, such as Emacs-Lisp mode. That is, provided you double-click (with mouse-2) on a symbol-constituent character, such as :/.?=@. If you instead double-click a word-constituent character, then just that word is selected. For example, in Emacs-Lisp mode, if you double-click the URL http://www.emacswiki.org/emacs/SiteMap at the : or a / or a ., then the whole URL is selected. And in the email address help-gnu-emacs <at> gnu.org, if you double-click a - or the @ or the ., then the whole address is selected.(Continue reading)
RSS Feed