summaryrefslogtreecommitdiff
path: root/doc/lispref/buffers.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/lispref/buffers.texi')
-rw-r--r--doc/lispref/buffers.texi19
1 files changed, 15 insertions, 4 deletions
diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi
index 6a5367c17ba..5375eb64155 100644
--- a/doc/lispref/buffers.texi
+++ b/doc/lispref/buffers.texi
@@ -371,6 +371,12 @@ See the related function @code{generate-new-buffer} in @ref{Creating
Buffers}.
@end defun
+@defun buffer-last-name &optional buffer
+This function returns the previous name of @var{buffer}, before it was
+killed or before the last time it was renamed. If nil or omitted,
+@var{buffer} defaults to the current buffer.
+@end defun
+
@node Buffer File Name
@section Buffer File Name
@cindex visited file
@@ -959,7 +965,7 @@ infinite recursion.
@defun buffer-match-p condition buffer-or-name &rest args
This function checks if a buffer designated by @code{buffer-or-name}
-satisfies the specified @code{condition}. Optional arguments
+satisfies the specified @var{condition}. Optional arguments
@var{args} are passed to the predicate function in @var{condition}. A
valid @var{condition} can be one of the following:
@itemize @bullet{}
@@ -985,10 +991,15 @@ Satisfied if @emph{any} condition in @var{conds} satisfies
Satisfied if @emph{all} the conditions in @var{conds} satisfy
@code{buffer-match-p}, with the same buffer and @code{args}.
@item derived-mode
-Satisfied if the buffer's major mode derives from @var{expr}.
+Satisfied if the buffer's major mode derives from @var{expr}. Note
+that this condition might fail to report a match if
+@code{buffer-match-p} is invoked before the major mode of the buffer
+has been established.
@item major-mode
Satisfied if the buffer's major mode is equal to @var{expr}. Prefer
-using @code{derived-mode} instead, when both can work.
+using @code{derived-mode} instead, when both can work. Note that this
+condition might fail to report a match if @code{buffer-match-p} is
+invoked before the major mode of the buffer has been established.
@end table
@item t
Satisfied by any buffer. A convenient alternative to @code{""} (empty
@@ -998,7 +1009,7 @@ string) or @code{(and)} (empty conjunction).
@defun match-buffers condition &optional buffer-list &rest args
This function returns a list of all buffers that satisfy the
-@code{condition}. If no buffers match, the function returns
+@var{condition}. If no buffers match, the function returns
@code{nil}. The argument @var{condition} is as defined in
@code{buffer-match-p} above. By default, all the buffers are
considered, but this can be restricted via the optional argument