diff lisp/prim/mouse.el @ 74:54cc21c15cbb r20-0b32

Import from CVS: tag r20-0b32
author cvs
date Mon, 13 Aug 2007 09:04:33 +0200
parents 131b0175ea99
children cf808b4c4290
line wrap: on
line diff
--- a/lisp/prim/mouse.el	Mon Aug 13 09:03:47 2007 +0200
+++ b/lisp/prim/mouse.el	Mon Aug 13 09:04:33 2007 +0200
@@ -771,9 +771,17 @@
   (cond ((eq type 'word)
 	 ;; trap the beginning and end of buffer errors
 	 (condition-case ()
-	     (if forwardp
-		 (default-mouse-track-end-of-word t)
-	       (default-mouse-track-beginning-of-word t))
+	     (progn
+	       (setq type (char-syntax (char-after (point))))
+	       (if forwardp
+		   (if (= type ?\()
+		       (goto-char (scan-sexps (point) 1))
+		     (if (= type  ?\))
+			 (forward-char 1)
+		       (default-mouse-track-end-of-word t)))
+		 (if (= type ?\))
+		     (goto-char (scan-sexps (1+ (point)) -1))
+		   (default-mouse-track-beginning-of-word t))))
 	   (error ())))
 	((eq type 'line)
 	 (if forwardp (end-of-line) (beginning-of-line)))