all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* change "word" definition (syntax table) for double-click?
@ 2008-11-29 21:36 ead-gnu-emacs
  2008-11-30  2:13 ` Xah Lee
  0 siblings, 1 reply; 7+ messages in thread
From: ead-gnu-emacs @ 2008-11-29 21:36 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

How can I have a double-click on for instance the middle "o" in
"http://www.foo.com/" highlight the entirety of "http://www.foo.com/"
rather than merely the word "foo"?

I'm using this version of Emacs:
    GNU Emacs 22.2.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
    of 2008-11-09 on raven, modified by Debian

and I've looked at this web page:
    Hacking the syntax table
    http://www.emacswiki.org/emacs/EmacsSyntaxTable#toc3

, specifically this note:
    You can also set which syntax table is used on a per command
basis.
    Here is how to use my-wacky-syntax-table with the C-M-f shortcut,
    bound to forward-sexp by default.
    (global-set-key "\C-\M-f" '(lambda ()
        (interactive)
        (with-syntax-table my-wacky-syntax-table (forward-sexp))))

; and I've created my own syntax table wherein all non-whitespace
characters are word characters:
    (defvar my-syntax-table
        (let ((table (make-syntax-table)))
            (modify-syntax-entry ?\n "-" table)
            (modify-syntax-entry ?!  "w" table)
            (modify-syntax-entry ?\" "w" table)
            (modify-syntax-entry ?#  "w" table)
            (modify-syntax-entry ?$  "w" table)
            (modify-syntax-entry ?%  "w" table)
            (modify-syntax-entry ?&  "w" table)
            (modify-syntax-entry ?'  "w" table)
            (modify-syntax-entry ?\( "w" table)
            (modify-syntax-entry ?\) "w" table)
            (modify-syntax-entry ?*  "w" table)
            (modify-syntax-entry ?+  "w" table)
            (modify-syntax-entry ?,  "w" table)
            (modify-syntax-entry ?-  "w" table)
            (modify-syntax-entry ?.  "w" table)
            (modify-syntax-entry ?/  "w" table)
            (modify-syntax-entry ?:  "w" table)
            (modify-syntax-entry ?\; "w" table)
            (modify-syntax-entry ?<  "w" table)
            (modify-syntax-entry ?=  "w" table)
            (modify-syntax-entry ?>  "w" table)
            (modify-syntax-entry ??  "w" table)
            (modify-syntax-entry ?@  "w" table)
            (modify-syntax-entry ?\[ "w" table)
            (modify-syntax-entry ?\\ "w" table)
            (modify-syntax-entry ?\] "w" table)
            (modify-syntax-entry ?^  "w" table)
            (modify-syntax-entry ?_  "w" table)
            (modify-syntax-entry ?`  "w" table)
            (modify-syntax-entry ?{  "w" table)
            (modify-syntax-entry ?|  "w" table)
            (modify-syntax-entry ?}  "w" table)
            (modify-syntax-entry ?~  "w" table)
            table))

; and I've attempted to bind mouse-set-point to [(double-mouse-1)]
using
the above syntax table:
    (global-set-key [(double-mouse-1)] 'my-double-mouse-1)
    (defun my-double-mouse-1 (event)
        "Run mouse-set-point with my syntax table."
        (interactive "e")
        (with-syntax-table my-syntax-table (mouse-set-point)))

. However, I get an error message when I perform a double-click:
    progn: Wrong number of arguments: #[(event) "\301^H!\210\302^H
\211^X
    :\203]^@\303^H8:\203^W^@\303\202^X^@\304^H8\202#^@\305 `
\306\307F)!
    \207" [event mouse-minibuffer-check posn-set-point 2 1 selected
window
    (0 . 0) 0] 6 581237 "e"], 0

So, where am I going wrong? How can I have my syntax table be applied
to
a double-click?

Thanks a million,
Eric
--
Eric De Mund   | Ixian Systems           | Jab: eadixian@jabber.org/
main
ead@ixian.com  | 650 Castro St, #120-210 | Y!M: ead0002
ixian.com/ead/ | Mountain View, CA 94041 | ICQ: 811788


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-12-01 18:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-29 21:36 change "word" definition (syntax table) for double-click? ead-gnu-emacs
2008-11-30  2:13 ` Xah Lee
2008-12-01  5:08   ` ead-gnu-emacs
2008-12-01  5:57     ` Xah Lee
2008-12-01 18:29     ` Drew Adams
2008-12-01 18:39       ` Drew Adams
2008-12-01 18:52       ` Drew Adams

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.