/[emacs]/emacs/lisp/mouse.el
ViewVC logotype

Diff of /emacs/lisp/mouse.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.241.2.8 by miles, Mon Oct 25 04:22:23 2004 UTC revision 1.241.2.9 by miles, Fri Oct 29 02:05:09 2004 UTC
# Line 1025  If MODE is 2 then do the same for lines. Line 1025  If MODE is 2 then do the same for lines.
1025    "List of keys which shall cause the mouse region to be deleted.")    "List of keys which shall cause the mouse region to be deleted.")
1026    
1027  (defun mouse-show-mark ()  (defun mouse-show-mark ()
1028    (if transient-mark-mode    (let ((inhibit-quit t)
1029        (delete-overlay mouse-drag-overlay)          (echo-keystrokes 0)
1030      (let ((inhibit-quit t)          event events key ignore
1031            (echo-keystrokes 0)          (x-lost-selection-functions
1032            event events key ignore           (if (boundp 'x-lost-selection-functions)
1033            x-lost-selection-hooks)               (copy-sequence x-lost-selection-functions))))
1034        (add-hook 'x-lost-selection-hooks      (add-hook 'x-lost-selection-hook
1035                  (lambda (seltype)                (lambda (seltype)
1036                    (if (eq seltype 'PRIMARY)                  (if (eq seltype 'PRIMARY)
1037                        (progn (setq ignore t)                      (progn (setq ignore t)
1038                               (throw 'mouse-show-mark t)))))                             (throw 'mouse-show-mark t)))))
1039        (move-overlay mouse-drag-overlay (point) (mark t))      (if transient-mark-mode
1040        (catch 'mouse-show-mark          (delete-overlay mouse-drag-overlay)
1041          ;; In this loop, execute scroll bar and switch-frame events.        (move-overlay mouse-drag-overlay (point) (mark t)))
1042          ;; Also ignore down-events that are undefined.      (catch 'mouse-show-mark
1043          (while (progn (setq event (read-event))        ;; In this loop, execute scroll bar and switch-frame events.
1044                        (setq events (append events (list event)))        ;; Also ignore down-events that are undefined.
1045                        (setq key (apply 'vector events))        (while (progn (setq event (read-event))
1046                        (or (and (consp event)                      (setq events (append events (list event)))
1047                                 (eq (car event) 'switch-frame))                      (setq key (apply 'vector events))
1048                            (and (consp event)                      (or (and (consp event)
1049                                 (eq (posn-point (event-end event))                               (eq (car event) 'switch-frame))
1050                                     'vertical-scroll-bar))                          (and (consp event)
1051                            (and (memq 'down (event-modifiers event))                               (eq (posn-point (event-end event))
1052                                 (not (key-binding key))                                   'vertical-scroll-bar))
1053                                 (not (mouse-undouble-last-event events))                          (and (memq 'down (event-modifiers event))
1054                                 (not (member key mouse-region-delete-keys)))))                               (not (key-binding key))
1055            (and (consp event)                               (not (mouse-undouble-last-event events))
1056                 (or (eq (car event) 'switch-frame)                               (not (member key mouse-region-delete-keys)))))
1057                     (eq (posn-point (event-end event))          (and (consp event)
1058                         'vertical-scroll-bar))               (or (eq (car event) 'switch-frame)
1059                 (let ((keys (vector 'vertical-scroll-bar event)))                   (eq (posn-point (event-end event))
1060                   (and (key-binding keys)                       'vertical-scroll-bar))
1061                        (progn               (let ((keys (vector 'vertical-scroll-bar event)))
1062                          (call-interactively (key-binding keys)                 (and (key-binding keys)
1063                                              nil keys)                      (progn
1064                          (setq events nil)))))))                        (call-interactively (key-binding keys)
1065        ;; If we lost the selection, just turn off the highlighting.                                            nil keys)
1066        (if ignore                        (setq events nil)))))))
1067            nil      ;; If we lost the selection, just turn off the highlighting.
1068          ;; For certain special keys, delete the region.      (if ignore
1069          (if (member key mouse-region-delete-keys)          nil
1070              (delete-region (overlay-start mouse-drag-overlay)        ;; For certain special keys, delete the region.
1071                             (overlay-end mouse-drag-overlay))        (if (member key mouse-region-delete-keys)
1072            ;; Otherwise, unread the key so it gets executed normally.            (delete-region (overlay-start mouse-drag-overlay)
1073            (setq unread-command-events                           (overlay-end mouse-drag-overlay))
1074                  (nconc events unread-command-events))))          ;; Otherwise, unread the key so it gets executed normally.
1075        (setq quit-flag nil)          (setq unread-command-events
1076                  (nconc events unread-command-events))))
1077        (setq quit-flag nil)
1078        (unless transient-mark-mode
1079        (delete-overlay mouse-drag-overlay))))        (delete-overlay mouse-drag-overlay))))
1080    
1081  (defun mouse-set-mark (click)  (defun mouse-set-mark (click)

Legend:
Removed from v.1.241.2.8  
changed lines
  Added in v.1.241.2.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26