changeset 22852:dfb255fb91c8

(mouse-skip-word): If point is at word constituent characters, pay attention to word-separating-categories by using forward-word instead of skip-syntax-forward/backward.
author Kenichi Handa <handa@m17n.org>
date Thu, 30 Jul 1998 01:34:38 +0000
parents 2c2eb47ec8e3
children 62d2fb895f5f
files lisp/mouse.el
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mouse.el	Wed Jul 29 23:04:24 1998 +0000
+++ b/lisp/mouse.el	Thu Jul 30 01:34:38 1998 +0000
@@ -639,7 +639,18 @@
 If DIR is positive skip forward; if negative, skip backward."
   (let* ((char (following-char))
 	 (syntax (char-to-string (char-syntax char))))
-    (cond ((or (string= syntax "w") (string= syntax " "))
+    (cond ((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,
+	   ;; we simularte the original behaviour by using
+	   ;; forward-word.
+	   (if (< dir 0)
+	       (if (not (looking-at "\\<"))
+		   (forward-word -1))
+	     (if (or (looking-at "\\<") (not (looking-at "\\>")))
+		 (forward-word 1))))
+	  ((string= syntax " ")
 	   (if (< dir 0)
 	       (skip-syntax-backward syntax)
 	     (skip-syntax-forward syntax)))