Merge from trunk.

This commit is contained in:
Alan Mackenzie 2012-01-18 11:50:27 +00:00
commit e8afb1265f
22 changed files with 1416 additions and 1138 deletions

View file

@ -1,3 +1,7 @@
2012-01-16 Juanma Barranquero <lekktu@gmail.com>
* .bzrignore: Ignore etc/__pycache__.
2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
Port HAVE_PTHREAD configuration to MirBSD 10 (Bug#10201).

View file

@ -117,7 +117,7 @@ TUTORIAL.pt_BR
TUTORIAL.ro
TUTORIAL.ru
TUTORIAL.sk
TUTORIAL.sl
TUTORIAL.sl Primoz PETERLIN
TUTORIAL.sv
TUTORIAL.th
TUTORIAL.zh
@ -203,7 +203,7 @@ help.texi
hooks.texi
index.texi
internals.texi
intro.texi
intro.texi cyd
keymaps.texi
lists.texi
loading.texi

View file

@ -1,3 +1,7 @@
2012-01-16 Volker Sobek <reklov@live.com> (tiny change)
* programs.texi (Comment Commands): Typo (bug#10514).
2012-01-15 Chong Yidong <cyd@gnu.org>
* xresources.texi (X Resources): Describe GTK+ case first.
@ -21,8 +25,7 @@
2012-01-14 Chong Yidong <cyd@gnu.org>
* cmdargs.texi (Action Arguments): No need to mention
EMACSLOADPATH.
* cmdargs.texi (Action Arguments): No need to mention EMACSLOADPATH.
(General Variables): Add xref to Lisp Libraries.
(Initial Options): Copyedits.
(Resume Arguments): Node deleted; emacs.bash/csh are obsolete.
@ -8847,7 +8850,7 @@
;; coding: utf-8
;; End:
Copyright (C) 1993-1999, 2001-2011 Free Software Foundation, Inc.
Copyright (C) 1993-1999, 2001-2012 Free Software Foundation, Inc.
This file is part of GNU Emacs.

View file

@ -952,7 +952,7 @@ comment text.
comment on the current line, along with the whitespace before it.
Since the comment is saved to the kill ring, you can reinsert it on
another line by moving to the end of that line, doing @kbd{C-y}, and
then @kbd{M-;} to realign the command. You can achieve the same
then @kbd{M-;} to realign the comment. You can achieve the same
effect as @kbd{C-u M-;} by typing @kbd{M-x comment-kill}
(@code{comment-dwim} actually calls @code{comment-kill} as a
subroutine when it is given a prefix argument).

View file

@ -1,3 +1,7 @@
2012-01-17 Glenn Morris <rgm@gnu.org>
* emacs-lisp-intro.texi (re-search-forward): Fix typo.
2011-11-24 Juanma Barranquero <lekktu@gmail.com>
* makefile.w32-in: Update dependencies.

View file

@ -12607,7 +12607,7 @@ four arguments:
@enumerate
@item
The first argument is the regular expression that the function searches
for. The regular expression will be a string between quotations marks.
for. The regular expression will be a string between quotation marks.
@item
The optional second argument limits how far the function will search; it is a

View file

@ -1,3 +1,12 @@
2012-01-16 Juanma Barranquero <lekktu@gmail.com>
* windows.texi (Window Parameters): Use @pxref.
2012-01-16 Martin Rudalics <rudalics@gmx.at>
* windows.texi (Window Configurations, Window Parameters):
Describe persistent window parameters.
2011-12-27 Stefan Monnier <monnier@iro.umontreal.ca>
* variables.texi (Creating Buffer-Local): Warn against misuses of

View file

@ -3104,7 +3104,9 @@ window configuration; see @ref{Frame Configurations}.
@defun current-window-configuration &optional frame
This function returns a new object representing @var{frame}'s current
window configuration. The default for @var{frame} is the selected
frame.
frame. This function saves copies of window parameters listed by the
variable @code{window-persistent-parameters}, see @ref{Window
Parameters} for details.
@end defun
@defun set-window-configuration configuration
@ -3206,24 +3208,30 @@ 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.
configuration on disk and read it back in another Emacs session, the
functions described next can be used. These functions are also useful
to clone the state of a frame into an arbitrary live window
(@code{set-window-configuration} effectively clones the windows of a
frame into the root window of that very frame only).
@defun window-state-get &optional window markers
@defun window-state-get &optional window ignore
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.
If the optional argument @var{ignore} is non-@code{nil}, this means to
not use markers for sampling positions like @code{window-point} or
@code{window-start}. This argument should be non-@code{nil} when the
state shall be written on disk and read back in another session.
The variable @code{window-persistent-parameters} specifies whether and
which window parameters are saved by this function, see @ref{Window
Parameters} for details.
@end defun
The value returned by @code{window-state-get} can be converted by using
The value returned by @code{window-state-get} can be converted, 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
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.
@ -3268,6 +3276,51 @@ This function sets @var{window}'s value of @var{parameter} to
is the selected window.
@end defun
By default, functions saving and restoring window configurations or the
states of windows (@pxref{Window Configurations}) do not care about
window parameters. This means, that when you change the value of a
parameter within the body of a @code{save-window-excursion}, the
previous value is not restored upon exit of that macro. It also means
that when you clone via @code{window-state-put} a window state saved
earlier by @code{window-state-get}, the cloned windows come up with no
parameters at all. The following variable allows to override the
standard behavior.
@defvar window-persistent-parameters
This variable is an alist specifying which parameters get saved by
@code{current-window-configuration} and @code{window-state-get} and
subsequently restored by @code{set-window-configuration} and
@code{window-state-put}, see @ref{Window Configurations}.
The @sc{car} of each entry of this alist is the symbol specifying the
parameter. The @sc{cdr} must be one of the following:
@table @asis
@item @code{state}
This value means the parameter is saved by @code{window-state-get}
provided its @var{ignore} argument is @code{nil}. The function
@code{current-window-configuration} does not save this parameter.
@item @code{nil}
This value specifies that the parameter is saved by
@code{current-window-configuration} and, provided its @var{ignore}
argument is @code{nil}, by @code{window-state-get}.
@item @code{t}
This means that the parameter is saved unconditionally by both
@code{current-window-configuration} and @code{window-state-get}. This
value should not be used for parameters whose values do not have a read
syntax. Otherwise, invoking @code{window-state-put} in another session
may fail with an @code{invalid-read-syntax} error.
@end table
Parameters that have been saved are restored to their previous values by
@code{set-window-configuration} respectively are installed by
@code{window-state-put}. Parameters that have not been saved are left
alone by @code{set-window-configuration} respectively are not installed
by @code{window-state-put}.
@end defvar
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
@ -3287,7 +3340,7 @@ windows when exiting that function.
@end defvar
The following parameters are currently used by the window management
code.
code:
@table @asis
@item @code{delete-window}
@ -3309,14 +3362,20 @@ This parameter affects the execution of @code{other-window}
@item @code{no-other-window}
This parameter marks the window as not selectable by @code{other-window}
(@pxref{Cyclic Window Ordering}).
@item @code{clone-of}
This parameter specifies the window this one has been cloned from and is
installed by @code{window-state-get}, see @ref{Window Configurations}.
@item @code{quit-restore}
This parameter tells how to proceed with a window when the buffer it
shows is no more needed. It is installed by the buffer display
functions (@pxref{Choosing Window}) and consulted by the function
@code{quit-window} (@pxref{Quitting Windows}).
@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}).
are reserved and should not be used by applications.
@node Window Hooks

View file

@ -1,3 +1,12 @@
2012-01-19 Werner Lemberg <wl@gnu.org>
* tutorial/TUTORIAL.de: Updated; synchronize with TUTORIAL.
Minor typographical improvements.
2012-01-17 Primoz PETERLIN <primoz.peterlin@mf.uni-lj.si>
* tutorials/TUTORIAL.sl: Update.
2012-01-14 Eli Zaretskii <eliz@gnu.org>
* tutorials/TUTORIAL.he: Update to follow changes to TUTORIAL in

View file

@ -71,6 +71,12 @@ things in their .emacs.
** See if other files can use generated-autoload-file (see eg ps-print).
** Write more tests. Pick a fixed bug from the database, write a test
case to make sure it stays fixed. Or pick your favorite programming
major-mode, and write a test for its indentation. Or a version
control backend, and write a test for its status parser. Etc.
See test/automated for examples.
* Small but important fixes needed in existing features:
** Flymake's customization mechanism needs to be both simpler (fewer

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -75,8 +75,8 @@ Author: Miroslav Vaško <vasko@debian.cz>
Maintainer: Maintainer needed.
* TUTORIAL.sl:
Author: Primož Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si>
Maintainer: Primož Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si>
Author: Primož Peterlin <primozz.peterlin@gmail.com>
Maintainer: Primož Peterlin <primozz.peterlin@gmail.com>
* TUTORIAL.sv:
Author: Mats Lidell <matsl@contactor.se>

View file

@ -1,3 +1,34 @@
2012-01-18 Glenn Morris <rgm@gnu.org>
* files.el (auto-mode-alist, inhibit-first-line-modes-regexps)
(set-auto-mode): Doc fixes.
2012-01-17 Glenn Morris <rgm@gnu.org>
* isearch.el (search-nonincremental-instead): Fix doc typo.
* dired.el (dired-insert-directory): Handle newlines in directory name.
(dired-build-subdir-alist): Unescape newlines in directory name.
2012-01-17 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-local-end-of-line): New defcustom.
(tramp-action-login, tramp-action-yesno, tramp-action-yn)
(tramp-action-terminal): Use it. (Bug#10530)
2012-01-16 Stefan Monnier <monnier@iro.umontreal.ca>
* minibuffer.el (completion--replace): Strip properties (bug#10062).
2012-01-16 Martin Rudalics <rudalics@gmx.at>
* window.el (window-state-ignored-parameters): Remove variable.
(window--state-get-1): Rename argument MARKERS to IGNORE.
Handle persistent window parameters. Make copy of clone-of
parameter only if requested. (Bug#10348)
(window--state-put-2): Install a window parameter only if it has
a non-nil value or an existing parameter shall be overwritten.
2012-01-15 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-sh.el (tramp-remote-path): Set tramp-autoload cookie.
@ -21,6 +52,17 @@
* dired.el (dired-get-filename): Fix 'verbatim case of previous change.
2012-01-13 Alan Mackenzie <acm@muc.de>
Fix filling for when filladapt mode is enabled.
* progmodes/cc-cmds.el (c-fill-paragraph): In the invocation of
c-mask-paragraph, pass in `fill-paragraph' rather than
`fill-region-as-paragraph'. (This is a reversion of a previous
change.)
* progmodes/cc-mode.el (c-basic-common-init): Make
fill-paragraph-handle-comment buffer local and set it to nil.
2012-01-13 Glenn Morris <rgm@gnu.org>
* dired.el (dired-switches-escape-p): New function.
@ -38,7 +80,7 @@
Fix Emacs bug #10463 - put `widen's around the critical spots.
* progmodes/cc-engine.el (c-in-literal, c-literal-limits): put a
* progmodes/cc-engine.el (c-in-literal, c-literal-limits): Put a
widen around each invocation of c-state-pp-to-literal. Remove an
unused let variable.
@ -49,8 +91,8 @@
2012-01-10 Chong Yidong <cyd@gnu.org>
* net/network-stream.el (network-stream-open-starttls): Avoid
emitting a confusing error message when the server gives a bad
* net/network-stream.el (network-stream-open-starttls):
Avoid emitting a confusing error message when the server gives a bad
response to the capability command.
2012-01-10 Glenn Morris <rgm@gnu.org>
@ -143,8 +185,8 @@
* custom.el (enable-theme): Don't set custom-safe-themes.
* cus-theme.el (custom-theme-merge-theme): Ignore
custom-enabled-themes and custom-safe-themes.
* cus-theme.el (custom-theme-merge-theme):
Ignore custom-enabled-themes and custom-safe-themes.
2012-01-05 Michael R. Mauger <mmaug@yahoo.com>
@ -167,8 +209,8 @@
2012-01-03 Chong Yidong <cyd@gnu.org>
* shell.el (shell-dynamic-complete-functions): Put
pcomplete-completions-at-point, so as to try
* shell.el (shell-dynamic-complete-functions):
Put pcomplete-completions-at-point, so as to try
comint-filename-completion first (Bug#10417).
2012-01-02 Richard Stallman <rms@gnu.org>
@ -193,8 +235,8 @@
2012-01-01 Eli Zaretskii <eliz@gnu.org>
* term/w32-win.el (dynamic-library-alist) <gnutls>: Load
libgnutls-28.dll, from GnuTLS version 3.x, in preference to
* term/w32-win.el (dynamic-library-alist) <gnutls>:
Load libgnutls-28.dll, from GnuTLS version 3.x, in preference to
libgnutls-26.dll.
2011-12-31 Andreas Schwab <schwab@linux-m68k.org>
@ -246,11 +288,10 @@
2011-12-24 Alan Mackenzie <acm@muc.de>
Introduce a mechanism to widen the region used in context font
locking. Use this to protect declarations from losing their
contexts.
locking. Use this to protect declarations from losing their contexts.
* progmodes/cc-langs.el (c-before-font-lock-functions): Replace
c-set-fl-decl-start with c-change-set-fl-decl-start (Renaming).
* progmodes/cc-langs.el (c-before-font-lock-functions):
Replace c-set-fl-decl-start with c-change-set-fl-decl-start (Renaming).
(c-before-context-fontification-functions): New defvar, a list of
functions to be run just before context (etc.) font locking.
@ -402,22 +443,19 @@
* progmodes/cc-langs (c-label-kwds): Let AWK take the same
expression as the rest.
(c-nonlabel-token-key): Allow string literals for AWK. Refactor
for the other modes.
(c-nonlabel-token-key): Allow string literals for AWK.
Refactor for the other modes.
Large brace-block initialisation makes CC Mode slow: Fix.
Tidy up and accelerate c-in-literal, etc. by using the
c-parse-state
Tidy up and accelerate c-in-literal, etc. by using the c-parse-state
routines. Limit backward searching in c-font-lock-enclosing.decl.
* progmodes/cc-engine.el (c-state-pp-to-literal): Return the
pp-state and literal type in addition to the limits.
(c-state-safe-place): New defun, extracted from
c-state-literal-at.
(c-state-safe-place): New defun, extracted from c-state-literal-at.
(c-state-literal-at): Use the above new defun.
(c-slow-in-literal, c-fast-in-literal): Removed.
(c-in-literal, c-literal-limits): Amended to use
c-state-pp-to-literal.
(c-slow-in-literal, c-fast-in-literal): Remove.
(c-in-literal, c-literal-limits): Amend to use c-state-pp-to-literal.
* progmodes/cc-fonts.el (c-font-lock-enclosing-decls): Check for
being in a literal. Add a limit for backward searching.
@ -491,8 +529,8 @@
2011-12-10 Eli Zaretskii <eliz@gnu.org>
* mail/rmailsum.el (rmail-header-summary): RFC2047 decode the
`from' or `to' address before taking its substring. Fixes
incorrect display in Rmail summary buffer whereby an RFC2047
`from' or `to' address before taking its substring.
Fixes incorrect display in Rmail summary buffer whereby an RFC2047
encoded name is chopped in the middle of the encoded string, and
thus displayed encoded.
@ -711,8 +749,8 @@
(verilog-uvm-statement-re): Support UVM indentation and
highlighting, with old OVM keywords only.
(verilog-auto-tieoff, verilog-auto-tieoff-declaration):
Support AUTOTIEOFF creating non-wire data types. Suggested by Jonathan
Greenlaw.
Support AUTOTIEOFF creating non-wire data types.
Suggested by Jonathan Greenlaw.
(verilog-auto-insert-lisp, verilog-delete-to-paren)
(verilog-forward-sexp-cmt, verilog-forward-sexp-ign-cmt)
(verilog-inject-sense, verilog-read-inst-pins)
@ -798,11 +836,11 @@
Andrew Drake.
(verilog-auto-star-safe, verilog-delete-auto-star-implicit)
(verilog-inst-comment-re): Fix not deleting Interfaced comment
when expanding .* in interfaces, bug320. Reported by Pierre-David
Pfister.
when expanding .* in interfaces, bug320.
Reported by Pierre-David Pfister.
(verilog-read-module-name): Fix import statements between module
name and open parenthesis, bug317. Reported by Pierre-David
Pfister.
name and open parenthesis, bug317.
Reported by Pierre-David Pfister.
(verilog-simplify-range-expression): Fix simplification of
multiplications inside AUTOWIRE connections, bug303.
(verilog-auto-inst-port): Support parameter expansion in
@ -1056,8 +1094,7 @@
2011-11-19 Andreas Schwab <schwab@linux-m68k.org>
* progmodes/sh-script.el (sh-assignment-regexp): Add entry for
bash.
* progmodes/sh-script.el (sh-assignment-regexp): Add entry for bash.
2011-11-19 Juri Linkov <juri@jurta.org>
@ -1182,8 +1219,7 @@
* window.el (window-resize, delete-window, split-window):
Replace window-splits by window-combination-resize.
* cus-start.el (window-splits): Replace by
window-combination-resize.
* cus-start.el (window-splits): Replace by window-combination-resize.
2011-11-17 Glenn Morris <rgm@gnu.org>
@ -1248,8 +1284,7 @@
* window.el (split-window, window-state-get-1)
(window-state-put-1, window-state-put-2): Rename occurrences of
window-nest to window-combination-limit.
* cus-start.el (window-nest): Rename to
window-combination-limit.
* cus-start.el (window-nest): Rename to window-combination-limit.
2011-11-16 Chong Yidong <cyd@gnu.org>

View file

@ -1172,7 +1172,22 @@ see `dired-use-ls-dired' for more details.")
"\\015"
(text-properties-at (match-beginning 0)))
nil t))
(set-marker end nil)))
(set-marker end nil))
;; Replace any newlines in DIR with literal "\n"s, for the sake
;; of the header line. To disambiguate a literal "\n" in the
;; actual dirname, we also replace "\" with "\\".
;; Personally, I think this should always be done, irrespective
;; of the value of dired-actual-switches, because:
;; i) Dired simply does not work with an unescaped newline in
;; the directory name used in the header (bug=10469#28), and
;; ii) "\" is always replaced with "\\" in the listing, so doing
;; it in the header as well makes things consistent.
;; But at present it is only done if "-b" is in ls-switches,
;; because newlines in dirnames are uncommon, and people may
;; have gotten used to seeing unescaped "\" in the headers.
;; Note: adjust dired-build-subdir-alist if you change this.
(setq dir (replace-regexp-in-string "\\\\" "\\\\" dir nil t)
dir (replace-regexp-in-string "\n" "\\n" dir nil t)))
(dired-insert-set-properties opoint (point))
;; If we used --dired and it worked, the lines are already indented.
;; Otherwise, indent them.
@ -2541,12 +2556,31 @@ instead of `dired-actual-switches'."
(delete-region (point) (match-end 1))
(insert new-dir-name))
(setq count (1+ count))
;; Undo any escaping of newlines and \ by dired-insert-directory.
;; Convert "n" preceded by odd number of \ to newline, and \\ to \.
(when (and (dired-switches-escape-p switches)
(string-match-p "\\\\" new-dir-name))
(let (temp res)
(mapc (lambda (char)
(cond ((equal char ?\\)
(if temp
(setq res (concat res "\\")
temp nil)
(setq temp "\\")))
((and temp (equal char ?n))
(setq res (concat res "\n")
temp nil))
(t
(setq res (concat res temp (char-to-string char))
temp nil))))
new-dir-name)
(setq new-dir-name res)))
(dired-alist-add-1 new-dir-name
;; Place a sub directory boundary between lines.
(save-excursion
(goto-char (match-beginning 0))
(beginning-of-line)
(point-marker)))))
;; Place a sub directory boundary between lines.
(save-excursion
(goto-char (match-beginning 0))
(beginning-of-line)
(point-marker)))))
(if (and (> count 1) (called-interactively-p 'interactive))
(message "Buffer includes %d directories" count)))
;; We don't need to sort it because it is in buffer order per

View file

@ -2405,9 +2405,6 @@ If the element has the form (REGEXP FUNCTION NON-NIL), then after
calling FUNCTION (if it's not nil), we delete the suffix that matched
REGEXP and search the list again for another match.
If the file name matches `inhibit-first-line-modes-regexps',
then `auto-mode-alist' is not processed.
The extensions whose FUNCTION is `archive-mode' should also
appear in `auto-coding-alist' with `no-conversion' coding system.
@ -2481,7 +2478,8 @@ See also `auto-mode-alist'.")
(defvar inhibit-first-line-modes-regexps
(mapcar 'purecopy '("\\.tar\\'" "\\.tgz\\'" "\\.tiff?\\'"
"\\.gif\\'" "\\.png\\'" "\\.jpe?g\\'"))
"List of regexps; if one matches a file name, don't look for `-*-'.")
"List of regexps; if one matches a file name, don't look for `-*-'.
See also `inhibit-first-line-modes-suffixes'.")
(defvar inhibit-first-line-modes-suffixes nil
"List of regexps for what to ignore, for `inhibit-first-line-modes-regexps'.
@ -2550,7 +2548,8 @@ Also applies to `magic-fallback-mode-alist'.")
(defun set-auto-mode (&optional keep-mode-if-same)
"Select major mode appropriate for current buffer.
To find the right major mode, this function checks for a -*- mode tag,
To find the right major mode, this function checks for a -*- mode tag
\(unless `inhibit-first-line-modes-regexps' says not to),
checks for a `mode:' entry in the Local Variables section of the file,
checks if it uses an interpreter listed in `interpreter-mode-alist',
matches the buffer beginning against `magic-mode-alist',

View file

@ -102,7 +102,7 @@ in Isearch mode is always downcased."
:group 'isearch)
(defcustom search-nonincremental-instead t
"If non-nil, do a nonincremental search instead if exiting immediately.
"If non-nil, do a nonincremental search instead of exiting immediately.
Actually, `isearch-edit-string' is called to let you enter the search
string, and RET terminates editing and does a nonincremental search."
:type 'boolean

View file

@ -571,6 +571,10 @@ in the last `cdr'."
(defun completion--replace (beg end newtext)
"Replace the buffer text between BEG and END with NEWTEXT.
Moves point to the end of the new text."
;; The properties on `newtext' include things like
;; completions-first-difference, which we don't want to include
;; upon insertion.
(set-text-properties 0 (length newtext) nil newtext)
;; Maybe this should be in subr.el.
;; You'd think this is trivial to do, but details matter if you want
;; to keep markers "at the right place" and be robust in the face of

View file

@ -460,6 +460,12 @@ usually suffice.")
"Regexp which matches `tramp-echo-mark' as it gets echoed by
the remote shell.")
(defcustom tramp-local-end-of-line
(if (memq system-type '(windows-nt)) "\r\n" "\n")
"*String used for end of line in local processes."
:group 'tramp
:type 'string)
(defcustom tramp-rsh-end-of-line "\n"
"*String used for end of line in rsh connections.
I don't think this ever needs to be changed, so please tell me about it
@ -1902,7 +1908,7 @@ Falls back to normal file name handler if no Tramp file name handler exists."
;; operations shall return at least a default value
;; in order to give the user a chance to correct the
;; file name in the minibuffer.
;; We cannot use 'debug as error handler. In order
;; We cannot use `debug' as error handler. In order
;; to get a full backtrace, one could apply
;; (setq debug-on-error t debug-on-signal t)
(error
@ -3116,7 +3122,7 @@ beginning of local filename are not substituted."
(tramp-message vec 3 "Sending login name `%s'" tramp-current-user)
(with-current-buffer (tramp-get-connection-buffer vec)
(tramp-message vec 6 "\n%s" (buffer-string)))
(tramp-send-string vec tramp-current-user))
(tramp-send-string vec (concat tramp-current-user tramp-local-end-of-line)))
(defun tramp-action-password (proc vec)
"Query the user for a password."
@ -3148,7 +3154,7 @@ See also `tramp-action-yn'."
(throw 'tramp-action 'permission-denied))
(with-current-buffer (tramp-get-connection-buffer vec)
(tramp-message vec 6 "\n%s" (buffer-string)))
(tramp-send-string vec "yes"))))
(tramp-send-string vec (concat "yes" tramp-local-end-of-line)))))
(defun tramp-action-yn (proc vec)
"Ask the user for confirmation using `y-or-n-p'.
@ -3162,7 +3168,7 @@ See also `tramp-action-yesno'."
(throw 'tramp-action 'permission-denied))
(with-current-buffer (tramp-get-connection-buffer vec)
(tramp-message vec 6 "\n%s" (buffer-string)))
(tramp-send-string vec "y"))))
(tramp-send-string vec (concat "y" tramp-local-end-of-line)))))
(defun tramp-action-terminal (proc vec)
"Tell the remote host which terminal type to use.
@ -3170,7 +3176,7 @@ The terminal type can be configured with `tramp-terminal-type'."
(tramp-message vec 5 "Setting `%s' as terminal type." tramp-terminal-type)
(with-current-buffer (tramp-get-connection-buffer vec)
(tramp-message vec 6 "\n%s" (buffer-string)))
(tramp-send-string vec tramp-terminal-type))
(tramp-send-string vec (concat tramp-terminal-type tramp-local-end-of-line)))
(defun tramp-action-process-alive (proc vec)
"Check, whether a process has finished."

View file

@ -3568,10 +3568,7 @@ specific buffers."
))
;;; Window states, how to get them and how to put them in a window.
(defvar window-state-ignored-parameters '(quit-restore)
"List of window parameters ignored by `window-state-get'.")
(defun window--state-get-1 (window &optional markers)
(defun window--state-get-1 (window &optional ignore)
"Helper function for `window-state-get'."
(let* ((type
(cond
@ -3589,12 +3586,27 @@ specific buffers."
(normal-width . ,(window-normal-size window t))
(combination-limit . ,(window-combination-limit window))
,@(let (list)
(dolist (parameter (window-parameters window))
(unless (memq (car parameter)
window-state-ignored-parameters)
(setq list (cons parameter list))))
(unless (window-parameter window 'clone-of)
;; Make a clone-of parameter.
;; Make copies of persistent window parameters whose cdr
;; is either t or, when IGNORE is non-nil, is either nil
;; or `state'.
(dolist (pers window-persistent-parameters)
(when (and (consp pers)
(or (eq (cdr pers) t)
(and (memq (cdr pers) '(state nil))
(not ignore))))
(let ((par (assq (car pers) (window-parameters window))))
(setq list (cons (cons (car pers) (when par (cdr par)))
list)))))
;; Save `clone-of' parameter unless IGNORE or
;; `window-persistent-parameters' prevail.
(when (and (not (assq 'clone-of (window-parameters window)))
(let ((clone-of
(assq 'clone-of
window-persistent-parameters)))
(when clone-of
(if ignore
(eq (cdr clone-of) t)
(memq (cdr clone-of) '(state nil))))))
(setq list (cons (cons 'clone-of window) list)))
(when list
`((parameters . ,list))))
@ -3616,30 +3628,31 @@ specific buffers."
(scroll-bars . ,(window-scroll-bars window))
(vscroll . ,(window-vscroll window))
(dedicated . ,(window-dedicated-p window))
(point . ,(if markers (copy-marker point) point))
(start . ,(if markers (copy-marker start) start))
(point . ,(if ignore point (copy-marker point)))
(start . ,(if ignore start (copy-marker start)))
,@(when mark
`((mark . ,(if markers
(copy-marker mark) mark)))))))))))
`((mark . ,(if ignore
mark (copy-marker mark))))))))))))
(tail
(when (memq type '(vc hc))
(let (list)
(setq window (window-child window))
(while window
(setq list (cons (window--state-get-1 window markers) list))
(setq list (cons (window--state-get-1 window ignore) list))
(setq window (window-right window)))
(nreverse list)))))
(append head tail)))
(defun window-state-get (&optional window markers)
(defun window-state-get (&optional window ignore)
"Return state of WINDOW as a Lisp object.
WINDOW can be any window and defaults to the root window of the
selected frame.
Optional argument MARKERS non-nil means use markers for sampling
positions like `window-point' or `window-start'. MARKERS should
be non-nil only if the value is used for putting the state back
in the same session (note that markers slow down processing).
Optional argument IGNORE non-nil means do not use markers for
sampling positions like `window-point' or `window-start' and do
not record parameters unless `window-persistent-parameters'
requests it. IGNORE should be non-nil when the return value
shall be written to a file and read back in another session.
The return value can be used as argument for `window-state-put'
to put the state recorded here into an arbitrary window. The
@ -3665,7 +3678,7 @@ value can be also stored on disk and read back in a new session."
;; These are probably not needed.
,@(when (window-size-fixed-p window) `((fixed-height . t)))
,@(when (window-size-fixed-p window t) `((fixed-width . t))))
(window--state-get-1 window markers)))
(window--state-get-1 window ignore)))
(defvar window-state-put-list nil
"Helper variable for `window-state-put'.")
@ -3744,10 +3757,15 @@ value can be also stored on disk and read back in a new session."
(state (cdr (assq 'buffer item))))
(when combination-limit
(set-window-combination-limit window combination-limit))
;; Process parameters.
;; Assign saved window parameters. If a parameter's value is nil,
;; don't assign it unless the new window has it set already (which
;; shouldn't happen unless some `window-configuration-change-hook'
;; function installed it).
(when parameters
(dolist (parameter parameters)
(set-window-parameter window (car parameter) (cdr parameter))))
(when (or (cdr parameter)
(window-parameter window (car parameter)))
(set-window-parameter window (car parameter) (cdr parameter)))))
;; Process buffer related state.
(when state
;; We don't want to raise an error here so we create a buffer if

View file

@ -1,3 +1,9 @@
2012-01-16 Martin Rudalics <rudalics@gmx.at>
* window.c (Vwindow_persistent_parameters): New variable.
(Fset_window_configuration, save_window_save): Handle persistent
window parameters.
2012-01-14 Eli Zaretskii <eliz@gnu.org>
* w32fns.c (signal_user_input): Don't do a QUIT, to avoid

View file

@ -57,7 +57,7 @@ static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window;
static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically;
static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command;
static Lisp_Object Qsafe, Qabove, Qbelow;
static Lisp_Object Qauto_buffer_name;
static Lisp_Object Qauto_buffer_name, Qclone_of, Qstate;
static int displayed_window_lines (struct window *);
static struct window *decode_window (Lisp_Object);
@ -5410,6 +5410,7 @@ the return value is nil. Otherwise the value is t. */)
{
Lisp_Object window;
Lisp_Object dead_windows = Qnil;
register Lisp_Object tem, par, pers;
register struct window *w;
register struct saved_window *p;
struct window *root_window;
@ -5543,7 +5544,28 @@ the return value is nil. Otherwise the value is t. */)
w->vertical_scroll_bar_type = p->vertical_scroll_bar_type;
w->dedicated = p->dedicated;
w->combination_limit = p->combination_limit;
w->window_parameters = p->window_parameters;
/* Restore any window parameters that have been saved.
Parameters that have not been saved are left alone. */
for (tem = p->window_parameters; CONSP (tem); tem = XCDR (tem))
{
pers = XCAR (tem);
if (CONSP (pers))
{
if (NILP (XCDR (pers)))
{
par = Fassq (XCAR (pers), w->window_parameters);
if (CONSP (par) && !NILP (XCDR (par)))
/* Reset a parameter to nil if and only if it
has a non-nil association. Don't make new
associations. */
Fsetcdr (par, Qnil);
}
else
/* Always restore a non-nil value. */
Fset_window_parameter (window, XCAR (pers), XCDR (pers));
}
}
XSETFASTINT (w->last_modified, 0);
XSETFASTINT (w->last_overlay_modified, 0);
@ -5810,7 +5832,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
{
register struct saved_window *p;
register struct window *w;
register Lisp_Object tem;
register Lisp_Object tem, pers, par;
for (;!NILP (window); window = w->next)
{
@ -5838,12 +5860,60 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
p->vertical_scroll_bar_type = w->vertical_scroll_bar_type;
p->dedicated = w->dedicated;
p->combination_limit = w->combination_limit;
p->window_parameters = w->window_parameters;
p->window_parameters = Qnil;
if (!NILP (Vwindow_persistent_parameters))
{
/* Run cycle detection on Vwindow_persistent_parameters. */
Lisp_Object tortoise, hare;
hare = tortoise = Vwindow_persistent_parameters;
while (CONSP (hare))
{
hare = XCDR (hare);
if (!CONSP (hare))
break;
hare = XCDR (hare);
tortoise = XCDR (tortoise);
if (EQ (hare, tortoise))
/* Reset Vwindow_persistent_parameters to Qnil. */
{
Vwindow_persistent_parameters = Qnil;
break;
}
}
for (tem = Vwindow_persistent_parameters; CONSP (tem);
tem = XCDR (tem))
{
pers = XCAR (tem);
/* Save values for persistent window parameters whose cdr
is either nil or t. */
if (CONSP (pers) && (NILP (XCDR (pers)) || EQ (XCDR (pers), Qt)))
{
par = Fassq (XCAR (pers), w->window_parameters);
if (NILP (par))
/* If the window has no value for the parameter,
make one. */
p->window_parameters = Fcons (Fcons (XCAR (pers), Qnil),
p->window_parameters);
else
/* If the window has a value for the parameter,
save it. */
p->window_parameters = Fcons (Fcons (XCAR (par),
XCDR (par)),
p->window_parameters);
}
}
}
if (!NILP (w->buffer))
{
/* Save w's value of point in the window configuration.
If w is the selected window, then get the value of point
from the buffer; pointm is garbage in the selected window. */
/* Save w's value of point in the window configuration. If w
is the selected window, then get the value of point from
the buffer; pointm is garbage in the selected window. */
if (EQ (window, selected_window))
{
p->pointm = Fmake_marker ();
@ -6433,6 +6503,8 @@ syms_of_window (void)
DEFSYM (Qabove, "above");
DEFSYM (Qbelow, "below");
DEFSYM (Qauto_buffer_name, "auto-buffer-name");
DEFSYM (Qclone_of, "clone-of");
DEFSYM (Qstate, "state");
staticpro (&Vwindow_list);
@ -6542,6 +6614,31 @@ retrieved via the function `window-combination-limit' and altered by the
function `set-window-combination-limit'. */);
Vwindow_combination_limit = Qnil;
DEFVAR_LISP ("window-persistent-parameters", Vwindow_persistent_parameters,
doc: /* Alist of persistent window parameters.
Parameters in this list are saved by `current-window-configuration' and
`window-state-get' and subsequently restored to their previous values by
`set-window-configuration' and `window-state-put'.
The car of each entry of this alist is the symbol specifying the
parameter. The cdr is one of the following:
The symbol `state' means the parameter is saved by `window-state-get'
provided its IGNORE argument is nil. `current-window-configuration'
does not save this parameter.
nil means the parameter is saved by `current-window-configuration' and,
provided its IGNORE argument is nil, by `window-state-get'.
t means the parameter is saved unconditionally by both
`current-window-configuration' and `window-state-get'. Parameters
without read syntax (like windows or frames) should not use that.
Parameters not saved by `current-window-configuration' or
`window-state-get' are left alone by `set-window-configuration'
respectively are not installed by `window-state-put'. */);
Vwindow_persistent_parameters = list1 (Fcons (Qclone_of, Qstate));
defsubr (&Sselected_window);
defsubr (&Sminibuffer_window);
defsubr (&Swindow_minibuffer_p);