Commit 41614825 authored by Glenn Morris's avatar Glenn Morris

Merge from emacs-24; up to 117687

parents 97cd7301 86b1c771
......@@ -198,11 +198,11 @@ specific images completely by customizing @code{shr-blocked-images}.
@vindex shr-color-visible-distance-min
@vindex shr-color-visible-luminance-min
@cindex Contrast
EWW (or rather its HTML renderer @code{shr}) use the colors declared
in the HTML page but adjust them if needed to keep a certain minimum
contrast. If that is still to low for you, have a look at the
EWW (or rather its HTML renderer @code{shr}) uses the colors declared
in the HTML page, but adjusts them if needed to keep a certain minimum
contrast. If that is still too low for you, you can customize the
variables @code{shr-color-visible-distance-min} and
@code{shr-color-visible-luminance-min}.
@code{shr-color-visible-luminance-min} to get a better contrast.
@node History and Acknowledgments
@appendix History and Acknowledgments
......
2014-11-08 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-check-cached-permissions): Include hop in
the constructed Tramp file name. (Bug#18943)
2014-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
* emulation/cua-base.el (cua--select-keymaps): Use region-active-p
(bug#18952).
(cua-set-mark, cua--post-command-handler-1):
* emulation/cua-gmrk.el (cua-cancel-global-mark): Same.
2014-11-08 Michael Albinus <michael.albinus@gmx.de>
* files.el (file-name-non-special): Wrap the call of
`insert-file-contents' by `unwind-protect', in order to set the
buffer's file name anyway. (Bug#18891)
2014-11-08 Alan Mackenzie <acm@muc.de>
Fix wrong bound to c-font-lock-declarators. Fixes bug #18948.
* progmodes/cc-fonts.el (c-font-lock-declarations): Pass
"(point-max)" as bound to c-font-lock-declarators, not "limit", as
the buffer is sometimes narrowed to less than "limit" (e.g., in
the presence of macros).
2014-11-08 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-error-with-buffer): Show connection buffer
only when message appeared in minibuffer. (Bug#18891)
* net/tramp-adb.el (tramp-adb-handle-file-attributes):
* net/tramp-gvfs.el (tramp-gvfs-handle-file-attributes):
* net/tramp-sh.el (tramp-sh-handle-file-attributes): Return nil in
case of errors.
2014-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment):
......
......@@ -1015,7 +1015,7 @@ With a double \\[universal-argument] prefix argument, unconditionally set mark."
(or (and cua-auto-mark-last-change
(cua-pop-to-last-change))
(pop-to-mark-command)))
((and cua-toggle-set-mark mark-active)
((and cua-toggle-set-mark (region-active-p))
(cua--deactivate)
(message "Mark cleared"))
(t
......@@ -1127,7 +1127,7 @@ If ARG is the atom `-', scroll upward by nearly full screen."
(if cua--debug
(cond
(cua--rectangle (cua--rectangle-assert))
(mark-active (message "Mark=%d Point=%d" (mark t) (point)))))
((region-active-p) (message "Mark=%d Point=%d" (mark t) (point)))))
(if cua-enable-cursor-indications
(cua--update-indications))
......@@ -1186,7 +1186,7 @@ If ARG is the atom `-', scroll upward by nearly full screen."
(defun cua--select-keymaps ()
;; Setup conditions for selecting the proper keymaps in cua--keymap-alist.
(setq cua--ena-region-keymap
(and mark-active (not deactivate-mark)))
(and (region-active-p) (not deactivate-mark)))
(setq cua--ena-prefix-override-keymap
(and cua--ena-region-keymap
cua-enable-cua-keys
......
......@@ -321,7 +321,7 @@ With prefix argument, don't jump to global mark when canceling it."
(defun cua-cancel-global-mark ()
"Cancel the global mark."
(interactive)
(if mark-active
(if (region-active-p)
(cua-cancel)
(if (cua--global-mark-active)
(cua--deactivate-global-mark t)))
......
......@@ -6670,7 +6670,7 @@ only these files will be asked to be saved."
(`add (concat "/:" (apply operation arguments)))
(`insert-file-contents
(let ((visit (nth 1 arguments)))
(prog1
(unwind-protect
(apply operation arguments)
(when (and visit buffer-file-name)
(setq buffer-file-name (concat "/:" buffer-file-name))))))
......
......@@ -316,17 +316,18 @@ pass to the OPERATION."
(defun tramp-adb-handle-file-attributes (filename &optional id-format)
"Like `file-attributes' for Tramp files."
(unless id-format (setq id-format 'integer))
(with-parsed-tramp-file-name filename nil
(with-tramp-file-property
v localname (format "file-attributes-%s" id-format)
(and
(tramp-adb-send-command-and-check
v (format "%s -d -l %s"
(tramp-adb-get-ls-command v)
(tramp-shell-quote-argument localname)))
(with-current-buffer (tramp-get-buffer v)
(tramp-adb-sh-fix-ls-output)
(cdar (tramp-do-parse-file-attributes-with-ls v id-format)))))))
(ignore-errors
(with-parsed-tramp-file-name filename nil
(with-tramp-file-property
v localname (format "file-attributes-%s" id-format)
(and
(tramp-adb-send-command-and-check
v (format "%s -d -l %s"
(tramp-adb-get-ls-command v)
(tramp-shell-quote-argument localname)))
(with-current-buffer (tramp-get-buffer v)
(tramp-adb-sh-fix-ls-output)
(cdar (tramp-do-parse-file-attributes-with-ls v id-format))))))))
(defun tramp-do-parse-file-attributes-with-ls (vec &optional id-format)
"Parse `file-attributes' for Tramp files using the ls(1) command."
......
......@@ -720,124 +720,128 @@ is no information where to trace the message.")
(defun tramp-gvfs-handle-file-attributes (filename &optional id-format)
"Like `file-attributes' for Tramp files."
(unless id-format (setq id-format 'integer))
;; Don't modify `last-coding-system-used' by accident.
(let ((last-coding-system-used last-coding-system-used)
dirp res-symlink-target res-numlinks res-uid res-gid res-access
res-mod res-change res-size res-filemodes res-inode res-device)
(with-parsed-tramp-file-name filename nil
(with-tramp-file-property
v localname (format "file-attributes-%s" id-format)
(tramp-message v 5 "file attributes: %s" localname)
(tramp-gvfs-send-command
v "gvfs-info" (tramp-gvfs-url-file-name filename))
;; Parse output ...
(with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-min))
(when (re-search-forward "attributes:" nil t)
;; ... directory or symlink
(goto-char (point-min))
(setq dirp (if (re-search-forward "type:\\s-+directory" nil t) t))
(goto-char (point-min))
(setq res-symlink-target
(if (re-search-forward
"standard::symlink-target:\\s-+\\(\\S-+\\)" nil t)
(match-string 1)))
;; ... number links
(goto-char (point-min))
(setq res-numlinks
(if (re-search-forward "unix::nlink:\\s-+\\([0-9]+\\)" nil t)
(string-to-number (match-string 1)) 0))
;; ... uid and gid
(ignore-errors
;; Don't modify `last-coding-system-used' by accident.
(let ((last-coding-system-used last-coding-system-used)
dirp res-symlink-target res-numlinks res-uid res-gid res-access
res-mod res-change res-size res-filemodes res-inode res-device)
(with-parsed-tramp-file-name filename nil
(with-tramp-file-property
v localname (format "file-attributes-%s" id-format)
(tramp-message v 5 "file attributes: %s" localname)
(tramp-gvfs-send-command
v "gvfs-info" (tramp-gvfs-url-file-name filename))
;; Parse output ...
(with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-min))
(setq res-uid
(or (if (eq id-format 'integer)
(when (re-search-forward "attributes:" nil t)
;; ... directory or symlink
(goto-char (point-min))
(setq dirp (if (re-search-forward "type:\\s-+directory" nil t) t))
(goto-char (point-min))
(setq res-symlink-target
(if (re-search-forward
"standard::symlink-target:\\s-+\\(\\S-+\\)" nil t)
(match-string 1)))
;; ... number links
(goto-char (point-min))
(setq res-numlinks
(if (re-search-forward
"unix::nlink:\\s-+\\([0-9]+\\)" nil t)
(string-to-number (match-string 1)) 0))
;; ... uid and gid
(goto-char (point-min))
(setq res-uid
(or (if (eq id-format 'integer)
(if (re-search-forward
"unix::uid:\\s-+\\([0-9]+\\)" nil t)
(string-to-number (match-string 1)))
(if (re-search-forward
"unix::uid:\\s-+\\([0-9]+\\)" nil t)
(string-to-number (match-string 1)))
(if (re-search-forward
"owner::user:\\s-+\\(\\S-+\\)" nil t)
(match-string 1)))
(tramp-get-local-uid id-format)))
(setq res-gid
(or (if (eq id-format 'integer)
"owner::user:\\s-+\\(\\S-+\\)" nil t)
(match-string 1)))
(tramp-get-local-uid id-format)))
(setq res-gid
(or (if (eq id-format 'integer)
(if (re-search-forward
"unix::gid:\\s-+\\([0-9]+\\)" nil t)
(string-to-number (match-string 1)))
(if (re-search-forward
"unix::gid:\\s-+\\([0-9]+\\)" nil t)
(string-to-number (match-string 1)))
(if (re-search-forward
"owner::group:\\s-+\\(\\S-+\\)" nil t)
(match-string 1)))
(tramp-get-local-gid id-format)))
;; ... last access, modification and change time
(goto-char (point-min))
(setq res-access
(if (re-search-forward
"time::access:\\s-+\\([0-9]+\\)" nil t)
(seconds-to-time (string-to-number (match-string 1)))
'(0 0)))
(goto-char (point-min))
(setq res-mod
(if (re-search-forward
"time::modified:\\s-+\\([0-9]+\\)" nil t)
(seconds-to-time (string-to-number (match-string 1)))
'(0 0)))
(goto-char (point-min))
(setq res-change
(if (re-search-forward
"time::changed:\\s-+\\([0-9]+\\)" nil t)
(seconds-to-time (string-to-number (match-string 1)))
'(0 0)))
;; ... size
(goto-char (point-min))
(setq res-size
(if (re-search-forward
"standard::size:\\s-+\\([0-9]+\\)" nil t)
(string-to-number (match-string 1)) 0))
;; ... file mode flags
(goto-char (point-min))
(setq res-filemodes
(if (re-search-forward "unix::mode:\\s-+\\([0-9]+\\)" nil t)
(tramp-file-mode-from-int
(string-to-number (match-string 1)))
(if dirp "drwx------" "-rwx------")))
;; ... inode and device
(goto-char (point-min))
(setq res-inode
(if (re-search-forward "unix::inode:\\s-+\\([0-9]+\\)" nil t)
(string-to-number (match-string 1))
(tramp-get-inode v)))
(goto-char (point-min))
(setq res-device
(if (re-search-forward "unix::device:\\s-+\\([0-9]+\\)" nil t)
(string-to-number (match-string 1))
(tramp-get-device v)))
;; Return data gathered.
(list
;; 0. t for directory, string (name linked to) for
;; symbolic link, or nil.
(or dirp res-symlink-target)
;; 1. Number of links to file.
res-numlinks
;; 2. File uid.
res-uid
;; 3. File gid.
res-gid
;; 4. Last access time, as a list of integers.
;; 5. Last modification time, likewise.
;; 6. Last status change time, likewise.
res-access res-mod res-change
;; 7. Size in bytes (-1, if number is out of range).
res-size
;; 8. File modes.
res-filemodes
;; 9. t if file's gid would change if file were deleted
;; and recreated.
nil
;; 10. Inode number.
res-inode
;; 11. Device number.
res-device
)))))))
"owner::group:\\s-+\\(\\S-+\\)" nil t)
(match-string 1)))
(tramp-get-local-gid id-format)))
;; ... last access, modification and change time
(goto-char (point-min))
(setq res-access
(if (re-search-forward
"time::access:\\s-+\\([0-9]+\\)" nil t)
(seconds-to-time (string-to-number (match-string 1)))
'(0 0)))
(goto-char (point-min))
(setq res-mod
(if (re-search-forward
"time::modified:\\s-+\\([0-9]+\\)" nil t)
(seconds-to-time (string-to-number (match-string 1)))
'(0 0)))
(goto-char (point-min))
(setq res-change
(if (re-search-forward
"time::changed:\\s-+\\([0-9]+\\)" nil t)
(seconds-to-time (string-to-number (match-string 1)))
'(0 0)))
;; ... size
(goto-char (point-min))
(setq res-size
(if (re-search-forward
"standard::size:\\s-+\\([0-9]+\\)" nil t)
(string-to-number (match-string 1)) 0))
;; ... file mode flags
(goto-char (point-min))
(setq res-filemodes
(if (re-search-forward "unix::mode:\\s-+\\([0-9]+\\)" nil t)
(tramp-file-mode-from-int
(string-to-number (match-string 1)))
(if dirp "drwx------" "-rwx------")))
;; ... inode and device
(goto-char (point-min))
(setq res-inode
(if (re-search-forward
"unix::inode:\\s-+\\([0-9]+\\)" nil t)
(string-to-number (match-string 1))
(tramp-get-inode v)))
(goto-char (point-min))
(setq res-device
(if (re-search-forward
"unix::device:\\s-+\\([0-9]+\\)" nil t)
(string-to-number (match-string 1))
(tramp-get-device v)))
;; Return data gathered.
(list
;; 0. t for directory, string (name linked to) for
;; symbolic link, or nil.
(or dirp res-symlink-target)
;; 1. Number of links to file.
res-numlinks
;; 2. File uid.
res-uid
;; 3. File gid.
res-gid
;; 4. Last access time, as a list of integers.
;; 5. Last modification time, likewise.
;; 6. Last status change time, likewise.
res-access res-mod res-change
;; 7. Size in bytes (-1, if number is out of range).
res-size
;; 8. File modes.
res-filemodes
;; 9. t if file's gid would change if file were deleted
;; and recreated.
nil
;; 10. Inode number.
res-inode
;; 11. Device number.
res-device
))))))))
(defun tramp-gvfs-handle-file-directory-p (filename)
"Like `file-directory-p' for Tramp files."
......
......@@ -1103,23 +1103,24 @@ target of the symlink differ."
(defun tramp-sh-handle-file-attributes (filename &optional id-format)
"Like `file-attributes' for Tramp files."
(unless id-format (setq id-format 'integer))
;; Don't modify `last-coding-system-used' by accident.
(let ((last-coding-system-used last-coding-system-used))
(with-parsed-tramp-file-name (expand-file-name filename) nil
(with-tramp-file-property
v localname (format "file-attributes-%s" id-format)
(save-excursion
(tramp-convert-file-attributes
v
(or
(cond
((tramp-get-remote-stat v)
(tramp-do-file-attributes-with-stat v localname id-format))
((tramp-get-remote-perl v)
(tramp-do-file-attributes-with-perl v localname id-format))
(t nil))
;; The scripts could fail, for example with huge file size.
(tramp-do-file-attributes-with-ls v localname id-format))))))))
(ignore-errors
;; Don't modify `last-coding-system-used' by accident.
(let ((last-coding-system-used last-coding-system-used))
(with-parsed-tramp-file-name (expand-file-name filename) nil
(with-tramp-file-property
v localname (format "file-attributes-%s" id-format)
(save-excursion
(tramp-convert-file-attributes
v
(or
(cond
((tramp-get-remote-stat v)
(tramp-do-file-attributes-with-stat v localname id-format))
((tramp-get-remote-perl v)
(tramp-do-file-attributes-with-perl v localname id-format))
(t nil))
;; The scripts could fail, for example with huge file size.
(tramp-do-file-attributes-with-ls v localname id-format)))))))))
(defun tramp-do-file-attributes-with-ls (vec localname &optional id-format)
"Implement `file-attributes' for Tramp files using the ls(1) command."
......
......@@ -1604,7 +1604,9 @@ an input event arrives. The other arguments are passed to `tramp-error'."
(when (and buf
tramp-message-show-message
(not (zerop tramp-verbose))
(not (tramp-completion-mode-p)))
(not (tramp-completion-mode-p))
;; Show only when Emacs has started already.
(current-message))
(let ((enable-recursive-minibuffers t))
;; `tramp-error' does not show messages. So we must do it
;; ourselves.
......@@ -3917,7 +3919,8 @@ be granted."
(tramp-file-name-method vec)
(tramp-file-name-user vec)
(tramp-file-name-host vec)
(tramp-file-name-localname vec))
(tramp-file-name-localname vec)
(tramp-file-name-hop vec))
(intern suffix))))
(remote-uid
(tramp-get-connection-property
......
......@@ -1255,6 +1255,8 @@ casts and declarations are fontified. Used on level 2 and higher."
c-font-lock-maybe-decl-faces
(lambda (match-pos inside-macro)
;; Note to maintainers: don't use `limit' inside this lambda form;
;; c-find-decl-spots sometimes narrows to less than `limit'.
(setq start-pos (point))
(when
;; The result of the form below is true when we don't recognize a
......@@ -1487,7 +1489,7 @@ casts and declarations are fontified. Used on level 2 and higher."
;; At a real declaration?
(if (memq (c-forward-type t) '(t known found decltype))
(progn
(c-font-lock-declarators limit t is-typedef)
(c-font-lock-declarators (point-max) t is-typedef)
nil)
;; False alarm. Return t to go on to the next check.
(goto-char start-pos)
......
2014-11-08 Jan Djärv <jan.h.d@swipnet.se>
* nsterm.m (run): Only use non-system event loop if OSX version is
exactly 10.9 (Bug#18993).
2014-11-08 Michael Albinus <michael.albinus@gmx.de>
* callproc.c (encode_current_directory): Support handling of file
names prepended by "/:". (Bug#18891)
2014-11-08 Alan Mackenzie <acm@muc.de>
* syntax.c (back_comment): Fix off-by-one error (bug#18022).
2014-11-08 Dima Kogan <dima@secretsauce.net>
* xgselect.c (xg_select): Use g_main_context_acquire (bug#18861).
2014-11-08 Michael Albinus <michael.albinus@gmx.de>
* dired.c (Ffile_attributes): Return Qnil, if Fexpand_file_name
raises an error. (Bug#18891)
2014-11-08 Martin Rudalics <rudalics@gmx.at>
* frame.c (adjust_frame_size): Call x_set_window_size only if
......
......@@ -127,6 +127,14 @@ encode_current_directory (void)
dir = expand_and_dir_to_file (dir, Qnil);
if (NILP (Ffile_accessible_directory_p (dir)))
report_file_error ("Setting current directory",
BVAR (current_buffer, directory));
/* Remove "/:" from dir. */
if (! NILP (Fstring_match (build_string ("^/:"), dir, Qnil)))
dir = Fsubstring (dir, make_number (2), Qnil);
if (STRING_MULTIBYTE (dir))
dir = ENCODE_FILE (dir);
if (! file_accessible_directory_p (dir))
......
......@@ -909,7 +909,10 @@ so last access time will always be midnight of that day. */)
Lisp_Object encoded;
Lisp_Object handler;
filename = Fexpand_file_name (filename, Qnil);
filename = internal_condition_case_2 (Fexpand_file_name, filename, Qnil,
Qt, Fidentity);
if (!STRINGP (filename))
return Qnil;
/* If the file name has special constructs in it,
call the corresponding file handler. */
......
......@@ -4501,15 +4501,15 @@ - (id)init
#ifdef NS_IMPL_COCOA
- (void)run
{
#ifndef NSAppKitVersionNumber10_8
#define NSAppKitVersionNumber10_8 1187
#ifndef NSAppKitVersionNumber10_9
#define NSAppKitVersionNumber10_9 1265
#endif
if (NSAppKitVersionNumber <= NSAppKitVersionNumber10_8)
{
[super run];
return;
}
if ((int)NSAppKitVersionNumber != NSAppKitVersionNumber10_9)
{
[super run];
return;
}
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
......
......@@ -825,7 +825,7 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
{
from = comment_end;
from_byte = comment_end_byte;
UPDATE_SYNTAX_TABLE_FORWARD (comment_end - 1);
UPDATE_SYNTAX_TABLE_FORWARD (comment_end);
}
/* If comstart_pos is set and we get here (ie. didn't jump to `lossage'
or `done'), then we've found the beginning of the non-nested comment. */
......
......@@ -55,19 +55,28 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds,
GPollFD *gfds = gfds_buf;
int gfds_size = ARRAYELTS (gfds_buf);
int n_gfds, retval = 0, our_fds = 0, max_fds = fds_lim - 1;
int i, nfds, tmo_in_millisec;
bool context_acquired = false;
int i, nfds, tmo_in_millisec = -1;
bool need_to_dispatch;
USE_SAFE_ALLOCA;
context = g_main_context_default ();
context_acquired = g_main_context_acquire (context);
/* FIXME: If we couldn't acquire the context, we just silently proceed
because this function handles more than just glib file descriptors.
Note that, as implemented, this failure is completely silent: there is
no feedback to the caller. */
if (rfds) all_rfds = *rfds;
else FD_ZERO (&all_rfds);
if (wfds) all_wfds = *wfds;
else FD_ZERO (&all_wfds);
n_gfds = g_main_context_query (context, G_PRIORITY_LOW, &tmo_in_millisec,
gfds, gfds_size);
n_gfds = (context_acquired
? g_main_context_query (context, G_PRIORITY_LOW, &tmo_in_millisec,
gfds, gfds_size)
: -1);
if (gfds_size < n_gfds)
{
SAFE_NALLOCA (gfds, sizeof *gfds, n_gfds);
......@@ -152,6 +161,9 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds,
errno = pselect_errno;
}
if (context_acquired)
g_main_context_release (context);
/* To not have to recalculate timeout, return like this. */
if ((our_fds > 0 || (nfds == 0 && tmop == &tmo)) && (retval == 0))
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment