aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/lispref/ChangeLog7
-rw-r--r--doc/lispref/buffers.texi11
-rw-r--r--doc/lispref/elisp.texi9
-rw-r--r--doc/lispref/hooks.texi2
-rw-r--r--doc/lispref/windows.texi52
-rw-r--r--src/ChangeLog6
-rw-r--r--src/buffer.c4
-rw-r--r--src/window.c15
8 files changed, 74 insertions, 32 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 114d0197308..88a20fd8a2a 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,7 +1,14 @@
12014-03-07 Martin Rudalics <rudalics@gmx.at> 12014-03-07 Martin Rudalics <rudalics@gmx.at>
2 2
3 * buffers.texi (The Buffer List): Rename node to Buffer List.
4 Describe `buffer-list-update-hook'.
5 * elisp.texi (Top): "The Buffer List" renamed to "Buffer List".
6 Add node for Window Dividers.
7 * hooks.texi (Standard Hooks): Add reference to
8 `buffer-list-update-hook'.
3 * windows.texi (Window Sizes): Describe `window-min-size'. 9 * windows.texi (Window Sizes): Describe `window-min-size'.
4 (Splitting Windows): Update description of `split-window'. 10 (Splitting Windows): Update description of `split-window'.
11 (Selecting Windows): Update description of `select-window'.
5 12
62014-03-06 Martin Rudalics <rudalics@gmx.at> 132014-03-06 Martin Rudalics <rudalics@gmx.at>
7 14
diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi
index fbb6c4009af..1293a03082c 100644
--- a/doc/lispref/buffers.texi
+++ b/doc/lispref/buffers.texi
@@ -25,7 +25,7 @@ not be displayed in any windows.
25* Modification Time:: Determining whether the visited file was changed 25* Modification Time:: Determining whether the visited file was changed
26 "behind Emacs's back". 26 "behind Emacs's back".
27* Read Only Buffers:: Modifying text is not allowed in a read-only buffer. 27* Read Only Buffers:: Modifying text is not allowed in a read-only buffer.
28* The Buffer List:: How to look at all the existing buffers. 28* Buffer List:: How to look at all the existing buffers.
29* Creating Buffers:: Functions that create buffers. 29* Creating Buffers:: Functions that create buffers.
30* Killing Buffers:: Buffers exist until explicitly killed. 30* Killing Buffers:: Buffers exist until explicitly killed.
31* Indirect Buffers:: An indirect buffer shares text with some other buffer. 31* Indirect Buffers:: An indirect buffer shares text with some other buffer.
@@ -759,7 +759,7 @@ buffer is read-only. @xref{Using Interactive}, for another way to
759signal an error if the current buffer is read-only. 759signal an error if the current buffer is read-only.
760@end defun 760@end defun
761 761
762@node The Buffer List 762@node Buffer List
763@section The Buffer List 763@section The Buffer List
764@cindex buffer list 764@cindex buffer list
765 765
@@ -910,6 +910,13 @@ buffer returned by @code{last-buffer} (see above), in the selected
910window. 910window.
911@end deffn 911@end deffn
912 912
913@defvar buffer-list-update-hook
914This is a normal hook run whenever the buffer list changes. Functions
915(implicitly) running this hook are @code{get-buffer-create}
916(@pxref{Creating Buffers}), @code{rename-buffer} (@pxref{Buffer Names}),
917@code{kill-buffer} (@pxref{Killing Buffers}), @code{bury-buffer} (see
918above) and @code{select-window} (@pxref{Selecting Windows}).
919@end defvar
913 920
914@node Creating Buffers 921@node Creating Buffers
915@section Creating Buffers 922@section Creating Buffers
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index 8442c3dbcfe..f0a55968376 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -992,7 +992,7 @@ Buffers
992 "behind Emacs's back". 992 "behind Emacs's back".
993* Read Only Buffers:: Modifying text is not allowed in a 993* Read Only Buffers:: Modifying text is not allowed in a
994 read-only buffer. 994 read-only buffer.
995* The Buffer List:: How to look at all the existing buffers. 995* Buffer List:: How to look at all the existing buffers.
996* Creating Buffers:: Functions that create buffers. 996* Creating Buffers:: Functions that create buffers.
997* Killing Buffers:: Buffers exist until explicitly killed. 997* Killing Buffers:: Buffers exist until explicitly killed.
998* Indirect Buffers:: An indirect buffer shares text with some 998* Indirect Buffers:: An indirect buffer shares text with some
@@ -1344,12 +1344,13 @@ Emacs Display
1344 for text characters: font, colors, etc. 1344 for text characters: font, colors, etc.
1345* Fringes:: Controlling window fringes. 1345* Fringes:: Controlling window fringes.
1346* Scroll Bars:: Controlling vertical scroll bars. 1346* Scroll Bars:: Controlling vertical scroll bars.
1347* Window Dividers:: Separating windows visually.
1347* Display Property:: Enabling special display features. 1348* Display Property:: Enabling special display features.
1348* Images:: Displaying images in Emacs buffers. 1349* Images:: Displaying images in Emacs buffers.
1349* Buttons:: Adding clickable buttons to Emacs buffers. 1350* Buttons:: Adding clickable buttons to Emacs buffers.
1350* Abstract Display:: Emacs's Widget for Object Collections. 1351* Abstract Display:: Emacs's Widget for Object Collections.
1351* Blinking:: How Emacs shows the matching open parenthesis. 1352* Blinking:: How Emacs shows the matching open parenthesis.
1352* Character Display:: How Emacs displays individual characters. 1353* Character Display:: How Emacs displays individual characters.
1353* Beeping:: Audible signal to the user. 1354* Beeping:: Audible signal to the user.
1354* Window Systems:: Which window system is being used. 1355* Window Systems:: Which window system is being used.
1355* Bidirectional Display:: Display of bidirectional scripts, such as 1356* Bidirectional Display:: Display of bidirectional scripts, such as
@@ -1384,10 +1385,10 @@ Faces
1384* Attribute Functions:: Functions to examine and set face attributes. 1385* Attribute Functions:: Functions to examine and set face attributes.
1385* Displaying Faces:: How Emacs combines the faces specified for 1386* Displaying Faces:: How Emacs combines the faces specified for
1386 a character. 1387 a character.
1387* Face Remapping:: Remapping faces to alternative definitions. 1388* Face Remapping:: Remapping faces to alternative definitions.
1388* Face Functions:: How to define and examine faces. 1389* Face Functions:: How to define and examine faces.
1389* Auto Faces:: Hook for automatic face assignment. 1390* Auto Faces:: Hook for automatic face assignment.
1390* Basic Faces:: Faces that are defined by default. 1391* Basic Faces:: Faces that are defined by default.
1391* Font Selection:: Finding the best available font for a face. 1392* Font Selection:: Finding the best available font for a face.
1392* Font Lookup:: Looking up the names of available fonts 1393* Font Lookup:: Looking up the names of available fonts
1393 and information about them. 1394 and information about them.
diff --git a/doc/lispref/hooks.texi b/doc/lispref/hooks.texi
index c28fe2d5f5b..79704f3c509 100644
--- a/doc/lispref/hooks.texi
+++ b/doc/lispref/hooks.texi
@@ -98,7 +98,7 @@ Hook run after a frame's font changes.
98 98
99@item buffer-list-update-hook 99@item buffer-list-update-hook
100@vindex buffer-list-update-hook 100@vindex buffer-list-update-hook
101Hook run when the buffer list changes. 101Hook run when the buffer list changes (@pxref{Buffer List}).
102 102
103@item buffer-quit-function 103@item buffer-quit-function
104@vindex buffer-quit-function 104@vindex buffer-quit-function
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 0020c8bc967..fb022de546e 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -1504,16 +1504,27 @@ windows.
1504@defun select-window window &optional norecord 1504@defun select-window window &optional norecord
1505This function makes @var{window} the selected window and the window 1505This function makes @var{window} the selected window and the window
1506selected within its frame (@pxref{Basic Windows}) and selects that 1506selected within its frame (@pxref{Basic Windows}) and selects that
1507frame. @var{window} must be a live window. This function also makes 1507frame. It also makes @var{window}'s buffer (@pxref{Buffers and
1508@var{window}'s buffer (@pxref{Buffers and Windows}) current and sets 1508Windows}) current and sets that buffer's value of @code{point} to the
1509that buffer's value of @code{point} to the value of @code{window-point} 1509value of @code{window-point} (@pxref{Window Point}) in @var{window}.
1510(@pxref{Window Point}) in @var{window}. The return value is 1510@var{window} must be a live window. The return value is @var{window}.
1511@var{window}.
1512 1511
1513By default, this function also moves @var{window}'s buffer to the front 1512By default, this function also moves @var{window}'s buffer to the front
1514of the buffer list (@pxref{The Buffer List}), and makes @var{window} the 1513of the buffer list (@pxref{Buffer List}), and makes @var{window} the
1515most recently selected window. However, if the optional argument 1514most recently selected window. However, if the optional argument
1516@var{norecord} is non-@code{nil}, these additional actions are omitted. 1515@var{norecord} is non-@code{nil}, these additional actions are omitted.
1516
1517This function runs @code{buffer-list-update-hook} (@pxref{Buffer List})
1518unless @var{norecord} is non-@code{nil}. Note that applications and
1519internal routines often temporarily select a window in order to simplify
1520coding. As a rule, such selections (including those made by the macros
1521@code{save-selected-window} and @code{with-selected-window} below) are
1522not recorded thus avoiding to pollute @code{buffer-list-update-hook}.
1523Selections that ``really count'' are those causing a visible change in
1524the next redisplay of @var{window}'s frame and should be always
1525recorded. This also means that to run a function each time a window
1526gets selected, putting it on @code{buffer-list-update-hook} should be
1527the right choice.
1517@end defun 1528@end defun
1518 1529
1519@cindex most recently selected windows 1530@cindex most recently selected windows
@@ -1882,7 +1893,7 @@ window and make it the current buffer. It is often used interactively
1882return value is the buffer switched to. 1893return value is the buffer switched to.
1883 1894
1884If @var{buffer-or-name} is @code{nil}, it defaults to the buffer 1895If @var{buffer-or-name} is @code{nil}, it defaults to the buffer
1885returned by @code{other-buffer} (@pxref{The Buffer List}). If 1896returned by @code{other-buffer} (@pxref{Buffer List}). If
1886@var{buffer-or-name} is a string that is not the name of any existing 1897@var{buffer-or-name} is a string that is not the name of any existing
1887buffer, this function creates a new buffer with that name; the new 1898buffer, this function creates a new buffer with that name; the new
1888buffer's major mode is determined by the variable @code{major-mode} 1899buffer's major mode is determined by the variable @code{major-mode}
@@ -1890,7 +1901,7 @@ buffer's major mode is determined by the variable @code{major-mode}
1890 1901
1891Normally, the specified buffer is put at the front of the buffer 1902Normally, the specified buffer is put at the front of the buffer
1892list---both the global buffer list and the selected frame's buffer 1903list---both the global buffer list and the selected frame's buffer
1893list (@pxref{The Buffer List}). However, this is not done if the 1904list (@pxref{Buffer List}). However, this is not done if the
1894optional argument @var{norecord} is non-@code{nil}. 1905optional argument @var{norecord} is non-@code{nil}.
1895 1906
1896Sometimes, @code{switch-to-buffer} may be unable to display the buffer 1907Sometimes, @code{switch-to-buffer} may be unable to display the buffer
@@ -1968,7 +1979,7 @@ possible (@pxref{Input Focus}). The return value is the buffer that
1968was switched to. 1979was switched to.
1969 1980
1970If @var{buffer-or-name} is @code{nil}, it defaults to the buffer 1981If @var{buffer-or-name} is @code{nil}, it defaults to the buffer
1971returned by @code{other-buffer} (@pxref{The Buffer List}). If 1982returned by @code{other-buffer} (@pxref{Buffer List}). If
1972@var{buffer-or-name} is a string that is not the name of any existing 1983@var{buffer-or-name} is a string that is not the name of any existing
1973buffer, this function creates a new buffer with that name; the new 1984buffer, this function creates a new buffer with that name; the new
1974buffer's major mode is determined by the variable @code{major-mode} 1985buffer's major mode is determined by the variable @code{major-mode}
@@ -2524,9 +2535,9 @@ or killed, or has been already shown by a recent invocation of
2524 2535
2525If repeated invocations of this command have already shown all buffers 2536If repeated invocations of this command have already shown all buffers
2526previously shown in @var{window}, further invocations will show buffers 2537previously shown in @var{window}, further invocations will show buffers
2527from the buffer list of the frame @var{window} appears on (@pxref{The 2538from the buffer list of the frame @var{window} appears on (@pxref{Buffer
2528Buffer List}), trying to skip buffers that are already shown in another 2539List}), trying to skip buffers that are already shown in another window
2529window on that frame. 2540on that frame.
2530@end deffn 2541@end deffn
2531 2542
2532@deffn Command switch-to-next-buffer &optional window 2543@deffn Command switch-to-next-buffer &optional window
@@ -2537,7 +2548,7 @@ defaults to the selected one.
2537 2548
2538If there is no recent invocation of @code{switch-to-prev-buffer} that 2549If there is no recent invocation of @code{switch-to-prev-buffer} that
2539can be undone, this function tries to show a buffer from the buffer list 2550can be undone, this function tries to show a buffer from the buffer list
2540of the frame @var{window} appears on (@pxref{The Buffer List}). 2551of the frame @var{window} appears on (@pxref{Buffer List}).
2541@end deffn 2552@end deffn
2542 2553
2543By default @code{switch-to-prev-buffer} and @code{switch-to-next-buffer} 2554By default @code{switch-to-prev-buffer} and @code{switch-to-next-buffer}
@@ -2584,7 +2595,7 @@ called when a buffer gets killed, deletes the window in case (1) and
2584behaves like @code{delete-windows-on} otherwise. 2595behaves like @code{delete-windows-on} otherwise.
2585@c FIXME: Does replace-buffer-in-windows _delete_ a window in case (1)? 2596@c FIXME: Does replace-buffer-in-windows _delete_ a window in case (1)?
2586 2597
2587 When @code{bury-buffer} (@pxref{The Buffer List}) operates on the 2598 When @code{bury-buffer} (@pxref{Buffer List}) operates on the
2588selected window (which shows the buffer that shall be buried), it 2599selected window (which shows the buffer that shall be buried), it
2589handles case (2) by calling @code{frame-auto-hide-function} 2600handles case (2) by calling @code{frame-auto-hide-function}
2590(@pxref{Quitting Windows}) to deal with the selected frame. The other 2601(@pxref{Quitting Windows}) to deal with the selected frame. The other
@@ -2623,7 +2634,7 @@ buffer is shown on a separate frame, you might want to call
2623hand, a window has been reused for displaying the buffer, you might 2634hand, a window has been reused for displaying the buffer, you might
2624prefer showing the buffer previously shown in that window, by calling the 2635prefer showing the buffer previously shown in that window, by calling the
2625function @code{switch-to-prev-buffer} (@pxref{Window History}). 2636function @code{switch-to-prev-buffer} (@pxref{Window History}).
2626Finally, you might want to either bury (@pxref{The Buffer List}) or kill 2637Finally, you might want to either bury (@pxref{Buffer List}) or kill
2627(@pxref{Killing Buffers}) the window's buffer. 2638(@pxref{Killing Buffers}) the window's buffer.
2628 2639
2629 The following command uses information on how the window for 2640 The following command uses information on how the window for
@@ -2705,11 +2716,12 @@ one window that should be either quit, or whose buffer should be buried.
2705The function specified by this option is called to automatically hide 2716The function specified by this option is called to automatically hide
2706frames. This function is called with one argument---a frame. 2717frames. This function is called with one argument---a frame.
2707 2718
2708The function specified here is called by @code{bury-buffer} (@pxref{The 2719The function specified here is called by @code{bury-buffer}
2709Buffer List}) when the selected window is dedicated and shows the buffer 2720(@pxref{Buffer List}) when the selected window is dedicated and shows
2710to bury. It is also called by @code{quit-restore-window} (see above) 2721the buffer to bury. It is also called by @code{quit-restore-window}
2711when the frame of the window to quit has been specially created for 2722(see above) when the frame of the window to quit has been specially
2712displaying that window's buffer and the buffer is not killed. 2723created for displaying that window's buffer and the buffer is not
2724killed.
2713 2725
2714The default is to call @code{iconify-frame} (@pxref{Visibility of 2726The default is to call @code{iconify-frame} (@pxref{Visibility of
2715Frames}). Alternatively, you may specify either @code{delete-frame} 2727Frames}). Alternatively, you may specify either @code{delete-frame}
diff --git a/src/ChangeLog b/src/ChangeLog
index 9fef63c9a58..6d1285a82da 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12014-03-07 Martin Rudalics <rudalics@gmx.at>
2
3 * buffer.c (Vbuffer_list_update_hook): Doc-string fix.
4 * window.c (Fselect_window): Explain NORECORD and
5 `buffer-list-update-hook' in doc-string.
6
12014-03-06 Martin Rudalics <rudalics@gmx.at> 72014-03-06 Martin Rudalics <rudalics@gmx.at>
2 8
3 * window.c (Fother_window_for_scrolling): Check that 9 * window.c (Fother_window_for_scrolling): Check that
diff --git a/src/buffer.c b/src/buffer.c
index 90c15420d1d..028ef76ff71 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -6284,9 +6284,9 @@ The function `kill-all-local-variables' runs this before doing anything else. *
6284 6284
6285 DEFVAR_LISP ("buffer-list-update-hook", Vbuffer_list_update_hook, 6285 DEFVAR_LISP ("buffer-list-update-hook", Vbuffer_list_update_hook,
6286 doc: /* Hook run when the buffer list changes. 6286 doc: /* Hook run when the buffer list changes.
6287Functions running this hook are `get-buffer-create', 6287Functions running this hook are, `get-buffer-create',
6288`make-indirect-buffer', `rename-buffer', `kill-buffer', 6288`make-indirect-buffer', `rename-buffer', `kill-buffer',
6289and `bury-buffer-internal'. */); 6289`bury-buffer-internal' and `select-window'. */);
6290 Vbuffer_list_update_hook = Qnil; 6290 Vbuffer_list_update_hook = Qnil;
6291 DEFSYM (Qbuffer_list_update_hook, "buffer-list-update-hook"); 6291 DEFSYM (Qbuffer_list_update_hook, "buffer-list-update-hook");
6292 6292
diff --git a/src/window.c b/src/window.c
index 4d8520d7436..f42219cae94 100644
--- a/src/window.c
+++ b/src/window.c
@@ -559,7 +559,7 @@ select_window_1 (Lisp_Object window, bool inhibit_point_swap)
559DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0, 559DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0,
560 doc: /* Select WINDOW which must be a live window. 560 doc: /* Select WINDOW which must be a live window.
561Also make WINDOW's frame the selected frame and WINDOW that frame's 561Also make WINDOW's frame the selected frame and WINDOW that frame's
562selected window. In addition, make WINDOW's buffer current and set that 562selected window. In addition, make WINDOW's buffer current and set its
563buffer's value of `point' to the value of WINDOW's `window-point'. 563buffer's value of `point' to the value of WINDOW's `window-point'.
564Return WINDOW. 564Return WINDOW.
565 565
@@ -567,8 +567,17 @@ Optional second arg NORECORD non-nil means do not put this buffer at the
567front of the buffer list and do not make this window the most recently 567front of the buffer list and do not make this window the most recently
568selected one. 568selected one.
569 569
570Note that the main editor command loop sets the current buffer to the 570Run `buffer-list-update-hook' unless NORECORD is non-nil. Note that
571buffer of the selected window before each command. */) 571applications and internal routines often select a window temporarily for
572various purposes; mostly, to simplify coding. As a rule, such
573selections should be not recorded and therefore will not pollute
574`buffer-list-update-hook'. Selections that "really count" are those
575causing a visible change in the next redisplay of WINDOW's frame and
576should be always recorded. So if you think of running a function each
577time a window gets selected put it on `buffer-list-update-hook'.
578
579Also note that the main editor command loop sets the current buffer to
580the buffer of the selected window before each command. */)
572 (register Lisp_Object window, Lisp_Object norecord) 581 (register Lisp_Object window, Lisp_Object norecord)
573{ 582{
574 return select_window (window, norecord, 0); 583 return select_window (window, norecord, 0);