aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa1998-07-30 01:34:38 +0000
committerKenichi Handa1998-07-30 01:34:38 +0000
commit258e3295297a7255fe98e020ea10a4a9367a236f (patch)
treef049a1b0b95f510f360dad201209466b852d6f78
parent8a8a9abe0c0191c1ab7c923ff87abe226e21c9c5 (diff)
downloademacs-258e3295297a7255fe98e020ea10a4a9367a236f.tar.gz
emacs-258e3295297a7255fe98e020ea10a4a9367a236f.zip
(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.
-rw-r--r--lisp/mouse.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 1902db0a32d..be760126499 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -639,7 +639,18 @@ remains active. Otherwise, it remains until the next input event."
639If DIR is positive skip forward; if negative, skip backward." 639If DIR is positive skip forward; if negative, skip backward."
640 (let* ((char (following-char)) 640 (let* ((char (following-char))
641 (syntax (char-to-string (char-syntax char)))) 641 (syntax (char-to-string (char-syntax char))))
642 (cond ((or (string= syntax "w") (string= syntax " ")) 642 (cond ((string= syntax "w")
643 ;; Here, we can't use skip-syntax-forward/backward because
644 ;; they don't pay attention to word-separating-categories,
645 ;; and thus they will skip over a true word boundary. So,
646 ;; we simularte the original behaviour by using
647 ;; forward-word.
648 (if (< dir 0)
649 (if (not (looking-at "\\<"))
650 (forward-word -1))
651 (if (or (looking-at "\\<") (not (looking-at "\\>")))
652 (forward-word 1))))
653 ((string= syntax " ")
643 (if (< dir 0) 654 (if (< dir 0)
644 (skip-syntax-backward syntax) 655 (skip-syntax-backward syntax)
645 (skip-syntax-forward syntax))) 656 (skip-syntax-forward syntax)))