1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-25 23:10:47 -08:00

Merge from trunk.

This commit is contained in:
Paul Eggert 2011-09-25 14:06:35 -07:00
commit 60b5d3ca2b
10 changed files with 280 additions and 80 deletions

24
autogen/configure vendored
View file

@ -8057,14 +8057,9 @@ case $opsys in
LIB_STANDARD=-lc
START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o'
;;
netbsd | openbsd )
if test -f $CRT_DIR/crti.o; then
LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o'
START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
else
LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o'
START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o'
fi
netbsd | openbsd )
LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o'
START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o'
;;
esac
@ -8163,6 +8158,19 @@ fi # crt_files != ""
case $opsys in
netbsd | openbsd )
if test -f $CRT_DIR/crti.o; then
test -f $CRT_DIR/crtn.o || \
as_fn_error "Required file not found: crtn.o" "$LINENO" 5
LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o'
START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
fi
;;
esac

View file

@ -1,3 +1,18 @@
2011-09-25 Martin Rudalics <rudalics@gmx.at>
* windows.texi (Windows and Frames, Display Action Functions)
(Switching Buffers): Fix some typos.
(Buffers and Windows): Remove reference to window-auto-delete.
Reword description of replace-buffer-in-windows.
(Window History): Fix some typos and refer to frame local buffer
list.
(Quitting Windows): New node.
(Window Configurations): Add descriptions of window-state-get
and window-state-put.
(Window Parameters): Describe variable ignore-window-parameters.
Sketch some window parameters currently in use.
* elisp.texi (Top): Update node listing.
2011-09-25 Chong Yidong <cyd@stupidchicken.com>
* windows.texi (Display Action Functions)

View file

@ -942,6 +942,8 @@ Windows
* Window History:: Each window remembers the buffers displayed in it.
* Dedicated Windows:: How to avoid displaying another buffer in
a specific window.
* Quitting Windows:: How to restore the state prior to displaying a
buffer.
* Window Point:: Each window has its own location of point.
* Window Start and End:: Buffer positions indicating which text is
on-screen in a window.

View file

@ -29,6 +29,8 @@ is displayed in windows.
* Window History:: Each window remembers the buffers displayed in it.
* Dedicated Windows:: How to avoid displaying another buffer in
a specific window.
* Quitting Windows:: How to restore the state prior to displaying a
buffer.
* Window Point:: Each window has its own location of point.
* Window Start and End:: Buffer positions indicating which text is
on-screen in a window.
@ -294,7 +296,7 @@ optional argument @var{window} can be an arbitrary window and defaults
to the selected one. The return value is @code{nil} if @var{window} is
a live window or its children form a vertical combination. In the
example above @code{(window-left-child W4)} is @code{W6} while
@code{(window-top-child W3)} is @code{nil}.
@code{(window-left-child W3)} is @code{nil}.
@end defun
@defun window-child window
@ -2078,15 +2080,15 @@ buffer using @code{switch-to-prev-buffer} (@pxref{Window History}).
buffer; it defaults to the current buffer.
If a window displaying @var{buffer-or-name} is dedicated
(@pxref{Dedicated Windows}) has never displayed any other buffers and
(@pxref{Dedicated Windows}), has never displayed any other buffers and
is not the only window on its frame, that window is deleted. If that
window is the only window on its frame and there are other frames on
the frame's terminal, that frame is deleted too; otherwise, some other
buffer is displayed in that window, as explained above. A user can
prevent the deletion of windows and/or frames by customizing the
option @code{window-auto-delete}.
window is the only window on its frame and there are other frames on the
frame's terminal, that frame is deleted too; otherwise, the buffer
provided by the function @code{switch-to-prev-buffer} (@pxref{Window
History}) is displayed instead.
@end deffn
@node Switching Buffers
@section Switching to a Buffer in a Window
@cindex switching to a buffer
@ -2123,12 +2125,12 @@ list---both the global buffer list and the selected frame's buffer
list (@pxref{The Buffer List}). However, this is not done if the
optional argument @var{norecord} is non-@code{nil}.
If this function is unable to display in the seleted window---usually
because the selected window is a minibuffer window or is strongly
dedicated to its buffer (@pxref{Dedicated Windows})---then it normally
tries to display in some other window, in the manner of
@code{pop-to-buffer} (see below). However, if the optional argument
@var{force-same-window} is non-@code{nil}, it signals an error
If this function is unable to display the buffer in the selected
window---usually because the selected window is a minibuffer window or
is strongly dedicated to its buffer (@pxref{Dedicated Windows})---then
it normally tries to display the buffer in some other window, in the
manner of @code{pop-to-buffer} (see below). However, if the optional
argument @var{force-same-window} is non-@code{nil}, it signals an error
instead.
@end deffn
@ -2356,7 +2358,7 @@ window. It uses @code{split-window-sensibly} as a subroutine
@defun display-buffer-use-some-window buffer alist
This function tries to display @var{buffer} by choosing an existing
buffer and displaying the buffer in that window. It can fail if all
window and displaying the buffer in that window. It can fail if all
windows are dedicated to another buffer (@pxref{Dedicated Windows}).
@end defun
@ -2629,16 +2631,16 @@ If all options described above fail to produce a suitable window,
resort, it will try to display @var{buffer-or-name} on a separate frame.
In that case, the value of @code{pop-up-frames} is disregarded.
@node Window History
@section Window History
@cindex window history
Each window remembers the buffers it has displayed earlier and the
order in which these buffers have been removed from it. This history
is used, for example, by @code{replace-buffer-in-windows}
(@pxref{Buffers and Windows}). This list is set automatically
maintained by Emacs, but you can use the following functions to
explicitly inspect or alter it:
Each window remembers the buffers it has displayed earlier and the order
in which these buffers have been removed from it. This history is used,
for example, by @code{replace-buffer-in-windows} (@pxref{Buffers and
Windows}). This list is automatically maintained by Emacs, but you can
use the following functions to explicitly inspect or alter it:
@defun window-prev-buffers &optional window
This function returns a list specifying the previous contents of
@ -2652,7 +2654,7 @@ buffer was last shown, and @var{window-pos} is the point position when
that buffer was last shown.
The list is ordered so that earlier elements correspond to more
recently-shown buffers, and the first element corresponds to the
recently-shown buffers, and the first element usually corresponds to the
buffer most recently removed from the window.
@end defun
@ -2671,8 +2673,9 @@ below). This list is mainly used by @code{switch-to-prev-buffer} and
@defun window-next-buffers &optional window
This function returns the list of buffers recently re-shown in
@var{window} via @code{switch-to-prev-buffer}. @var{window} should be
a live window or @code{nil} (meaning the selected window).
@var{window} via @code{switch-to-prev-buffer}. The @var{window}
argument must denote a live window or @code{nil} (meaning the selected
window).
@end defun
@defun set-window-next-buffers window next-buffers
@ -2707,8 +2710,8 @@ or killed or has been already shown by a recent invocation of
If repeated invocations of this command have already shown all buffers
previously shown in @var{window}, further invocations will show buffers
from the global buffer list starting with the buffer returned by
@code{last-buffer} (@pxref{The Buffer List}).
from the buffer list of the frame @var{window} appears on (@pxref{The
Buffer List}).
@end deffn
@deffn Command switch-to-next-buffer &optional window
@ -2717,12 +2720,12 @@ the effect of the last @code{switch-to-prev-buffer} command in
@var{window}. The argument @var{window} must be a live window and
defaults to the selected one.
If there is no recent invocation of a @code{switch-to-prev-buffer}
that can be undone, this function tries to show the first buffer from
the global buffer list as returned by @code{other-buffer} (@pxref{The
Buffer List}).
If there is no recent invocation of a @code{switch-to-prev-buffer} that
can be undone, this function tries to show a buffer from the buffer list
of the frame @var{window} appears on (@pxref{The Buffer List}).
@end deffn
@node Dedicated Windows
@section Dedicated Windows
@cindex dedicated window
@ -2776,6 +2779,59 @@ display. Other functions do not treat @code{t} differently from any
non-@code{nil} value.
@end defun
@node Quitting Windows
@section Quitting Windows
When you want to get rid of a window used for displaying a buffer you
can use the function @code{delete-window} (@pxref{Deleting Windows}) to
remove that window from its frame. If the buffer has been shown on a
separate frame, you might want to call @code{delete-frame}
(@pxref{Deleting Frames}) instead. If, on the other hand, a window has
been reused for displaying the buffer, you might prefer showing the
buffer previously shown in that window by calling the function
@code{switch-to-prev-buffer} (@pxref{Window History}). Finally, you
might want to either bury (@pxref{The Buffer List}) or kill
(@pxref{Killing Buffers}) the window's buffer.
The following function uses information on how the window for
displaying the buffer was obtained in the first place thus attempting to
automatize the above decisions for you.
@deffn Command quit-window &optional kill window
This command quits @var{window} and buries its buffer. The argument
@var{window} must be a live window and defaults to the selected one.
With prefix argument @var{kill} non-@code{nil}, it kills the buffer
instead of burying it.
Quitting @var{window} means to proceed as follows: If @var{window} was
created specially for displaying its current buffer, delete @var{window}
provided its frame contains at least one other live window. If
@var{window} is the only window on its frame and other frames still
exist, delete the frame together with @var{window}. If, however, there
are no other frames left, display some other buffer in @var{window}.
If @var{window} was reused for displaying its buffer, this command tries
to display the buffer previously shown in it. It also tries to restore
the window start (@pxref{Window Start and End}) and point (@pxref{Window
Point}) positions of the previously shown buffer. If, in addition, the
current buffer was temporarily resized, this command will also try to
restore the original height of @var{window}.
The three cases described so far require that the buffer shown in
@var{window} is still the buffer displayed by the last buffer display
function for this window. If another buffer has been shown in the
meantime or the buffer previously shown no longer exists, this command
calls @code{switch-to-prev-buffer} (@pxref{Window History}) to show some
other buffer instead.
@end deffn
The function @code{quit-window} bases its decisions on information
stored in @var{window}'s @code{quit-restore} window parameter
(@pxref{Window Parameters}) and resets that parameter to @code{nil}
after it's done.
@node Window Point
@section Windows and Point
@cindex window position
@ -3522,14 +3578,13 @@ argument because it always uses the frame that @var{window} is on.
@cindex window configurations
@cindex saving window information
A @dfn{window configuration} records the entire layout of one
A @dfn{window configuration} records the entire layout of one
frame---all windows, their sizes, which buffers they contain, how those
buffers are scrolled, and their values of point and the mark; also their
fringes, margins, and scroll bar settings. It also includes the value
of @code{minibuffer-scroll-window}. As a special exception, the window
configuration does not record the value of point in the selected window
for the current buffer. Also, the window configuration does not record
the values of window parameters; see @ref{Window Parameters}.
for the current buffer.
You can bring back an entire frame layout by restoring a previously
saved window configuration. If you want to record the layout of all
@ -3639,24 +3694,62 @@ sense, but are not implemented because we did not need them. See the
file @file{winner.el} for some more operations on windows
configurations.
The objects returned by @code{current-window-configuration} die
together with the Emacs process. In order to store a window
configuration on disk and read it back in another Emacs session the
following two functions can be used.
@defun window-state-get &optional window markers
This function returns the state of @var{window} as a Lisp object. The
argument @var{window} can be any window and defaults to the root window
of the selected frame.
The optional argument @var{markers} non-@code{nil} means to use markers
for sampling positions like @code{window-point} or @code{window-start}.
This argument should be non-@code{nil} only if the value is used for
putting the state back in the same session since markers slow down
processing.
@end defun
The value returned by @code{window-state-get} can be converted by using
one of the functions defined by Desktop Save Mode (@pxref{Desktop Save
Mode}) to an object that can be written to a file. Such objects can be
read back and converted to a Lisp object representing the state of the
window. That Lisp object can be used as argument for the following
function in order to restore the state window in another window.
@defun window-state-put state &optional window ignore
This function puts the window state @var{state} into @var{window}. The
argument @var{state} should be the state of a window returned by an
earlier invocation of @code{window-state-get}, see above. The optional
argument @var{window} must specify a live window and defaults to the
selected one.
The optional argument @var{ignore} non-@code{nil} means to ignore
minimum window sizes and fixed size restrictions. If @var{ignore}
equals @code{safe}, this means subwindows can get as small as one line
and/or two columns.
@end defun
@node Window Parameters
@section Window Parameters
@cindex window parameters
This sections describes how window parameters can be used to associate
This section describes how window parameters can be used to associate
additional information with windows.
@defun window-parameter window parameter
This function returns @var{window}'s value for @var{parameter}. The
default for @var{window} is the selected window. If @var{window}
has no setting for @var{parameter}, this function returns @code{nil}.
default for @var{window} is the selected window. If @var{window} has no
setting for @var{parameter}, this function returns @code{nil}.
@end defun
@defun window-parameters &optional window
This function returns all parameters of @var{window} and their values.
The default for @var{window} is the selected window. The return value
is an association list of elements of the form @code{(@var{parameter}
. @var{value})}.
The default for @var{window} is the selected window. The return value,
if non-@code{nil} is an association list whose elements have the form
@code{(@var{parameter} . @var{value})}.
@end defun
@defun set-window-parameter window parameter value
@ -3665,13 +3758,56 @@ This function sets @var{window}'s value of @var{parameter} to
is the selected window.
@end defun
Currently, window parameters are not saved in window configurations and
consequently not restored by @code{set-window-configuration}. Hence,
any change of a parameter introduced via @code{set-window-parameter} can
be undone only by invoking @code{set-window-parameter} for the same
parameter again. Since @code{save-window-excursion} relies on window
configurations (@pxref{Window Configurations}), window parameters are
not saved and restored by that special form, either.
Some functions, notably @code{delete-window},
@code{delete-other-windows} and @code{split-window} may behave specially
when their @var{window} argument has a parameter set. You can override
such special behavior by binding the following variable to a
non-@code{nil} value:
@defvar ignore-window-parameters
If this variable is non-@code{nil}, some standard functions do not
process window parameters. The functions currently affected by this are
@code{split-window}, @code{delete-window}, @code{delete-other-windows}
and @code{other-window}.
An application can bind this variable to a non-@code{nil} value around
calls to these functions. If it does so, the application is fully
responsible for correctly assigning the parameters of all involved
windows when exiting that function.
@end defvar
The following parameters are currently used by the window management
code.
@table @asis
@item @code{delete-window}
This parameter affects the execution of @code{delete-window}
(@pxref{Deleting Windows}).
@item @code{delete-other-windows}
This parameter affects the execution of @code{delete-other-windows}
(@pxref{Deleting Windows}).
@item @code{split-window}
This parameter affects the execution of @code{split-window}
(@pxref{Splitting Windows}).
@item @code{other-window}
This parameter affects the execution of @code{other-window}
(@pxref{Cyclic Window Ordering}).
@item @code{no-other-window}
This parameter marks the window as not selectable by @code{other-window}
(@pxref{Cyclic Window Ordering}).
@end table
In addition, the parameters @code{window-atom} and @code{window-side}
are reserved and should not be used by applications. The
@code{quit-restore} parameter tells how to proceed with a window when
the buffer it shows is no more needed. This parameter is installed by
the buffer display functions (@pxref{Choosing Window}) and consulted by
the function @code{quit-window} (@pxref{Quitting Windows}).
@node Window Hooks
@section Hooks for Window Scrolling and Changes

View file

@ -425,6 +425,11 @@ These maximize and minize the size of a window within its frame.
These functions allow to navigate through the live buffers that have
been shown in a specific window.
+++
*** New functions `window-state-get' and `window-state-put'.
These functions allow to save and restore the state of an arbitrary
frame or window as an Elisp object.
** The inactive minibuffer has its own major mode `minibuffer-inactive-mode'.
This is handy for minibuffer-only frames, and is also used for the "mouse-1
pops up *Messages*" feature, which can now easily be changed.
@ -1030,11 +1035,11 @@ and `window-body-height' are provided.
*** Window parameters specific to window handling functions.
For each window you can specify a parameter to override the default
behavior of a number of functions like `split-window', `delete-window'
and `delete-other-windows'.
and `delete-other-windows'. The variable `ignore-window-parameters'
allows to ignore processing such parameters.
+++
*** New semantics of third argument of `split-window'.
The third argument of `split-window' has been renamed to SIDE and can be
set to any of the values 'below, 'right, 'above, or 'left to make the
new window appear on the corresponding side of the window that shall be
@ -1097,6 +1102,11 @@ are user-customizable variables.
See the docstring of `display-buffer' for details.
+++
*** New behavior of `quit-window'.
The behavior of `quit-window' has been changed in order to restore the
state before the last buffer display operation in that window.
** Completion
*** New variable completion-extra-properties used to specify extra properties

View file

@ -1,3 +1,14 @@
2011-09-25 Michael Albinus <michael.albinus@gmx.de>
* net/dbus.el (dbus-unregister-object): Don't release services for
registered signals. (Bug#9581)
2011-09-25 Teodor Zlatanov <tzz@lifelogs.com>
* progmodes/cfengine.el (cfengine-auto-mode): Add convenience
function that picks between cfengine 2 and 3 support
automatically. Update docs accordingly.
2011-09-22 Ken Manheimer <ken.manheimer@gmail.com>
* allout.el (allout-this-command-hid-stuff): Buffer-local variable

View file

@ -140,11 +140,14 @@ association to the service from D-Bus."
;; Find the corresponding entry in the hash table.
(let* ((key (car object))
(value (cdr object))
(value (cadr object))
(bus (car key))
(service (car value))
(entry (gethash key dbus-registered-objects-table))
ret)
;; key has the structure (BUS INTERRFACE MEMBER).
;; value has the structure (SERVICE PATH [HANDLER]).
;; entry has the structure ((UNAME SERVICE PATH MEMBER [RULE]) ...).
;; value has the structure ((SERVICE PATH [HANDLER]) ...).
;; MEMBER is either a string (the handler), or a cons cell (a
;; property value). UNAME and property values are not taken into
;; account for comparision.
@ -152,8 +155,8 @@ association to the service from D-Bus."
;; Loop over the registered functions.
(dolist (elt entry)
(when (equal
(car value)
(butlast (cdr elt) (- (length (cdr elt)) (length (car value)))))
value
(butlast (cdr elt) (- (length (cdr elt)) (length value))))
(setq ret t)
;; Compute new hash value. If it is empty, remove it from the
;; hash table.
@ -162,17 +165,16 @@ association to the service from D-Bus."
;; Remove match rule of signals.
(let ((rule (nth 4 elt)))
(when (stringp rule)
(setq service nil) ; We do not need to unregister the service.
(dbus-call-method
(car key) dbus-service-dbus dbus-path-dbus dbus-interface-dbus
bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus
"RemoveMatch" rule)))))
;; Check, whether there is still a registered function or property
;; for the given service. If not, unregister the service from the
;; bus.
(dolist (elt entry)
(let ((service (cadr elt))
(bus (car key))
found)
(when service
(when service
(dolist (elt entry)
(let (found)
(maphash
(lambda (k v)
(dolist (e v)

View file

@ -26,16 +26,21 @@
;; Provides support for editing GNU Cfengine files, including
;; font-locking, Imenu and indention, but with no special keybindings.
;; Possible customization for auto-mode selection:
;; (push '(("^cfagent.conf\\'" . cfengine-mode)) auto-mode-alist)
;; (push '(("^cf\\." . cfengine-mode)) auto-mode-alist)
;; (push '(("\\.cf\\'" . cfengine-mode)) auto-mode-alist)
;; The CFEngine 3.x support doesn't have Imenu support but patches are
;; welcome.
;; Or, if you want to use the CFEngine 3.x support:
;; You can set it up so either cfengine-mode (2.x and earlier) or
;; cfengine3-mode (3.x) will be picked, depending on the buffer
;; contents:
;; (push '(("^cfagent.conf\\'" . cfengine3-mode)) auto-mode-alist)
;; (push '(("^cf\\." . cfengine3-mode)) auto-mode-alist)
;; (push '(("\\.cf\\'" . cfengine3-mode)) auto-mode-alist)
;; (add-to-list 'auto-mode-alist '("\\.cf\\'" . cfengine-auto-mode))
;; OR you can choose to always use a specific version, if you prefer
;; it
;; (add-to-list 'auto-mode-alist '("\\.cf\\'" . cfengine3-mode))
;; (add-to-list 'auto-mode-alist '("^cf\\." . cfengine-mode))
;; (add-to-list 'auto-mode-alist '("^cfagent.conf\\'" . cfengine-mode))
;; This is not the same as the mode written by Rolf Ebert
;; <ebert@waporo.muc.de>, distributed with cfengine-2.0.5. It does
@ -466,6 +471,18 @@ to the action header."
#'cfengine-beginning-of-defun)
(set (make-local-variable 'end-of-defun-function) #'cfengine-end-of-defun))
;;;###autoload
(defun cfengine-auto-mode ()
"Choose between `cfengine-mode' and `cfengine3-mode' depending
on the buffer contents"
(let ((v3 nil))
(save-restriction
(goto-char (point-min))
(while (not (or (eobp) v3))
(setq v3 (looking-at (concat cfengine3-defuns-regex "\\>")))
(forward-line)))
(if v3 (cfengine3-mode) (cfengine-mode))))
(provide 'cfengine3)
(provide 'cfengine)

View file

@ -767,6 +767,11 @@
rather than rolling our own approximation.
(SCROLL_BAR_VEC_SIZE): Remove; not used.
2011-09-25 Michael Albinus <michael.albinus@gmx.de>
* dbusbind.c (Fdbus_register_signal): When service is not
registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
2011-09-25 Glenn Morris <rgm@gnu.org>
* buffer.c (truncate-lines): Doc fix.

View file

@ -2071,13 +2071,7 @@ usage: (dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest ARG
&& (SBYTES (service) > 0)
&& (strcmp (SSDATA (service), DBUS_SERVICE_DBUS) != 0)
&& (strncmp (SSDATA (service), ":", 1) != 0))
{
uname = call2 (intern ("dbus-get-name-owner"), bus, service);
/* When there is no unique name, we mark it with an empty
string. */
if (NILP (uname))
uname = empty_unibyte_string;
}
uname = call2 (intern ("dbus-get-name-owner"), bus, service);
else
uname = service;