/[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.228 by rms, Fri Nov 2 07:14:16 2001 UTC revision 1.229 by rms, Wed Nov 14 02:48:17 2001 UTC
# Line 953  If DIR is positive skip forward; if nega Line 953  If DIR is positive skip forward; if nega
953  (defun mouse-show-mark ()  (defun mouse-show-mark ()
954    (if transient-mark-mode    (if transient-mark-mode
955        (delete-overlay mouse-drag-overlay)        (delete-overlay mouse-drag-overlay)
956      (let ((inhibit-quit t)      (if (not (display-graphic-p))
957            (echo-keystrokes 0)          (save-excursion
958            event events key ignore            (goto-char (mark t))
959            x-lost-selection-hooks)            (sit-for 1))
960        (add-hook 'x-lost-selection-hooks        (let ((inhibit-quit t)
961                  (lambda (seltype)              (echo-keystrokes 0)
962                    (if (eq seltype 'PRIMARY)              event events key ignore
963                        (progn (setq ignore t)              x-lost-selection-hooks)
964                               (throw 'mouse-show-mark t)))))          (add-hook 'x-lost-selection-hooks
965        (move-overlay mouse-drag-overlay (point) (mark t))                    (lambda (seltype)
966        (catch 'mouse-show-mark                      (if (eq seltype 'PRIMARY)
967          ;; In this loop, execute scroll bar and switch-frame events.                          (progn (setq ignore t)
968          ;; Also ignore down-events that are undefined.                                 (throw 'mouse-show-mark t)))))
969          (while (progn (setq event (read-event))          (move-overlay mouse-drag-overlay (point) (mark t))
970                        (setq events (append events (list event)))          (catch 'mouse-show-mark
971                        (setq key (apply 'vector events))            ;; In this loop, execute scroll bar and switch-frame events.
972                        (or (and (consp event)            ;; Also ignore down-events that are undefined.
973                                 (eq (car event) 'switch-frame))            (while (progn (setq event (read-event))
974                            (and (consp event)                          (setq events (append events (list event)))
975                                 (eq (posn-point (event-end event))                          (setq key (apply 'vector events))
976                                     'vertical-scroll-bar))                          (or (and (consp event)
977                            (and (memq 'down (event-modifiers event))                                   (eq (car event) 'switch-frame))
978                                 (not (key-binding key))                              (and (consp event)
979                                 (not (mouse-undouble-last-event events))                                   (eq (posn-point (event-end event))
980                                 (not (member key mouse-region-delete-keys)))))                                       'vertical-scroll-bar))
981            (and (consp event)                              (and (memq 'down (event-modifiers event))
982                 (or (eq (car event) 'switch-frame)                                   (not (key-binding key))
983                     (eq (posn-point (event-end event))                                   (not (mouse-undouble-last-event events))
984                         'vertical-scroll-bar))                                   (not (member key mouse-region-delete-keys)))))
985                 (let ((keys (vector 'vertical-scroll-bar event)))              (and (consp event)
986                   (and (key-binding keys)                   (or (eq (car event) 'switch-frame)
987                        (progn                       (eq (posn-point (event-end event))
988                          (call-interactively (key-binding keys)                           'vertical-scroll-bar))
989                                              nil keys)                   (let ((keys (vector 'vertical-scroll-bar event)))
990                          (setq events nil)))))))                     (and (key-binding keys)
991        ;; If we lost the selection, just turn off the highlighting.                          (progn
992        (if ignore                            (call-interactively (key-binding keys)
993            nil                                                nil keys)
994          ;; For certain special keys, delete the region.                            (setq events nil)))))))
995          (if (member key mouse-region-delete-keys)          ;; If we lost the selection, just turn off the highlighting.
996              (delete-region (overlay-start mouse-drag-overlay)          (if ignore
997                             (overlay-end mouse-drag-overlay))              nil
998            ;; Otherwise, unread the key so it gets executed normally.            ;; For certain special keys, delete the region.
999            (setq unread-command-events            (if (member key mouse-region-delete-keys)
1000                  (nconc events unread-command-events))))                (delete-region (overlay-start mouse-drag-overlay)
1001        (setq quit-flag nil)                               (overlay-end mouse-drag-overlay))
1002        (delete-overlay mouse-drag-overlay))              ;; Otherwise, unread the key so it gets executed normally.
1003      (save-excursion              (setq unread-command-events
1004        (goto-char (mark t))                    (nconc events unread-command-events))))
1005        (sit-for 1))))          (setq quit-flag nil)
1006            (delete-overlay mouse-drag-overlay)))))
1007    
1008  (defun mouse-set-mark (click)  (defun mouse-set-mark (click)
1009    "Set mark at the position clicked on with the mouse.    "Set mark at the position clicked on with the mouse.
# Line 1606  and selects that window." Line 1607  and selects that window."
1607      (let ((buf (x-popup-menu event menu))      (let ((buf (x-popup-menu event menu))
1608            (window (posn-window (event-start event))))            (window (posn-window (event-start event))))
1609        (when buf        (when buf
1610              (or (framep window) (select-window window))          (select-window
1611             (if (framep window) (frame-selected-window window)
1612               window))
1613          (switch-to-buffer buf)))))          (switch-to-buffer buf)))))
1614    
1615  (defun mouse-buffer-menu-alist (buffers)  (defun mouse-buffer-menu-alist (buffers)

Legend:
Removed from v.1.228  
changed lines
  Added in v.1.229

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