aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2011-11-25 23:43:34 +0800
committerChong Yidong2011-11-25 23:43:34 +0800
commit4ad3bc2a221e84930ac53f09972a7b46362e4f21 (patch)
tree06edb40f7df73b6be713567dcee528ab7b23f0a1
parent5c730f48c59db8a891cbe46014645f01b4c201e6 (diff)
downloademacs-4ad3bc2a221e84930ac53f09972a7b46362e4f21.tar.gz
emacs-4ad3bc2a221e84930ac53f09972a7b46362e4f21.zip
Fixes and updates for Frames chapter in Emacs manual.
* doc/emacs/files.texi (Visiting): `C-x 5 f' works on ttys too. * doc/emacs/frames.texi (Frames): Rewrite introduction. (Mouse Commands): Default for mouse-drag-copy-region is now t. The mouse-save-then-kill-command does not copy to kill ring by default. Behavior of DEL is not special to mouse commands now. (Mouse References): Document mouse-1-click-follows-link more thoroughly. (Menu Mouse Clicks): Move footnote to the main text and add xref to Init Rebinding node. (Mode Line Mouse): Mouse-3 on the mode-line does not bury buffer. * lisp/window.el (display-buffer--special-action): Minor doc fix.
-rw-r--r--doc/emacs/ChangeLog14
-rw-r--r--doc/emacs/files.texi5
-rw-r--r--doc/emacs/frames.texi223
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/window.el7
5 files changed, 142 insertions, 111 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index abf0c86d1cf..8cef196c90d 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,17 @@
12011-11-25 Chong Yidong <cyd@gnu.org>
2
3 * frames.texi (Frames): Rewrite introduction.
4 (Mouse Commands): Default for mouse-drag-copy-region is now t.
5 Mouse-3 does not copy to kill ring by default. DEL does not
6 behave specially for mouse commands any more.
7 (Mouse References): Document mouse-1-click-follows-link more
8 thoroughly.
9 (Menu Mouse Clicks): Move footnote to the main text and add xref
10 to Init Rebinding node.
11 (Mode Line Mouse): Mouse-3 on the mode-line does not bury buffer.
12
13 * files.texi (Visiting): `C-x 5 f' works on ttys too.
14
12011-11-24 Juanma Barranquero <lekktu@gmail.com> 152011-11-24 Juanma Barranquero <lekktu@gmail.com>
2 16
3 * display.texi (Font Lock): Fix typo. 17 * display.texi (Font Lock): Fix typo.
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index 2317f876b08..8c41ca13225 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -267,9 +267,8 @@ newly requested file. @xref{Windows}.
267@kindex C-x 5 f 267@kindex C-x 5 f
268@findex find-file-other-frame 268@findex find-file-other-frame
269 @kbd{C-x 5 f} (@code{find-file-other-frame}) is similar, but opens a 269 @kbd{C-x 5 f} (@code{find-file-other-frame}) is similar, but opens a
270new frame, or makes visible any existing frame showing the file you 270new frame, or selects any existing frame showing the specified file.
271seek. This feature is available only when you are using a window 271@xref{Frames}.
272system. @xref{Frames}.
273 272
274@cindex file selection dialog 273@cindex file selection dialog
275 On graphical displays, there are two additional methods for visiting 274 On graphical displays, there are two additional methods for visiting
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index 49222451cce..22333fc0971 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -6,31 +6,41 @@
6@chapter Frames and Graphical Displays 6@chapter Frames and Graphical Displays
7@cindex frames 7@cindex frames
8 8
9 When using a graphical display, you can create multiple system-level 9 When Emacs is started on a graphical display, e.g. on the X Window
10``windows'' in a single Emacs session. We refer to these system-level 10System, it occupies a graphical system-level ``window''. In this
11windows as @dfn{frames}. A frame initially contains a single Emacs 11manual, we call this a @dfn{frame}; we reserve the word ``window'' for
12window; however, you can subdivide this Emacs window into smaller 12the part of the frame used for displaying a buffer. A frame initially
13windows, all fitting into the same frame. Each frame normally 13contains one window, but it can be subdivided into multiple windows
14contains its own echo area and minibuffer. 14(@pxref{Windows}). A frame normally also contains a menu bar, tool
15 15bar, and echo area.
16 To avoid confusion, we reserve the word ``window'' for the 16
17subdivisions that Emacs implements, and never use it to refer to a 17 You can also create additional frames (@pxref{Creating Frames}).
18frame. 18All frames created in the same Emacs session have access to the same
19 19underlying buffers and other data. For instance, if a buffer is being
20 Any editing you do in one frame affects the other frames. For 20shown in more than one frame, any changes made to it in one frame show
21instance, if you put text in the kill ring in one frame, you can yank 21up immediately in the other frames too.
22it in another frame. If you exit Emacs through @kbd{C-x C-c} in one 22
23frame, it terminates all the frames. To delete just one frame, use 23 Typing @kbd{C-x C-c} closes all the frames on the current display,
24and ends the Emacs session if it has no frames open on any other
25displays (@pxref{Exiting}). To close just the selected frame, type
24@kbd{C-x 5 0} (that is zero, not @kbd{o}). 26@kbd{C-x 5 0} (that is zero, not @kbd{o}).
25 27
26 Emacs compiled for MS-DOS emulates some windowing functionality, 28 This chapter describes Emacs features specific to graphical displays
27so that you can use many of the features described in this chapter. 29(particularly mouse commands), and features for managing multiple
30frames. On text-only terminals, many of these features are
31unavailable. However, it is still possible to create multiple
32``frames'' on text-only terminals; such frames are displayed one at a
33time, filling the entire terminal screen (@pxref{Non-Window
34Terminals}). It is also possible to use the mouse on some text-only
35terminals (@pxref{Text-Only Mouse}, for doing so on GNU and UNIX
36systems; and
28@iftex 37@iftex
29@xref{MS-DOS Mouse,,,emacs-xtra,Specialized Emacs Features}. 38@pxref{MS-DOS Mouse,,,emacs-xtra,Specialized Emacs Features},
30@end iftex 39@end iftex
31@ifnottex 40@ifnottex
32@xref{MS-DOS Mouse}. 41@pxref{MS-DOS Mouse},
33@end ifnottex 42@end ifnottex
43for doing so on MS-DOS).
34 44
35@menu 45@menu
36* Mouse Commands:: Moving, cutting, and pasting, with the mouse. 46* Mouse Commands:: Moving, cutting, and pasting, with the mouse.
@@ -87,29 +97,30 @@ ring; on a second click, kill it (@code{mouse-save-then-kill}).
87 The most basic mouse command is @code{mouse-set-point}, which is 97 The most basic mouse command is @code{mouse-set-point}, which is
88called by clicking with the left mouse button, @kbd{Mouse-1}, in the 98called by clicking with the left mouse button, @kbd{Mouse-1}, in the
89text area of a window. This moves point to the position where you 99text area of a window. This moves point to the position where you
90clicked. 100clicked. If that window was not the selected window, it becomes the
101selected window.
91 102
92@vindex x-mouse-click-focus-ignore-position 103@vindex x-mouse-click-focus-ignore-position
93 Normally, Emacs does not distinguish between ordinary mouse clicks 104 Normally, if the frame you clicked in was not the selected frame, it
94and clicks that select a frame. When you click on a frame to select 105is made the selected frame, in addition to selecting the window and
95it, that also changes the selected window and cursor position 106setting the cursor. On the X Window System, you can change this by
96according to the mouse click position. On the X Window System, you 107setting the variable @code{x-mouse-click-focus-ignore-position} to
97can change this behavior by setting the variable 108@code{t}. In that case, the initial click on an unselected frame just
98@code{x-mouse-click-focus-ignore-position} to @code{t}. Then the 109selects the frame, without doing anything else; clicking again selects
99first click selects the frame, but does not affect the selected window 110the window and sets the cursor position.
100or cursor position. If you click again in the same place, that click
101will be in the selected frame, so it will change the window or cursor
102position.
103 111
104@findex mouse-set-region 112@findex mouse-set-region
105@vindex mouse-drag-copy-region
106 Holding down @kbd{Mouse-1} and ``dragging'' the mouse over a stretch 113 Holding down @kbd{Mouse-1} and ``dragging'' the mouse over a stretch
107of text activates the region around that text 114of text activates the region around that text
108(@code{mouse-set-region}). @xref{Mark}. Emacs places the mark where 115(@code{mouse-set-region}), placing the mark where you started holding
109you started holding down the mouse button, and point where you release 116down the mouse button, and point where you release it (@pxref{Mark}).
110it. In addition, the region is copied into the kill ring (@pxref{Kill 117In addition, the text in the region becomes the primary selection
111Ring}). If you don't want Emacs to copy the region, change the 118(@pxref{Primary Selection}).
112variable @code{mouse-drag-copy-region} to @code{nil}. 119
120@vindex mouse-drag-copy-region
121 If you change the variable @code{mouse-drag-copy-region} to a
122non-@code{nil} value, dragging the mouse over a stretch of text also
123adds the text to the kill ring. The default is @code{nil}.
113 124
114@vindex mouse-scroll-min-lines 125@vindex mouse-scroll-min-lines
115 If you move the mouse off the top or bottom of the window while 126 If you move the mouse off the top or bottom of the window while
@@ -124,7 +135,7 @@ on how far away from the window edge the mouse has gone; the variable
124 Clicking with the middle mouse button, @kbd{Mouse-2}, moves point to 135 Clicking with the middle mouse button, @kbd{Mouse-2}, moves point to
125the position where you clicked and inserts the contents of the primary 136the position where you clicked and inserts the contents of the primary
126selection (@code{mouse-yank-primary}). @xref{Primary Selection}. 137selection (@code{mouse-yank-primary}). @xref{Primary Selection}.
127This behavior is consistent with other X applications; alternatively, 138This behavior is consistent with other X applications. Alternatively,
128you can rebind @kbd{Mouse-2} to @code{mouse-yank-at-click}, which 139you can rebind @kbd{Mouse-2} to @code{mouse-yank-at-click}, which
129performs a yank at point. 140performs a yank at point.
130 141
@@ -144,7 +155,6 @@ depending on where you click and the status of the region:
144@item 155@item
145If no region is active, clicking @kbd{Mouse-3} activates the region, 156If no region is active, clicking @kbd{Mouse-3} activates the region,
146placing the mark where point was and point at the clicked position. 157placing the mark where point was and point at the clicked position.
147In addition, the text in the region is copied to the kill ring.
148 158
149@item 159@item
150If a region is active, clicking @kbd{Mouse-3} adjusts the nearer end 160If a region is active, clicking @kbd{Mouse-3} adjusts the nearer end
@@ -155,8 +165,8 @@ region was already on the kill ring, it replaces it there.
155@item 165@item
156If you originally specified the region using a double or triple 166If you originally specified the region using a double or triple
157@kbd{Mouse-1}, so that the region is defined to consist of entire 167@kbd{Mouse-1}, so that the region is defined to consist of entire
158words or lines, then adjusting the region with @kbd{Mouse-3} also 168words or lines (@pxref{Word and Line Mouse}), then adjusting the
159proceeds by entire words or lines. 169region with @kbd{Mouse-3} also proceeds by entire words or lines.
160 170
161@item 171@item
162If you use @kbd{Mouse-3} a second time consecutively, at the same 172If you use @kbd{Mouse-3} a second time consecutively, at the same
@@ -168,23 +178,17 @@ just once---or just drag across the text with @kbd{Mouse-1}. Then you
168can copy it elsewhere by yanking it. 178can copy it elsewhere by yanking it.
169@end itemize 179@end itemize
170 180
181 The @code{mouse-save-then-kill} command also obeys the variable
182@code{mouse-drag-copy-region} (described above). If the value is
183non-@code{nil}, then whenever the command sets or adjusts the active
184region, the text in the region is also added to the kill ring. If the
185latest kill ring entry had been added the same way, that entry is
186replaced rather than making a new entry.
187
171 Whenever you set the region using any of the mouse commands 188 Whenever you set the region using any of the mouse commands
172described above, the mark will be deactivated by any subsequent 189described above, the mark will be deactivated by any subsequent
173unshifted cursor motion command, in addition to the usual ways of 190unshifted cursor motion command, in addition to the usual ways of
174deactivating the mark. @xref{Shift Selection}. While the region 191deactivating the mark. @xref{Shift Selection}.
175remains active, typing @key{Backspace} or @key{Delete} deletes the
176text in that region and deactivates the mark; this behavior follows a
177convention established by other graphical programs, and it does
178@emph{not} apply when you set the region any other way, including
179shift-selection (@pxref{Shift Selection}).
180
181@cindex Delete Selection mode
182@cindex mode, Delete Selection
183@findex delete-selection-mode
184 Many graphical applications also follow the convention that
185insertion while text is selected deletes the selected text. You can
186make Emacs behave this way by enabling Delete Selection mode.
187@xref{Using Region}.
188 192
189@node Word and Line Mouse 193@node Word and Line Mouse
190@section Mouse Commands for Words and Lines 194@section Mouse Commands for Words and Lines
@@ -202,7 +206,7 @@ underscore, in C mode) selects the symbol surrounding that character.
202Double-clicking on a character with open- or close-parenthesis syntax 206Double-clicking on a character with open- or close-parenthesis syntax
203selects the parenthetical grouping which that character starts or 207selects the parenthetical grouping which that character starts or
204ends. Double-clicking on a character with string-delimiter syntax 208ends. Double-clicking on a character with string-delimiter syntax
205(such as a singlequote or doublequote in C) selects the string 209(such as a single-quote or double-quote in C) selects the string
206constant (Emacs uses heuristics to figure out whether that character 210constant (Emacs uses heuristics to figure out whether that character
207is the beginning or the end of it). 211is the beginning or the end of it).
208 212
@@ -220,50 +224,54 @@ Select the text you drag across, in the form of whole lines.
220@section Following References with the Mouse 224@section Following References with the Mouse
221@kindex Mouse-1 @r{(selection)} 225@kindex Mouse-1 @r{(selection)}
222@kindex Mouse-2 @r{(selection)} 226@kindex Mouse-2 @r{(selection)}
227@cindex hyperlinks
228@cindex links
229@cindex text buttons
230@cindex buttons
223 231
224@vindex mouse-highlight 232@vindex mouse-highlight
225 Some Emacs buffers include @dfn{buttons}. A button is a piece of 233 Some Emacs buffers include @dfn{buttons}, or @dfn{hyperlinks}:
226text that performs some action when you activate it, such as following 234pieces of text that perform some action (e.g. following a reference)
227a reference. Usually, a button's text is visually highlighted: it is 235when activated (e.g. by clicking on them). Usually, a button's text
228underlined, or a box is drawn around it. If you move the mouse over a 236is visually highlighted: it is underlined, or a box is drawn around
229button, the shape of the mouse cursor changes and the button lights up 237it. If you move the mouse over a button, the shape of the mouse
230(if you change the variable @code{mouse-highlight} to @code{nil}, 238cursor changes and the button lights up. If you change the variable
231Emacs disables this highlighting). 239@code{mouse-highlight} to @code{nil}, Emacs disables this
240highlighting.
232 241
233 You can activate a button by moving point to it and typing 242 You can activate a button by moving point to it and typing
234@key{RET}, or by clicking either @kbd{Mouse-1} or @kbd{Mouse-2} on the 243@key{RET}, or by clicking either @kbd{Mouse-1} or @kbd{Mouse-2} on the
235button. For example, typing @key{RET} or clicking on a file name in a 244button. For example, in a Dired buffer, each file name is a button;
236Dired buffer visits that file (@pxref{Dired}). Doing it on an error 245activating it causes Emacs to visit that file (@pxref{Dired}). In a
237message in the @samp{*Compilation*} buffer goes to the source code for 246@samp{*Compilation*} buffer, each error message is a button, and
238that error message (@pxref{Compilation}). Doing it on a completion in 247activating it visits the source code for that error
239the @samp{*Completions*} buffer chooses that completion 248(@pxref{Compilation}).
240(@pxref{Completion}). 249
241 250 Although clicking @kbd{Mouse-1} on a button usually activates the
242 Although clicking @kbd{Mouse-1} on a button usually activates that 251button, if you hold the mouse button down for a period of time before
243button, if you hold the mouse button down for a short period of time 252releasing it (specifically, for more than 450 milliseconds), then
244before releasing it (specifically, for more than 450 milliseconds), 253Emacs moves point where you clicked, without activating the button.
245then Emacs moves point where you clicked instead. This behavior 254In this way, you can use the mouse to move point over a button without
246allows you to use the mouse to move point over a button without 255activating it. Dragging the mouse over or onto a button has its usual
247following it. Dragging---moving the mouse while it is held down---has 256behavior of setting the region, and does not activate the button.
248its usual behavior of setting the region, even if you drag from or 257
249onto a button. 258 You can change how @kbd{Mouse-1} applies to buttons by customizing
259the variable @code{mouse-1-click-follows-link}. If the value is a
260positive integer, that determines how long you need to hold the mouse
261button down for, in milliseconds, to cancel button activation; the
262default is 450, as described in the previous paragraph. If the value
263is @code{nil}, @kbd{Mouse-1} just sets point where you clicked, and
264does not activate buttons. If the value is @code{double}, double
265clicks activate buttons but single clicks just set point.
250 266
251@vindex mouse-1-click-in-non-selected-windows 267@vindex mouse-1-click-in-non-selected-windows
252 Normally, clicking @kbd{Mouse-1} on a button activates the button 268 Normally, @kbd{Mouse-1} on a button activates the button even if it
253even if it is in a nonselected window. If you change the variable 269is in a non-selected window. If you change the variable
254@code{mouse-1-click-in-non-selected-windows} to @code{nil}, clicking 270@code{mouse-1-click-in-non-selected-windows} to @code{nil},
255@kbd{Mouse-1} on a button in an un-selected window moves point to the 271@kbd{Mouse-1} on a button in an unselected window moves point to the
256clicked position and selects that window, without activating the 272clicked position and selects that window, without activating the
257button. 273button.
258 274
259@vindex mouse-1-click-follows-link
260 In Emacs versions before 22, only @kbd{Mouse-2} activates buttons
261and @kbd{Mouse-1} always sets point. If you prefer this older
262behavior, set the variable @code{mouse-1-click-follows-link} to
263@code{nil}. This variable also lets you choose various other
264alternatives for following links with the mouse. Type @kbd{C-h v
265mouse-1-click-follows-link @key{RET}} for more details.
266
267@node Menu Mouse Clicks 275@node Menu Mouse Clicks
268@section Mouse Clicks for Menus 276@section Mouse Clicks for Menus
269 277
@@ -288,20 +296,26 @@ for editing formatted text. @xref{Formatted Text}.
288This menu is mode-specific. For most modes if Menu-bar mode is on, 296This menu is mode-specific. For most modes if Menu-bar mode is on,
289this menu has the same items as all the mode-specific menu-bar menus 297this menu has the same items as all the mode-specific menu-bar menus
290put together. Some modes may specify a different menu for this 298put together. Some modes may specify a different menu for this
291button.@footnote{Some systems use @kbd{Mouse-3} for a mode-specific 299button. If Menu Bar mode is off, this menu contains all the items
292menu. We took a survey of users, and found they preferred to keep 300which would be present in the menu bar---not just the mode-specific
293@kbd{Mouse-3} for selecting and killing regions. Hence the decision 301ones---so that you can access them without having to display the menu
294to use @kbd{C-Mouse-3} for this menu. To use @kbd{Mouse-3} instead, 302bar.
295do @code{(global-set-key [mouse-3] 'mouse-popup-menubar-stuff)}.} If
296Menu-bar mode is off, this menu contains all the items which would be
297present in the menu bar---not just the mode-specific ones---so that
298you can access them without having to display the menu bar.
299 303
300@item S-Mouse-1 304@item S-Mouse-1
301This menu is for changing the default face within the window's buffer. 305This menu is for changing the default face within the window's buffer.
302@xref{Text Scale}. 306@xref{Text Scale}.
303@end table 307@end table
304 308
309 Some graphical applications use @kbd{Mouse-3} for a mode-specific
310menu. If you prefer @kbd{Mouse-3} in Emacs to bring up such a menu
311instead of running the @code{mouse-save-then-kill} command, rebind
312@kbd{Mouse-3} by adding the following line to your init file
313(@pxref{Init Rebinding}):
314
315@smallexample
316(global-set-key [mouse-3] 'mouse-popup-menubar-stuff)
317@end smallexample
318
305@node Mode Line Mouse 319@node Mode Line Mouse
306@section Mode Line Mouse Commands 320@section Mode Line Mouse Commands
307@cindex mode line, mouse 321@cindex mode line, mouse
@@ -332,21 +346,20 @@ make any window smaller than the minimum height.
332@item Mouse-3 346@item Mouse-3
333@kindex Mouse-3 @r{(mode line)} 347@kindex Mouse-3 @r{(mode line)}
334@kbd{Mouse-3} on a mode line deletes the window it belongs to. If the 348@kbd{Mouse-3} on a mode line deletes the window it belongs to. If the
335frame has only one window, it buries the current buffer instead, and 349frame has only one window, it does nothing.
336switches to another buffer.
337 350
338@item C-Mouse-2 351@item C-Mouse-2
339@kindex C-mouse-2 @r{(mode line)} 352@kindex C-mouse-2 @r{(mode line)}
340@kbd{C-Mouse-2} on a mode line splits the window above 353@kbd{C-Mouse-2} on a mode line splits that window, producing two
341horizontally, above the place in the mode line where you click. 354side-by-side windows with the boundary running through the click
355position (@pxref{Split Window}).
342@end table 356@end table
343 357
344@kindex C-Mouse-2 @r{(scroll bar)} 358@kindex C-Mouse-2 @r{(scroll bar)}
345@kindex Mouse-1 @r{(scroll bar)} 359@kindex Mouse-1 @r{(scroll bar)}
346 Using @kbd{Mouse-1} on the divider between two side-by-side mode 360 Furthermore, by clicking and dragging @kbd{Mouse-1} on the divider
347lines, you can move the vertical boundary left or right. Using 361between two side-by-side mode lines, you can move the vertical
348@kbd{C-Mouse-2} on a scroll bar splits the corresponding window 362boundary to the left or right.
349vertically. @xref{Split Window}.
350 363
351@node Creating Frames 364@node Creating Frames
352@section Creating Frames 365@section Creating Frames
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8f31c293b7a..117a5c2fed6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12011-11-24 Chong Yidong <cyd@gnu.org>
2
3 * window.el (display-buffer--special-action): Doc fix.
4
12011-11-25 Juanma Barranquero <lekktu@gmail.com> 52011-11-25 Juanma Barranquero <lekktu@gmail.com>
2 6
3 * emacs-lisp/avl-tree.el (avl-tree--do-copy, avl-tree-create) 7 * emacs-lisp/avl-tree.el (avl-tree--do-copy, avl-tree-create)
diff --git a/lisp/window.el b/lisp/window.el
index ad611bbba56..0796b7fa493 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -4786,9 +4786,10 @@ terminal if either of those variables is non-nil."
4786 (window--display-buffer-1 window)))) 4786 (window--display-buffer-1 window))))
4787 4787
4788(defun display-buffer--special-action (buffer) 4788(defun display-buffer--special-action (buffer)
4789 "Try to display BUFFER using `special-display-function'. 4789 "Return special display action for BUFFER, if any.
4790Call `special-display-p' on BUFFER's name, and if that returns 4790If `special-display-p' returns non-nil for BUFFER, return an
4791non-nil, call `special-display-function' on BUFFER." 4791appropriate display action involving `special-display-function'.
4792See `display-buffer' for the format of display actions."
4792 (and special-display-function 4793 (and special-display-function
4793 ;; `special-display-p' returns either t or a list of frame 4794 ;; `special-display-p' returns either t or a list of frame
4794 ;; parameters to pass to `special-display-function'. 4795 ;; parameters to pass to `special-display-function'.