summaryrefslogtreecommitdiff
path: root/lisp/emulation
diff options
context:
space:
mode:
authorMichael Kifer <kifer@cs.stonybrook.edu>1995-08-20 04:30:48 +0000
committerMichael Kifer <kifer@cs.stonybrook.edu>1995-08-20 04:30:48 +0000
commit36b600032fc0505b4d613784c70e04153537757c (patch)
tree87ba86b7f165ce858b363f014e02ebcce862a554 /lisp/emulation
parentca905877c4b6f18411f596381399f79bc709cd4c (diff)
downloademacs-36b600032fc0505b4d613784c70e04153537757c.tar.gz
(vip-surrounding-word): modified to understand tripple clicks.
Diffstat (limited to 'lisp/emulation')
-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.
If CLICK-COUNT is 3 or more, returns the line clicked on with leading and
trailing space and tabs removed. In that case, the first argument, COUNT,
is ignored."
- (if (> click-count 2)
- (let (beg)
+ (let ((basic-alpha "_a-zA-Z0-9") ; it is important for `_' to come first
+ (basic-alpha-B "[_a-zA-Z0-9]")
+ (basic-nonalphasep-B vip-NONALPHASEP-B)
+ (end-modifiers "")
+ (start-modifiers "")
+ vip-ALPHA vip-ALPHA-B
+ vip-NONALPHA vip-NONALPHA-B
+ vip-ALPHASEP vip-ALPHASEP-B
+ vip-NONALPHASEP vip-NONALPHASEP-B
+ beg skip-flag result
+ one-char-word-func word-function-forw word-function-back word-beg)
+ (if (> click-count 2)
(save-excursion
(beginning-of-line)
(skip-chars-forward " \t")
(setq beg (point))
(end-of-line)
- (buffer-substring beg (point))))
- (let* ((basic-alpha "_a-zA-Z0-9") ;; it is important for `_' to come first
- (basic-alpha-B "[_a-zA-Z0-9]")
- (basic-nonalphasep-B vip-NONALPHASEP-B)
- (end-modifiers "")
- (start-modifiers "")
- vip-ALPHA vip-ALPHA-B
- vip-NONALPHA vip-NONALPHA-B
- vip-ALPHASEP vip-ALPHASEP-B
- vip-NONALPHASEP vip-NONALPHASEP-B
- skip-flag
- one-char-word-func word-function-forw word-function-back word-beg)
+ (setq result (buffer-substring beg (point))))
(if (and (looking-at basic-nonalphasep-B)
(or (save-excursion (vip-backward-char-carefully)
@@ -173,8 +172,14 @@ is ignored."
(setq count (1- count)))
(vip-forward-char-carefully)
- (buffer-substring word-beg (point)))
- )))
+ (setq result (buffer-substring word-beg (point))))
+ ) ; if
+ ;; XEmacs doesn't have set-text-propertiesr, but there buffer-substring
+ ;; doesn't return properties together with the string, so it's not needed.
+ (if vip-emacs-p
+ (set-text-properties 0 (length result) nil result))
+ result
+ ))
(defun vip-mouse-click-get-word (click count click-count)