Commit 16adf2e6 authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

Merge from emacs-24; up to 2014-03-23T23:14:52Z!

parents 5af73b0f 196716cf
2014-03-26 Paul Eggert <>
Merge from gnulib, incorporating:
2014-03-26 strftime: wrap macros in "do {...} while(0)"
* lib/strftime.c: Update from gnulib.
2014-03-26 Glenn Morris <>
* (CLASH_DETECTION): Remove option. Every platform
2014-03-26 Eli Zaretskii <>
* files.texi (Kinds of Files): Improve documentation of
file-symlink-p. (Bug#17073) Add cross-references.
2014-03-26 Barry O'Reilly <>
* markers.texi (Moving Marker Positions): The 2014-03-02 doc
change mentioning undo's inability to handle relocated markers no
longer applies. See bug#16818.
* text.texi (Undo): Expand documentation of (TEXT . POS) and
(MARKER . ADJUSTMENT) undo elements.
2014-03-26 Glenn Morris <>
* files.texi (File Locks): All systems support locking.
......@@ -950,22 +950,26 @@ as directories, symbolic links, and ordinary files.
@defun file-symlink-p filename
@cindex file symbolic links
If the file @var{filename} is a symbolic link, the
@code{file-symlink-p} function returns the (non-recursive) link target
as a string. (Determining the file name that the link points to from
the target is nontrivial.) First, this function recursively follows
symbolic links at all levels of parent directories.
If the file @var{filename} is not a symbolic link (or there is no such file),
@code{file-symlink-p} function returns its (non-recursive) link target
as a string. (The link target string is not necessarily the full
absolute file name of the target; determining the full file name that
the link points to is nontrivial, see below.) If the leading
directories of @var{filename} include symbolic links, this function
recursively follows them.
If the file @var{filename} is not a symbolic link, or does not exist,
@code{file-symlink-p} returns @code{nil}.
Here are a few examples of using this function:
(file-symlink-p "foo")
(file-symlink-p "not-a-symlink")
@result{} nil
@end group
(file-symlink-p "sym-link")
@result{} "foo"
@result{} "not-a-symlink"
@end group
(file-symlink-p "sym-link2")
......@@ -976,6 +980,40 @@ If the file @var{filename} is not a symbolic link (or there is no such file),
@result{} "/pub/bin"
@end group
@end example
Note that in the third example, the function returned @file{sym-link},
but did not proceed to resolve it, although that file is itself a
symbolic link. This is what we meant by ``non-recursive'' above---the
process of following the symbolic links does not recurse if the link
target is itself a link.
The string that this function returns is what is recorded in the
symbolic link; it may or may not include any leading directories.
This function does @emph{not} expand the link target to produce a
fully-qualified file name, and in particular does not use the leading
directories, if any, of the @var{filename} argument if the link target
is not an absolute file name. Here's an example:
(file-symlink-p "/foo/bar/baz")
@result{} "some-file"
@end group
@end example
Here, although @file{/foo/bar/baz} was given as a fully-qualified file
name, the result is not, and in fact does not have any leading
directories at all. And since @file{some-file} might itself be a
symbolic link, you cannot simply prepend leading directories to it,
nor even naively use @code{expand-file-name} (@pxref{File Name
Expansion}) to produce its absolute file name.
For this reason, this function is seldom useful if you need to
determine more than just the fact that a file is or isn't a symbolic
link. If you actually need the file name of the link target, use
@code{file-chase-links} or @code{file-truename}, described in
@end defun
The next two functions recursively follow symbolic links at
......@@ -344,12 +344,10 @@ specify the insertion type, create them with insertion type
@section Moving Marker Positions
This section describes how to change the position of an existing
marker. When you do this, be sure you know how the marker is used
outside of your program. For example, moving a marker to an unrelated
new position can cause undo to later adjust the marker incorrectly.
Often when you wish to relocate a marker to an unrelated position, it
is preferable to make a new marker and set the prior one to point
marker. When you do this, be sure you know whether the marker is used
outside of your program, and, if so, what effects will result from
moving it---otherwise, confusing things may happen in other parts of
@defun set-marker marker position &optional buffer
This function moves @var{marker} to @var{position}
......@@ -1270,7 +1270,8 @@ This kind of element indicates how to reinsert text that was deleted.
The deleted text itself is the string @var{text}. The place to
reinsert it is @code{(abs @var{position})}. If @var{position} is
positive, point was at the beginning of the deleted text, otherwise it
was at the end.
was at the end. Zero or more (@var{marker} . @var{adjustment})
elements follow immediately after this element.
@item (t . @var{time-flag})
This kind of element indicates that an unmodified buffer became
......@@ -1296,8 +1297,10 @@ Here's how you might undo the change:
@item (@var{marker} . @var{adjustment})
This kind of element records the fact that the marker @var{marker} was
relocated due to deletion of surrounding text, and that it moved
@var{adjustment} character positions. Undoing this element moves
@var{marker} @minus{} @var{adjustment} characters.
@var{adjustment} character positions. If the marker's location is
consistent with the (@var{text} . @var{position}) element preceding it
in the undo list, then undoing this element moves @var{marker}
@minus{} @var{adjustment} characters.
@item (apply @var{funname} . @var{args})
This is an extensible undo item, which is undone by calling
2014-03-26 Paul Eggert <>
* texinfo.tex: Update from gnulib.
2014-03-26 Michael Albinus <>
* tramp.texi (Frequently Asked Questions): Add fish shell settings.
2014-03-23 Katsumi Yamaoka <>
* gnus.texi (Ma Gnus): Mention header attachment buttons.
......@@ -3,7 +3,7 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
......@@ -3935,19 +3935,23 @@
% multitable-only commands.
% @headitem starts a heading row, which we typeset in bold.
% Assignments have to be global since we are inside the implicit group
% of an alignment entry. \everycr resets \everytab so we don't have to
% @headitem starts a heading row, which we typeset in bold. Assignments
% have to be global since we are inside the implicit group of an
% alignment entry. \everycr below resets \everytab so we don't have to
% undo it ourselves.
\def\headitemfont{\b}% for people to use in the template row; not changeable
\gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings
\global\everytab={\bf}% can't use \headitemfont since the parsing differs
\the\everytab % for the first item
% default for tables with no headings.
% A \tab used to include \hskip1sp. But then the space in a template
% line is not enough. That is bad. So let's go back to just `&' until
% we again encounter the problem the 1sp was intended to solve.
......@@ -3978,15 +3982,15 @@
\everycr = {%
\global\everytab={}% Reset from possible headitem.
\global\colcount=0 % Reset the column counter.
% Check for saved footnotes, etc.
% Check for saved footnotes, etc.:
% Keeps underfull box messages off when table breaks over pages.
% Maybe so, but it also creates really weird page breaks when the
% table breaks over pages. Wouldn't \vfil be better? Wait until the
% problem manifests itself, so it can be fixed for real --karl.
% Perhaps a \nobreak, then reset:
......@@ -3053,15 +3053,28 @@ setting the cursor at the top of the buffer, and applying the expression
If it fails, or the cursor is not moved at the end of the buffer, your
prompt is not recognized correctly.
A special problem is the zsh, which uses left-hand side and right-hand
side prompts in parallel. Therefore, it is necessary to disable the
zsh line editor on the remote host. You shall add to @file{~/.zshrc}
the following command:
A special problem is the zsh shell, which uses left-hand side and
right-hand side prompts in parallel. Therefore, it is necessary to
disable the zsh line editor on the remote host. You shall add to
@file{~/.zshrc} the following command:
[ $TERM = "dumb" ] && unsetopt zle && PS1='$ '
@end example
Similar fancy prompt settings are known from the fish shell. Here you
must add in @file{~/.config/fish/}:
function fish_prompt
if test $TERM = "dumb"
echo "\$ "
@end example
Furthermore it has been reported, that @value{tramp} (like sshfs,
incidentally) doesn't work with WinSSHD due to strange prompt settings.
......@@ -681,24 +681,44 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
switch (format_char)
#define DO_NUMBER(d, v) \
digits = d; \
number_value = v; goto do_number
do \
{ \
digits = d; \
number_value = v; \
goto do_number; \
} \
while (0)
#define DO_SIGNED_NUMBER(d, negative, v) \
digits = d; \
negative_number = negative; \
u_number_value = v; goto do_signed_number
do \
{ \
digits = d; \
negative_number = negative; \
u_number_value = v; \
goto do_signed_number; \
} \
while (0)
/* The mask is not what you might think.
When the ordinal i'th bit is set, insert a colon
before the i'th digit of the time zone representation. */
#define DO_TZ_OFFSET(d, negative, mask, v) \
digits = d; \
negative_number = negative; \
tz_colon_mask = mask; \
u_number_value = v; goto do_tz_offset
do \
{ \
digits = d; \
negative_number = negative; \
tz_colon_mask = mask; \
u_number_value = v; \
goto do_tz_offset; \
} \
while (0)
#define DO_NUMBER_SPACEPAD(d, v) \
digits = d; \
number_value = v; goto do_number_spacepad
do \
{ \
digits = d; \
number_value = v; \
goto do_number_spacepad; \
} \
while (0)
case L_('%'):
if (modifier != 0)
......@@ -1265,9 +1285,9 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
if (modifier == L_('O'))
goto bad_format;
DO_SIGNED_NUMBER (4, tp->tm_year < -TM_YEAR_BASE,
tp->tm_year + (unsigned int) TM_YEAR_BASE);
DO_SIGNED_NUMBER (4, tp->tm_year < -TM_YEAR_BASE,
tp->tm_year + (unsigned int) TM_YEAR_BASE);
case L_('y'):
if (modifier == L_('E'))
2014-03-26 Juanma Barranquero <>
* emacs-lisp/package.el: Fix bug#16733 (again).
(url-http-parse-response, url-http-end-of-headers, url-recreate-url)
(url-http-target-url): Remove unused declarations.
(package-handle-response): Remove.
(package--with-work-buffer): Use url-insert-file-contents and simplify.
(package--download-one-archive): Use current-buffer instead of
dynamic binding of `buffer'.
(describe-package-1): Do not decode readme-string.
2014-03-26 Michael Albinus <>
* net/tramp.el (tramp-methods, tramp-connection-timeout): Fix docstring.
* net/tramp-sh.el (tramp-sh-handle-vc-registered): Revert change
from 2014-03-07, it decreases performance unnecessarily. Let-bind
`remote-file-name-inhibit-cache' to nil in the second pass.
(tramp-find-executable): Do not call "which" on SunOS.
(tramp-send-command-and-check): Fix docstring.
(tramp-do-copy-or-rename-file-directly): In the `rename' case,
check whether source directory has set the sticky bit.
2014-03-26 Barry O'Reilly <>
* simple.el (primitive-undo): Only process marker adjustments
validated against their corresponding (TEXT . POS). Issue warning
for lone marker adjustments in undo history. (Bug#16818)
(undo-make-selective-list): Add marker adjustments to selective
undo list based on whether their corresponding (TEXT . POS) is in
the region. Remove variable adjusted-markers, which was unused
and only non nil during undo-make-selective-list.
(undo-elt-in-region): Return nil when passed a marker adjustment
and explain in function doc.
2014-03-26 Nicolas Richard <>
* align.el (align-region): Do not fail when end-mark is nil (bug#17088).
2014-03-26 Dmitry Gutov <>
* progmodes/ruby-mode.el (ruby-expression-expansion-re):
Match special global variables without curlies, too.
(ruby-font-lock-keywords): Simplify the matcher for special global
variables. Don't require a non-word character after the variable.
2014-03-26 Stefan Monnier <>
* simple.el (redisplay-highlight-region-function): Increase priority of
overlay to make sure boundaries are visible (bug#15899).
2014-03-26 Juanma Barranquero <>
* frameset.el (frameset--initial-params): Fix typo in parameter name.
(frameset-restore): Compare display strings with equal.
* frame.el (make-frame): Don't quote display name in error message,
it is already a string.
2014-03-26 Thierry Volpiatto <>
* net/tramp.el (tramp-read-passwd): Suspend the timers while reading
the password.
2014-03-26 Dmitry Gutov <>
* emacs-lisp/package.el (package--add-to-archive-contents):
Include already installed and built-in packages in
(package-install): Don't include already installed packages in the
options during interactive invocation. (Bug#16762)
(package-show-package-list): If the buffer is already displayed in
another window, switch to that window.
2014-03-26 Reto Zimmermann <>
Sync with upstream vhdl mode v3.35.1.
......@@ -1247,7 +1322,7 @@
dbus-call-method check for completion using a busy-wait loop with
gradual backoff.
2013-10-02 Michael Albinus <>
2014-02-16 Michael Albinus <>
Sync with Tramp 2.2.9.
......@@ -1603,7 +1603,7 @@ aligner would have dealt with are."
rule-index (1+ rule-index)))
;; This function can use a lot of temporary markers, so instead of
;; waiting for the next GC we delete them immediately (Bug#10047).
(set-marker end-mark nil)
(when end-mark (set-marker end-mark nil))
(dolist (m markers)
(set-marker m nil))
......@@ -205,13 +205,9 @@ If VERSION is nil, the package is not loaded (it is \"disabled\")."
(defvar Info-directory-list)
(declare-function info-initialize "info" ())
(declare-function url-http-parse-response "url-http" ())
(declare-function url-http-file-exists-p "url-http" (url))
(declare-function lm-header "lisp-mnt" (header))
(declare-function lm-commentary "lisp-mnt" (&optional file))
(defvar url-http-end-of-headers)
(declare-function url-recreate-url "url-parse" (urlobj))
(defvar url-http-target-url)
(defcustom package-archives '(("gnu" . ""))
"An alist of archives from which to fetch.
......@@ -770,38 +766,14 @@ This macro retrieves FILE from LOCATION into a temporary buffer,
and evaluates BODY while that buffer is current. This work
buffer is killed afterwards. Return the last value in BODY."
(declare (indent 2) (debug t))
`(let* ((http (string-match "\\`https?:" ,location))
(if http
(url-retrieve-synchronously (concat ,location ,file))
(generate-new-buffer "*package work buffer*"))))
(with-current-buffer buffer
(if http
(progn (package-handle-response)
(re-search-forward "^$" nil 'move)
(delete-region (point-min) (point)))
(unless (file-name-absolute-p ,location)
(error "Archive location %s is not an absolute file name"
(insert-file-contents (expand-file-name ,file ,location)))
(kill-buffer buffer))))
(defun package-handle-response ()
"Handle the response from a `url-retrieve-synchronously' call.
Parse the HTTP response and throw if an error occurred.
The url package seems to require extra processing for this.
This should be called in a `save-excursion', in the download buffer.
It will move point to somewhere in the headers."
;; We assume HTTP here.
(require 'url-http)
(let ((response (url-http-parse-response)))
(when (or (< response 200) (>= response 300))
(error "Error downloading %s:%s"
(url-recreate-url url-http-target-url)
(buffer-substring-no-properties (point) (line-end-position))))))
(if (string-match-p "\\`https?:" ,location)
(url-insert-file-contents (concat ,location ,file))
(unless (file-name-absolute-p ,location)
(error "Archive location %s is not an absolute file name"
(insert-file-contents (expand-file-name ,file ,location)))
(defun package--archive-file-exists-p (location file)
(let ((http (string-match "\\`https?:" location)))
......@@ -1047,14 +1019,9 @@ Also, add the originating archive to the `package-desc' structure."
(existing-packages (assq name package-archive-contents))
(pinned-to-archive (assoc name package-pinned-packages)))
;; Skip entirely if pinned to another archive or already installed.
((or (and pinned-to-archive
(not (equal (cdr pinned-to-archive) archive)))
(let ((bi (assq name package--builtin-versions)))
(and bi (version-list-= version (cdr bi))))
(let ((ins (cdr (assq name package-alist))))
(and ins (version-list-= version
(package-desc-version (car ins))))))
;; Skip entirely if pinned to another archive.
((and pinned-to-archive
(not (equal (cdr pinned-to-archive) archive)))
((not existing-packages)
(push (list name pkg-desc) package-archive-contents))
......@@ -1090,8 +1057,11 @@ in an archive in `package-archives'. Interactively, prompt for its name."
(list (intern (completing-read
"Install package: "
(mapcar (lambda (elt) (symbol-name (car elt)))
(delq nil
(mapcar (lambda (elt)
(unless (package-installed-p (car elt))
(symbol-name (car elt))))
nil t)))))
(if (package-desc-p pkg)
......@@ -1272,7 +1242,7 @@ similar to an entry in `package-alist'. Save the cached copy to
(car archive)))))
;; Read the retrieved buffer to make sure it is valid (e.g. it
;; may fetch a URL redirect page).
(when (listp (read buffer))
(when (listp (read (current-buffer)))
(make-directory dir t)
(setq buffer-file-name (expand-file-name file dir))
(let ((version-control 'never)
......@@ -1531,8 +1501,7 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
(setq readme-string (buffer-string))
(error nil))
(let ((coding (detect-coding-string readme-string t)))
(insert (decode-coding-string readme-string coding t))))
(insert readme-string))
((file-readable-p readme)
(insert-file-contents readme)
(goto-char (point-max))))))))
......@@ -2117,11 +2086,14 @@ When KEYWORDS are given, only packages with those KEYWORDS are
(require 'finder-inf nil t)
(let ((buf (get-buffer-create "*Packages*")))
(let* ((buf (get-buffer-create "*Packages*"))
(win (get-buffer-window buf)))
(with-current-buffer buf
(package-menu--generate nil packages keywords))
(switch-to-buffer buf)))
(if win
(select-window win)
(switch-to-buffer buf))))
;; package-menu--generate rebinds "q" on the fly, so we have to
;; hard-code the binding in the doc-string here.
......@@ -668,7 +668,7 @@ the new frame according to its own rules."
(cdr (assq 'window-system parameters)))
(or (window-system-for-display display)
(error "Don't know how to interpret display \"%S\""
(error "Don't know how to interpret display %S"
(t window-system)))
(frame-creation-function (cdr (assq w frame-creation-function-alist)))
......@@ -940,7 +940,7 @@ is the parameter alist of the frame being restored. Internal use only."
Setting position and size parameters as soon as possible helps reducing
flickering; other parameters, like `minibuffer' and `border-width', can
not be changed once the frame has been created. Internal use only."
(cl-loop for param in '(left top with height border-width minibuffer)
(cl-loop for param in '(left top width height border-width minibuffer)
when (assq param parameters) collect it))
(defun frameset--restore-frame (parameters window-state filters force-onscreen)
......@@ -1146,8 +1146,8 @@ All keyword parameters default to nil."
frame to-tty duplicate)
;; Only set target if forcing displays and the target display is different.
(unless (or (frameset-keep-original-display-p force-display)
(eq (frame-parameter nil 'display)
(cdr (assq 'display frame-cfg))))
(equal (frame-parameter nil 'display)
(cdr (assq 'display frame-cfg))))
(setq frameset--target-display (cons 'display
(frame-parameter nil 'display))
to-tty (null (cdr frameset--target-display))))
......@@ -2110,6 +2110,12 @@ the uid and gid from FILENAME."
;; We can do it directly.
((let (file-name-handler-alist)
(and (file-readable-p localname1)
;; No sticky bit when renaming.
(or (eq op 'copy)
(file-modes (file-name-directory localname1))
(tramp-compat-octal-to-decimal "1000"))))
(file-writable-p (file-name-directory localname2))
(or (file-directory-p localname2)
(file-writable-p localname2))))
......@@ -3311,55 +3317,57 @@ the result will be a local, non-Tramp, filename."
v 3 (format "Checking `vc-registered' for %s" file)
(unless remote-file-name-inhibit-cache
;; There could be new files, created by the vc backend. We
;; cannot reuse the old cache entries, therefore.
(let (tramp-vc-registered-file-names
(remote-file-name-inhibit-cache (current-time))
`((,tramp-file-name-regexp . tramp-vc-file-name-handler))))
;; Here we collect only file names, which need an operation.
(ignore-errors (tramp-run-real-handler 'vc-registered (list file)))
(tramp-message v 10 "\n%s" tramp-vc-registered-file-names)
;; Send just one command, in order to fill the cache.
(when tramp-vc-registered-file-names
(format tramp-vc-registered-read-file-names
(tramp-get-file-exists-command v)
(format "%s -r" (tramp-get-test-command v)))
;; We cannot use `tramp-send-command-and-read',
;; because this does not cooperate well with
;; heredoc documents.
"tramp_vc_registered_read_file_names <<'%s'\n%s\n%s\n"
(mapconcat 'tramp-shell-quote-argument
(with-current-buffer (tramp-get-connection-buffer v)
;; Read the expression.
(goto-char (point-min))
(read (current-buffer)))))