Mercurial > emacs
comparison lisp/emulation/viper-mous.el @ 49598:0d8b17d428b5
Trailing whitepace deleted.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Tue, 04 Feb 2003 13:24:35 +0000 |
parents | 633233bf2bbf |
children | 695cf19ef79e d7ddb3e565de |
comparison
equal
deleted
inserted
replaced
49597:e88404e8f2cf | 49598:0d8b17d428b5 |
---|---|
56 :prefix "viper-" | 56 :prefix "viper-" |
57 :group 'viper) | 57 :group 'viper) |
58 | 58 |
59 | 59 |
60 ;;; Variables | 60 ;;; Variables |
61 | 61 |
62 ;; Variable used for catching the switch-frame event. | 62 ;; Variable used for catching the switch-frame event. |
63 ;; If non-nil, indicates that previous-frame should be the selected | 63 ;; If non-nil, indicates that previous-frame should be the selected |
64 ;; one. Used by viper-mouse-click-get-word. Not a user option. | 64 ;; one. Used by viper-mouse-click-get-word. Not a user option. |
65 (defvar viper-frame-of-focus nil) | 65 (defvar viper-frame-of-focus nil) |
66 | 66 |
67 ;; Frame that was selected before the switch-frame event. | 67 ;; Frame that was selected before the switch-frame event. |
68 (defconst viper-current-frame-saved (selected-frame)) | 68 (defconst viper-current-frame-saved (selected-frame)) |
69 | 69 |
70 (defcustom viper-surrounding-word-function 'viper-surrounding-word | 70 (defcustom viper-surrounding-word-function 'viper-surrounding-word |
71 "*Function that determines what constitutes a word for clicking events. | 71 "*Function that determines what constitutes a word for clicking events. |
72 Takes two parameters: a COUNT, indicating how many words to return, | 72 Takes two parameters: a COUNT, indicating how many words to return, |
73 and CLICK-COUNT, telling whether this is the first click, a double-click, | 73 and CLICK-COUNT, telling whether this is the first click, a double-click, |
74 or a tripple-click." | 74 or a tripple-click." |
75 :type 'symbol | 75 :type 'symbol |
76 :group 'viper-mouse) | 76 :group 'viper-mouse) |
77 | 77 |
78 ;; time interval in millisecond within which successive clicks are | 78 ;; time interval in millisecond within which successive clicks are |
79 ;; considered related | 79 ;; considered related |
80 (defcustom viper-multiclick-timeout (if (viper-window-display-p) | 80 (defcustom viper-multiclick-timeout (if (viper-window-display-p) |
81 (if viper-xemacs-p | 81 (if viper-xemacs-p |
82 mouse-track-multi-click-time | 82 mouse-track-multi-click-time |
92 ;; time stamp of the last click event; XEmacs only | 92 ;; time stamp of the last click event; XEmacs only |
93 (defvar viper-last-click-event-timestamp 0) | 93 (defvar viper-last-click-event-timestamp 0) |
94 | 94 |
95 ;; Local variable used to toggle wraparound search on click. | 95 ;; Local variable used to toggle wraparound search on click. |
96 (viper-deflocalvar viper-mouse-click-search-noerror t) | 96 (viper-deflocalvar viper-mouse-click-search-noerror t) |
97 | 97 |
98 ;; Local variable used to delimit search after wraparound. | 98 ;; Local variable used to delimit search after wraparound. |
99 (viper-deflocalvar viper-mouse-click-search-limit nil) | 99 (viper-deflocalvar viper-mouse-click-search-limit nil) |
100 | 100 |
101 ;; remembers prefix argument to pass along to commands invoked by second | 101 ;; remembers prefix argument to pass along to commands invoked by second |
102 ;; click. | 102 ;; click. |
103 ;; This is needed because in Emacs (not XEmacs), assigning to preix-arg | 103 ;; This is needed because in Emacs (not XEmacs), assigning to preix-arg |
104 ;; causes Emacs to count the second click as if it was a single click | 104 ;; causes Emacs to count the second click as if it was a single click |
105 (defvar viper-global-prefix-argument nil) | 105 (defvar viper-global-prefix-argument nil) |
145 (defsubst viper-mouse-click-posn (click) | 145 (defsubst viper-mouse-click-posn (click) |
146 (viper-cond-compile-for-xemacs-or-emacs | 146 (viper-cond-compile-for-xemacs-or-emacs |
147 (event-point click) ; xemacs | 147 (event-point click) ; xemacs |
148 (posn-point (event-start click)) ; emacs | 148 (posn-point (event-start click)) ; emacs |
149 )) | 149 )) |
150 | 150 |
151 | 151 |
152 (defun viper-surrounding-word (count click-count) | 152 (defun viper-surrounding-word (count click-count) |
153 "Returns word surrounding point according to a heuristic. | 153 "Returns word surrounding point according to a heuristic. |
154 COUNT indicates how many regions to return. | 154 COUNT indicates how many regions to return. |
155 If CLICK-COUNT is 1, `word' is a word in Vi sense. | 155 If CLICK-COUNT is 1, `word' is a word in Vi sense. |
172 (beginning-of-line) | 172 (beginning-of-line) |
173 (viper-skip-all-separators-forward 'within-line) | 173 (viper-skip-all-separators-forward 'within-line) |
174 (setq beg (point)) | 174 (setq beg (point)) |
175 (end-of-line) | 175 (end-of-line) |
176 (setq result (buffer-substring beg (point)))) | 176 (setq result (buffer-substring beg (point)))) |
177 | 177 |
178 (if (and (not (viper-looking-at-alphasep)) | 178 (if (and (not (viper-looking-at-alphasep)) |
179 (or (save-excursion (viper-backward-char-carefully) | 179 (or (save-excursion (viper-backward-char-carefully) |
180 (viper-looking-at-alpha)) | 180 (viper-looking-at-alpha)) |
181 (save-excursion (viper-forward-char-carefully) | 181 (save-excursion (viper-forward-char-carefully) |
182 (viper-looking-at-alpha)))) | 182 (viper-looking-at-alpha)))) |
192 ((looking-at "\\^") "\\^") | 192 ((looking-at "\\^") "\\^") |
193 ((viper-looking-at-separator) "") | 193 ((viper-looking-at-separator) "") |
194 (t (char-to-string (following-char)))) | 194 (t (char-to-string (following-char)))) |
195 ) | 195 ) |
196 )) | 196 )) |
197 | 197 |
198 ;; Add `-' to alphanum, if it wasn't added and if we are in Lisp | 198 ;; Add `-' to alphanum, if it wasn't added and if we are in Lisp |
199 (or (looking-at "-") | 199 (or (looking-at "-") |
200 (not (string-match "lisp" (symbol-name major-mode))) | 200 (not (string-match "lisp" (symbol-name major-mode))) |
201 (setq modifiers (concat modifiers "C-C-"))) | 201 (setq modifiers (concat modifiers "C-C-"))) |
202 | 202 |
203 | 203 |
204 (save-excursion | 204 (save-excursion |
205 (cond ((> click-count 1) (viper-skip-nonseparators 'backward)) | 205 (cond ((> click-count 1) (viper-skip-nonseparators 'backward)) |
206 ((viper-looking-at-alpha modifiers) | 206 ((viper-looking-at-alpha modifiers) |
207 (viper-skip-alpha-backward modifiers)) | 207 (viper-skip-alpha-backward modifiers)) |
208 ((not (viper-looking-at-alphasep modifiers)) | 208 ((not (viper-looking-at-alphasep modifiers)) |
210 (t (if (> click-count 1) | 210 (t (if (> click-count 1) |
211 (viper-skip-nonseparators 'backward) | 211 (viper-skip-nonseparators 'backward) |
212 (viper-skip-alpha-backward modifiers)))) | 212 (viper-skip-alpha-backward modifiers)))) |
213 | 213 |
214 (setq word-beg (point)) | 214 (setq word-beg (point)) |
215 | 215 |
216 (setq skip-flag nil) ; don't move 1 char forw the first time | 216 (setq skip-flag nil) ; don't move 1 char forw the first time |
217 (while (> count 0) | 217 (while (> count 0) |
218 (if skip-flag (viper-forward-char-carefully 1)) | 218 (if skip-flag (viper-forward-char-carefully 1)) |
219 (setq skip-flag t) ; now always move 1 char forward | 219 (setq skip-flag t) ; now always move 1 char forward |
220 (if (> click-count 1) | 220 (if (> click-count 1) |
235 (defun viper-mouse-click-get-word (click count click-count) | 235 (defun viper-mouse-click-get-word (click count click-count) |
236 "Returns word surrounding the position of a mouse click. | 236 "Returns word surrounding the position of a mouse click. |
237 Click may be in another window. Current window and buffer isn't changed. | 237 Click may be in another window. Current window and buffer isn't changed. |
238 On single or double click, returns the word as determined by | 238 On single or double click, returns the word as determined by |
239 `viper-surrounding-word-function'." | 239 `viper-surrounding-word-function'." |
240 | 240 |
241 (let ((click-word "") | 241 (let ((click-word "") |
242 (click-pos (viper-mouse-click-posn click)) | 242 (click-pos (viper-mouse-click-posn click)) |
243 (click-buf (viper-mouse-click-window-buffer click))) | 243 (click-buf (viper-mouse-click-window-buffer click))) |
244 (or (natnump count) (setq count 1)) | 244 (or (natnump count) (setq count 1)) |
245 (or (natnump click-count) (setq click-count 1)) | 245 (or (natnump click-count) (setq click-count 1)) |
246 | 246 |
247 (save-excursion | 247 (save-excursion |
248 (save-window-excursion | 248 (save-window-excursion |
249 (if click-pos | 249 (if click-pos |
250 (progn | 250 (progn |
251 (set-buffer click-buf) | 251 (set-buffer click-buf) |
252 | 252 |
253 (goto-char click-pos) | 253 (goto-char click-pos) |
254 (setq click-word | 254 (setq click-word |
255 (funcall viper-surrounding-word-function count click-count))) | 255 (funcall viper-surrounding-word-function count click-count))) |
256 (error "Click must be over a window")) | 256 (error "Click must be over a window")) |
257 click-word)))) | 257 click-word)))) |
278 (cond ((integerp arg) nil) | 278 (cond ((integerp arg) nil) |
279 ;; prefix arg is a list when one hits C-u then command | 279 ;; prefix arg is a list when one hits C-u then command |
280 ((and (listp arg) (integerp (car arg))) | 280 ((and (listp arg) (integerp (car arg))) |
281 (setq arg (car arg))) | 281 (setq arg (car arg))) |
282 (t (setq arg 1))) | 282 (t (setq arg 1))) |
283 | 283 |
284 (if (not (eq (key-binding viper-mouse-down-insert-key-parsed) | 284 (if (not (eq (key-binding viper-mouse-down-insert-key-parsed) |
285 'viper-mouse-catch-frame-switch)) | 285 'viper-mouse-catch-frame-switch)) |
286 () ; do nothing | 286 () ; do nothing |
287 (let (click-count interrupting-event) | 287 (let (click-count interrupting-event) |
288 (if (and | 288 (if (and |
307 (if (and interrupting-event | 307 (if (and interrupting-event |
308 (eventp interrupting-event) | 308 (eventp interrupting-event) |
309 (not (viper-mouse-event-p interrupting-event))) | 309 (not (viper-mouse-event-p interrupting-event))) |
310 (viper-set-unread-command-events interrupting-event)) | 310 (viper-set-unread-command-events interrupting-event)) |
311 ))))) | 311 ))))) |
312 | 312 |
313 ;; Arg is an event. Accepts symbols and numbers, too | 313 ;; Arg is an event. Accepts symbols and numbers, too |
314 (defun viper-mouse-event-p (event) | 314 (defun viper-mouse-event-p (event) |
315 (if (eventp event) | 315 (if (eventp event) |
316 (string-match "\\(mouse-\\|frame\\|screen\\|track\\)" | 316 (string-match "\\(mouse-\\|frame\\|screen\\|track\\)" |
317 (prin1-to-string (viper-event-key event))))) | 317 (prin1-to-string (viper-event-key event))))) |
318 | 318 |
319 ;; XEmacs has no double-click events. So, we must simulate. | 319 ;; XEmacs has no double-click events. So, we must simulate. |
320 ;; So, we have to simulate event-click-count. | 320 ;; So, we have to simulate event-click-count. |
321 (defun viper-event-click-count (click) | 321 (defun viper-event-click-count (click) |
322 (viper-cond-compile-for-xemacs-or-emacs | 322 (viper-cond-compile-for-xemacs-or-emacs |
323 (viper-event-click-count-xemacs click) ; xemacs | 323 (viper-event-click-count-xemacs click) ; xemacs |
324 (event-click-count click) ; emacs | 324 (event-click-count click) ; emacs |
325 )) | 325 )) |
326 | 326 |
327 ;; kind of semaphore for updating viper-current-click-count | 327 ;; kind of semaphore for updating viper-current-click-count |
328 (defvar viper-counting-clicks-p nil) | 328 (defvar viper-counting-clicks-p nil) |
329 (viper-cond-compile-for-xemacs-or-emacs | 329 (viper-cond-compile-for-xemacs-or-emacs |
330 (defun viper-event-click-count-xemacs (click) | 330 (defun viper-event-click-count-xemacs (click) |
331 (let ((time-delta (- (event-timestamp click) | 331 (let ((time-delta (- (event-timestamp click) |
344 viper-current-click-count | 344 viper-current-click-count |
345 0) | 345 0) |
346 )) | 346 )) |
347 nil ; emacs | 347 nil ; emacs |
348 ) | 348 ) |
349 | 349 |
350 | 350 |
351 (defun viper-mouse-click-search-word (click arg) | 351 (defun viper-mouse-click-search-word (click arg) |
352 "Find the word clicked or double-clicked on. Word may be in another window. | 352 "Find the word clicked or double-clicked on. Word may be in another window. |
353 With prefix argument, N, search for N-th occurrence. | 353 With prefix argument, N, search for N-th occurrence. |
354 This command must be bound to a mouse click. The double-click action of the | 354 This command must be bound to a mouse click. The double-click action of the |
365 'viper-mouse-click-search-word)) | 365 'viper-mouse-click-search-word)) |
366 (and viper-xemacs-p (not (event-over-text-area-p click))))) | 366 (and viper-xemacs-p (not (event-over-text-area-p click))))) |
367 () ; do nothing, if binding isn't right or not over text | 367 () ; do nothing, if binding isn't right or not over text |
368 (let ((previous-search-string viper-s-string) | 368 (let ((previous-search-string viper-s-string) |
369 click-word click-count) | 369 click-word click-count) |
370 | 370 |
371 (if (and | 371 (if (and |
372 (viper-multiclick-p) | 372 (viper-multiclick-p) |
373 ;; This trick checks if there is a pending mouse event if so, we use | 373 ;; This trick checks if there is a pending mouse event if so, we use |
374 ;; this latter event and discard the current mouse click If the next | 374 ;; this latter event and discard the current mouse click If the next |
375 ;; pending event is not a mouse event, we execute the current mouse | 375 ;; pending event is not a mouse event, we execute the current mouse |
385 ;; make sure we counted this event---needed for XEmacs only | 385 ;; make sure we counted this event---needed for XEmacs only |
386 (viper-event-click-count click)) | 386 (viper-event-click-count click)) |
387 ;; uninterrupted wait | 387 ;; uninterrupted wait |
388 (setq click-count (viper-event-click-count click)) | 388 (setq click-count (viper-event-click-count click)) |
389 (setq click-word (viper-mouse-click-get-word click nil click-count)) | 389 (setq click-word (viper-mouse-click-get-word click nil click-count)) |
390 | 390 |
391 (if (> click-count 1) | 391 (if (> click-count 1) |
392 (setq arg viper-global-prefix-argument | 392 (setq arg viper-global-prefix-argument |
393 viper-global-prefix-argument nil)) | 393 viper-global-prefix-argument nil)) |
394 (setq arg (or arg 1)) | 394 (setq arg (or arg 1)) |
395 | 395 |
396 (viper-deactivate-mark) | 396 (viper-deactivate-mark) |
397 (if (or (not (string= click-word viper-s-string)) | 397 (if (or (not (string= click-word viper-s-string)) |
398 (not (markerp viper-search-start-marker)) | 398 (not (markerp viper-search-start-marker)) |
399 (not (equal (marker-buffer viper-search-start-marker) | 399 (not (equal (marker-buffer viper-search-start-marker) |
400 (current-buffer))) | 400 (current-buffer))) |
402 (progn | 402 (progn |
403 (setq viper-search-start-marker (point-marker) | 403 (setq viper-search-start-marker (point-marker) |
404 viper-local-search-start-marker viper-search-start-marker | 404 viper-local-search-start-marker viper-search-start-marker |
405 viper-mouse-click-search-noerror t | 405 viper-mouse-click-search-noerror t |
406 viper-mouse-click-search-limit nil) | 406 viper-mouse-click-search-limit nil) |
407 | 407 |
408 ;; make search string known to Viper | 408 ;; make search string known to Viper |
409 (setq viper-s-string (if viper-re-search | 409 (setq viper-s-string (if viper-re-search |
410 (regexp-quote click-word) | 410 (regexp-quote click-word) |
411 click-word)) | 411 click-word)) |
412 (if (not (string= viper-s-string (car viper-search-history))) | 412 (if (not (string= viper-s-string (car viper-search-history))) |
413 (setq viper-search-history | 413 (setq viper-search-history |
414 (cons viper-s-string viper-search-history))) | 414 (cons viper-s-string viper-search-history))) |
415 )) | 415 )) |
416 | 416 |
417 (push-mark nil t) | 417 (push-mark nil t) |
418 (while (> arg 0) | 418 (while (> arg 0) |
419 (viper-forward-word 1) | 419 (viper-forward-word 1) |
420 (condition-case nil | 420 (condition-case nil |
421 (progn | 421 (progn |
429 (if (and | 429 (if (and |
430 (markerp viper-local-search-start-marker) | 430 (markerp viper-local-search-start-marker) |
431 (marker-buffer viper-local-search-start-marker)) | 431 (marker-buffer viper-local-search-start-marker)) |
432 (goto-char viper-local-search-start-marker)) | 432 (goto-char viper-local-search-start-marker)) |
433 (viper-line-pos 'end))) | 433 (viper-line-pos 'end))) |
434 | 434 |
435 (goto-char (point-min)) | 435 (goto-char (point-min)) |
436 (search-forward click-word | 436 (search-forward click-word |
437 viper-mouse-click-search-limit nil))) | 437 viper-mouse-click-search-limit nil))) |
438 (goto-char (match-beginning 0)) | 438 (goto-char (match-beginning 0)) |
439 (message "Searching for: %s" viper-s-string) | 439 (message "Searching for: %s" viper-s-string) |
450 (message | 450 (message |
451 "`%s': Last occurrence in %s. Back to beginning of search" | 451 "`%s': Last occurrence in %s. Back to beginning of search" |
452 click-word (buffer-name (current-buffer))) | 452 click-word (buffer-name (current-buffer))) |
453 (setq arg 1) ;; to terminate the loop | 453 (setq arg 1) ;; to terminate the loop |
454 (sit-for 2)) | 454 (sit-for 2)) |
455 (setq viper-mouse-click-search-noerror t) | 455 (setq viper-mouse-click-search-noerror t) |
456 (setq viper-mouse-click-search-limit nil) | 456 (setq viper-mouse-click-search-limit nil) |
457 (if (and (markerp viper-local-search-start-marker) | 457 (if (and (markerp viper-local-search-start-marker) |
458 (marker-buffer viper-local-search-start-marker)) | 458 (marker-buffer viper-local-search-start-marker)) |
459 (goto-char viper-local-search-start-marker)))) | 459 (goto-char viper-local-search-start-marker)))) |
460 (setq arg (1- arg))) | 460 (setq arg (1- arg))) |
461 )))) | 461 )))) |
462 | 462 |
463 (defun viper-mouse-catch-frame-switch (event arg) | 463 (defun viper-mouse-catch-frame-switch (event arg) |
464 "Catch the event of switching frame. | 464 "Catch the event of switching frame. |
465 Usually is bound to a `down-mouse' event to work properly. See sample | 465 Usually is bound to a `down-mouse' event to work properly. See sample |
466 bindings in the Viper manual." | 466 bindings in the Viper manual." |
467 (interactive "e\nP") | 467 (interactive "e\nP") |
470 (setq prefix-arg arg) | 470 (setq prefix-arg arg) |
471 (if (eq last-command 'handle-switch-frame) | 471 (if (eq last-command 'handle-switch-frame) |
472 (setq viper-frame-of-focus viper-current-frame-saved)) | 472 (setq viper-frame-of-focus viper-current-frame-saved)) |
473 ;; make Emacs forget that it executed viper-mouse-catch-frame-switch | 473 ;; make Emacs forget that it executed viper-mouse-catch-frame-switch |
474 (setq this-command last-command)) | 474 (setq this-command last-command)) |
475 | 475 |
476 ;; Called just before switching frames. Saves the old selected frame. | 476 ;; Called just before switching frames. Saves the old selected frame. |
477 ;; Sets last-command to handle-switch-frame (this is done automatically in | 477 ;; Sets last-command to handle-switch-frame (this is done automatically in |
478 ;; Emacs. | 478 ;; Emacs. |
479 ;; The semantics of switching frames is different in Emacs and XEmacs. | 479 ;; The semantics of switching frames is different in Emacs and XEmacs. |
480 ;; In Emacs, if you select-frame A while mouse is over frame B and then | 480 ;; In Emacs, if you select-frame A while mouse is over frame B and then |
481 ;; start typing, input goes to frame B, which becomes selected. | 481 ;; start typing, input goes to frame B, which becomes selected. |
482 ;; In XEmacs, input will go to frame A. This may be a bug in one of the | 482 ;; In XEmacs, input will go to frame A. This may be a bug in one of the |
483 ;; Emacsen, but also may be a design decision. | 483 ;; Emacsen, but also may be a design decision. |
573 viper-mouse-down-search-key-parsed | 573 viper-mouse-down-search-key-parsed |
574 (viper-parse-mouse-key 'viper-mouse-search-key 'down)) | 574 (viper-parse-mouse-key 'viper-mouse-search-key 'down)) |
575 (cond ((or (null viper-mouse-up-search-key-parsed) | 575 (cond ((or (null viper-mouse-up-search-key-parsed) |
576 (null viper-mouse-down-search-key-parsed)) | 576 (null viper-mouse-down-search-key-parsed)) |
577 nil) ; just quit | 577 nil) ; just quit |
578 ((and (null force) | 578 ((and (null force) |
579 (key-binding viper-mouse-up-search-key-parsed) | 579 (key-binding viper-mouse-up-search-key-parsed) |
580 (not (eq (key-binding viper-mouse-up-search-key-parsed) | 580 (not (eq (key-binding viper-mouse-up-search-key-parsed) |
581 'viper-mouse-click-search-word))) | 581 'viper-mouse-click-search-word))) |
582 (message | 582 (message |
583 "%S already bound to a mouse event. Viper mouse-search feature disabled" | 583 "%S already bound to a mouse event. Viper mouse-search feature disabled" |
584 viper-mouse-up-search-key-parsed)) | 584 viper-mouse-up-search-key-parsed)) |
585 ((and (null force) | 585 ((and (null force) |
586 (key-binding viper-mouse-down-search-key-parsed) | 586 (key-binding viper-mouse-down-search-key-parsed) |
587 (not (eq (key-binding viper-mouse-down-search-key-parsed) | 587 (not (eq (key-binding viper-mouse-down-search-key-parsed) |
588 'viper-mouse-catch-frame-switch))) | 588 'viper-mouse-catch-frame-switch))) |
589 (message | 589 (message |
590 "%S already bound to a mouse event. Viper mouse-search feature disabled" | 590 "%S already bound to a mouse event. Viper mouse-search feature disabled" |
591 viper-mouse-down-search-key-parsed)) | 591 viper-mouse-down-search-key-parsed)) |
592 (t | 592 (t |
593 (global-set-key viper-mouse-up-search-key-parsed | 593 (global-set-key viper-mouse-up-search-key-parsed |
594 'viper-mouse-click-search-word) | 594 'viper-mouse-click-search-word) |
595 (global-set-key viper-mouse-down-search-key-parsed | 595 (global-set-key viper-mouse-down-search-key-parsed |
596 'viper-mouse-catch-frame-switch)))) | 596 'viper-mouse-catch-frame-switch)))) |
597 | 597 |
606 nil) ; just quit | 606 nil) ; just quit |
607 ((and (null force) | 607 ((and (null force) |
608 (key-binding viper-mouse-up-insert-key-parsed) | 608 (key-binding viper-mouse-up-insert-key-parsed) |
609 (not (eq (key-binding viper-mouse-up-insert-key-parsed) | 609 (not (eq (key-binding viper-mouse-up-insert-key-parsed) |
610 'viper-mouse-click-insert-word))) | 610 'viper-mouse-click-insert-word))) |
611 (message | 611 (message |
612 "%S already bound to a mouse event. Viper mouse-insert feature disabled" | 612 "%S already bound to a mouse event. Viper mouse-insert feature disabled" |
613 viper-mouse-up-insert-key-parsed)) | 613 viper-mouse-up-insert-key-parsed)) |
614 ((and (null force) | 614 ((and (null force) |
615 (key-binding viper-mouse-down-insert-key-parsed) | 615 (key-binding viper-mouse-down-insert-key-parsed) |
616 (not (eq (key-binding viper-mouse-down-insert-key-parsed) | 616 (not (eq (key-binding viper-mouse-down-insert-key-parsed) |
617 'viper-mouse-catch-frame-switch))) | 617 'viper-mouse-catch-frame-switch))) |
618 (message | 618 (message |
619 "%S already bound to a mouse event. Viper mouse-insert feature disabled" | 619 "%S already bound to a mouse event. Viper mouse-insert feature disabled" |
620 viper-mouse-down-insert-key-parsed)) | 620 viper-mouse-down-insert-key-parsed)) |
621 (t | 621 (t |
622 (global-set-key viper-mouse-up-insert-key-parsed | 622 (global-set-key viper-mouse-up-insert-key-parsed |
623 'viper-mouse-click-insert-word) | 623 'viper-mouse-click-insert-word) |
624 (global-set-key viper-mouse-down-insert-key-parsed | 624 (global-set-key viper-mouse-down-insert-key-parsed |
625 'viper-mouse-catch-frame-switch)))) | 625 'viper-mouse-catch-frame-switch)))) |
626 | 626 |
664 (const :format "%v " shift) | 664 (const :format "%v " shift) |
665 (const control)) | 665 (const control)) |
666 (integer :tag "Button")) | 666 (integer :tag "Button")) |
667 :set 'viper-reset-mouse-insert-key | 667 :set 'viper-reset-mouse-insert-key |
668 :group 'viper-mouse) | 668 :group 'viper-mouse) |
669 | 669 |
670 | 670 |
671 | 671 |
672 ;;; Local Variables: | 672 ;;; Local Variables: |
673 ;;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun) | 673 ;;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun) |
674 ;;; End: | 674 ;;; End: |