Mercurial > emacs
annotate lisp/mouse.el @ 1314:4cbe6db1041e
* intervals.h: Declare `copy_intervals()'.
author | Joseph Arceneaux <jla@gnu.org> |
---|---|
date | Sat, 03 Oct 1992 00:04:59 +0000 |
parents | 467833df795b |
children | f34d8e4d1d7b |
rev | line source |
---|---|
659
505130d1ddf8
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
584
diff
changeset
|
1 ;;; mouse.el --- window system-independent mouse support. |
791
203c23c9f22c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
758
diff
changeset
|
2 |
840
113281b361ec
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
791
diff
changeset
|
3 ;;; Copyright (C) 1988, 1992 Free Software Foundation, Inc. |
113281b361ec
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
791
diff
changeset
|
4 |
791
203c23c9f22c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
758
diff
changeset
|
5 ;; Maintainer: FSF |
203c23c9f22c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
758
diff
changeset
|
6 ;; Keywords: hardware |
203c23c9f22c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
758
diff
changeset
|
7 |
465 | 8 ;;; This file is part of GNU Emacs. |
66 | 9 |
465 | 10 ;;; GNU Emacs is free software; you can redistribute it and/or modify |
11 ;;; it under the terms of the GNU General Public License as published by | |
705 | 12 ;;; the Free Software Foundation; either version 2, or (at your option) |
465 | 13 ;;; any later version. |
66 | 14 |
465 | 15 ;;; GNU Emacs is distributed in the hope that it will be useful, |
16 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;;; GNU General Public License for more details. | |
66 | 19 |
465 | 20 ;;; You should have received a copy of the GNU General Public License |
21 ;;; along with GNU Emacs; see the file COPYING. If not, write to | |
22 ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
66 | 23 |
24 | |
465 | 25 ;;; Utility functions. |
26 | |
27 (defun mouse-movement-p (event) | |
28 (and (consp event) | |
29 (eq (car event) 'mouse-movement))) | |
30 | |
31 (defun event-window (event) (nth 1 event)) | |
32 (defun event-point (event) (nth 2 event)) | |
33 (defun mouse-coords (event) (nth 3 event)) | |
34 (defun mouse-timestamp (event) (nth 4 event)) | |
66 | 35 |
465 | 36 ;;; Indent track-mouse like progn. |
37 (put 'track-mouse 'lisp-indent-function 0) | |
66 | 38 |
465 | 39 |
40 (defun mouse-delete-window (click) | |
1214
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
41 "Delete the window you click on. |
465 | 42 This must be bound to a mouse click." |
1113 | 43 (interactive "e") |
465 | 44 (delete-window (event-window click))) |
45 | |
46 (defun mouse-delete-other-windows (click) | |
1214
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
47 "Delete all window except the one you click on." |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
48 (interactive "@e") |
66 | 49 (delete-other-windows)) |
50 | |
465 | 51 (defun mouse-split-window-vertically (click) |
52 "Select Emacs window mouse is on, then split it vertically in half. | |
53 The window is split at the line clicked on. | |
54 This command must be bound to a mouse click." | |
1214
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
55 (interactive "@e") |
465 | 56 (split-window-vertically (1+ (cdr (mouse-coords click))))) |
66 | 57 |
1214
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
58 (defun mouse-split-window-horizontally (click) |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
59 "Select Emacs window mouse is on, then split it horizontally in half. |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
60 The window is split at the column clicked on. |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
61 This command must be bound to a mouse click." |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
62 (interactive "@e") |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
63 (split-window-horizontally (1+ (car (mouse-coords click))))) |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
64 |
465 | 65 (defun mouse-set-point (click) |
66 "Move point to the position clicked on with the mouse. | |
67 This must be bound to a mouse click." | |
1113 | 68 (interactive "e") |
465 | 69 (select-window (event-window click)) |
1039 | 70 (if (numberp (event-point click)) |
71 (goto-char (event-point click)))) | |
66 | 72 |
465 | 73 (defun mouse-set-mark (click) |
74 "Set mark at the position clicked on with the mouse. | |
75 Display cursor at that position for a second. | |
76 This must be bound to a mouse click." | |
1113 | 77 (interactive "e") |
66 | 78 (let ((point-save (point))) |
79 (unwind-protect | |
465 | 80 (progn (mouse-set-point click) |
66 | 81 (push-mark nil t) |
191 | 82 (sit-for 1)) |
66 | 83 (goto-char point-save)))) |
84 | |
465 | 85 (defun mouse-kill (click) |
86 "Kill the region between point and the mouse click. | |
87 The text is saved in the kill ring, as with \\[kill-region]." | |
1113 | 88 (interactive "e") |
758 | 89 (let ((click-posn (event-point click))) |
1039 | 90 (if (numberp click-posn) |
91 (kill-region (min (point) click-posn) | |
92 (max (point) click-posn))))) | |
66 | 93 |
705 | 94 (defun mouse-yank-at-click (click arg) |
95 "Insert the last stretch of killed text at the position clicked on. | |
96 Prefix arguments are interpreted as with \\[yank]." | |
1113 | 97 (interactive "e\nP") |
705 | 98 (mouse-set-point click) |
99 (yank arg)) | |
100 | |
101 (defun mouse-kill-ring-save (click) | |
465 | 102 "Copy the region between point and the mouse click in the kill ring. |
103 This does not delete the region; it acts like \\[kill-ring-save]." | |
1113 | 104 (interactive "e") |
465 | 105 (mouse-set-mark click) |
705 | 106 (call-interactively 'kill-ring-save)) |
66 | 107 |
1214
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
108 (defun mouse-save-then-kill (click) |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
109 "Copy the region between point and the mouse click in the kill ring. |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
110 This does not delete the region; it acts like \\[kill-ring-save]." |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
111 (interactive "e") |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
112 (mouse-set-mark click) |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
113 (if (string= (buffer-substring (point) (mark)) (car kill-ring)) |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
114 ;; If this text was already saved in kill ring, |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
115 ;; now delete it from the buffer. |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
116 (progn |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
117 (let ((buffer-undo-list t)) |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
118 (delete-region (point) (mark))) |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
119 ;; Make the undo list by hand so it is shared. |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
120 (setq buffer-undo-list |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
121 (cons (cons (car kill-ring) (point)) buffer-undo-list))) |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
122 ;; Otherwise, save this region. |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
123 (call-interactively 'kill-ring-save))) |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
124 |
1056
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
125 (defun mouse-buffer-menu (event) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
126 "Pop up a menu of buffers for selection with the mouse." |
1113 | 127 (interactive "e") |
1056
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
128 (let ((menu |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
129 (list "Buffer Menu" |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
130 (cons "Select Buffer" |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
131 (let ((tail (buffer-list)) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
132 head) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
133 (while tail |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
134 (let ((elt (car tail))) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
135 (if (not (string-match "^ " |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
136 (buffer-name elt))) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
137 (setq head (cons |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
138 (cons |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
139 (format |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
140 "%14s %s" |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
141 (buffer-name elt) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
142 (or (buffer-file-name elt) "")) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
143 elt) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
144 head)))) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
145 (setq tail (cdr tail))) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
146 (reverse head)))))) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
147 (switch-to-buffer (or (x-popup-menu event menu) (current-buffer))))) |
66 | 148 |
149 ;; Commands for the scroll bar. | |
150 | |
1214
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
151 (defun mouse-scroll-down (click) |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
152 (interactive "@e") |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
153 (scroll-down (1+ (cdr (mouse-coords click))))) |
66 | 154 |
1214
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
155 (defun mouse-scroll-up (click) |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
156 (interactive "@e") |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
157 (scroll-up (1+ (cdr (mouse-coords click))))) |
66 | 158 |
159 (defun mouse-scroll-down-full () | |
160 (interactive "@") | |
161 (scroll-down nil)) | |
162 | |
163 (defun mouse-scroll-up-full () | |
164 (interactive "@") | |
165 (scroll-up nil)) | |
166 | |
1214
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
167 (defun mouse-scroll-move-cursor (click) |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
168 (interactive "@e") |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
169 (move-to-window-line (1+ (cdr (mouse-coords click))))) |
66 | 170 |
171 (defun mouse-scroll-absolute (event) | |
172 (interactive "@e") | |
173 (let* ((pos (car event)) | |
174 (position (car pos)) | |
175 (length (car (cdr pos)))) | |
176 (if (<= length 0) (setq length 1)) | |
177 (let* ((scale-factor (max 1 (/ length (/ 8000000 (buffer-size))))) | |
178 (newpos (* (/ (* (/ (buffer-size) scale-factor) | |
179 position) | |
180 length) | |
181 scale-factor))) | |
182 (goto-char newpos) | |
183 (recenter '(4))))) | |
184 | |
1214
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
185 (defun mouse-scroll-left (click) |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
186 (interactive "@e") |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
187 (scroll-left (1+ (car (mouse-coords click))))) |
66 | 188 |
189 (defun mouse-scroll-right (ncolumns) | |
1214
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
190 (interactive "@e") |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
191 (scroll-right (1+ (car (mouse-coords click))))) |
66 | 192 |
193 (defun mouse-scroll-left-full () | |
194 (interactive "@") | |
195 (scroll-left nil)) | |
196 | |
197 (defun mouse-scroll-right-full () | |
198 (interactive "@") | |
199 (scroll-right nil)) | |
200 | |
1214
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
201 (defun mouse-scroll-move-cursor-horizontally (click) |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
202 (interactive "@e") |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
203 (move-to-column (1+ (car (mouse-coords click))))) |
66 | 204 |
205 (defun mouse-scroll-absolute-horizontally (event) | |
206 (interactive "@e") | |
207 (let* ((pos (car event)) | |
208 (position (car pos)) | |
209 (length (car (cdr pos)))) | |
210 (set-window-hscroll (selected-window) 33))) | |
211 | |
1060
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
212 (global-set-key [scroll-bar mouse-1] 'mouse-scroll-up) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
213 (global-set-key [scroll-bar mouse-2] 'mouse-scroll-absolute) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
214 (global-set-key [scroll-bar mouse-3] 'mouse-scroll-down) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
215 |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
216 (global-set-key [vertical-slider mouse-1] 'mouse-scroll-move-cursor) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
217 (global-set-key [vertical-slider mouse-2] 'mouse-scroll-move-cursor) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
218 (global-set-key [vertical-slider mouse-3] 'mouse-scroll-move-cursor) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
219 |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
220 (global-set-key [thumbup mouse-1] 'mouse-scroll-up-full) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
221 (global-set-key [thumbup mouse-2] 'mouse-scroll-up-full) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
222 (global-set-key [thumbup mouse-3] 'mouse-scroll-up-full) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
223 |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
224 (global-set-key [thumbdown mouse-1] 'mouse-scroll-down-full) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
225 (global-set-key [thumbdown mouse-2] 'mouse-scroll-down-full) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
226 (global-set-key [thumbdown mouse-3] 'mouse-scroll-down-full) |
66 | 227 |
1060
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
228 (global-set-key [horizontal-scroll-bar mouse-1] 'mouse-scroll-left) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
229 (global-set-key [horizontal-scroll-bar mouse-2] |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
230 'mouse-scroll-absolute-horizontally) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
231 (global-set-key [horizontal-scroll-bar mouse-3] 'mouse-scroll-right) |
66 | 232 |
1060
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
233 (global-set-key [horizontal-slider mouse-1] |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
234 'mouse-scroll-move-cursor-horizontally) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
235 (global-set-key [horizontal-slider mouse-2] |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
236 'mouse-scroll-move-cursor-horizontally) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
237 (global-set-key [horizontal-slider mouse-3] |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
238 'mouse-scroll-move-cursor-horizontally) |
66 | 239 |
1060
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
240 (global-set-key [thumbleft mouse-1] 'mouse-scroll-left-full) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
241 (global-set-key [thumbleft mouse-2] 'mouse-scroll-left-full) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
242 (global-set-key [thumbleft mouse-3] 'mouse-scroll-left-full) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
243 |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
244 (global-set-key [thumbright mouse-1] 'mouse-scroll-right-full) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
245 (global-set-key [thumbright mouse-2] 'mouse-scroll-right-full) |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
246 (global-set-key [thumbright mouse-3] 'mouse-scroll-right-full) |
1214
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
247 |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
248 (global-set-key [horizontal-scroll-bar S-mouse-2] |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
249 'mouse-split-window-horizontally) |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
250 (global-set-key [mode-line S-mouse-2] |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
251 'mouse-split-window-horizontally) |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
252 (global-set-key [vertical-scroll-bar S-mouse-2] |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
253 'mouse-split-window) |
1060
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
254 |
303 | 255 ;;;; |
256 ;;;; Here are experimental things being tested. Mouse events | |
257 ;;;; are of the form: | |
258 ;;;; ((x y) window screen-part key-sequence timestamp) | |
66 | 259 ;; |
303 | 260 ;;;; |
261 ;;;; Dynamically track mouse coordinates | |
262 ;;;; | |
66 | 263 ;; |
303 | 264 ;;(defun track-mouse (event) |
265 ;; "Track the coordinates, absolute and relative, of the mouse." | |
266 ;; (interactive "@e") | |
267 ;; (while mouse-grabbed | |
268 ;; (let* ((pos (read-mouse-position (selected-screen))) | |
269 ;; (abs-x (car pos)) | |
270 ;; (abs-y (cdr pos)) | |
271 ;; (relative-coordinate (coordinates-in-window-p | |
272 ;; (list (car pos) (cdr pos)) | |
273 ;; (selected-window)))) | |
274 ;; (if (consp relative-coordinate) | |
275 ;; (message "mouse: [%d %d], (%d %d)" abs-x abs-y | |
276 ;; (car relative-coordinate) | |
277 ;; (car (cdr relative-coordinate))) | |
278 ;; (message "mouse: [%d %d]" abs-x abs-y))))) | |
66 | 279 |
280 ;; | |
281 ;; Dynamically put a box around the line indicated by point | |
282 ;; | |
758 | 283 ;; |
284 ;;(require 'backquote) | |
285 ;; | |
286 ;;(defun mouse-select-buffer-line (event) | |
287 ;; (interactive "@e") | |
288 ;; (let ((relative-coordinate | |
289 ;; (coordinates-in-window-p (car event) (selected-window))) | |
290 ;; (abs-y (car (cdr (car event))))) | |
291 ;; (if (consp relative-coordinate) | |
292 ;; (progn | |
293 ;; (save-excursion | |
294 ;; (move-to-window-line (car (cdr relative-coordinate))) | |
295 ;; (x-draw-rectangle | |
296 ;; (selected-screen) | |
297 ;; abs-y 0 | |
298 ;; (save-excursion | |
299 ;; (move-to-window-line (car (cdr relative-coordinate))) | |
300 ;; (end-of-line) | |
301 ;; (push-mark nil t) | |
302 ;; (beginning-of-line) | |
303 ;; (- (region-end) (region-beginning))) 1)) | |
304 ;; (sit-for 1) | |
305 ;; (x-erase-rectangle (selected-screen)))))) | |
306 ;; | |
307 ;;(defvar last-line-drawn nil) | |
308 ;;(defvar begin-delim "[^ \t]") | |
309 ;;(defvar end-delim "[^ \t]") | |
310 ;; | |
311 ;;(defun mouse-boxing (event) | |
312 ;; (interactive "@e") | |
313 ;; (save-excursion | |
314 ;; (let ((screen (selected-screen))) | |
315 ;; (while (= (x-mouse-events) 0) | |
316 ;; (let* ((pos (read-mouse-position screen)) | |
317 ;; (abs-x (car pos)) | |
318 ;; (abs-y (cdr pos)) | |
319 ;; (relative-coordinate | |
320 ;; (coordinates-in-window-p (` ((, abs-x) (, abs-y))) | |
321 ;; (selected-window))) | |
322 ;; (begin-reg nil) | |
323 ;; (end-reg nil) | |
324 ;; (end-column nil) | |
325 ;; (begin-column nil)) | |
326 ;; (if (and (consp relative-coordinate) | |
327 ;; (or (not last-line-drawn) | |
328 ;; (not (= last-line-drawn abs-y)))) | |
329 ;; (progn | |
330 ;; (move-to-window-line (car (cdr relative-coordinate))) | |
331 ;; (if (= (following-char) 10) | |
332 ;; () | |
333 ;; (progn | |
334 ;; (setq begin-reg (1- (re-search-forward end-delim))) | |
335 ;; (setq begin-column (1- (current-column))) | |
336 ;; (end-of-line) | |
337 ;; (setq end-reg (1+ (re-search-backward begin-delim))) | |
338 ;; (setq end-column (1+ (current-column))) | |
339 ;; (message "%s" (buffer-substring begin-reg end-reg)) | |
340 ;; (x-draw-rectangle screen | |
341 ;; (setq last-line-drawn abs-y) | |
342 ;; begin-column | |
343 ;; (- end-column begin-column) 1)))))))))) | |
344 ;; | |
345 ;;(defun mouse-erase-box () | |
346 ;; (interactive) | |
347 ;; (if last-line-drawn | |
348 ;; (progn | |
349 ;; (x-erase-rectangle (selected-screen)) | |
350 ;; (setq last-line-drawn nil)))) | |
66 | 351 |
465 | 352 ;;; (defun test-x-rectangle () |
353 ;;; (use-local-mouse-map (setq rectangle-test-map (make-sparse-keymap))) | |
354 ;;; (define-key rectangle-test-map mouse-motion-button-left 'mouse-boxing) | |
355 ;;; (define-key rectangle-test-map mouse-button-left-up 'mouse-erase-box)) | |
66 | 356 |
357 ;; | |
358 ;; Here is how to do double clicking in lisp. About to change. | |
359 ;; | |
360 | |
361 (defvar double-start nil) | |
362 (defconst double-click-interval 300 | |
363 "Max ticks between clicks") | |
364 | |
365 (defun double-down (event) | |
366 (interactive "@e") | |
367 (if double-start | |
368 (let ((interval (- (nth 4 event) double-start))) | |
369 (if (< interval double-click-interval) | |
370 (progn | |
371 (backward-up-list 1) | |
372 ;; (message "Interval %d" interval) | |
373 (sleep-for 1))) | |
374 (setq double-start nil)) | |
375 (setq double-start (nth 4 event)))) | |
376 | |
377 (defun double-up (event) | |
378 (interactive "@e") | |
379 (and double-start | |
380 (> (- (nth 4 event ) double-start) double-click-interval) | |
381 (setq double-start nil))) | |
382 | |
465 | 383 ;;; (defun x-test-doubleclick () |
384 ;;; (use-local-mouse-map (setq doubleclick-test-map (make-sparse-keymap))) | |
385 ;;; (define-key doubleclick-test-map mouse-button-left 'double-down) | |
386 ;;; (define-key doubleclick-test-map mouse-button-left-up 'double-up)) | |
66 | 387 |
388 ;; | |
389 ;; This scrolls while button is depressed. Use preferable in scrollbar. | |
390 ;; | |
391 | |
392 (defvar scrolled-lines 0) | |
393 (defconst scroll-speed 1) | |
394 | |
395 (defun incr-scroll-down (event) | |
396 (interactive "@e") | |
397 (setq scrolled-lines 0) | |
398 (incremental-scroll scroll-speed)) | |
399 | |
400 (defun incr-scroll-up (event) | |
401 (interactive "@e") | |
402 (setq scrolled-lines 0) | |
403 (incremental-scroll (- scroll-speed))) | |
404 | |
405 (defun incremental-scroll (n) | |
406 (while (= (x-mouse-events) 0) | |
407 (setq scrolled-lines (1+ (* scroll-speed scrolled-lines))) | |
408 (scroll-down n) | |
409 (sit-for 300 t))) | |
410 | |
411 (defun incr-scroll-stop (event) | |
412 (interactive "@e") | |
413 (message "Scrolled %d lines" scrolled-lines) | |
414 (setq scrolled-lines 0) | |
415 (sleep-for 1)) | |
416 | |
465 | 417 ;;; (defun x-testing-scroll () |
418 ;;; (let ((scrolling-map (function mouse-vertical-scroll-bar-prefix))) | |
419 ;;; (define-key scrolling-map mouse-button-left 'incr-scroll-down) | |
420 ;;; (define-key scrolling-map mouse-button-right 'incr-scroll-up) | |
421 ;;; (define-key scrolling-map mouse-button-left-up 'incr-scroll-stop) | |
422 ;;; (define-key scrolling-map mouse-button-right-up 'incr-scroll-stop))) | |
66 | 423 |
424 ;; | |
425 ;; Some playthings suitable for picture mode? They need work. | |
426 ;; | |
427 | |
428 (defun mouse-kill-rectangle (event) | |
429 "Kill the rectangle between point and the mouse cursor." | |
430 (interactive "@e") | |
431 (let ((point-save (point))) | |
432 (save-excursion | |
433 (mouse-set-point event) | |
434 (push-mark nil t) | |
435 (if (> point-save (point)) | |
436 (kill-rectangle (point) point-save) | |
437 (kill-rectangle point-save (point)))))) | |
438 | |
439 (defun mouse-open-rectangle (event) | |
440 "Kill the rectangle between point and the mouse cursor." | |
441 (interactive "@e") | |
442 (let ((point-save (point))) | |
443 (save-excursion | |
444 (mouse-set-point event) | |
445 (push-mark nil t) | |
446 (if (> point-save (point)) | |
447 (open-rectangle (point) point-save) | |
448 (open-rectangle point-save (point)))))) | |
449 | |
450 ;; Must be a better way to do this. | |
451 | |
452 (defun mouse-multiple-insert (n char) | |
453 (while (> n 0) | |
454 (insert char) | |
455 (setq n (1- n)))) | |
456 | |
457 ;; What this could do is not finalize until button was released. | |
458 | |
459 (defun mouse-move-text (event) | |
460 "Move text from point to cursor position, inserting spaces." | |
461 (interactive "@e") | |
462 (let* ((relative-coordinate | |
463 (coordinates-in-window-p (car event) (selected-window)))) | |
464 (if (consp relative-coordinate) | |
465 (cond ((> (current-column) (car relative-coordinate)) | |
466 (delete-char | |
467 (- (car relative-coordinate) (current-column)))) | |
468 ((< (current-column) (car relative-coordinate)) | |
469 (mouse-multiple-insert | |
470 (- (car relative-coordinate) (current-column)) " ")) | |
471 ((= (current-column) (car relative-coordinate)) (ding)))))) | |
1100
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
472 |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
473 ;; Font selection. |
465 | 474 |
1100
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
475 (defvar x-fixed-font-alist |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
476 '("Font menu" |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
477 ("Misc" |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
478 ("fixed" "fixed") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
479 ("6x10" "6x10") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
480 ("6x12" "6x12") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
481 ("6x13" "6x13") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
482 ("7x13" "7x13") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
483 ("7x14" "7x14") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
484 ("8x13" "8x13") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
485 ("8x13 bold" "8x13bold") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
486 ("8x16" "8x16") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
487 ("9x15" "9x15") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
488 ("9x15 bold" "9x15bold") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
489 ("10x20" "10x20") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
490 ("11x18" "11x18") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
491 ("12x24" "12x24")) |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
492 ;;; We don't seem to have these; who knows what they are. |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
493 ;;; ("fg-18" "fg-18") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
494 ;;; ("fg-25" "fg-25") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
495 ;;; ("lucidasanstypewriter-12" "lucidasanstypewriter-12") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
496 ;;; ("lucidasanstypewriter-bold-14" "lucidasanstypewriter-bold-14") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
497 ;;; ("lucidasanstypewriter-bold-24" "lucidasanstypewriter-bold-24") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
498 ;;; ("lucidatypewriter-bold-r-24" "-b&h-lucidatypewriter-bold-r-normal-sans-24-240-75-75-m-140-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
499 ;;; ("fixed-medium-20" "-misc-fixed-medium-*-*-*-20-*-*-*-*-*-*-*") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
500 ("Courier" |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
501 ("8" "-adobe-courier-medium-r-normal--8-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
502 ("10" "-adobe-courier-medium-r-normal--10-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
503 ("12" "-adobe-courier-medium-r-normal--12-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
504 ("14" "-adobe-courier-medium-r-normal--14-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
505 ("18" "-adobe-courier-medium-r-normal--18-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
506 ("24" "-adobe-courier-medium-r-normal--24-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
507 ("8 bold" "-adobe-courier-bold-r-normal--8-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
508 ("10 bold" "-adobe-courier-bold-r-normal--10-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
509 ("12 bold" "-adobe-courier-bold-r-normal--12-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
510 ("14 bold" "-adobe-courier-bold-r-normal--14-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
511 ("18 bold" "-adobe-courier-bold-r-normal--18-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
512 ("24 bold" "-adobe-courier-bold-r-normal--24-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
513 ("8 slant" "-adobe-courier-medium-o-normal--8-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
514 ("10 slant" "-adobe-courier-medium-o-normal--10-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
515 ("12 slant" "-adobe-courier-medium-o-normal--12-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
516 ("14 slant" "-adobe-courier-medium-o-normal--14-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
517 ("18 slant" "-adobe-courier-medium-o-normal--18-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
518 ("24 slant" "-adobe-courier-medium-o-normal--24-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
519 ("8 bold slant" "-adobe-courier-bold-o-normal--8-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
520 ("10 bold slant" "-adobe-courier-bold-o-normal--10-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
521 ("12 bold slant" "-adobe-courier-bold-o-normal--12-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
522 ("14 bold slant" "-adobe-courier-bold-o-normal--14-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
523 ("18 bold slant" "-adobe-courier-bold-o-normal--18-*-*-*-m-*-iso8859-1") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
524 ("24 bold slant" "-adobe-courier-bold-o-normal--24-*-*-*-m-*-iso8859-1")) |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
525 ) |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
526 "X fonts suitable for use in Emacs.") |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
527 |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
528 (defun mouse-set-font (font) |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
529 "Select an emacs font from a list of known good fonts" |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
530 (interactive |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
531 (x-popup-menu last-nonmenu-event x-fixed-font-alist)) |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
532 (modify-frame-parameters (selected-frame) |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
533 (list (cons 'font font)))) |
465 | 534 |
535 ;;; Bindings for mouse commands. | |
536 | |
1060
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
537 ;; This won't be needed once the drag and down events |
1057
d9775f33488d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1056
diff
changeset
|
538 ;; are properly implemented. |
d9775f33488d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1056
diff
changeset
|
539 (global-set-key [mouse-1] 'mouse-set-point) |
d9775f33488d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1056
diff
changeset
|
540 |
1056
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
541 (global-set-key [down-mouse-1] 'mouse-set-point) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
542 (global-set-key [drag-mouse-1] 'mouse-set-mark) |
705 | 543 (global-set-key [mouse-2] 'mouse-yank-at-click) |
1214
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
544 (global-set-key [mouse-3] 'mouse-save-then-kill) |
705 | 545 |
1056
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
546 (global-set-key [C-mouse-1] 'mouse-buffer-menu) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
547 |
1100
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
548 (global-set-key [C-mouse-3] 'mouse-set-font) |
5b3b202a84c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1064
diff
changeset
|
549 |
1056
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
550 ;; Replaced with dragging mouse-1 |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
551 ;; (global-set-key [S-mouse-1] 'mouse-set-mark) |
1214
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
552 |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
553 (global-set-key [mode-line mouse-1] 'mouse-delete-other-windows) |
467833df795b
(mouse-split-window-vertically): Use @.
Richard M. Stallman <rms@gnu.org>
parents:
1113
diff
changeset
|
554 (global-set-key [mode-line mouse-3] 'mouse-delete-window) |
1056
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
555 |
1060
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
556 ;; Define the mouse help menu tree. |
af78c65921c8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1058
diff
changeset
|
557 |
1056
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
558 (defvar help-menu-map '(keymap "Help")) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
559 (global-set-key [C-mouse-2] help-menu-map) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
560 |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
561 (defvar help-apropos-map '(keymap "Is there a command that...")) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
562 (defvar help-keys-map '(keymap "Key Commands <==> Functions")) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
563 (defvar help-manual-map '(keymap "Manual and tutorial")) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
564 (defvar help-misc-map '(keymap "Odds and ends")) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
565 (defvar help-modes-map '(keymap "Modes")) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
566 (defvar help-admin-map '(keymap "Administrivia")) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
567 |
1058
19c6978ab218
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1057
diff
changeset
|
568 (define-key help-menu-map [apropos] |
1064
e699ce19609f
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1060
diff
changeset
|
569 (cons "@Is there a command that..." help-apropos-map)) |
1058
19c6978ab218
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1057
diff
changeset
|
570 (define-key help-menu-map [keys] |
1064
e699ce19609f
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1060
diff
changeset
|
571 (cons "@Key Commands <==> Functions" help-keys-map)) |
1058
19c6978ab218
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1057
diff
changeset
|
572 (define-key help-menu-map [manuals] |
1064
e699ce19609f
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1060
diff
changeset
|
573 (cons "@Manual and tutorial" help-manual-map)) |
1058
19c6978ab218
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1057
diff
changeset
|
574 (define-key help-menu-map [misc] |
1064
e699ce19609f
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1060
diff
changeset
|
575 (cons "@Odds and ends" help-misc-map)) |
1058
19c6978ab218
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1057
diff
changeset
|
576 (define-key help-menu-map [modes] |
1064
e699ce19609f
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1060
diff
changeset
|
577 (cons "@Modes" help-modes-map)) |
1058
19c6978ab218
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1057
diff
changeset
|
578 (define-key help-menu-map [admin] |
1064
e699ce19609f
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1060
diff
changeset
|
579 (cons "@Administrivia" help-admin-map)) |
1056
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
580 |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
581 (define-key help-apropos-map "c" '("Command Apropos" . command-apropos)) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
582 (define-key help-apropos-map "a" '("Apropos" . apropos)) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
583 |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
584 (define-key help-keys-map "b" |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
585 '("List all keystroke commands" . describe-bindings)) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
586 (define-key help-keys-map "c" |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
587 '("Describe key briefly" . describe-key-briefly)) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
588 (define-key help-keys-map "k" |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
589 '("Describe key verbose" . describe-key)) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
590 (define-key help-keys-map "f" |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
591 '("Describe Lisp function" . describe-function)) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
592 (define-key help-keys-map "w" |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
593 '("Where is this command" . where-is)) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
594 |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
595 (define-key help-manual-map "i" '("Info system" . info)) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
596 (define-key help-manual-map "t" |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
597 '("Invoke Emacs tutorial" . help-with-tutorial)) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
598 |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
599 (define-key help-misc-map "l" '("Last 100 Keystrokes" . view-lossage)) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
600 (define-key help-misc-map "s" '("Describe syntax table" . describe-syntax)) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
601 |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
602 (define-key help-modes-map "m" |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
603 '("Describe current major mode" . describe-mode)) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
604 (define-key help-modes-map "b" |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
605 '("List all keystroke commands" . describe-bindings)) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
606 |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
607 (define-key help-admin-map "n" |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
608 '("view Emacs news" . view-emacs-news)) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
609 (define-key help-admin-map "l" |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
610 '("View the GNU Emacs license" . describe-copying)) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
611 (define-key help-admin-map "d" |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
612 '("Describe distribution" . describe-distribution)) |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
613 (define-key help-admin-map "w" |
a7fc54083464
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1039
diff
changeset
|
614 '("Describe (non)warranty" . describe-no-warranty)) |
584 | 615 |
616 (provide 'mouse) | |
617 | |
659
505130d1ddf8
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
584
diff
changeset
|
618 ;;; mouse.el ends here |