aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2001-02-17 13:51:18 +0000
committerRichard M. Stallman2001-02-17 13:51:18 +0000
commit564ee37bd23aafed06923bb36877bbab4cbc664b (patch)
treec751222949bb982c1c91916b9841269837303956
parent595ded7377f4ceb3d93b7d46a71751e388428f5b (diff)
downloademacs-564ee37bd23aafed06923bb36877bbab4cbc664b.tar.gz
emacs-564ee37bd23aafed06923bb36877bbab4cbc664b.zip
Major rewrite of Uniquify node and Iswitchb node.
Reorder info about indirect buffers, and clarify. Put BS and MSB together in one node, Buffer Menus. Don't mention kill-read-only-ok here. Misc. clarifications.
-rw-r--r--man/buffers.texi171
1 files changed, 90 insertions, 81 deletions
diff --git a/man/buffers.texi b/man/buffers.texi
index 71dcde881dd..fa2f1ba736d 100644
--- a/man/buffers.texi
+++ b/man/buffers.texi
@@ -134,10 +134,11 @@ selected buffer. Here is an example of a buffer list:@refill
134@end smallexample 134@end smallexample
135 135
136@noindent 136@noindent
137Note that the buffer @samp{*Help*} was made by a help request; it is not 137Note that the buffer @samp{*Help*} was made by a help request; it is
138visiting any file. The buffer @code{man} was made by Dired on the 138not visiting any file. The buffer @code{man} was made by Dired on the
139directory @file{/u2/emacs/man/}. You can list buffers visiting files 139directory @file{/u2/emacs/man/}. You can list only buffers that are
140only by giving the command a prefix, i.e. type @kbd{C-u C-x C-b}. 140visiting files by giving the command a prefix; for instance, by typing
141@kbd{C-u C-x C-b}.
141 142
142@need 2000 143@need 2000
143@node Misc Buffer 144@node Misc Buffer
@@ -159,13 +160,11 @@ Scroll through buffer @var{buffer}.
159@vindex buffer-read-only 160@vindex buffer-read-only
160@cindex read-only buffer 161@cindex read-only buffer
161 A buffer can be @dfn{read-only}, which means that commands to change 162 A buffer can be @dfn{read-only}, which means that commands to change
162its contents are not allowed. The mode line indicates read-only buffers 163its contents are not allowed. The mode line indicates read-only
163with @samp{%%} or @samp{%*} near the left margin. Read-only buffers are 164buffers with @samp{%%} or @samp{%*} near the left margin. Read-only
164usually made by subsystems such as Dired and Rmail that have special 165buffers are usually made by subsystems such as Dired and Rmail that
165commands to operate on the text; also by visiting a file whose access 166have special commands to operate on the text; also by visiting a file
166control says you cannot write it. However, if the variable 167whose access control says you cannot write it.
167@code{kill-read-only-ok} is set to a non-@code{nil} value, you can kill
168(a.k.a.@: cut) read-only text, see @ref{Killing}.
169 168
170 If you wish to make changes in a read-only buffer, use the command 169 If you wish to make changes in a read-only buffer, use the command
171@kbd{C-x C-q} (@code{vc-toggle-read-only}). It makes a read-only buffer 170@kbd{C-x C-q} (@code{vc-toggle-read-only}). It makes a read-only buffer
@@ -425,21 +424,22 @@ buffer, but killing an indirect buffer has no effect on its base buffer.
425 One way to use indirect buffers is to display multiple views of an 424 One way to use indirect buffers is to display multiple views of an
426outline. @xref{Outline Views}. 425outline. @xref{Outline Views}.
427 426
428 The command @kbd{M-x make-indirect-buffer} creates an indirect buffer
429whose name is @var{indirect-name} and whose text is identical to that of
430the buffer @var{base-buffer}. It prompts for both @var{base-buffer} and
431@var{indirect-name}.
432
433@cindex multiple @samp{*info*} and @samp{*Help*} buffers 427@cindex multiple @samp{*info*} and @samp{*Help*} buffers
434 The command @kbd{M-x clone-indirect-buffer} creates an indirect buffer 428 A quick and handy way to make an indirect buffer is with the command
435whose base buffer is the current buffer, and also selects the 429@kbd{M-x clone-indirect-buffer}. It creates and selects an indirect
436newly-created indirect buffer. With a numeric argument, it prompts for 430buffer whose base buffer is the current buffer. With a numeric
437the name of the indirect buffer; otherwise it defaults to the name of 431argument, it prompts for the name of the indirect buffer; otherwise it
438the current buffer, modifying it by adding a @samp{<@var{n}>} prefix if 432defaults to the name of the current buffer, modifying it by adding a
439required. @kbd{C-x 4 c} (@code{clone-indirect-buffer-other-window}) 433@samp{<@var{n}>} prefix if required. @kbd{C-x 4 c}
440works like @kbd{M-x clone-indirect-buffer}, but it selects the cloned 434(@code{clone-indirect-buffer-other-window}) works like @kbd{M-x
441buffer in another window. These commands come in handy if you want to 435clone-indirect-buffer}, but it selects the cloned buffer in another
442create new @samp{*info*} or @samp{*Help*} buffers, for example. 436window. These commands come in handy if you want to create new
437@samp{*info*} or @samp{*Help*} buffers, for example.
438
439 The more general way is with the command @kbd{M-x
440make-indirect-buffer}. It creates an indirect buffer from buffer
441@var{base-buffer}, under the name @var{indirect-name}. It prompts for
442both @var{base-buffer} and @var{indirect-name} using the minibuffer.
443 443
444@node Buffer Convenience 444@node Buffer Convenience
445@section Convenience Features and Customization of Buffer Handling 445@section Convenience Features and Customization of Buffer Handling
@@ -447,29 +447,46 @@ create new @samp{*info*} or @samp{*Help*} buffers, for example.
447@menu 447@menu
448* Uniquify:: Buffer names can contain directory parts. 448* Uniquify:: Buffer names can contain directory parts.
449* Iswitchb:: Switching between buffers with substrings. 449* Iswitchb:: Switching between buffers with substrings.
450* BS:: Configurable buffer menu. 450* Buffer Menus:: Configurable buffer menu.
451* MSB:: Customizing the Mouse Buffer Selection Menus.
452@end menu 451@end menu
453 452
454@node Uniquify 453@node Uniquify
455@subsection Directory Names in Buffer Names 454@subsection Making Buffer Names Unique
456 455
457@findex toggle-uniquify-buffer-names
458@vindex uniquify-buffer-name-style
459@cindex unique buffer names 456@cindex unique buffer names
460@cindex directories in buffer names 457@cindex directories in buffer names
461Emacs's standard method for making buffer names unique adds @samp{<2>}, 458 When several buffers visit identically-named files, Emacs must give
462@samp{<3>}, etc. to the end of (all but one of) the buffers. The 459the buffers distinct names. The usual method for making buffer names
463Uniquify package replaces that behavior, for buffers visiting files and 460unique adds @samp{<2>}, @samp{<3>}, etc. to the end of the buffer
464dired buffers. It implements a uniquification that adds parts of the 461names (all but one of them).
465file name until the buffer names are unique. For instance, buffers 462
466visiting @file{/u/mernst/tmp/Makefile} and 463@vindex uniquify-buffer-name-style
467@file{/usr/projects/zaphod/Makefile} would be named @samp{tmp/Makefile} 464 Other methods work by adding parts of each file's directory to the
468and @samp{zaphod/Makefile}, respectively (instead of @samp{Makefile} 465buffer name. To select one, customize the variable
469and @samp{Makefile<2>}). You can turn on this mode and select other 466@code{uniquify-buffer-name-style} (@pxref{Easy Customization}).
470buffer name styles by customizing the user option 467
471@code{uniquify-buffer-name-style}. The command @kbd{M-x 468 For instance, the @code{forward} naming method puts part of the
472toggle-uniquify-buffer-names} can also be used to toggle the mode. 469directory name at the beginning of the buffer name; using this method,
470buffers visiting @file{/u/mernst/tmp/Makefile} and
471@file{/usr/projects/zaphod/Makefile} would be named
472@samp{tmp/Makefile} and @samp{zaphod/Makefile}, respectively (instead
473of @samp{Makefile} and @samp{Makefile<2>}).
474
475 By contrast, the @code{post-forward} naming method would call the
476buffers @samp{Makefile|tmp} and @samp{Makefile|zaphod}, and the
477@code{reverse} naming method would call them @samp{Makefile\tmp} and
478@samp{Makefile\zaphod}. The nontrivial difference between
479@code{post-forward} and @code{reverse} occurs when just one directory
480name is not enough to distinguish two files; then @code{reverse} puts
481the directory names in reverse order, so that @file{/top/middle/file}
482becomes @samp{file\middle\top}, while @code{post-forward} puts them in
483forward order after the file name, as in @samp{file|top/middle}.
484
485 Which rule to follow for putting the directory names in the buffer
486name is not very important if you are going to @emph{look} at the
487buffer names before you type one. But as an experienced user, if you
488know the rule, you won't have to look. And then you may find that one
489rule or another is easier for you to remember and utilize fast.
473 490
474@node Iswitchb 491@node Iswitchb
475@subsection Switching Between Buffers using Substrings 492@subsection Switching Between Buffers using Substrings
@@ -482,59 +499,51 @@ toggle-uniquify-buffer-names} can also be used to toggle the mode.
482@kindex C-x 5 b @r{(Iswitchb mode)} 499@kindex C-x 5 b @r{(Iswitchb mode)}
483@kindex C-x 4 C-o @r{(Iswitchb mode)} 500@kindex C-x 4 C-o @r{(Iswitchb mode)}
484 501
485Iswitchb global minor mode provides convenient switching between buffers 502 Iswitchb global minor mode provides convenient switching between
486using substrings of their names by replacing the normal keybindings 503buffers using substrings of their names. It replaces the normal
487@kbd{C-x b}, @kbd{C-x 4 b}, @kbd{C-x 5 b} and @kbd{C-x 4 C-o}. 504definitions of @kbd{C-x b}, @kbd{C-x 4 b}, @kbd{C-x 5 b}, and @kbd{C-x
5054 C-o} with alternative commands that are somewhat ``smarter.''
488 506
489When you are prompted for a buffer name, as you type in a substring the 507 When one of these commands prompts you for a buffer name, you can
490list of buffers currently matching it is displayed as you type, with the 508type in just a substring of the name you want to choose. As you enter
491most recent buffers visited towards the start of the list. The buffer 509the substring, Iswitchb mode continuously displays a list of buffers
492at the start will be the one visited when you press @key{RET}. By 510that match the substring you have typed.
493typing more of the substring, the list is narrowed down so that
494gradually the buffer you want will be at the top of the list.
495Alternatively, you can use @kbd{C-s} and @kbd{C-r} to rotate buffer
496names in the list until the one you want is at the top of the list.
497Completion is available so that you can see what is common to all of the
498matching buffers as you type.
499 511
500@node BS 512 At any time, you can type @key{RET} to select the first buffer in
501@subsection Configurable Buffer Menus 513the list. So the way to select a particular buffer is to make it the
514first in the list. There are two ways to do this. You can type more
515of the buffer name and thus narrow down the list, excluding unwanted
516buffers above the desired one. Alternatively, you can use @kbd{C-s}
517and @kbd{C-r} to rotate the list until the desired buffer is first.
518
519 @key{TAB} while entering the buffer name performs completion on the
520string you have entered, based on the displayed list of buffers.
521
522@node Buffer Menus
523@subsection Customizing Buffer Menus
502 524
503@findex bs-show 525@findex bs-show
504@findex bs-cycle-next
505@findex bs-cycle-previous
506@cindex buffer list, customizable 526@cindex buffer list, customizable
507@table @kbd 527@table @kbd
508@item M-x bs-show 528@item M-x bs-show
509Make a list of buffers similarly to @kbd{M-x list-buffers} but 529Make a list of buffers similarly to @kbd{M-x list-buffers} but
510customizable. 530customizable.
511@item M-x bs-cycle-next
512Cycle to the next buffer in the configuration.
513@item M-x bs-cycle-previous
514Cycle to the previous buffer in the configuration.
515@end table 531@end table
516 532
517@kbd{M-x bs-show} pops up a buffer list similar to the one normally 533 @kbd{M-x bs-show} pops up a buffer list similar to the one normally
518displayed by @kbd{C-x C-b} but which can be customized. You might like 534displayed by @kbd{C-x C-b} but which you can customize. If you prefer
519to bind it to @kbd{C-x C-b}. You can customize the display, for 535this to the usual buffer list, you can bind this command to @kbd{C-x
520instance to display a subset of buffers, in the @code{bs} Custom group. 536C-b}. To customize this buffer list, use the @code{bs} Custom group
521A special subset of all buffers is available---for instance avoiding 537(@pxref{Easy Customization}).
522ones like @samp{*Messages*}---through which you can cycle with @kbd{M-x
523bs-cycle-next} and @kbd{M-x bs-cycle-previous}. Those commands could be
524bound to convenient keys.
525
526@node MSB
527@subsection Customizing the Mouse Buffer Selection Menus
528 538
529@findex msb-mode 539@findex msb-mode
530@cindex mode, MSB 540@cindex mode, MSB
531@cindex MSB mode 541@cindex MSB mode
532@cindex buffer menu 542@cindex buffer menu
533@findex mouse-buffer-menu 543@findex mouse-buffer-menu
534@kindex C-down-mouse-1 544@kindex C-Down-Mouse-1
535 545 MSB global minor mode (``MSB'' stands for ``mouse select buffer'')
536MSB global minor mode provides a different and customizable mouse buffer 546provides a different and customizable mouse buffer menu which you may
537menu which you may prefer. It replaces the bindings of 547prefer. It replaces the bindings of @code{mouse-buffer-menu},
538@code{mouse-buffer-menu}, normally on @kbd{C-down-mouse-1}, and the menu 548normally on @kbd{C-Down-Mouse-1}, and the menu bar buffer menu. You
539bar buffer menu. You can customize the menu in the @code{msb} Custom 549can customize the menu in the @code{msb} Custom group.
540group.