;;; viper-mous.el --- mouse support for Viper
-;; Copyright (C) 1994-1997, 2001-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1997, 2001-2016 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
;; Package: viper
(defvar viper-s-string)
(defvar viper-re-search)
-;; loading happens only in non-interactive compilation
-;; in order to spare non-viperized emacs from being viperized
-(if noninteractive
- (eval-when-compile
- (require 'viper-cmd)
- ))
-;; end pacifier
-
(require 'viper-util)
+;; end pacifier
(defgroup viper-mouse nil
(defvar viper-current-frame-saved (selected-frame))
(defcustom viper-surrounding-word-function 'viper-surrounding-word
- "*Function that determines what constitutes a word for clicking events.
+ "Function that determines what constitutes a word for clicking events.
Takes two parameters: a COUNT, indicating how many words to return,
and CLICK-COUNT, telling whether this is the first click, a double-click,
-or a tripple-click."
+or a triple-click."
:type 'symbol
:group 'viper-mouse)
mouse-track-multi-click-time
double-click-time)
500)
- "*Time interval in millisecond within which successive mouse clicks are
+ "Time interval in millisecond within which successive mouse clicks are
considered related."
:type 'integer
:group 'viper-mouse)
;; remembers prefix argument to pass along to commands invoked by second
;; click.
-;; This is needed because in Emacs (not XEmacs), assigning to preix-arg
+;; This is needed because in Emacs (not XEmacs), assigning to prefix-arg
;; causes Emacs to count the second click as if it was a single click
(defvar viper-global-prefix-argument nil)
(posn-point (event-start click))))
+
+(declare-function viper-backward-char-carefully "viper-cmd" (&optional arg))
+(declare-function viper-forward-char-carefully "viper-cmd" (&optional arg))
+
(defun viper-surrounding-word (count click-count)
"Returns word surrounding point according to a heuristic.
COUNT indicates how many regions to return.
If the character clicked on is a non-separator and is non-alphanumeric but
is adjacent to an alphanumeric symbol, then it is considered alphanumeric
for the purpose of this command. If this character has a matching
-character, such as `\(' is a match for `\)', then the matching character is
+character, such as `(' is a match for `)', then the matching character is
also considered alphanumeric.
For convenience, in Lisp modes, `-' is considered alphanumeric.
With prefix argument, N, insert that many words.
This command must be bound to a mouse click.
The double-click action of the same mouse button must not be bound
-\(or it must be bound to the same function\).
+\(or it must be bound to the same function).
See `viper-surrounding-word' for the definition of a word in this case."
(interactive "e\nP")
(if viper-frame-of-focus ;; to handle clicks in another frame
viper-current-click-count
0))))
+(declare-function viper-forward-word "viper-cmd" (arg))
+(declare-function viper-adjust-window "viper-cmd" ())
(defun viper-mouse-click-search-word (click arg)
"Find the word clicked or double-clicked on. Word may be in another window.
With prefix argument, N, search for N-th occurrence.
This command must be bound to a mouse click. The double-click action of the
-same button must not be bound \(or it must be bound to the same function\).
+same button must not be bound \(or it must be bound to the same function).
See `viper-surrounding-word' for the details on what constitutes a word for
this command."
(interactive "e\nP")
(defcustom viper-mouse-search-key '(meta shift 1)
- "*Key used to click-search in Viper.
+ "Key used to click-search in Viper.
This must be a list that specifies the mouse button and modifiers.
The supported modifiers are `meta', `shift', and `control'.
For instance, `(meta shift 1)' means that holding the meta and shift
:group 'viper-mouse)
(defcustom viper-mouse-insert-key '(meta shift 2)
- "*Key used to click-insert in Viper.
+ "Key used to click-insert in Viper.
Must be a list that specifies the mouse button and modifiers.
The supported modifiers are `meta', `shift', and `control'.
For instance, `(meta shift 2)' means that holding the meta and shift keys