Merge from origin/emacs-26

913c001 * lisp/files.el (write-file): Clarify the doc string.  (Bug#3...
d614b84 Fix typos in midnight.el
8c2778a Improve documentation of 'move-file-to-trash'
c7b8a51 ; * doc/lispref/functions.texi (Anonymous Functions): Fix typo.
92296de * src/data.c (Ftype_of): xwidget objects are possible! (bug#3...
a3242cc Improve documentation of Diff mode
39e85a0 Note that lex bound lambda forms are not self-quoting (Bug#33...
fa605f2 Rewrite buffer display related doc-strings and doc
aa55659 Fix call to GlobalMemoryStatusEx in w32.c

# Conflicts:
#	doc/emacs/files.texi
#	src/data.c
This commit is contained in:
Glenn Morris 2018-11-12 09:38:27 -08:00
commit 23209e2c19
10 changed files with 282 additions and 195 deletions

View file

@ -1427,23 +1427,30 @@ manually, type @kbd{M-x diff-mode}.
@cindex hunk, diff
The changes specified in a patch are grouped into @dfn{hunks}, which
are contiguous chunks of text that contain one or more changed lines.
Hunks can also include unchanged lines to provide context for the
Hunks usually also include unchanged lines to provide context for the
changes. Each hunk is preceded by a @dfn{hunk header}, which
specifies the old and new line numbers at which the hunk occurs. Diff
mode highlights each hunk header, to distinguish it from the actual
contents of the hunk.
specifies the old and new line numbers where the hunk's changes occur.
Diff mode highlights each hunk header, to distinguish it from the
actual contents of the hunk.
The first hunk in a patch is preceded by a file header, which shows
the names of the new and the old versions of the file, and their time
stamps. If a patch shows changes for more than one file, each file
has such a header before the first hunk of that file's changes.
@vindex diff-update-on-the-fly
You can edit a Diff mode buffer like any other buffer. (If it is
read-only, you need to make it writable first. @xref{Misc Buffer}.)
Whenever you change a hunk, Diff mode attempts to automatically
correct the line numbers in the hunk headers, to ensure that the patch
remains correct. To disable automatic line number correction,
change the variable @code{diff-update-on-the-fly} to @code{nil}.
read-only, you need to make it writable first; see @ref{Misc Buffer}.)
Whenever you edit a hunk, Diff mode attempts to automatically correct
the line numbers in the hunk headers, to ensure that the patch remains
correct, and could still be applied by @command{patch}. To disable
automatic line number correction, change the variable
@code{diff-update-on-the-fly} to @code{nil}.
Diff mode treats each hunk as an error message, similar to
Compilation mode. Thus, you can use commands such as @kbd{M-g M-n} to
visit the corresponding source locations. @xref{Compilation Mode}.
Diff mode arranges for hunks to be treated as compiler error
messages by @kbd{M-g M-n} and other commands that handle error messages
(@pxref{Compilation Mode}). Thus, you can use the compilation-mode
commands to visit the corresponding source locations.
In addition, Diff mode provides the following commands to navigate,
manipulate and apply parts of patches:
@ -1451,7 +1458,8 @@ manipulate and apply parts of patches:
@table @kbd
@item M-n
@findex diff-hunk-next
Move to the next hunk-start (@code{diff-hunk-next}).
Move to the next hunk-start (@code{diff-hunk-next}). With prefix
argument @var{n}, move forward to the @var{n}th next hunk.
@findex diff-auto-refine-mode
@cindex mode, Diff Auto-Refine
@ -1469,19 +1477,22 @@ default, add this to your init file (@pxref{Hooks}):
@item M-p
@findex diff-hunk-prev
Move to the previous hunk-start (@code{diff-hunk-prev}). Like
Move to the previous hunk-start (@code{diff-hunk-prev}). With prefix
argument @var{n}, move back to the @var{n}th previous hunk. Like
@kbd{M-n}, this has the side-effect of refining the hunk you move to,
unless you disable Diff Auto-Refine mode.
@item M-@}
@findex diff-file-next
Move to the next file-start, in a multi-file patch
(@code{diff-file-next}).
(@code{diff-file-next}). With prefix argument @var{n}, move forward
to the start of the @var{n}th next file.
@item M-@{
@findex diff-file-prev
Move to the previous file-start, in a multi-file patch
(@code{diff-file-prev}).
(@code{diff-file-prev}). With prefix argument @var{n}, move back to
the start of the @var{n}th previous file.
@item M-k
@findex diff-hunk-kill
@ -1496,7 +1507,10 @@ In a multi-file patch, kill the current file part.
@findex diff-apply-hunk
@cindex patches, applying
Apply this hunk to its target file (@code{diff-apply-hunk}). With a
prefix argument of @kbd{C-u}, revert this hunk.
prefix argument of @kbd{C-u}, revert this hunk, i.e.@: apply the
reverse of the hunk, which changes the ``new'' version into the ``old''
version. If @code{diff-jump-to-old-file} is non-@code{nil}, apply the
hunk to the ``old'' version of the file instead.
@item C-c C-b
@findex diff-refine-hunk
@ -1506,8 +1520,16 @@ of each changed line were actually changed.
@item C-c C-c
@findex diff-goto-source
@vindex diff-jump-to-old-file
Go to the source file and line corresponding to this hunk
(@code{diff-goto-source}).
(@code{diff-goto-source}). By default, this jumps to the ``new''
version of the file, the one shown first on the file header.
With a prefix argument, jump to the ``old'' version instead. If
@code{diff-jump-to-old-file} is non-@code{nil}, this command by
default jumps to the ``old'' file, and the meaning of the prefix
argument is reversed. If the prefix argument is a number greater than
8 (e.g., if you type @kbd{C-u C-u C-c C-c}), then this command also
sets @code{diff-jump-to-old-file} for the next invocation.
@item C-c C-e
@findex diff-ediff-patch
@ -1517,41 +1539,47 @@ Start an Ediff session with the patch (@code{diff-ediff-patch}).
@item C-c C-n
@findex diff-restrict-view
Restrict the view to the current hunk (@code{diff-restrict-view}).
@xref{Narrowing}. With a prefix argument of @kbd{C-u}, restrict the
@xref{Narrowing}. With a prefix argument, restrict the
view to the current file of a multiple-file patch. To widen again,
use @kbd{C-x n w} (@code{widen}).
@item C-c C-r
@findex diff-reverse-direction
Reverse the direction of comparison for the entire buffer
(@code{diff-reverse-direction}).
(@code{diff-reverse-direction}). With a prefix argument, reverse the
direction only inside the current region (@pxref{Mark}). Reversing
the direction means changing the hunks and the file-start headers to
produce a patch that would change the ``new'' version into the ``old''
one.
@item C-c C-s
@findex diff-split-hunk
Split the hunk at point (@code{diff-split-hunk}). This is for
manually editing patches, and only works with the @dfn{unified diff
format} produced by the @option{-u} or @option{--unified} options to
the @command{diff} program. If you need to split a hunk in the
@dfn{context diff format} produced by the @option{-c} or
@option{--context} options to @command{diff}, first convert the buffer
to the unified diff format with @kbd{C-c C-u}.
Split the hunk at point (@code{diff-split-hunk}) into two separate
hunks. This inserts a hunk header and modifies the header of the
current hunk. This command is useful for manually editing patches,
and only works with the @dfn{unified diff format} produced by the
@option{-u} or @option{--unified} options to the @command{diff}
program. If you need to split a hunk in the @dfn{context diff format}
produced by the @option{-c} or @option{--context} options to
@command{diff}, first convert the buffer to the unified diff format
with @kbd{C-c C-u}.
@item C-c C-d
@findex diff-unified->context
Convert the entire buffer to the @dfn{context diff format}
(@code{diff-unified->context}). With a prefix argument, convert only
the text within the region.
the hunks within the region.
@item C-c C-u
@findex diff-context->unified
Convert the entire buffer to unified diff format
(@code{diff-context->unified}). With a prefix argument, convert
unified format to context format. When the mark is active, convert
only the text within the region.
only the hunks within the region.
@item C-c C-w
@findex diff-ignore-whitespace-hunk
Re-diff the current hunk, disregarding changes in whitespace
Re-generate the current hunk, disregarding changes in whitespace
(@code{diff-ignore-whitespace-hunk}).
@item C-x 4 A
@ -1582,7 +1610,8 @@ that whitespace in both the patch and the patched source file(s).
This command does not save the modifications that it makes, so you can
decide whether to save the changes (the list of modified files is
displayed in the echo area). With a prefix argument, it tries to
modify the original source files rather than the patched source files.
modify the original (``old'') source files rather than the patched
(``new'') source files.
@node Copying and Naming
@section Copying, Naming and Renaming Files
@ -1668,10 +1697,12 @@ Dired rather than @code{delete-file}. @xref{Dired Deletion}.
@cindex trash
@cindex recycle bin
@findex move-file-to-trash
@kbd{M-x move-file-to-trash} moves a file into the system
@dfn{Trash} (or @dfn{Recycle Bin}). This is a facility available on
most operating systems; files that are moved into the Trash can be
brought back later if you change your mind.
brought back later if you change your mind. (The way to restore
trashed files is system-dependent.)
@vindex delete-by-moving-to-trash
By default, Emacs deletion commands do @emph{not} use the Trash. To

View file

@ -1082,15 +1082,18 @@ This macro returns an anonymous function with argument list
@var{args}, documentation string @var{doc} (if any), interactive spec
@var{interactive} (if any), and body forms given by @var{body}.
In effect, this macro makes @code{lambda} forms self-quoting:
evaluating a form whose @sc{car} is @code{lambda} yields the form
itself:
Under dynamic binding, this macro effectively makes @code{lambda}
forms self-quoting: evaluating a form whose @sc{car} is @code{lambda}
yields the form itself:
@example
(lambda (x) (* x x))
@result{} (lambda (x) (* x x))
@end example
Note that when evaluating under lexical binding the result is a
closure object (@pxref{Closures}).
The @code{lambda} form has one other effect: it tells the Emacs
evaluator and byte-compiler that its argument is a function, by using
@code{function} as a subroutine (see below).

View file

@ -2747,8 +2747,8 @@ the buffer. This entry is used by
@vindex reusable-frames@r{, a buffer display action alist entry}
@item reusable-frames
The value specifies the frame(s) to search for a window that can be
reused because it already displays the buffer. It can be set as
The value specifies the set of frames to search for a window that can
be reused because it already displays the buffer. It can be set as
follows:
@itemize @bullet
@ -2792,17 +2792,20 @@ entry.
@vindex window-height@r{, a buffer display action alist entry}
@item window-height
The value specifies whether and how to adjust the height of the chosen
window, and can have the following values:
window and can be one of the following:
@itemize @bullet
@item
@code{nil} means to leave the height of the chosen window alone.
@item
A number specifies the desired height of the chosen window. An
integer specifies the number of lines of the window. A floating-point
number gives the fraction of the window's height with respect to the
height of the frame's root window.
An integer number specifies the desired total height of the chosen
window in lines.
@item
A floating-point number specifies the fraction of the chosen window's
desired total height with respect to the total height of its frame's
root window.
@item
If the value specifies a function, that function is called with one
@ -2812,7 +2815,11 @@ are @code{shrink-window-if-larger-than-buffer} and
@code{fit-window-to-buffer}, see @ref{Resizing Windows}.
@end itemize
All action functions that choose a window should process this entry.
By convention, the height of the chosen window is adjusted only if the
window is part of a vertical combination (@pxref{Windows and Frames})
to avoid changing the height of other, unrelated windows. Also, this
entry should be processed only under certain conditions which are
specified right below this list.
@vindex window-width@r{, a buffer display action alist entry}
@item window-width
@ -2825,10 +2832,13 @@ value can be one of the following:
@code{nil} means to leave the width of the chosen window alone.
@item
A number specifies the desired width of the chosen window. An integer
specifies the number of columns of the window. A floating-point
number gives the fraction of the window's width with respect to the
width of the frame's root window.
An integer specifies the desired total width of the chosen window in
columns.
@item
A floating-point number specifies the fraction of the chosen window's
desired total width with respect to the total width of the frame's
root window.
@item
If the value specifies a function, that function is called with one
@ -2836,16 +2846,21 @@ argument---the chosen window. The function is supposed to adjust the
width of the window; its return value is ignored.
@end itemize
All action functions that choose a window should process this entry.
By convention, the width of the chosen window is adjusted only if the
window is part of a horizontal combination (@pxref{Windows and
Frames}) to avoid changing the width of other, unrelated windows.
Also, this entry should be processed under only certain conditions
which are specified right below this list.
@vindex preserve-size@r{, a buffer display action alist entry}
@item preserve-size
If non-@code{nil} such an entry tells Emacs to preserve the size of
the window chosen (@pxref{Preserving Window Sizes}). The value should
be either @code{(t . nil)} to preserve the width of the window,
@code{(nil . t)} to preserve its height or @code{(t . t)} to preserve
both its width and its height. All action functions that choose a
window should process this entry.
be either @w{@code{(t . nil)}} to preserve the width of the window,
@w{@code{(nil . t)}} to preserve its height or @w{@code{(t . t)}} to
preserve both, its width and its height. This entry should be
processed only under certain conditions which are specified right
after this list.
@vindex pop-up-frame-parameters@r{, a buffer display action alist entry}
@item pop-up-frame-parameters
@ -2900,6 +2915,15 @@ will display the buffer. @code{display-buffer-no-window} is the only
action function that cares about this entry.
@end table
By convention, the entries @code{window-height}, @code{window-width}
and @code{preserve-size} are applied after the chosen window's buffer
has been set up and if and only if that window never showed another
buffer before. More precisely, the latter means that the window must
have been either created by the current @code{display-buffer} call or
the window was created earlier by @code{display-buffer} to show the
buffer and never was used to show another buffer until it was reused
by the current invocation of @code{display-buffer}.
@node Choosing Window Options
@subsection Additional Options for Displaying Buffers

View file

@ -4324,12 +4324,15 @@ the old visited file has been renamed to the new name FILENAME."
"Write current buffer into file FILENAME.
This makes the buffer visit that file, and marks it as not modified.
If you specify just a directory name as FILENAME, that means to use
the default file name but in that directory. You can also yank
the default file name into the minibuffer to edit it, using \\<minibuffer-local-map>\\[next-history-element].
Interactively, prompt for FILENAME.
If you specify just a directory name as FILENAME, that means to write
to a file in that directory. In this case, the base name of the file
is the same as that of the file visited in the buffer, or the buffer
name sans leading directories, if any, if the buffer is not already
visiting a file.
If the buffer is not already visiting a file, the default file name
for the output file is the buffer name.
You can also yank the file name into the minibuffer to edit it,
using \\<minibuffer-local-map>\\[next-history-element].
If optional second arg CONFIRM is non-nil, this function
asks for confirmation before overwriting an existing file.

View file

@ -64,7 +64,7 @@ the time when it is run.")
(defcustom clean-buffer-list-delay-general 3
"The number of days before any buffer becomes eligible for autokilling.
The autokilling is done by `clean-buffer-list' when is it in `midnight-hook'.
The autokilling is done by `clean-buffer-list' when it is in `midnight-hook'.
Currently displayed and/or modified (unsaved) buffers, as well as buffers
matching `clean-buffer-list-kill-never-buffer-names' and
`clean-buffer-list-kill-never-regexps' are excluded."
@ -81,7 +81,7 @@ displayed more than this many seconds ago."
"List of regexps saying which buffers will be killed at midnight.
If buffer name matches a regexp in the list and the buffer was not displayed
in the last `clean-buffer-list-delay-special' seconds, it is killed by
`clean-buffer-list' when is it in `midnight-hook'.
`clean-buffer-list' when it is in `midnight-hook'.
If a member of the list is a cons, its `car' is the regexp and its `cdr' is
the number of seconds to use instead of `clean-buffer-list-delay-special'.
See also `clean-buffer-list-kill-buffer-names',
@ -101,7 +101,7 @@ if the buffer should be killed by `clean-buffer-list'."
"List of strings saying which buffers will be killed at midnight.
Buffers with names in this list, which were not displayed in the last
`clean-buffer-list-delay-special' seconds, are killed by `clean-buffer-list'
when is it in `midnight-hook'.
when it is in `midnight-hook'.
If a member of the list is a cons, its `car' is the name and its `cdr' is
the number of seconds to use instead of `clean-buffer-list-delay-special'.
See also `clean-buffer-list-kill-regexps',

View file

@ -93,12 +93,13 @@ Info node `(elisp)Specification List' for details."
`(put (quote ,symbol) 'edebug-form-spec (quote ,spec)))
(defmacro lambda (&rest cdr)
"Return a lambda expression.
A call of the form (lambda ARGS DOCSTRING INTERACTIVE BODY) is
self-quoting; the result of evaluating the lambda expression is the
expression itself. The lambda expression may then be treated as a
function, i.e., stored as the function value of a symbol, passed to
`funcall' or `mapcar', etc.
"Return an anonymous function.
Under dynamic binding, a call of the form (lambda ARGS DOCSTRING
INTERACTIVE BODY) is self-quoting; the result of evaluating the
lambda expression is the expression itself. Under lexical
binding, the result is a closure. Regardless, the result is a
function, i.e., it may be stored as the function value of a
symbol, passed to `funcall' or `mapcar', etc.
ARGS should take the same form as an argument list for a `defun'.
DOCSTRING is an optional documentation string.

View file

@ -6772,7 +6772,11 @@ live."
((or (eq type 'frame)
(and (eq (car quit-restore) 'same)
(eq (nth 1 quit-restore) 'frame)))
;; Adjust size of frame if asked for.
;; A window that never showed another buffer but BUFFER ever
;; since it was created on a new frame.
;;
;; Adjust size of frame if asked for. We probably should do
;; that only for a single window frame.
(cond
((not size))
((consp size)
@ -6791,7 +6795,10 @@ live."
((or (eq type 'window)
(and (eq (car quit-restore) 'same)
(eq (nth 1 quit-restore) 'window)))
;; Adjust height of window if asked for.
;; A window that never showed another buffer but BUFFER ever
;; since it was created on an existing frame.
;;
;; Adjust width and/or height of window if asked for.
(cond
((not height))
((numberp height)
@ -6887,31 +6894,41 @@ The actual non-nil value of this variable will be copied to the
"Custom type for `display-buffer' actions.")
(defvar display-buffer-overriding-action '(nil . nil)
"User-defined overriding action to perform to display a buffer.
This action overrides all the other actions in the action variables
and arguments passed to `display-buffer'.
Value should be a cons cell (FUNCTION . ALIST), where FUNCTION is
a function or a list of functions. Each function should accept
two arguments: a buffer to display and an alist similar to ALIST.
The default value is empty.
See `display-buffer' for details.")
"Overriding action for buffer display.
This action overrides all the other actions in the action
variables and arguments passed to `display-buffer'. The value
should be a cons cell (FUNCTIONS . ALIST), where FUNCTIONS is a
function or a list of functions. Each function should accept two
arguments: a buffer to display and an alist similar to ALIST.
See `display-buffer' for details.
This variable is not intended for user customization. Lisp
programs should never set this variable permanently but may bind
it around calls of buffer display functions like `display-buffer'
or `pop-to-buffer'. Since such a binding will affect any nested
buffer display requests, this variable should be used with utmost
care.")
(put 'display-buffer-overriding-action 'risky-local-variable t)
(defcustom display-buffer-alist nil
"Alist of user-defined conditional actions for `display-buffer'.
Its value takes effect before `display-buffer-base-action'
and `display-buffer-fallback-action', but after
Its value takes effect before processing the ACTION argument of
`display-buffer' and before `display-buffer-base-action' and
`display-buffer-fallback-action', but after
`display-buffer-overriding-action', which see.
If non-nil, this is a list of elements (CONDITION . ACTION), where:
If non-nil, this is an alist of elements (CONDITION . ACTION),
where:
CONDITION is either a regexp matching buffer names, or a
function that takes two arguments - a buffer name and the
ACTION argument of `display-buffer' - and returns a boolean.
ACTION is a cons cell (FUNCTION . ALIST), where FUNCTION is a
function or a list of functions. Each such function should
accept two arguments: a buffer to display and an alist of the
same form as ALIST. See `display-buffer' for details.
ACTION is a cons cell (FUNCTIONS . ALIST), where FUNCTIONS is an
action function or a list of action functions and ALIST is an
action alist. Each such action function should accept two
arguments: a buffer to display and an alist of the same form as
ALIST. See `display-buffer' for details.
`display-buffer' scans this alist until it either finds a
matching regular expression or the function specified by a
@ -6931,11 +6948,12 @@ associated action to the list of actions it will try."
This is the default action used by `display-buffer' if no other
actions are specified or all fail, before falling back on
`display-buffer-fallback-action'.
It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a
function or a list of functions. Each function should accept two
arguments: a buffer to display and an alist similar to ALIST.
The default value is empty.
See `display-buffer' for details."
It should be a cons cell (FUNCTIONS . ALIST), where FUNCTIONS is
an action function or a list of action functions and ALIST is an
action alist. Each such action function should accept two
arguments: a buffer to display and an alist of the same form as
ALIST. See `display-buffer' for details."
:type display-buffer--action-custom-type
:risky t
:version "24.1"
@ -6951,17 +6969,20 @@ See `display-buffer' for details."
display-buffer-pop-up-frame))
"Default fallback action for `display-buffer'.
This is the action used by `display-buffer' if no other actions
specified, e.g. by the user options `display-buffer-alist' or
`display-buffer-base-action', or they all fail. See `display-buffer'.")
have been specified, for example, by the user options
`display-buffer-alist' or `display-buffer-base-action', or they
all fail. It should never be set by programs or users. See
`display-buffer'.")
(put 'display-buffer-fallback-action 'risky-local-variable t)
(defun display-buffer-assq-regexp (buffer-name alist action)
"Retrieve ALIST entry corresponding to BUFFER-NAME.
This returns the cdr of the ALIST entry if either its key is a
string that matches BUFFER-NAME, as reported by `string-match-p';
or if the key is a function that returns a non-nil when called
with 3 arguments: the ALIST key, BUFFER-NAME, and ACTION.
ACTION should have the form of the action argument passed to `display-buffer'."
This returns the cdr of the alist entry ALIST if either its key
is a string that matches BUFFER-NAME, as reported by
`string-match-p'; or if the key is a function that returns
non-nil when called with three arguments: the ALIST key,
BUFFER-NAME and ACTION. ACTION should have the form of the
action argument passed to `display-buffer'."
(catch 'match
(dolist (entry alist)
(let ((key (car entry)))
@ -6990,100 +7011,99 @@ fails, call `display-buffer-pop-up-frame'.")
(defun display-buffer (buffer-or-name &optional action frame)
"Display BUFFER-OR-NAME in some window, without selecting it.
BUFFER-OR-NAME must be a buffer or the name of an existing
buffer. Return the window chosen for displaying BUFFER-OR-NAME,
or nil if no such window is found.
BUFFER-OR-NAME must be a buffer or a string naming a live buffer.
Return the window chosen for displaying that buffer, or nil if no
such window is found.
Optional argument ACTION, if non-nil, should specify a display
action. Its form is described below.
Optional argument ACTION, if non-nil, should specify a buffer
display action of the form (FUNCTIONS . ALIST). FUNCTIONS is
either an \"action function\" or a possibly empty list of action
functions. ALIST is a possibly empty \"action alist\".
Optional argument FRAME, if non-nil, acts like an additional
ALIST entry (reusable-frames . FRAME) to the action list of ACTION,
specifying the frame(s) to search for a window that is already
displaying the buffer. See `display-buffer-reuse-window'.
An action function is a function that accepts two arguments: the
buffer to display and an action alist. Based on those arguments,
it should try to display the buffer in a window and return that
window. An action alist is an association list mapping symbols
to values. Action functions use the action alist passed to them
to fine-tune their behaviors.
If ACTION is non-nil, it should have the form (FUNCTION . ALIST),
where FUNCTION is either a function or a list of functions, and
ALIST is an arbitrary association list (alist).
Each such function should accept two arguments: the buffer to
display and an alist. Based on those arguments, it should
display the buffer and return the window. If the caller is
prepared to handle the case of not displaying the buffer
and returning nil from `display-buffer' it should pass
\(allow-no-window . t) as an element of the ALIST.
The `display-buffer' function builds a function list and an alist
by combining the functions and alists specified in
`display-buffer' builds a list of action functions and an action
alist by combining any action functions and alists specified by
`display-buffer-overriding-action', `display-buffer-alist', the
ACTION argument, `display-buffer-base-action', and
`display-buffer-fallback-action' (in order). Then it calls each
function in the combined function list in turn, passing the
buffer as the first argument and the combined alist as the second
argument, until one of the functions returns non-nil.
buffer as the first argument and the combined action alist as the
second argument, until one of the functions returns non-nil.
If ACTION is nil, the function list and the alist are built using
only the other variables mentioned above.
Action functions and the action they try to perform are:
`display-buffer-same-window' -- Use the selected window.
`display-buffer-reuse-window' -- Use a window already showing
the buffer.
`display-buffer-in-previous-window' -- Use a window that did
show the buffer before.
`display-buffer-use-some-window' -- Use some existing window.
`display-buffer-pop-up-window' -- Pop up a new window.
`display-buffer-below-selected' -- Use or pop up a window below
the selected one.
`display-buffer-at-bottom' -- Use or pop up a window at the
bottom of the selected frame.
`display-buffer-pop-up-frame' -- Show the buffer on a new frame.
`display-buffer-in-child-frame' -- Show the buffer in a
child frame.
`display-buffer-no-window' -- Do not display the buffer and
have `display-buffer' return nil immediately.
Available action functions include:
`display-buffer-same-window'
`display-buffer-reuse-window'
`display-buffer-pop-up-frame'
`display-buffer-in-child-frame'
`display-buffer-pop-up-window'
`display-buffer-in-previous-window'
`display-buffer-use-some-window'
`display-buffer-use-some-frame'
Action alist entries are:
'inhibit-same-window' -- A non-nil value prevents the same
window from being used for display.
'inhibit-switch-frame' -- A non-nil value prevents any frame
used for showing the buffer from being raised or selected.
'reusable-frames' -- The value specifies the set of frames to
search for a window that already displays the buffer.
Possible values are nil (the selected frame), t (any live
frame), visible (any visible frame), 0 (any visible or
iconified frame) or an existing live frame.
'pop-up-frame-parameters' -- The value specifies an alist of
frame parameters to give a new frame, if one is created.
'window-height' -- The value specifies the desired height of the
window chosen and is either an integer (the total height of
the window), a floating point number (the fraction of its
total height with respect to the total height of the frame's
root window) or a function to be called with one argument -
the chosen window. The function is supposed to adjust the
height of the window; its return value is ignored. Suitable
functions are `shrink-window-if-larger-than-buffer' and
`fit-window-to-buffer'.
'window-width' -- The value specifies the desired width of the
window chosen and is either an integer (the total width of
the window), a floating point number (the fraction of its
total width with respect to the width of the frame's root
window) or a function to be called with one argument - the
chosen window. The function is supposed to adjust the width
of the window; its return value is ignored.
'preserve-size' -- The value should be either (t . nil) to
preserve the width of the chosen window, (nil . t) to
preserve its height or (t . t) to preserve its height and
width in future changes of the window configuration.
'window-parameters' -- The value specifies an alist of window
parameters to give the chosen window.
'allow-no-window' -- A non-nil value means that `display-buffer'
may not display the buffer and return nil immediately.
Recognized alist entries include:
The entries 'window-height', 'window-width' and 'preserve-size'
are applied only when the window used for displaying the buffer
never showed another buffer before.
`inhibit-same-window' -- A non-nil value prevents the same
window from being used for display.
The ACTION argument can also have a non-nil and non-list value.
This means to display the buffer in a window other than the
selected one, even if it is already displayed in the selected
window. If called interactively with a prefix argument, ACTION
is t. Non-interactive calls should always supply a list or nil.
`inhibit-switch-frame' -- A non-nil value prevents any other
frame from being raised or selected,
even if the window is displayed there.
`reusable-frames' -- Value specifies frame(s) to search for a
window that already displays the buffer.
See `display-buffer-reuse-window'.
`pop-up-frame-parameters' -- Value specifies an alist of frame
parameters to give a new frame, if
one is created.
`window-height' -- Value specifies either an integer (the number
of lines of a new window), a floating point number (the
fraction of a new window with respect to the height of the
frame's root window) or a function to be called with one
argument - a new window. The function is supposed to adjust
the height of the window; its return value is ignored.
Suitable functions are `shrink-window-if-larger-than-buffer'
and `fit-window-to-buffer'.
`window-width' -- Value specifies either an integer (the number
of columns of a new window), a floating point number (the
fraction of a new window with respect to the width of the
frame's root window) or a function to be called with one
argument - a new window. The function is supposed to adjust
the width of the window; its return value is ignored.
`allow-no-window' -- A non-nil value indicates readiness for the case
of not displaying the buffer and FUNCTION can safely return
a non-window value to suppress displaying.
`preserve-size' -- Value should be either (t . nil) to
preserve the width of the window, (nil . t) to preserve its
height or (t . t) to preserve both.
`window-parameters' -- Value specifies an alist of window
parameters to give the chosen window.
The ACTION argument to `display-buffer' can also have a non-nil
and non-list value. This means to display the buffer in a window
other than the selected one, even if it is already displayed in
the selected window. If called interactively with a prefix
argument, ACTION is t."
The optional third argument FRAME, if non-nil, acts like a
\(reusable-frames . FRAME) entry appended to the action alist
specified by the ACTION argument."
(interactive (list (read-buffer "Display buffer: " (other-buffer))
(if current-prefix-arg t)))
(let ((buffer (if (bufferp buffer-or-name)
@ -7141,9 +7161,10 @@ its documentation for additional customization information."
;;; `display-buffer' action functions:
(defun display-buffer-use-some-frame (buffer alist)
"Display BUFFER in an existing frame that meets a predicate
\(by default any frame other than the current frame). If
successful, return the window used; otherwise return nil.
"Display BUFFER in an existing frame that meets a predicate.
The default predicate is to use any frame other than the selected
frame. If successful, return the window used; otherwise return
nil.
If ALIST has a non-nil `inhibit-switch-frame' entry, avoid
raising the frame.
@ -7156,17 +7177,18 @@ predicate.
If ALIST has a non-nil `inhibit-same-window' entry, avoid using
the currently selected window (only useful with a frame-predicate
that allows the selected frame)."
(let* ((predicate (or (cdr (assq 'frame-predicate alist))
(lambda (frame)
(and
(not (eq frame (selected-frame)))
(not (window-dedicated-p
(or
(get-lru-window frame)
(frame-first-window frame)))))
)))
(let* ((predicate
(or (cdr (assq 'frame-predicate alist))
(lambda (frame)
(and (not (eq frame (selected-frame)))
(not (window-dedicated-p
(or (get-lru-window frame)
(frame-first-window frame))))))))
(frame (car (filtered-frame-list predicate)))
(window (and frame (get-lru-window frame nil (cdr (assq 'inhibit-same-window alist))))))
(window
(and frame
(get-lru-window
frame nil (cdr (assq 'inhibit-same-window alist))))))
(when window
(prog1
(window--display-buffer

View file

@ -267,11 +267,13 @@ for example, (type-of 1) returns `integer'. */)
}
case PVEC_MODULE_FUNCTION:
return Qmodule_function;
case PVEC_XWIDGET:
return Qxwidget;
case PVEC_XWIDGET_VIEW:
return Qxwidget_view;
/* "Impossible" cases. */
case PVEC_MISC_PTR:
case PVEC_XWIDGET:
case PVEC_OTHER:
case PVEC_XWIDGET_VIEW:
case PVEC_SUB_CHAR_TABLE:
case PVEC_FREE: ;
}
@ -3930,8 +3932,8 @@ syms_of_data (void)
DEFSYM (Qmarker, "marker");
DEFSYM (Qoverlay, "overlay");
DEFSYM (Qfinalizer, "finalizer");
#ifdef HAVE_MODULES
DEFSYM (Qmodule_function, "module-function");
#ifdef HAVE_MODULES
DEFSYM (Quser_ptr, "user-ptr");
#endif
DEFSYM (Qfloat, "float");
@ -3954,6 +3956,8 @@ syms_of_data (void)
DEFSYM (Qfont_entity, "font-entity");
DEFSYM (Qfont_object, "font-object");
DEFSYM (Qterminal, "terminal");
DEFSYM (Qxwidget, "xwidget");
DEFSYM (Qxwidget_view, "xwidget-view");
DEFSYM (Qdefun, "defun");

View file

@ -7225,6 +7225,7 @@ system_process_attributes (Lisp_Object pid)
code_convert_string_norecord (tem, Vlocale_coding_system, 0)),
attrs);
memstex.dwLength = sizeof (memstex);
if (global_memory_status_ex (&memstex))
#if __GNUC__ || (defined (_MSC_VER) && _MSC_VER >= 1300)
totphys = memstex.ullTotalPhys / 1024.0;

View file

@ -1014,8 +1014,6 @@ syms_of_xwidget (void)
defsubr (&Sxwidget_buffer);
defsubr (&Sset_xwidget_plist);
DEFSYM (Qxwidget, "xwidget");
DEFSYM (QCxwidget, ":xwidget");
DEFSYM (QCtitle, ":title");