comparison lisp/packages/mode-motion+.el @ 2:ac2d302a0011 r19-15b2

Import from CVS: tag r19-15b2
author cvs
date Mon, 13 Aug 2007 08:46:35 +0200
parents 376386a54a3c
children ec9a17fef872
comparison
equal deleted inserted replaced
1:c0c6a60d29db 2:ac2d302a0011
30 ;; of the maintainers accepts responsibility to anyone for the consequences of 30 ;; of the maintainers accepts responsibility to anyone for the consequences of
31 ;; using it or for whether it serves any particular purpose or works 31 ;; using it or for whether it serves any particular purpose or works
32 ;; at all. 32 ;; at all.
33 33
34 ; Change History 34 ; Change History
35 ; Revision 3.16 Fri Jun 28 13:01:12 1996 ritchier@msc.ie
36 ; Stop multiple highlighting lossage with 19.14 release.
37
35 ; Revision 3.15 Thu Feb 15 14:26:34 GMT 1996 Russell.Ritchie@gssec.bt.co.uk 38 ; Revision 3.15 Thu Feb 15 14:26:34 GMT 1996 Russell.Ritchie@gssec.bt.co.uk
36 ; lisp-interaction-popup-menu => lisp-interaction-mode-popup-menu, 39 ; lisp-interaction-popup-menu => lisp-interaction-mode-popup-menu,
37 ; emacs-lisp-popup-menu => emacs-lisp-mode-popup-menu. 40 ; emacs-lisp-popup-menu => emacs-lisp-mode-popup-menu.
38 41
39 ; Revision 3.14 Tue Nov 14 11:14:38 GMT 1995 Russell.Ritchie@gssec.bt.co.uk 42 ; Revision 3.14 Tue Nov 14 11:14:38 GMT 1995 Russell.Ritchie@gssec.bt.co.uk
243 ; - only two elisp files: mode-motion+.el, thing.el 246 ; - only two elisp files: mode-motion+.el, thing.el
244 ; 247 ;
245 248
246 (require 'thing) 249 (require 'thing)
247 (require 'mode-motion) 250 (require 'mode-motion)
248 (defconst mode-motion+-version "3.15") 251 (defconst mode-motion+-version "3.16")
249 252
250 ;;; This file defines a set of mouse motion handlers that do some 253 ;;; This file defines a set of mouse motion handlers that do some
251 ;;; highlighting of the text when the mouse moves over. 254 ;;; highlighting of the text when the mouse moves over.
252 ;;; An exhaustive list of the motion handlers defined in this file may be 255 ;;; An exhaustive list of the motion handlers defined in this file may be
253 ;;; obtained with M-x list-motion-handlers. 256 ;;; obtained with M-x list-motion-handlers.
1099 (unwind-protect 1102 (unwind-protect
1100 (progn 1103 (progn
1101 (and buffer 1104 (and buffer
1102 (set-buffer buffer) 1105 (set-buffer buffer)
1103 (select-window window)) 1106 (select-window window))
1104
1105 ;; kludge: if point = end-of-window, then probably the mouse
1106 ;; is actually between the last line and the modeline. In
1107 ;; this case move point to back one
1108 (and point
1109 (not (< point (window-end window)))
1110 (setq point (1- point)))
1111 ;; Create a new mode-motion-extent if there isn't one 1107 ;; Create a new mode-motion-extent if there isn't one
1112 ;; (or a destroyed one) 1108 ;; (or a destroyed one)
1113 (if (and (extent-live-p mode-motion-extent) 1109 (if (and (extent-live-p mode-motion-extent)
1114 (extent-buffer mode-motion-extent)) 1110 (extent-buffer mode-motion-extent))
1115 () 1111 ()
1160 ;; the region might be in reverse order. Stop in this case 1156 ;; the region might be in reverse order. Stop in this case
1161 (<= (car region) (cdr region))) 1157 (<= (car region) (cdr region)))
1162 (if (or (not (motion-handler-follow-point handler)) 1158 (if (or (not (motion-handler-follow-point handler))
1163 (pos-visible-in-window-p point)) 1159 (pos-visible-in-window-p point))
1164 (progn 1160 (progn
1165 ;; set the extent face 1161 (set-extent-endpoints
1162 mode-motion-extent (car region) (cdr region))
1166 (set-extent-face 1163 (set-extent-face
1167 mode-motion-extent (motion-handler-face handler)) 1164 mode-motion-extent (motion-handler-face handler))
1168 ;; set the new boundary
1169 (set-extent-endpoints
1170 mode-motion-extent (car region) (cdr region))
1171 ;; highlight if required
1172 (set-extent-property
1173 mode-motion-extent 'highlight
1174 (motion-handler-highlight handler))
1175 (highlight-extent mode-motion-extent
1176 (motion-handler-highlight handler))
1177 ;; make point follow the mouse or point to 1165 ;; make point follow the mouse or point to
1178 ;; the beginning of the line do not move the 1166 ;; the beginning of the line do not move the
1179 ;; cursor if a mark is set. 1167 ;; cursor if a mark is set.
1180 (cond ((and (motion-handler-follow-point handler) 1168 (cond ((and (motion-handler-follow-point handler)
1181 (not (mark))) 1169 (not (mark)))