diff options
| author | Sam Steingold | 2001-10-24 20:02:16 +0000 |
|---|---|---|
| committer | Sam Steingold | 2001-10-24 20:02:16 +0000 |
| commit | 7b611de008c3b46f1de1cba8bfd1637df9f6f7bb (patch) | |
| tree | e55b83ac10f1d7ea31296f6aa3b064ee39c7b476 | |
| parent | 7ea0f4315a9a3406526c63d5b05d3f54e98f17c4 (diff) | |
| download | emacs-7b611de008c3b46f1de1cba8bfd1637df9f6f7bb.tar.gz emacs-7b611de008c3b46f1de1cba8bfd1637df9f6f7bb.zip | |
(mouse-buffer-menu-mode-groups): Added "Version Control" group.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/mouse.el | 125 |
2 files changed, 68 insertions, 62 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 32d2f3b2cb8..2b48093c343 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2001-10-24 Sam Steingold <sds@gnu.org> | ||
| 2 | |||
| 3 | * mouse.el (mouse-buffer-menu-mode-groups): Added "Version | ||
| 4 | Control" group. | ||
| 5 | |||
| 1 | 2001-10-24 Martin Stjernholm <bug-cc-mode@gnu.org> | 6 | 2001-10-24 Martin Stjernholm <bug-cc-mode@gnu.org> |
| 2 | 7 | ||
| 3 | * progmodes/cc-engine.el (c-beginning-of-member-init-list): | 8 | * progmodes/cc-engine.el (c-beginning-of-member-init-list): |
diff --git a/lisp/mouse.el b/lisp/mouse.el index 93a374f3ff1..833b254049e 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -321,7 +321,7 @@ MODE-LINE-P non-nil means a mode line is dragged." | |||
| 321 | ;; we must select the window where the start event originated. | 321 | ;; we must select the window where the start event originated. |
| 322 | ;; unwind-protect will restore the old selected window later. | 322 | ;; unwind-protect will restore the old selected window later. |
| 323 | (select-window start-event-window) | 323 | (select-window start-event-window) |
| 324 | 324 | ||
| 325 | ;; if this is the bottommost ordinary window, then to | 325 | ;; if this is the bottommost ordinary window, then to |
| 326 | ;; move its modeline the minibuffer must be enlarged. | 326 | ;; move its modeline the minibuffer must be enlarged. |
| 327 | (setq should-enlarge-minibuffer | 327 | (setq should-enlarge-minibuffer |
| @@ -330,13 +330,13 @@ MODE-LINE-P non-nil means a mode line is dragged." | |||
| 330 | (not (one-window-p t)) | 330 | (not (one-window-p t)) |
| 331 | (= (nth 1 (window-edges minibuffer)) | 331 | (= (nth 1 (window-edges minibuffer)) |
| 332 | (nth 3 (window-edges))))) | 332 | (nth 3 (window-edges))))) |
| 333 | 333 | ||
| 334 | ;; loop reading events and sampling the position of | 334 | ;; loop reading events and sampling the position of |
| 335 | ;; the mouse. | 335 | ;; the mouse. |
| 336 | (while (not done) | 336 | (while (not done) |
| 337 | (setq event (read-event) | 337 | (setq event (read-event) |
| 338 | mouse (mouse-position)) | 338 | mouse (mouse-position)) |
| 339 | 339 | ||
| 340 | ;; do nothing if | 340 | ;; do nothing if |
| 341 | ;; - there is a switch-frame event. | 341 | ;; - there is a switch-frame event. |
| 342 | ;; - the mouse isn't in the frame that we started in | 342 | ;; - the mouse isn't in the frame that we started in |
| @@ -350,27 +350,27 @@ MODE-LINE-P non-nil means a mode line is dragged." | |||
| 350 | ;; unknown event. | 350 | ;; unknown event. |
| 351 | (cond ((integerp event) | 351 | (cond ((integerp event) |
| 352 | (setq done t)) | 352 | (setq done t)) |
| 353 | 353 | ||
| 354 | ((eq (car event) 'switch-frame) | 354 | ((eq (car event) 'switch-frame) |
| 355 | nil) | 355 | nil) |
| 356 | 356 | ||
| 357 | ((not (memq (car event) '(mouse-movement scroll-bar-movement))) | 357 | ((not (memq (car event) '(mouse-movement scroll-bar-movement))) |
| 358 | (when (consp event) | 358 | (when (consp event) |
| 359 | (push event unread-command-events)) | 359 | (push event unread-command-events)) |
| 360 | (setq done t)) | 360 | (setq done t)) |
| 361 | 361 | ||
| 362 | ((not (eq (car mouse) start-event-frame)) | 362 | ((not (eq (car mouse) start-event-frame)) |
| 363 | nil) | 363 | nil) |
| 364 | 364 | ||
| 365 | ((null (car (cdr mouse))) | 365 | ((null (car (cdr mouse))) |
| 366 | nil) | 366 | nil) |
| 367 | 367 | ||
| 368 | (t | 368 | (t |
| 369 | (setq y (cdr (cdr mouse)) | 369 | (setq y (cdr (cdr mouse)) |
| 370 | edges (window-edges) | 370 | edges (window-edges) |
| 371 | top (nth 1 edges) | 371 | top (nth 1 edges) |
| 372 | bot (nth 3 edges)) | 372 | bot (nth 3 edges)) |
| 373 | 373 | ||
| 374 | ;; compute size change needed | 374 | ;; compute size change needed |
| 375 | (cond (mode-line-p | 375 | (cond (mode-line-p |
| 376 | ;; Scale back a move that would make the | 376 | ;; Scale back a move that would make the |
| @@ -384,13 +384,13 @@ MODE-LINE-P non-nil means a mode line is dragged." | |||
| 384 | ;; The window's top includes the header line! | 384 | ;; The window's top includes the header line! |
| 385 | (setq growth (- top y)))) | 385 | (setq growth (- top y)))) |
| 386 | (setq wconfig (current-window-configuration)) | 386 | (setq wconfig (current-window-configuration)) |
| 387 | 387 | ||
| 388 | ;; Check for an error case. | 388 | ;; Check for an error case. |
| 389 | (when (and (/= growth 0) | 389 | (when (and (/= growth 0) |
| 390 | (not minibuffer) | 390 | (not minibuffer) |
| 391 | (one-window-p t)) | 391 | (one-window-p t)) |
| 392 | (error "Attempt to resize sole window")) | 392 | (error "Attempt to resize sole window")) |
| 393 | 393 | ||
| 394 | ;; grow/shrink minibuffer? | 394 | ;; grow/shrink minibuffer? |
| 395 | (if should-enlarge-minibuffer | 395 | (if should-enlarge-minibuffer |
| 396 | (progn | 396 | (progn |
| @@ -411,7 +411,7 @@ MODE-LINE-P non-nil means a mode line is dragged." | |||
| 411 | ;; no. grow/shrink the selected window | 411 | ;; no. grow/shrink the selected window |
| 412 | ;(message "growth = %d" growth) | 412 | ;(message "growth = %d" growth) |
| 413 | (enlarge-window growth)) | 413 | (enlarge-window growth)) |
| 414 | 414 | ||
| 415 | ;; if this window's growth caused another | 415 | ;; if this window's growth caused another |
| 416 | ;; window to be deleted because it was too | 416 | ;; window to be deleted because it was too |
| 417 | ;; short, rescind the change. | 417 | ;; short, rescind the change. |
| @@ -792,7 +792,7 @@ remains active. Otherwise, it remains until the next input event." | |||
| 792 | (mouse-show-mark) | 792 | (mouse-show-mark) |
| 793 | ;; mouse-show-mark can call read-event, | 793 | ;; mouse-show-mark can call read-event, |
| 794 | ;; and that means the Emacs server could switch buffers | 794 | ;; and that means the Emacs server could switch buffers |
| 795 | ;; under us. If that happened, | 795 | ;; under us. If that happened, |
| 796 | ;; avoid trying to use the region. | 796 | ;; avoid trying to use the region. |
| 797 | (and (mark t) mark-active | 797 | (and (mark t) mark-active |
| 798 | (eq buffer (current-buffer)) | 798 | (eq buffer (current-buffer)) |
| @@ -864,7 +864,7 @@ If DIR is positive skip forward; if negative, skip backward." | |||
| 864 | (= start end) | 864 | (= start end) |
| 865 | (char-after start) | 865 | (char-after start) |
| 866 | (= (char-syntax (char-after start)) ?\))) | 866 | (= (char-syntax (char-after start)) ?\))) |
| 867 | (list (save-excursion | 867 | (list (save-excursion |
| 868 | (goto-char (1+ start)) | 868 | (goto-char (1+ start)) |
| 869 | (backward-sexp 1) | 869 | (backward-sexp 1) |
| 870 | (point)) | 870 | (point)) |
| @@ -881,7 +881,7 @@ If DIR is positive skip forward; if negative, skip backward." | |||
| 881 | (list start | 881 | (list start |
| 882 | (save-excursion | 882 | (save-excursion |
| 883 | (condition-case nil | 883 | (condition-case nil |
| 884 | (progn | 884 | (progn |
| 885 | (goto-char start) | 885 | (goto-char start) |
| 886 | (forward-sexp 1) | 886 | (forward-sexp 1) |
| 887 | (point)) | 887 | (point)) |
| @@ -943,7 +943,7 @@ If DIR is positive skip forward; if negative, skip backward." | |||
| 943 | (setcar last event) | 943 | (setcar last event) |
| 944 | nil))) | 944 | nil))) |
| 945 | 945 | ||
| 946 | ;; Momentarily show where the mark is, if highlighting doesn't show it. | 946 | ;; Momentarily show where the mark is, if highlighting doesn't show it. |
| 947 | 947 | ||
| 948 | (defvar mouse-region-delete-keys '([delete]) | 948 | (defvar mouse-region-delete-keys '([delete]) |
| 949 | "List of keys which shall cause the mouse region to be deleted.") | 949 | "List of keys which shall cause the mouse region to be deleted.") |
| @@ -1106,7 +1106,7 @@ which prepares for a second click to delete the text. | |||
| 1106 | If you have selected words or lines, this command extends the | 1106 | If you have selected words or lines, this command extends the |
| 1107 | selection through the word or line clicked on. If you do this | 1107 | selection through the word or line clicked on. If you do this |
| 1108 | again in a different position, it extends the selection again. | 1108 | again in a different position, it extends the selection again. |
| 1109 | If you do this twice in the same position, the selection is killed." | 1109 | If you do this twice in the same position, the selection is killed." |
| 1110 | (interactive "e") | 1110 | (interactive "e") |
| 1111 | (let ((before-scroll | 1111 | (let ((before-scroll |
| 1112 | (with-current-buffer (window-buffer (posn-window (event-start click))) | 1112 | (with-current-buffer (window-buffer (posn-window (event-start click))) |
| @@ -1120,7 +1120,7 @@ If you do this twice in the same position, the selection is killed." | |||
| 1120 | (set-buffer (window-buffer (posn-window (event-start click)))) | 1120 | (set-buffer (window-buffer (posn-window (event-start click)))) |
| 1121 | (and (mark t) (> (mod mouse-selection-click-count 3) 0) | 1121 | (and (mark t) (> (mod mouse-selection-click-count 3) 0) |
| 1122 | ;; Don't be fooled by a recent click in some other buffer. | 1122 | ;; Don't be fooled by a recent click in some other buffer. |
| 1123 | (eq mouse-selection-click-count-buffer | 1123 | (eq mouse-selection-click-count-buffer |
| 1124 | (current-buffer))))) | 1124 | (current-buffer))))) |
| 1125 | (if (not (and (eq last-command 'mouse-save-then-kill) | 1125 | (if (not (and (eq last-command 'mouse-save-then-kill) |
| 1126 | (equal click-posn | 1126 | (equal click-posn |
| @@ -1461,7 +1461,7 @@ again. If you do this twice in the same position, it kills the selection." | |||
| 1461 | click-posn)) | 1461 | click-posn)) |
| 1462 | (setq deactivate-mark nil))) | 1462 | (setq deactivate-mark nil))) |
| 1463 | (if (eq last-command 'mouse-secondary-save-then-kill) | 1463 | (if (eq last-command 'mouse-secondary-save-then-kill) |
| 1464 | ;; If the front of the kill ring comes from | 1464 | ;; If the front of the kill ring comes from |
| 1465 | ;; an immediately previous use of this command, | 1465 | ;; an immediately previous use of this command, |
| 1466 | ;; replace it with the extended region. | 1466 | ;; replace it with the extended region. |
| 1467 | ;; (It would be annoying to make a separate entry.) | 1467 | ;; (It would be annoying to make a separate entry.) |
| @@ -1514,6 +1514,7 @@ a large number if you prefer a mixed multitude. The default is 4." | |||
| 1514 | ("ObjC" . "C") | 1514 | ("ObjC" . "C") |
| 1515 | ("Text" . "Text") | 1515 | ("Text" . "Text") |
| 1516 | ("Outline" . "Text") | 1516 | ("Outline" . "Text") |
| 1517 | ("\\(log\\|diff\\|vc\\|cvs\\)" . "Version Control") ; "Change Management"? | ||
| 1517 | ("Lisp" . "Lisp")) | 1518 | ("Lisp" . "Lisp")) |
| 1518 | "How to group various major modes together in \\[mouse-buffer-menu]. | 1519 | "How to group various major modes together in \\[mouse-buffer-menu]. |
| 1519 | Each element has the form (REGEXP . GROUPNAME). | 1520 | Each element has the form (REGEXP . GROUPNAME). |
| @@ -1634,7 +1635,7 @@ and selects that window." | |||
| 1634 | (save-excursion | 1635 | (save-excursion |
| 1635 | (set-buffer elt) | 1636 | (set-buffer elt) |
| 1636 | (if buffer-read-only "%" " ")) | 1637 | (if buffer-read-only "%" " ")) |
| 1637 | (or (buffer-file-name elt) | 1638 | (or (buffer-file-name elt) |
| 1638 | (save-excursion | 1639 | (save-excursion |
| 1639 | (set-buffer elt) | 1640 | (set-buffer elt) |
| 1640 | (if list-buffers-directory | 1641 | (if list-buffers-directory |
| @@ -1671,27 +1672,27 @@ and selects that window." | |||
| 1671 | ;;; These need to be rewritten for the new scroll bar implementation. | 1672 | ;;; These need to be rewritten for the new scroll bar implementation. |
| 1672 | 1673 | ||
| 1673 | ;;;!! ;; Commands for the scroll bar. | 1674 | ;;;!! ;; Commands for the scroll bar. |
| 1674 | ;;;!! | 1675 | ;;;!! |
| 1675 | ;;;!! (defun mouse-scroll-down (click) | 1676 | ;;;!! (defun mouse-scroll-down (click) |
| 1676 | ;;;!! (interactive "@e") | 1677 | ;;;!! (interactive "@e") |
| 1677 | ;;;!! (scroll-down (1+ (cdr (mouse-coords click))))) | 1678 | ;;;!! (scroll-down (1+ (cdr (mouse-coords click))))) |
| 1678 | ;;;!! | 1679 | ;;;!! |
| 1679 | ;;;!! (defun mouse-scroll-up (click) | 1680 | ;;;!! (defun mouse-scroll-up (click) |
| 1680 | ;;;!! (interactive "@e") | 1681 | ;;;!! (interactive "@e") |
| 1681 | ;;;!! (scroll-up (1+ (cdr (mouse-coords click))))) | 1682 | ;;;!! (scroll-up (1+ (cdr (mouse-coords click))))) |
| 1682 | ;;;!! | 1683 | ;;;!! |
| 1683 | ;;;!! (defun mouse-scroll-down-full () | 1684 | ;;;!! (defun mouse-scroll-down-full () |
| 1684 | ;;;!! (interactive "@") | 1685 | ;;;!! (interactive "@") |
| 1685 | ;;;!! (scroll-down nil)) | 1686 | ;;;!! (scroll-down nil)) |
| 1686 | ;;;!! | 1687 | ;;;!! |
| 1687 | ;;;!! (defun mouse-scroll-up-full () | 1688 | ;;;!! (defun mouse-scroll-up-full () |
| 1688 | ;;;!! (interactive "@") | 1689 | ;;;!! (interactive "@") |
| 1689 | ;;;!! (scroll-up nil)) | 1690 | ;;;!! (scroll-up nil)) |
| 1690 | ;;;!! | 1691 | ;;;!! |
| 1691 | ;;;!! (defun mouse-scroll-move-cursor (click) | 1692 | ;;;!! (defun mouse-scroll-move-cursor (click) |
| 1692 | ;;;!! (interactive "@e") | 1693 | ;;;!! (interactive "@e") |
| 1693 | ;;;!! (move-to-window-line (1+ (cdr (mouse-coords click))))) | 1694 | ;;;!! (move-to-window-line (1+ (cdr (mouse-coords click))))) |
| 1694 | ;;;!! | 1695 | ;;;!! |
| 1695 | ;;;!! (defun mouse-scroll-absolute (event) | 1696 | ;;;!! (defun mouse-scroll-absolute (event) |
| 1696 | ;;;!! (interactive "@e") | 1697 | ;;;!! (interactive "@e") |
| 1697 | ;;;!! (let* ((pos (car event)) | 1698 | ;;;!! (let* ((pos (car event)) |
| @@ -1705,70 +1706,70 @@ and selects that window." | |||
| 1705 | ;;;!! scale-factor))) | 1706 | ;;;!! scale-factor))) |
| 1706 | ;;;!! (goto-char newpos) | 1707 | ;;;!! (goto-char newpos) |
| 1707 | ;;;!! (recenter '(4))))) | 1708 | ;;;!! (recenter '(4))))) |
| 1708 | ;;;!! | 1709 | ;;;!! |
| 1709 | ;;;!! (defun mouse-scroll-left (click) | 1710 | ;;;!! (defun mouse-scroll-left (click) |
| 1710 | ;;;!! (interactive "@e") | 1711 | ;;;!! (interactive "@e") |
| 1711 | ;;;!! (scroll-left (1+ (car (mouse-coords click))))) | 1712 | ;;;!! (scroll-left (1+ (car (mouse-coords click))))) |
| 1712 | ;;;!! | 1713 | ;;;!! |
| 1713 | ;;;!! (defun mouse-scroll-right (click) | 1714 | ;;;!! (defun mouse-scroll-right (click) |
| 1714 | ;;;!! (interactive "@e") | 1715 | ;;;!! (interactive "@e") |
| 1715 | ;;;!! (scroll-right (1+ (car (mouse-coords click))))) | 1716 | ;;;!! (scroll-right (1+ (car (mouse-coords click))))) |
| 1716 | ;;;!! | 1717 | ;;;!! |
| 1717 | ;;;!! (defun mouse-scroll-left-full () | 1718 | ;;;!! (defun mouse-scroll-left-full () |
| 1718 | ;;;!! (interactive "@") | 1719 | ;;;!! (interactive "@") |
| 1719 | ;;;!! (scroll-left nil)) | 1720 | ;;;!! (scroll-left nil)) |
| 1720 | ;;;!! | 1721 | ;;;!! |
| 1721 | ;;;!! (defun mouse-scroll-right-full () | 1722 | ;;;!! (defun mouse-scroll-right-full () |
| 1722 | ;;;!! (interactive "@") | 1723 | ;;;!! (interactive "@") |
| 1723 | ;;;!! (scroll-right nil)) | 1724 | ;;;!! (scroll-right nil)) |
| 1724 | ;;;!! | 1725 | ;;;!! |
| 1725 | ;;;!! (defun mouse-scroll-move-cursor-horizontally (click) | 1726 | ;;;!! (defun mouse-scroll-move-cursor-horizontally (click) |
| 1726 | ;;;!! (interactive "@e") | 1727 | ;;;!! (interactive "@e") |
| 1727 | ;;;!! (move-to-column (1+ (car (mouse-coords click))))) | 1728 | ;;;!! (move-to-column (1+ (car (mouse-coords click))))) |
| 1728 | ;;;!! | 1729 | ;;;!! |
| 1729 | ;;;!! (defun mouse-scroll-absolute-horizontally (event) | 1730 | ;;;!! (defun mouse-scroll-absolute-horizontally (event) |
| 1730 | ;;;!! (interactive "@e") | 1731 | ;;;!! (interactive "@e") |
| 1731 | ;;;!! (let* ((pos (car event)) | 1732 | ;;;!! (let* ((pos (car event)) |
| 1732 | ;;;!! (position (car pos)) | 1733 | ;;;!! (position (car pos)) |
| 1733 | ;;;!! (length (car (cdr pos)))) | 1734 | ;;;!! (length (car (cdr pos)))) |
| 1734 | ;;;!! (set-window-hscroll (selected-window) 33))) | 1735 | ;;;!! (set-window-hscroll (selected-window) 33))) |
| 1735 | ;;;!! | 1736 | ;;;!! |
| 1736 | ;;;!! (global-set-key [scroll-bar mouse-1] 'mouse-scroll-up) | 1737 | ;;;!! (global-set-key [scroll-bar mouse-1] 'mouse-scroll-up) |
| 1737 | ;;;!! (global-set-key [scroll-bar mouse-2] 'mouse-scroll-absolute) | 1738 | ;;;!! (global-set-key [scroll-bar mouse-2] 'mouse-scroll-absolute) |
| 1738 | ;;;!! (global-set-key [scroll-bar mouse-3] 'mouse-scroll-down) | 1739 | ;;;!! (global-set-key [scroll-bar mouse-3] 'mouse-scroll-down) |
| 1739 | ;;;!! | 1740 | ;;;!! |
| 1740 | ;;;!! (global-set-key [vertical-slider mouse-1] 'mouse-scroll-move-cursor) | 1741 | ;;;!! (global-set-key [vertical-slider mouse-1] 'mouse-scroll-move-cursor) |
| 1741 | ;;;!! (global-set-key [vertical-slider mouse-2] 'mouse-scroll-move-cursor) | 1742 | ;;;!! (global-set-key [vertical-slider mouse-2] 'mouse-scroll-move-cursor) |
| 1742 | ;;;!! (global-set-key [vertical-slider mouse-3] 'mouse-scroll-move-cursor) | 1743 | ;;;!! (global-set-key [vertical-slider mouse-3] 'mouse-scroll-move-cursor) |
| 1743 | ;;;!! | 1744 | ;;;!! |
| 1744 | ;;;!! (global-set-key [thumbup mouse-1] 'mouse-scroll-up-full) | 1745 | ;;;!! (global-set-key [thumbup mouse-1] 'mouse-scroll-up-full) |
| 1745 | ;;;!! (global-set-key [thumbup mouse-2] 'mouse-scroll-up-full) | 1746 | ;;;!! (global-set-key [thumbup mouse-2] 'mouse-scroll-up-full) |
| 1746 | ;;;!! (global-set-key [thumbup mouse-3] 'mouse-scroll-up-full) | 1747 | ;;;!! (global-set-key [thumbup mouse-3] 'mouse-scroll-up-full) |
| 1747 | ;;;!! | 1748 | ;;;!! |
| 1748 | ;;;!! (global-set-key [thumbdown mouse-1] 'mouse-scroll-down-full) | 1749 | ;;;!! (global-set-key [thumbdown mouse-1] 'mouse-scroll-down-full) |
| 1749 | ;;;!! (global-set-key [thumbdown mouse-2] 'mouse-scroll-down-full) | 1750 | ;;;!! (global-set-key [thumbdown mouse-2] 'mouse-scroll-down-full) |
| 1750 | ;;;!! (global-set-key [thumbdown mouse-3] 'mouse-scroll-down-full) | 1751 | ;;;!! (global-set-key [thumbdown mouse-3] 'mouse-scroll-down-full) |
| 1751 | ;;;!! | 1752 | ;;;!! |
| 1752 | ;;;!! (global-set-key [horizontal-scroll-bar mouse-1] 'mouse-scroll-left) | 1753 | ;;;!! (global-set-key [horizontal-scroll-bar mouse-1] 'mouse-scroll-left) |
| 1753 | ;;;!! (global-set-key [horizontal-scroll-bar mouse-2] | 1754 | ;;;!! (global-set-key [horizontal-scroll-bar mouse-2] |
| 1754 | ;;;!! 'mouse-scroll-absolute-horizontally) | 1755 | ;;;!! 'mouse-scroll-absolute-horizontally) |
| 1755 | ;;;!! (global-set-key [horizontal-scroll-bar mouse-3] 'mouse-scroll-right) | 1756 | ;;;!! (global-set-key [horizontal-scroll-bar mouse-3] 'mouse-scroll-right) |
| 1756 | ;;;!! | 1757 | ;;;!! |
| 1757 | ;;;!! (global-set-key [horizontal-slider mouse-1] | 1758 | ;;;!! (global-set-key [horizontal-slider mouse-1] |
| 1758 | ;;;!! 'mouse-scroll-move-cursor-horizontally) | 1759 | ;;;!! 'mouse-scroll-move-cursor-horizontally) |
| 1759 | ;;;!! (global-set-key [horizontal-slider mouse-2] | 1760 | ;;;!! (global-set-key [horizontal-slider mouse-2] |
| 1760 | ;;;!! 'mouse-scroll-move-cursor-horizontally) | 1761 | ;;;!! 'mouse-scroll-move-cursor-horizontally) |
| 1761 | ;;;!! (global-set-key [horizontal-slider mouse-3] | 1762 | ;;;!! (global-set-key [horizontal-slider mouse-3] |
| 1762 | ;;;!! 'mouse-scroll-move-cursor-horizontally) | 1763 | ;;;!! 'mouse-scroll-move-cursor-horizontally) |
| 1763 | ;;;!! | 1764 | ;;;!! |
| 1764 | ;;;!! (global-set-key [thumbleft mouse-1] 'mouse-scroll-left-full) | 1765 | ;;;!! (global-set-key [thumbleft mouse-1] 'mouse-scroll-left-full) |
| 1765 | ;;;!! (global-set-key [thumbleft mouse-2] 'mouse-scroll-left-full) | 1766 | ;;;!! (global-set-key [thumbleft mouse-2] 'mouse-scroll-left-full) |
| 1766 | ;;;!! (global-set-key [thumbleft mouse-3] 'mouse-scroll-left-full) | 1767 | ;;;!! (global-set-key [thumbleft mouse-3] 'mouse-scroll-left-full) |
| 1767 | ;;;!! | 1768 | ;;;!! |
| 1768 | ;;;!! (global-set-key [thumbright mouse-1] 'mouse-scroll-right-full) | 1769 | ;;;!! (global-set-key [thumbright mouse-1] 'mouse-scroll-right-full) |
| 1769 | ;;;!! (global-set-key [thumbright mouse-2] 'mouse-scroll-right-full) | 1770 | ;;;!! (global-set-key [thumbright mouse-2] 'mouse-scroll-right-full) |
| 1770 | ;;;!! (global-set-key [thumbright mouse-3] 'mouse-scroll-right-full) | 1771 | ;;;!! (global-set-key [thumbright mouse-3] 'mouse-scroll-right-full) |
| 1771 | ;;;!! | 1772 | ;;;!! |
| 1772 | ;;;!! (global-set-key [horizontal-scroll-bar S-mouse-2] | 1773 | ;;;!! (global-set-key [horizontal-scroll-bar S-mouse-2] |
| 1773 | ;;;!! 'mouse-split-window-horizontally) | 1774 | ;;;!! 'mouse-split-window-horizontally) |
| 1774 | ;;;!! (global-set-key [mode-line S-mouse-2] | 1775 | ;;;!! (global-set-key [mode-line S-mouse-2] |
| @@ -1800,7 +1801,7 @@ and selects that window." | |||
| 1800 | ;;;!! ;; (car relative-coordinate) | 1801 | ;;;!! ;; (car relative-coordinate) |
| 1801 | ;;;!! ;; (car (cdr relative-coordinate))) | 1802 | ;;;!! ;; (car (cdr relative-coordinate))) |
| 1802 | ;;;!! ;; (message "mouse: [%d %d]" abs-x abs-y))))) | 1803 | ;;;!! ;; (message "mouse: [%d %d]" abs-x abs-y))))) |
| 1803 | ;;;!! | 1804 | ;;;!! |
| 1804 | ;;;!! ;; | 1805 | ;;;!! ;; |
| 1805 | ;;;!! ;; Dynamically put a box around the line indicated by point | 1806 | ;;;!! ;; Dynamically put a box around the line indicated by point |
| 1806 | ;;;!! ;; | 1807 | ;;;!! ;; |
| @@ -1872,20 +1873,20 @@ and selects that window." | |||
| 1872 | ;;;!! ;; (progn | 1873 | ;;;!! ;; (progn |
| 1873 | ;;;!! ;; (x-erase-rectangle (selected-screen)) | 1874 | ;;;!! ;; (x-erase-rectangle (selected-screen)) |
| 1874 | ;;;!! ;; (setq last-line-drawn nil)))) | 1875 | ;;;!! ;; (setq last-line-drawn nil)))) |
| 1875 | ;;;!! | 1876 | ;;;!! |
| 1876 | ;;;!! ;;; (defun test-x-rectangle () | 1877 | ;;;!! ;;; (defun test-x-rectangle () |
| 1877 | ;;;!! ;;; (use-local-mouse-map (setq rectangle-test-map (make-sparse-keymap))) | 1878 | ;;;!! ;;; (use-local-mouse-map (setq rectangle-test-map (make-sparse-keymap))) |
| 1878 | ;;;!! ;;; (define-key rectangle-test-map mouse-motion-button-left 'mouse-boxing) | 1879 | ;;;!! ;;; (define-key rectangle-test-map mouse-motion-button-left 'mouse-boxing) |
| 1879 | ;;;!! ;;; (define-key rectangle-test-map mouse-button-left-up 'mouse-erase-box)) | 1880 | ;;;!! ;;; (define-key rectangle-test-map mouse-button-left-up 'mouse-erase-box)) |
| 1880 | ;;;!! | 1881 | ;;;!! |
| 1881 | ;;;!! ;; | 1882 | ;;;!! ;; |
| 1882 | ;;;!! ;; Here is how to do double clicking in lisp. About to change. | 1883 | ;;;!! ;; Here is how to do double clicking in lisp. About to change. |
| 1883 | ;;;!! ;; | 1884 | ;;;!! ;; |
| 1884 | ;;;!! | 1885 | ;;;!! |
| 1885 | ;;;!! (defvar double-start nil) | 1886 | ;;;!! (defvar double-start nil) |
| 1886 | ;;;!! (defconst double-click-interval 300 | 1887 | ;;;!! (defconst double-click-interval 300 |
| 1887 | ;;;!! "Max ticks between clicks") | 1888 | ;;;!! "Max ticks between clicks") |
| 1888 | ;;;!! | 1889 | ;;;!! |
| 1889 | ;;;!! (defun double-down (event) | 1890 | ;;;!! (defun double-down (event) |
| 1890 | ;;;!! (interactive "@e") | 1891 | ;;;!! (interactive "@e") |
| 1891 | ;;;!! (if double-start | 1892 | ;;;!! (if double-start |
| @@ -1897,58 +1898,58 @@ and selects that window." | |||
| 1897 | ;;;!! (sleep-for 1))) | 1898 | ;;;!! (sleep-for 1))) |
| 1898 | ;;;!! (setq double-start nil)) | 1899 | ;;;!! (setq double-start nil)) |
| 1899 | ;;;!! (setq double-start (nth 4 event)))) | 1900 | ;;;!! (setq double-start (nth 4 event)))) |
| 1900 | ;;;!! | 1901 | ;;;!! |
| 1901 | ;;;!! (defun double-up (event) | 1902 | ;;;!! (defun double-up (event) |
| 1902 | ;;;!! (interactive "@e") | 1903 | ;;;!! (interactive "@e") |
| 1903 | ;;;!! (and double-start | 1904 | ;;;!! (and double-start |
| 1904 | ;;;!! (> (- (nth 4 event ) double-start) double-click-interval) | 1905 | ;;;!! (> (- (nth 4 event ) double-start) double-click-interval) |
| 1905 | ;;;!! (setq double-start nil))) | 1906 | ;;;!! (setq double-start nil))) |
| 1906 | ;;;!! | 1907 | ;;;!! |
| 1907 | ;;;!! ;;; (defun x-test-doubleclick () | 1908 | ;;;!! ;;; (defun x-test-doubleclick () |
| 1908 | ;;;!! ;;; (use-local-mouse-map (setq doubleclick-test-map (make-sparse-keymap))) | 1909 | ;;;!! ;;; (use-local-mouse-map (setq doubleclick-test-map (make-sparse-keymap))) |
| 1909 | ;;;!! ;;; (define-key doubleclick-test-map mouse-button-left 'double-down) | 1910 | ;;;!! ;;; (define-key doubleclick-test-map mouse-button-left 'double-down) |
| 1910 | ;;;!! ;;; (define-key doubleclick-test-map mouse-button-left-up 'double-up)) | 1911 | ;;;!! ;;; (define-key doubleclick-test-map mouse-button-left-up 'double-up)) |
| 1911 | ;;;!! | 1912 | ;;;!! |
| 1912 | ;;;!! ;; | 1913 | ;;;!! ;; |
| 1913 | ;;;!! ;; This scrolls while button is depressed. Use preferable in scroll bar. | 1914 | ;;;!! ;; This scrolls while button is depressed. Use preferable in scroll bar. |
| 1914 | ;;;!! ;; | 1915 | ;;;!! ;; |
| 1915 | ;;;!! | 1916 | ;;;!! |
| 1916 | ;;;!! (defvar scrolled-lines 0) | 1917 | ;;;!! (defvar scrolled-lines 0) |
| 1917 | ;;;!! (defconst scroll-speed 1) | 1918 | ;;;!! (defconst scroll-speed 1) |
| 1918 | ;;;!! | 1919 | ;;;!! |
| 1919 | ;;;!! (defun incr-scroll-down (event) | 1920 | ;;;!! (defun incr-scroll-down (event) |
| 1920 | ;;;!! (interactive "@e") | 1921 | ;;;!! (interactive "@e") |
| 1921 | ;;;!! (setq scrolled-lines 0) | 1922 | ;;;!! (setq scrolled-lines 0) |
| 1922 | ;;;!! (incremental-scroll scroll-speed)) | 1923 | ;;;!! (incremental-scroll scroll-speed)) |
| 1923 | ;;;!! | 1924 | ;;;!! |
| 1924 | ;;;!! (defun incr-scroll-up (event) | 1925 | ;;;!! (defun incr-scroll-up (event) |
| 1925 | ;;;!! (interactive "@e") | 1926 | ;;;!! (interactive "@e") |
| 1926 | ;;;!! (setq scrolled-lines 0) | 1927 | ;;;!! (setq scrolled-lines 0) |
| 1927 | ;;;!! (incremental-scroll (- scroll-speed))) | 1928 | ;;;!! (incremental-scroll (- scroll-speed))) |
| 1928 | ;;;!! | 1929 | ;;;!! |
| 1929 | ;;;!! (defun incremental-scroll (n) | 1930 | ;;;!! (defun incremental-scroll (n) |
| 1930 | ;;;!! (while (= (x-mouse-events) 0) | 1931 | ;;;!! (while (= (x-mouse-events) 0) |
| 1931 | ;;;!! (setq scrolled-lines (1+ (* scroll-speed scrolled-lines))) | 1932 | ;;;!! (setq scrolled-lines (1+ (* scroll-speed scrolled-lines))) |
| 1932 | ;;;!! (scroll-down n) | 1933 | ;;;!! (scroll-down n) |
| 1933 | ;;;!! (sit-for 300 t))) | 1934 | ;;;!! (sit-for 300 t))) |
| 1934 | ;;;!! | 1935 | ;;;!! |
| 1935 | ;;;!! (defun incr-scroll-stop (event) | 1936 | ;;;!! (defun incr-scroll-stop (event) |
| 1936 | ;;;!! (interactive "@e") | 1937 | ;;;!! (interactive "@e") |
| 1937 | ;;;!! (message "Scrolled %d lines" scrolled-lines) | 1938 | ;;;!! (message "Scrolled %d lines" scrolled-lines) |
| 1938 | ;;;!! (setq scrolled-lines 0) | 1939 | ;;;!! (setq scrolled-lines 0) |
| 1939 | ;;;!! (sleep-for 1)) | 1940 | ;;;!! (sleep-for 1)) |
| 1940 | ;;;!! | 1941 | ;;;!! |
| 1941 | ;;;!! ;;; (defun x-testing-scroll () | 1942 | ;;;!! ;;; (defun x-testing-scroll () |
| 1942 | ;;;!! ;;; (let ((scrolling-map (function mouse-vertical-scroll-bar-prefix))) | 1943 | ;;;!! ;;; (let ((scrolling-map (function mouse-vertical-scroll-bar-prefix))) |
| 1943 | ;;;!! ;;; (define-key scrolling-map mouse-button-left 'incr-scroll-down) | 1944 | ;;;!! ;;; (define-key scrolling-map mouse-button-left 'incr-scroll-down) |
| 1944 | ;;;!! ;;; (define-key scrolling-map mouse-button-right 'incr-scroll-up) | 1945 | ;;;!! ;;; (define-key scrolling-map mouse-button-right 'incr-scroll-up) |
| 1945 | ;;;!! ;;; (define-key scrolling-map mouse-button-left-up 'incr-scroll-stop) | 1946 | ;;;!! ;;; (define-key scrolling-map mouse-button-left-up 'incr-scroll-stop) |
| 1946 | ;;;!! ;;; (define-key scrolling-map mouse-button-right-up 'incr-scroll-stop))) | 1947 | ;;;!! ;;; (define-key scrolling-map mouse-button-right-up 'incr-scroll-stop))) |
| 1947 | ;;;!! | 1948 | ;;;!! |
| 1948 | ;;;!! ;; | 1949 | ;;;!! ;; |
| 1949 | ;;;!! ;; Some playthings suitable for picture mode? They need work. | 1950 | ;;;!! ;; Some playthings suitable for picture mode? They need work. |
| 1950 | ;;;!! ;; | 1951 | ;;;!! ;; |
| 1951 | ;;;!! | 1952 | ;;;!! |
| 1952 | ;;;!! (defun mouse-kill-rectangle (event) | 1953 | ;;;!! (defun mouse-kill-rectangle (event) |
| 1953 | ;;;!! "Kill the rectangle between point and the mouse cursor." | 1954 | ;;;!! "Kill the rectangle between point and the mouse cursor." |
| 1954 | ;;;!! (interactive "@e") | 1955 | ;;;!! (interactive "@e") |
| @@ -1959,7 +1960,7 @@ and selects that window." | |||
| 1959 | ;;;!! (if (> point-save (point)) | 1960 | ;;;!! (if (> point-save (point)) |
| 1960 | ;;;!! (kill-rectangle (point) point-save) | 1961 | ;;;!! (kill-rectangle (point) point-save) |
| 1961 | ;;;!! (kill-rectangle point-save (point)))))) | 1962 | ;;;!! (kill-rectangle point-save (point)))))) |
| 1962 | ;;;!! | 1963 | ;;;!! |
| 1963 | ;;;!! (defun mouse-open-rectangle (event) | 1964 | ;;;!! (defun mouse-open-rectangle (event) |
| 1964 | ;;;!! "Kill the rectangle between point and the mouse cursor." | 1965 | ;;;!! "Kill the rectangle between point and the mouse cursor." |
| 1965 | ;;;!! (interactive "@e") | 1966 | ;;;!! (interactive "@e") |
| @@ -1970,16 +1971,16 @@ and selects that window." | |||
| 1970 | ;;;!! (if (> point-save (point)) | 1971 | ;;;!! (if (> point-save (point)) |
| 1971 | ;;;!! (open-rectangle (point) point-save) | 1972 | ;;;!! (open-rectangle (point) point-save) |
| 1972 | ;;;!! (open-rectangle point-save (point)))))) | 1973 | ;;;!! (open-rectangle point-save (point)))))) |
| 1973 | ;;;!! | 1974 | ;;;!! |
| 1974 | ;;;!! ;; Must be a better way to do this. | 1975 | ;;;!! ;; Must be a better way to do this. |
| 1975 | ;;;!! | 1976 | ;;;!! |
| 1976 | ;;;!! (defun mouse-multiple-insert (n char) | 1977 | ;;;!! (defun mouse-multiple-insert (n char) |
| 1977 | ;;;!! (while (> n 0) | 1978 | ;;;!! (while (> n 0) |
| 1978 | ;;;!! (insert char) | 1979 | ;;;!! (insert char) |
| 1979 | ;;;!! (setq n (1- n)))) | 1980 | ;;;!! (setq n (1- n)))) |
| 1980 | ;;;!! | 1981 | ;;;!! |
| 1981 | ;;;!! ;; What this could do is not finalize until button was released. | 1982 | ;;;!! ;; What this could do is not finalize until button was released. |
| 1982 | ;;;!! | 1983 | ;;;!! |
| 1983 | ;;;!! (defun mouse-move-text (event) | 1984 | ;;;!! (defun mouse-move-text (event) |
| 1984 | ;;;!! "Move text from point to cursor position, inserting spaces." | 1985 | ;;;!! "Move text from point to cursor position, inserting spaces." |
| 1985 | ;;;!! (interactive "@e") | 1986 | ;;;!! (interactive "@e") |