annotate lisp/obsolete/sun-fns.el @ 74493:817f7407b88f

** christopher.ian.moore@gmail.com, Nov 30: too much recursion in gnus-sort-threads-1. Fixed.
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 08 Dec 2006 16:26:50 +0000
parents e8a3fb527b77
children f7702c5f335d c5406394f567
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1 ;;; sun-fns.el --- subroutines of Mouse handling for Sun windows
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2
68640
e8a3fb527b77 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 65185
diff changeset
3 ;; Copyright (C) 1987, 2002, 2003, 2004, 2005,
e8a3fb527b77 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 65185
diff changeset
4 ;; 2006 Free Software Foundation, Inc.
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
6 ;; Author: Jeff Peck <peck@sun.com>
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
7 ;; Maintainer: none
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
8 ;; Keywords: hardware
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
9
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
11
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
15 ;; any later version.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
16
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
20 ;; GNU General Public License for more details.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
21
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64085
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 52401
diff changeset
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 52401
diff changeset
25 ;; Boston, MA 02110-1301, USA.
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
26
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
27 ;;; Commentary:
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
28
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
29 ;; Submitted Mar. 1987, Jeff Peck
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
30 ;; Sun Microsystems Inc. <peck@sun.com>
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
31 ;; Conceived Nov. 1986, Stan Jefferson,
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
32 ;; Computer Science Lab, SRI International.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
33 ;; GoodIdeas Feb. 1987, Steve Greenbaum
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
34 ;; & UpClicks Reasoning Systems, Inc.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
35 ;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
36 ;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
37 ;; Functions for manipulating via the mouse and mouse-map definitions
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
38 ;; for accessing them. Also definitions of mouse menus.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
39 ;; This file you should freely modify to reflect you personal tastes.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
40 ;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
41 ;; First half of file defines functions to implement mouse commands,
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
42 ;; Don't delete any of those, just add what ever else you need.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
43 ;; Second half of file defines mouse bindings, do whatever you want there.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
44
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
45 ;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
46 ;; Mouse Functions.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
47 ;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
48 ;; These functions follow the sun-mouse-handler convention of being called
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
49 ;; with three arguments: (window x-pos y-pos)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
50 ;; This makes it easy for a mouse executed command to know where the mouse is.
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 39022
diff changeset
51 ;; Use the macro "eval-in-window" to execute a function
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
52 ;; in a temporarily selected window.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
53 ;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
54 ;; If you have a function that must be called with other arguments
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
55 ;; bind the mouse button to an s-exp that contains the necessary parameters.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
56 ;; See "minibuffer" bindings for examples.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
57 ;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
58
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
59 ;;; Code:
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
60
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
61 (require 'term/sun-mouse)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
62
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
63 (defconst cursor-pause-milliseconds 300
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
64 "*Number of milliseconds to display alternate cursor (usually the mark)")
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
65
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
66 (defun indicate-region (&optional pause)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
67 "Bounce cursor to mark for cursor-pause-milliseconds and back again"
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
68 (or pause (setq pause cursor-pause-milliseconds))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
69 (let ((point (point)))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
70 (goto-char (mark))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
71 (sit-for-millisecs pause)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
72 ;(update-display)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
73 ;(sleep-for-millisecs pause)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
74 (goto-char point)))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
75
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
76
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
77 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
78 ;;; Text buffer operations
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
79 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
80 (defun mouse-move-point (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
81 "Move point to mouse cursor."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
82 (select-window window)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
83 (move-to-loc x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
84 (if (memq last-command ; support the mouse-copy/delete/yank
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
85 '(mouse-copy mouse-delete mouse-yank-move))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
86 (setq this-command 'mouse-yank-move))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
87 )
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
88
65185
7d1da711be4c (mouse-select-or-drag-move-point): Don't pass X and Y (they are ignored anyway).
Juanma Barranquero <lekktu@gmail.com>
parents: 64751
diff changeset
89 (defun mouse-set-mark (&optional window x y)
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
90 "Set mark at mouse cursor."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
91 (eval-in-window window ;; use this to get the unwind protect
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
92 (let ((point (point)))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
93 (move-to-loc x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
94 (set-mark (point))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
95 (goto-char point)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
96 (indicate-region)))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
97 )
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
98
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
99 (defun mouse-set-mark-and-select (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
100 "Set mark at mouse cursor, and select that window."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
101 (select-window window)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
102 (mouse-set-mark window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
103 )
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
104
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
105 (defun mouse-set-mark-and-stuff (w x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
106 "Set mark at mouse cursor, and put region in stuff buffer."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
107 (mouse-set-mark-and-select w x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
108 (sun-select-region (region-beginning) (region-end)))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
109
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
110 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
111 ;;; Simple mouse dragging stuff: marking with button up
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
112 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
113
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
114 (defvar *mouse-drag-window* nil)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
115 (defvar *mouse-drag-x* -1)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
116 (defvar *mouse-drag-y* -1)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
117
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
118 (defun mouse-drag-move-point (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
119 "Move point to mouse cursor, and allow dragging."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
120 (mouse-move-point window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
121 (setq *mouse-drag-window* window
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
122 *mouse-drag-x* x
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
123 *mouse-drag-y* y))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
124
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
125 (defun mouse-drag-set-mark-stuff (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
126 "The up click handler that goes with mouse-drag-move-point.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
127 If mouse is in same WINDOW but at different X or Y than when
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
128 mouse-drag-move-point was last executed, set the mark at mouse
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
129 and put the region in the stuff buffer."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
130 (if (and (eq *mouse-drag-window* window)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
131 (not (and (equal *mouse-drag-x* x)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
132 (equal *mouse-drag-y* y))))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
133 (mouse-set-mark-and-stuff window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
134 (setq this-command last-command)) ; this was just an upclick no-op.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
135 )
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
136
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
137 (defun mouse-select-or-drag-move-point (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
138 "Select window if not selected, otherwise do mouse-drag-move-point."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
139 (if (eq (selected-window) window)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
140 (mouse-drag-move-point window x y)
65185
7d1da711be4c (mouse-select-or-drag-move-point): Don't pass X and Y (they are ignored anyway).
Juanma Barranquero <lekktu@gmail.com>
parents: 64751
diff changeset
141 (mouse-select-window window)))
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
142
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
143 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
144 ;;; esoterica:
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
145 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
146 (defun mouse-exch-pt-and-mark (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
147 "Exchange point and mark."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
148 (select-window window)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
149 (exchange-point-and-mark)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
150 )
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
151
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
152 (defun mouse-call-kbd-macro (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
153 "Invokes last keyboard macro at mouse cursor."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
154 (mouse-move-point window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
155 (call-last-kbd-macro)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
156 )
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
157
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
158 (defun mouse-mark-thing (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
159 "Set point and mark to text object using syntax table.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
160 The resulting region is put in the sun-window stuff buffer.
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 39022
diff changeset
161 Left or right Paren syntax marks an s-expression.
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 39022
diff changeset
162 Clicking at the end of a line marks the line including a trailing newline.
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
163 If it doesn't recognize one of these it marks the character at point."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
164 (mouse-move-point window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
165 (if (eobp) (open-line 1))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
166 (let* ((char (char-after (point)))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
167 (syntax (char-syntax char)))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
168 (cond
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
169 ((eq syntax ?w) ; word.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
170 (forward-word 1)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
171 (set-mark (point))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
172 (forward-word -1))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
173 ;; try to include a single following whitespace (is this a good idea?)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
174 ;; No, not a good idea since inconsistent.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
175 ;;(if (eq (char-syntax (char-after (mark))) ?\ )
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
176 ;; (set-mark (1+ (mark))))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
177 ((eq syntax ?\( ) ; open paren.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
178 (mark-sexp 1))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
179 ((eq syntax ?\) ) ; close paren.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
180 (forward-char 1)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
181 (mark-sexp -1)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
182 (exchange-point-and-mark))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
183 ((eolp) ; mark line if at end.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
184 (set-mark (1+ (point)))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
185 (beginning-of-line 1))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
186 (t ; mark character
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
187 (set-mark (1+ (point)))))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
188 (indicate-region)) ; display region boundary.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
189 (sun-select-region (region-beginning) (region-end))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
190 )
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
191
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
192 (defun mouse-kill-thing (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
193 "Kill thing at mouse, and put point there."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
194 (mouse-mark-thing window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
195 (kill-region-and-unmark (region-beginning) (region-end))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
196 )
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
197
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
198 (defun mouse-kill-thing-there (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
199 "Kill thing at mouse, leave point where it was.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
200 See mouse-mark-thing for a description of the objects recognized."
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 39022
diff changeset
201 (eval-in-window window
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
202 (save-excursion
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
203 (mouse-mark-thing window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
204 (kill-region (region-beginning) (region-end))))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
205 )
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
206
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
207 (defun mouse-save-thing (window x y &optional quiet)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
208 "Put thing at mouse in kill ring.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
209 See mouse-mark-thing for a description of the objects recognized."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
210 (mouse-mark-thing window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
211 (copy-region-as-kill (region-beginning) (region-end))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
212 (if (not quiet) (message "Thing saved"))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
213 )
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
214
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
215 (defun mouse-save-thing-there (window x y &optional quiet)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
216 "Put thing at mouse in kill ring, leave point as is.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
217 See mouse-mark-thing for a description of the objects recognized."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
218 (eval-in-window window
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
219 (save-excursion
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
220 (mouse-save-thing window x y quiet))))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
221
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
222 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
223 ;;; Mouse yanking...
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
224 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
225 (defun mouse-copy-thing (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
226 "Put thing at mouse in kill ring, yank to point.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
227 See mouse-mark-thing for a description of the objects recognized."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
228 (setq last-command 'not-kill) ;Avoids appending to previous kills.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
229 (mouse-save-thing-there window x y t)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
230 (yank)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
231 (setq this-command 'yank))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
232
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
233 (defun mouse-move-thing (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
234 "Kill thing at mouse, yank it to point.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
235 See mouse-mark-thing for a description of the objects recognized."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
236 (setq last-command 'not-kill) ;Avoids appending to previous kills.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
237 (mouse-kill-thing-there window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
238 (yank)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
239 (setq this-command 'yank))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
240
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
241 (defun mouse-yank-at-point (&optional window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
242 "Yank from kill-ring at point; then cycle thru kill ring."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
243 (if (eq last-command 'yank)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
244 (let ((before (< (point) (mark))))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
245 (delete-region (point) (mark))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
246 (insert (current-kill 1))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
247 (if before (exchange-point-and-mark)))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
248 (yank))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
249 (setq this-command 'yank))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
250
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
251 (defun mouse-yank-at-mouse (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
252 "Yank from kill-ring at mouse; then cycle thru kill ring."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
253 (mouse-move-point window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
254 (mouse-yank-at-point window x y))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
255
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
256 (defun mouse-save/delete/yank (&optional window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
257 "Context sensitive save/delete/yank.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
258 Consecutive clicks perform as follows:
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
259 * first click saves region to kill ring,
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
260 * second click kills region,
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
261 * third click yanks from kill ring,
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
262 * subsequent clicks cycle thru kill ring.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
263 If mouse-move-point is performed after the first or second click,
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
264 the next click will do a yank, etc. Except for a possible mouse-move-point,
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
265 this command is insensitive to mouse location."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
266 (cond
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
267 ((memq last-command '(mouse-delete yank mouse-yank-move)) ; third+ click
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
268 (mouse-yank-at-point))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
269 ((eq last-command 'mouse-copy) ; second click
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
270 (kill-region (region-beginning) (region-end))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
271 (setq this-command 'mouse-delete))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
272 (t ; first click
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
273 (copy-region-as-kill (region-beginning) (region-end))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
274 (message "Region saved")
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
275 (setq this-command 'mouse-copy))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
276 ))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
277
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
278
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
279 (defun mouse-split-horizontally (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
280 "Splits the window horizontally at mouse cursor."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
281 (eval-in-window window (split-window-horizontally (1+ x))))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
282
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
283 (defun mouse-split-vertically (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
284 "Split the window vertically at the mouse cursor."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
285 (eval-in-window window (split-window-vertically (1+ y))))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
286
65185
7d1da711be4c (mouse-select-or-drag-move-point): Don't pass X and Y (they are ignored anyway).
Juanma Barranquero <lekktu@gmail.com>
parents: 64751
diff changeset
287 (defun mouse-select-window (&optional window x y)
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
288 "Selects the window, restoring point."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
289 (select-window window))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
290
65185
7d1da711be4c (mouse-select-or-drag-move-point): Don't pass X and Y (they are ignored anyway).
Juanma Barranquero <lekktu@gmail.com>
parents: 64751
diff changeset
291 (defun mouse-delete-other-windows (&optional window x y)
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
292 "Deletes all windows except the one mouse is in."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
293 (delete-other-windows window))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
294
65185
7d1da711be4c (mouse-select-or-drag-move-point): Don't pass X and Y (they are ignored anyway).
Juanma Barranquero <lekktu@gmail.com>
parents: 64751
diff changeset
295 (defun mouse-delete-window (window &optional x y)
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
296 "Deletes the window mouse is in."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
297 (delete-window window))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
298
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
299 (defun mouse-undo (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
300 "Invokes undo in the window mouse is in."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
301 (eval-in-window window (undo)))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
302
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
303 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
304 ;;; Scroll operations
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
305 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
306
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
307 ;;; The move-to-window-line is used below because otherwise
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
308 ;;; scrolling a non-selected process window with the mouse, after
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
309 ;;; the process has written text past the bottom of the window,
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
310 ;;; gives an "End of buffer" error, and then scrolls. The
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
311 ;;; move-to-window-line seems to force recomputing where things are.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
312 (defun mouse-scroll-up (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
313 "Scrolls the window upward."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
314 (eval-in-window window (move-to-window-line 1) (scroll-up nil)))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
315
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
316 (defun mouse-scroll-down (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
317 "Scrolls the window downward."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
318 (eval-in-window window (scroll-down nil)))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
319
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
320 (defun mouse-scroll-proportional (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
321 "Scrolls the window proportionally corresponding to window
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
322 relative X divided by window width."
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 39022
diff changeset
323 (eval-in-window window
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
324 (if (>= x (1- (window-width)))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
325 ;; When x is maximum (equal to or 1 less than window width),
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
326 ;; goto end of buffer. We check for this special case
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
327 ;; because the calculated goto-char often goes short of the
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
328 ;; end due to roundoff error, and we often really want to go
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
329 ;; to the end.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
330 (goto-char (point-max))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
331 (progn
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
332 (goto-char (+ (point-min) ; For narrowed regions.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
333 (* x (/ (- (point-max) (point-min))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
334 (1- (window-width))))))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
335 (beginning-of-line))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
336 )
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
337 (what-cursor-position) ; Report position.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
338 ))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
339
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
340 (defun mouse-line-to-top (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
341 "Scrolls the line at the mouse cursor up to the top."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
342 (eval-in-window window (scroll-up y)))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
343
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
344 (defun mouse-top-to-line (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
345 "Scrolls the top line down to the mouse cursor."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
346 (eval-in-window window (scroll-down y)))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
347
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
348 (defun mouse-line-to-bottom (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
349 "Scrolls the line at the mouse cursor to the bottom."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
350 (eval-in-window window (scroll-up (+ y (- 2 (window-height))))))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
351
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
352 (defun mouse-bottom-to-line (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
353 "Scrolls the bottom line up to the mouse cursor."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
354 (eval-in-window window (scroll-down (+ y (- 2 (window-height))))))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
355
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
356 (defun mouse-line-to-middle (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
357 "Scrolls the line at the mouse cursor to the middle."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
358 (eval-in-window window (scroll-up (- y -1 (/ (window-height) 2)))))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
359
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
360 (defun mouse-middle-to-line (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
361 "Scrolls the line at the middle to the mouse cursor."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
362 (eval-in-window window (scroll-up (- (/ (window-height) 2) y 1))))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
363
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
364
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
365 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
366 ;;; main emacs menu.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
367 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
368 (defmenu expand-menu
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
369 ("Vertically" mouse-expand-vertically *menu-window*)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
370 ("Horizontally" mouse-expand-horizontally *menu-window*))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
371
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
372 (defmenu delete-window-menu
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
373 ("This One" delete-window *menu-window*)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
374 ("All Others" delete-other-windows *menu-window*))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
375
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
376 (defmenu mouse-help-menu
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
377 ("Text Region"
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
378 mouse-help-region *menu-window* *menu-x* *menu-y* 'text)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
379 ("Scrollbar"
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
380 mouse-help-region *menu-window* *menu-x* *menu-y* 'scrollbar)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
381 ("Modeline"
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
382 mouse-help-region *menu-window* *menu-x* *menu-y* 'modeline)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
383 ("Minibuffer"
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
384 mouse-help-region *menu-window* *menu-x* *menu-y* 'minibuffer)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
385 )
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 39022
diff changeset
386
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
387 (defmenu emacs-quit-menu
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
388 ("Suspend" suspend-emacstool)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
389 ("Quit" save-buffers-kill-emacs))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
390
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
391 (defmenu emacs-menu
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
392 ("Emacs Menu")
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
393 ("Stuff Selection" sun-yank-selection)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
394 ("Expand" . expand-menu)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
395 ("Delete Window" . delete-window-menu)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
396 ("Previous Buffer" mouse-select-previous-buffer *menu-window*)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
397 ("Save Buffers" save-some-buffers)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
398 ("List Directory" list-directory nil)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
399 ("Dired" dired nil)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
400 ("Mouse Help" . mouse-help-menu)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
401 ("Quit" . emacs-quit-menu))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
402
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
403 (defun emacs-menu-eval (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
404 "Pop-up menu of editor commands."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
405 (sun-menu-evaluate window (1+ x) (1- y) 'emacs-menu))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
406
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
407 (defun mouse-expand-horizontally (window)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
408 (eval-in-window window
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
409 (enlarge-window 4 t)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
410 (update-display) ; Try to redisplay, since can get confused.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
411 ))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
412
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
413 (defun mouse-expand-vertically (window)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
414 (eval-in-window window (enlarge-window 4)))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
415
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
416 (defun mouse-select-previous-buffer (window)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
417 "Switch buffer in mouse window to most recently selected buffer."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
418 (eval-in-window window (switch-to-buffer (other-buffer))))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
419
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
420 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
421 ;;; minibuffer menu
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
422 ;;;
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 39022
diff changeset
423 (defmenu minibuffer-menu
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
424 ("Minibuffer" message "Just some miscellaneous minibuffer commands")
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
425 ("Stuff" sun-yank-selection)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
426 ("Do-It" exit-minibuffer)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
427 ("Abort" abort-recursive-edit)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
428 ("Suspend" suspend-emacs))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
429
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
430 (defun minibuffer-menu-eval (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
431 "Pop-up menu of commands."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
432 (sun-menu-evaluate window x (1- y) 'minibuffer-menu))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
433
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
434 (defun mini-move-point (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
435 ;; -6 is good for most common cases
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
436 (mouse-move-point window (- x 6) 0))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
437
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
438 (defun mini-set-mark-and-stuff (window x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
439 ;; -6 is good for most common cases
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
440 (mouse-set-mark-and-stuff window (- x 6) 0))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
441
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
442
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 39022
diff changeset
443 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
444 ;;; Buffer-mode Mouse commands
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 39022
diff changeset
445 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
446
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
447 (defun Buffer-at-mouse (w x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
448 "Calls Buffer-menu-buffer from mouse click."
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 39022
diff changeset
449 (save-window-excursion
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
450 (mouse-move-point w x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
451 (beginning-of-line)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
452 (Buffer-menu-buffer t)))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
453
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
454 (defun mouse-buffer-bury (w x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
455 "Bury the indicated buffer."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
456 (bury-buffer (Buffer-at-mouse w x y))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
457 )
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
458
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
459 (defun mouse-buffer-select (w x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
460 "Put the indicated buffer in selected window."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
461 (switch-to-buffer (Buffer-at-mouse w x y))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
462 (list-buffers)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
463 )
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
464
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
465 (defun mouse-buffer-delete (w x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
466 "mark indicated buffer for delete"
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
467 (save-window-excursion
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
468 (mouse-move-point w x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
469 (Buffer-menu-delete)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
470 ))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
471
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
472 (defun mouse-buffer-execute (w x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
473 "execute buffer-menu selections"
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
474 (save-window-excursion
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
475 (mouse-move-point w x y)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
476 (Buffer-menu-execute)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
477 ))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 39022
diff changeset
478
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
479 (defun enable-mouse-in-buffer-list ()
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
480 "Call this to enable mouse selections in *Buffer List*
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
481 LEFT puts the indicated buffer in the selected window.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
482 MIDDLE buries the indicated buffer.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
483 RIGHT marks the indicated buffer for deletion.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
484 MIDDLE-RIGHT deletes the marked buffers.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
485 To unmark a buffer marked for deletion, select it with LEFT."
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
486 (save-window-excursion
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
487 (list-buffers) ; Initialize *Buffer List*
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
488 (set-buffer "*Buffer List*")
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
489 (local-set-mouse '(text middle) 'mouse-buffer-bury)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 39022
diff changeset
490 (local-set-mouse '(text left) 'mouse-buffer-select)
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
491 (local-set-mouse '(text right) 'mouse-buffer-delete)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
492 (local-set-mouse '(text middle right) 'mouse-buffer-execute)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
493 )
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
494 )
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
495
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
496
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
497 ;;;*******************************************************************
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
498 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
499 ;;; Global Mouse Bindings.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
500 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
501 ;;; There is some sense to this mouse binding madness:
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
502 ;;; LEFT and RIGHT scrolls are inverses.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
503 ;;; SHIFT makes an opposite meaning in the scroll bar.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
504 ;;; SHIFT is an alternative to DOUBLE (but double chords do not exist).
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
505 ;;; META makes the scrollbar functions work in the text region.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
506 ;;; MIDDLE operates the mark
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
507 ;;; LEFT operates at point
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
508
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
509 ;;; META commands are generally non-destructive,
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
510 ;;; SHIFT is a little more dangerous.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
511 ;;; CONTROL is for the really complicated ones.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
512
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
513 ;;; CONTROL-META-SHIFT-RIGHT gives help on that region.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
514
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
515 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
516 ;;; Text Region mousemap
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
517 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
518 ;; The basics: Point, Mark, Menu, Sun-Select:
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
519 (global-set-mouse '(text left) 'mouse-drag-move-point)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
520 (global-set-mouse '(text up left) 'mouse-drag-set-mark-stuff)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
521 (global-set-mouse '(text shift left) 'mouse-exch-pt-and-mark)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
522 (global-set-mouse '(text double left) 'mouse-exch-pt-and-mark)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
523
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
524 (global-set-mouse '(text middle) 'mouse-set-mark-and-stuff)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
525
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
526 (global-set-mouse '(text right) 'emacs-menu-eval)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
527 (global-set-mouse '(text shift right) '(sun-yank-selection))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
528 (global-set-mouse '(text double right) '(sun-yank-selection))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
529
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
530 ;; The Slymoblics multi-command for Save, Kill, Copy, Move:
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
531 (global-set-mouse '(text shift middle) 'mouse-save/delete/yank)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
532 (global-set-mouse '(text double middle) 'mouse-save/delete/yank)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
533
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
534 ;; Save, Kill, Copy, Move Things:
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
535 ;; control-left composes with control middle/right to produce copy/move
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
536 (global-set-mouse '(text control middle ) 'mouse-save-thing-there)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
537 (global-set-mouse '(text control right ) 'mouse-kill-thing-there)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
538 (global-set-mouse '(text control left) 'mouse-yank-at-point)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
539 (global-set-mouse '(text control middle left) 'mouse-copy-thing)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
540 (global-set-mouse '(text control right left) 'mouse-move-thing)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
541 (global-set-mouse '(text control right middle) 'mouse-mark-thing)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
542
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
543 ;; The Universal mouse help command (press all buttons):
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
544 (global-set-mouse '(text shift control meta right) 'mouse-help-region)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
545 (global-set-mouse '(text double control meta right) 'mouse-help-region)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
546
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
547 ;;; Meta in Text Region is like meta version in scrollbar:
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
548 (global-set-mouse '(text meta left) 'mouse-line-to-top)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
549 (global-set-mouse '(text meta shift left) 'mouse-line-to-bottom)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
550 (global-set-mouse '(text meta double left) 'mouse-line-to-bottom)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
551 (global-set-mouse '(text meta middle) 'mouse-line-to-middle)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
552 (global-set-mouse '(text meta shift middle) 'mouse-middle-to-line)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
553 (global-set-mouse '(text meta double middle) 'mouse-middle-to-line)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
554 (global-set-mouse '(text meta control middle) 'mouse-split-vertically)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
555 (global-set-mouse '(text meta right) 'mouse-top-to-line)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
556 (global-set-mouse '(text meta shift right) 'mouse-bottom-to-line)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
557 (global-set-mouse '(text meta double right) 'mouse-bottom-to-line)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
558
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
559 ;; Miscellaneous:
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
560 (global-set-mouse '(text meta control left) 'mouse-call-kbd-macro)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
561 (global-set-mouse '(text meta control right) 'mouse-undo)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
562
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
563 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
564 ;;; Scrollbar mousemap.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
565 ;;; Are available in the Scrollbar Region, or with Meta Text (or Meta Scrollbar)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
566 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
567 (global-set-mouse '(scrollbar left) 'mouse-line-to-top)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
568 (global-set-mouse '(scrollbar shift left) 'mouse-line-to-bottom)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
569 (global-set-mouse '(scrollbar double left) 'mouse-line-to-bottom)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
570
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
571 (global-set-mouse '(scrollbar middle) 'mouse-line-to-middle)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
572 (global-set-mouse '(scrollbar shift middle) 'mouse-middle-to-line)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
573 (global-set-mouse '(scrollbar double middle) 'mouse-middle-to-line)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
574 (global-set-mouse '(scrollbar control middle) 'mouse-split-vertically)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
575
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
576 (global-set-mouse '(scrollbar right) 'mouse-top-to-line)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
577 (global-set-mouse '(scrollbar shift right) 'mouse-bottom-to-line)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
578 (global-set-mouse '(scrollbar double right) 'mouse-bottom-to-line)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
579
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
580 (global-set-mouse '(scrollbar meta left) 'mouse-line-to-top)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
581 (global-set-mouse '(scrollbar meta shift left) 'mouse-line-to-bottom)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
582 (global-set-mouse '(scrollbar meta double left) 'mouse-line-to-bottom)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
583 (global-set-mouse '(scrollbar meta middle) 'mouse-line-to-middle)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
584 (global-set-mouse '(scrollbar meta shift middle) 'mouse-middle-to-line)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
585 (global-set-mouse '(scrollbar meta double middle) 'mouse-middle-to-line)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
586 (global-set-mouse '(scrollbar meta control middle) 'mouse-split-vertically)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
587 (global-set-mouse '(scrollbar meta right) 'mouse-top-to-line)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
588 (global-set-mouse '(scrollbar meta shift right) 'mouse-bottom-to-line)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
589 (global-set-mouse '(scrollbar meta double right) 'mouse-bottom-to-line)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
590
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
591 ;; And the help menu:
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
592 (global-set-mouse '(scrollbar shift control meta right) 'mouse-help-region)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
593 (global-set-mouse '(scrollbar double control meta right) 'mouse-help-region)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
594
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
595 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
596 ;;; Modeline mousemap.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
597 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
598 ;;; Note: meta of any single button selects window.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
599
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
600 (global-set-mouse '(modeline left) 'mouse-scroll-up)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
601 (global-set-mouse '(modeline meta left) 'mouse-select-window)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
602
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
603 (global-set-mouse '(modeline middle) 'mouse-scroll-proportional)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
604 (global-set-mouse '(modeline meta middle) 'mouse-select-window)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
605 (global-set-mouse '(modeline control middle) 'mouse-split-horizontally)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
606
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
607 (global-set-mouse '(modeline right) 'mouse-scroll-down)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
608 (global-set-mouse '(modeline meta right) 'mouse-select-window)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
609
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
610 ;;; control-left selects this window, control-right deletes it.
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
611 (global-set-mouse '(modeline control left) 'mouse-delete-other-windows)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
612 (global-set-mouse '(modeline control right) 'mouse-delete-window)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
613
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
614 ;; in case of confusion, just select it:
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
615 (global-set-mouse '(modeline control left right)'mouse-select-window)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
616
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
617 ;; even without confusion (and without the keyboard) select it:
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
618 (global-set-mouse '(modeline left right) 'mouse-select-window)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
619
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
620 ;; And the help menu:
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
621 (global-set-mouse '(modeline shift control meta right) 'mouse-help-region)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
622 (global-set-mouse '(modeline double control meta right) 'mouse-help-region)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
623
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
624 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
625 ;;; Minibuffer Mousemap
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
626 ;;; Demonstrating some variety:
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
627 ;;;
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
628 (global-set-mouse '(minibuffer left) 'mini-move-point)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
629
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
630 (global-set-mouse '(minibuffer middle) 'mini-set-mark-and-stuff)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
631
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
632 (global-set-mouse '(minibuffer shift middle) '(select-previous-complex-command))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
633 (global-set-mouse '(minibuffer double middle) '(select-previous-complex-command))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
634 (global-set-mouse '(minibuffer control middle) '(next-complex-command 1))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
635 (global-set-mouse '(minibuffer meta middle) '(previous-complex-command 1))
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
636
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
637 (global-set-mouse '(minibuffer right) 'minibuffer-menu-eval)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
638
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
639 (global-set-mouse '(minibuffer shift control meta right) 'mouse-help-region)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
640 (global-set-mouse '(minibuffer double control meta right) 'mouse-help-region)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
641
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
642 (provide 'sun-fns)
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
643
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49598
diff changeset
644 ;;; arch-tag: 1c4c1192-f71d-4d5f-b883-ae659c28e132
39022
9a10bb9ac325 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
645 ;;; sun-fns.el ends here