aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kifer1995-08-20 04:30:48 +0000
committerMichael Kifer1995-08-20 04:30:48 +0000
commitc9dd7f74f681fbaa387a2f77a35dd14a70b74e61 (patch)
tree923b114f9c994f3869234f8b00b1441ff036fc4e
parent4040437e1f64e2e8d0b1d79c952bea4d4a65a489 (diff)
downloademacs-c9dd7f74f681fbaa387a2f77a35dd14a70b74e61.tar.gz
emacs-c9dd7f74f681fbaa387a2f77a35dd14a70b74e61.zip
(vip-surrounding-word): modified to understand tripple clicks.
-rw-r--r--lisp/emulation/viper-mous.el37
1 files changed, 21 insertions, 16 deletions
diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el
index 7e9ec8bb5c1..e3b91fbea6a 100644
--- a/lisp/emulation/viper-mous.el
+++ b/lisp/emulation/viper-mous.el
@@ -84,25 +84,24 @@ For convenience, in Lisp modes, `-' is considered alphanumeric.
84If CLICK-COUNT is 3 or more, returns the line clicked on with leading and 84If CLICK-COUNT is 3 or more, returns the line clicked on with leading and
85trailing space and tabs removed. In that case, the first argument, COUNT, 85trailing space and tabs removed. In that case, the first argument, COUNT,
86is ignored." 86is ignored."
87 (if (> click-count 2) 87 (let ((basic-alpha "_a-zA-Z0-9") ; it is important for `_' to come first
88 (let (beg) 88 (basic-alpha-B "[_a-zA-Z0-9]")
89 (basic-nonalphasep-B vip-NONALPHASEP-B)
90 (end-modifiers "")
91 (start-modifiers "")
92 vip-ALPHA vip-ALPHA-B
93 vip-NONALPHA vip-NONALPHA-B
94 vip-ALPHASEP vip-ALPHASEP-B
95 vip-NONALPHASEP vip-NONALPHASEP-B
96 beg skip-flag result
97 one-char-word-func word-function-forw word-function-back word-beg)
98 (if (> click-count 2)
89 (save-excursion 99 (save-excursion
90 (beginning-of-line) 100 (beginning-of-line)
91 (skip-chars-forward " \t") 101 (skip-chars-forward " \t")
92 (setq beg (point)) 102 (setq beg (point))
93 (end-of-line) 103 (end-of-line)
94 (buffer-substring beg (point)))) 104 (setq result (buffer-substring beg (point))))
95 (let* ((basic-alpha "_a-zA-Z0-9") ;; it is important for `_' to come first
96 (basic-alpha-B "[_a-zA-Z0-9]")
97 (basic-nonalphasep-B vip-NONALPHASEP-B)
98 (end-modifiers "")
99 (start-modifiers "")
100 vip-ALPHA vip-ALPHA-B
101 vip-NONALPHA vip-NONALPHA-B
102 vip-ALPHASEP vip-ALPHASEP-B
103 vip-NONALPHASEP vip-NONALPHASEP-B
104 skip-flag
105 one-char-word-func word-function-forw word-function-back word-beg)
106 105
107 (if (and (looking-at basic-nonalphasep-B) 106 (if (and (looking-at basic-nonalphasep-B)
108 (or (save-excursion (vip-backward-char-carefully) 107 (or (save-excursion (vip-backward-char-carefully)
@@ -173,8 +172,14 @@ is ignored."
173 (setq count (1- count))) 172 (setq count (1- count)))
174 173
175 (vip-forward-char-carefully) 174 (vip-forward-char-carefully)
176 (buffer-substring word-beg (point))) 175 (setq result (buffer-substring word-beg (point))))
177 ))) 176 ) ; if
177 ;; XEmacs doesn't have set-text-propertiesr, but there buffer-substring
178 ;; doesn't return properties together with the string, so it's not needed.
179 (if vip-emacs-p
180 (set-text-properties 0 (length result) nil result))
181 result
182 ))
178 183
179 184
180(defun vip-mouse-click-get-word (click count click-count) 185(defun vip-mouse-click-get-word (click count click-count)