1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-03 02:31:03 -08:00

auto upstream

This commit is contained in:
Joakim Verona 2013-02-27 00:03:49 +01:00
commit 96fd57d987
8 changed files with 140 additions and 121 deletions

View file

@ -1,3 +1,19 @@
2013-02-26 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-sh.el (tramp-sh-handle-insert-directory): Add
"2>/dev/null" to the ls command, in case "en_US.utf8" is not
defined. POSIX environments fall back to the "C" locale then and
emit a warning, which shall be suppressed.
2013-02-26 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Tweak logic.
(easy-mmode-set-keymap-parents): Use make-composed-keymap.
2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/bytecomp.el (byte-compile-file): Use let.
2013-02-25 Juri Linkov <juri@jurta.org>
* replace.el (read-regexp): Let-bind `default' to the first
@ -57,8 +73,8 @@
(tramp-default-method): Adapt check for
`tramp-ssh-controlmaster-options'.
* net/tramp-sh.el (tramp-methods): Replace
`tramp-ssh-controlmaster-template' by "%c".
* net/tramp-sh.el (tramp-methods):
Replace `tramp-ssh-controlmaster-template' by "%c".
(tramp-do-copy-or-rename-file-out-of-band)
(tramp-maybe-open-connection): Use it in format spec. Ensure,
that it is applied for the first hop only.
@ -80,8 +96,8 @@
* net/tramp.el (tramp-tramp-file-p): Fix docstring.
* net/tramp-sh.el (tramp-sh-handle-insert-directory): Handle
multibyte file names.
* net/tramp-sh.el (tramp-sh-handle-insert-directory):
Handle multibyte file names.
2013-02-22 Glenn Morris <rgm@gnu.org>
@ -104,8 +120,8 @@
2013-02-21 Fabián Ezequiel Gallina <fgallina@cuca>
* progmodes/python.el (python-info-current-defun): Enhance
match-data cluttering prevention.
* progmodes/python.el (python-info-current-defun):
Enhance match-data cluttering prevention.
2013-02-21 Glenn Morris <rgm@gnu.org>

View file

@ -1781,15 +1781,13 @@ The value is non-nil if there were no errors, nil if errors."
(when byte-compile-verbose
(message "Compiling %s..." filename))
(setq byte-compiler-error-flag nil)
(setq byte-compile-level (1+ byte-compile-level))
;; It is important that input-buffer not be current at this call,
;; so that the value of point set in input-buffer
;; within byte-compile-from-buffer lingers in that buffer.
(setq output-buffer
(save-current-buffer
(unwind-protect
(byte-compile-from-buffer input-buffer)
(setq byte-compile-level (1- byte-compile-level)))))
(let ((byte-compile-level (1+ byte-compile-level)))
(byte-compile-from-buffer input-buffer))))
(if byte-compiler-error-flag
nil
(when byte-compile-verbose

View file

@ -359,10 +359,8 @@ on if the hook has explicitly disabled it."
(MODE-check-buffers
(intern (concat global-mode-name "-check-buffers")))
(MODE-cmhh (intern (concat global-mode-name "-cmhh")))
(MODE-disable-in-buffer
(intern (concat global-mode-name "-disable-in-buffer")))
(minor-MODE-hook (intern (concat mode-name "-hook")))
(disable-MODE (intern (concat "disable-" mode-name)))
(MODE-set-explicitly (intern (concat mode-name "-set-explicitly")))
(MODE-major-mode (intern (concat (symbol-name mode) "-major-mode")))
keyw)
@ -409,8 +407,6 @@ See `%s' for more information on %s."
(add-hook 'find-file-hook ',MODE-check-buffers)
(add-hook 'change-major-mode-hook ',MODE-cmhh))
(remove-hook 'after-change-major-mode-hook ',MODE-enable-in-buffers)
(remove-hook 'change-major-mode-after-body-hook
',MODE-enable-in-buffers)
(remove-hook 'find-file-hook ',MODE-check-buffers)
(remove-hook 'change-major-mode-hook ',MODE-cmhh))
@ -425,7 +421,7 @@ See `%s' for more information on %s."
;; A function which checks whether MODE has been disabled in the major
;; mode hook which has just been run.
(add-hook ',minor-MODE-hook ',MODE-disable-in-buffer)
(add-hook ',minor-MODE-hook ',MODE-set-explicitly)
;; List of buffers left to process.
(defvar ,MODE-buffers nil)
@ -435,8 +431,7 @@ See `%s' for more information on %s."
(dolist (buf ,MODE-buffers)
(when (buffer-live-p buf)
(with-current-buffer buf
(if ,disable-MODE
(if ,mode (,mode -1))
(unless ,MODE-set-explicitly
(unless (eq ,MODE-major-mode major-mode)
(if ,mode
(progn
@ -457,30 +452,20 @@ See `%s' for more information on %s."
(add-to-list ',MODE-buffers (current-buffer))
(add-hook 'post-command-hook ',MODE-check-buffers))
(put ',MODE-cmhh 'definition-name ',global-mode)
;; disable-MODE is set in MODE-disable-in-buffer and cleared by
;; MODE-set-explicitly is set in MODE-set-explicitly and cleared by
;; kill-all-local-variables.
(defvar-local ,disable-MODE nil)
(defun ,MODE-disable-in-buffer ()
(unless ,mode
(setq ,disable-MODE t)))
(put ',MODE-disable-in-buffer 'definition-name ',global-mode))))
(defvar-local ,MODE-set-explicitly nil)
(defun ,MODE-set-explicitly ()
(setq ,MODE-set-explicitly t))
(put ',MODE-set-explicitly 'definition-name ',global-mode))))
;;;
;;; easy-mmode-defmap
;;;
(eval-and-compile
(if (fboundp 'set-keymap-parents)
(defalias 'easy-mmode-set-keymap-parents 'set-keymap-parents)
(defun easy-mmode-set-keymap-parents (m parents)
(set-keymap-parent
m
(cond
((not (consp parents)) parents)
((not (cdr parents)) (car parents))
(t (let ((m (copy-keymap (pop parents))))
(easy-mmode-set-keymap-parents m parents)
m)))))))
(defun easy-mmode-set-keymap-parents (m parents)
(set-keymap-parent
m (if (cdr parents) (make-composed-keymap parents) (car parents))))
;;;###autoload
(defun easy-mmode-define-keymap (bs &optional name m args)

View file

@ -2593,12 +2593,12 @@ This is like `dired-recursive-delete-directory' for Tramp files."
;; If `full-directory-p', we just say `ls -l FILENAME'.
;; Else we chdir to the parent directory, then say `ls -ld BASENAME'.
;; "--dired" returns byte positions. Therefore, the file names
;; must be encoded, which is guaranteed by "LC_ALL=en_US.UTF8
;; must be encoded, which is guaranteed by "LC_ALL=en_US.utf8
;; LC_CTYPE=''".
(if full-directory-p
(tramp-send-command
v
(format "env LC_ALL=en_US.UTF8 LC_CTYPE='' %s %s %s 2>/dev/null"
(format "env LC_ALL=en_US.utf8 LC_CTYPE='' %s %s %s 2>/dev/null"
(tramp-get-ls-command v)
switches
(if wildcard
@ -2614,7 +2614,7 @@ This is like `dired-recursive-delete-directory' for Tramp files."
(tramp-run-real-handler 'file-name-directory (list localname))))
(tramp-send-command
v
(format "env LC_ALL=en_US.UTF8 LC_CTYPE='' %s %s %s"
(format "env LC_ALL=en_US.utf8 LC_CTYPE='' %s %s %s 2>/dev/null"
(tramp-get-ls-command v)
switches
(if (or wildcard

View file

@ -1,3 +1,24 @@
2013-02-26 Bastien Guerry <bzg@gnu.org>
* window.c (Frecenter): Tiny docstring enhancement.
2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
Minor textprop integer cleanup.
* intervals.h, textprop.c (add_text_properties_from_list):
Return void, not int, since nobody uses the return value.
* textprop.c (validate_plist, add_properties, remove_properties)
(Fadd_text_properties):
Don't assume list length fits in int.
(interval_has_all_properties, interval_has_some_properties)
(interval_has_some_properties_list, add_properties, remove_properties)
(Fadd_text_properties, Fremove_text_properties)
(Fremove_list_of_text_properties, text_property_stickiness):
Use bool for booleans.
(Fadd_text_properties, Fremove_text_properties):
(Fremove_list_of_text_properties):
Reindent do-while as per GNU style.
2013-02-25 Eli Zaretskii <eliz@gnu.org>
Implement CLASH_DETECTION for MS-Windows.

View file

@ -293,7 +293,7 @@ extern void set_text_properties_1 (Lisp_Object, Lisp_Object,
Lisp_Object text_property_list (Lisp_Object, Lisp_Object, Lisp_Object,
Lisp_Object);
int add_text_properties_from_list (Lisp_Object, Lisp_Object, Lisp_Object);
void add_text_properties_from_list (Lisp_Object, Lisp_Object, Lisp_Object);
Lisp_Object extend_property_ranges (Lisp_Object, Lisp_Object);
Lisp_Object get_char_property_and_overlay (Lisp_Object, Lisp_Object,
Lisp_Object, Lisp_Object*);

View file

@ -198,14 +198,14 @@ validate_plist (Lisp_Object list)
if (CONSP (list))
{
register int i;
register Lisp_Object tail;
for (i = 0, tail = list; CONSP (tail); i++)
bool odd_length = 0;
Lisp_Object tail;
for (tail = list; CONSP (tail); tail = XCDR (tail))
{
tail = XCDR (tail);
odd_length ^= 1;
QUIT;
}
if (i & 1)
if (odd_length)
error ("Odd length text property list");
return list;
}
@ -213,20 +213,19 @@ validate_plist (Lisp_Object list)
return Fcons (list, Fcons (Qnil, Qnil));
}
/* Return nonzero if interval I has all the properties,
/* Return true if interval I has all the properties,
with the same values, of list PLIST. */
static int
static bool
interval_has_all_properties (Lisp_Object plist, INTERVAL i)
{
register Lisp_Object tail1, tail2, sym1;
register int found;
Lisp_Object tail1, tail2;
/* Go through each element of PLIST. */
for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
{
sym1 = XCAR (tail1);
found = 0;
Lisp_Object sym1 = XCAR (tail1);
bool found = 0;
/* Go through I's plist, looking for sym1 */
for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2)))
@ -249,13 +248,13 @@ interval_has_all_properties (Lisp_Object plist, INTERVAL i)
return 1;
}
/* Return nonzero if the plist of interval I has any of the
/* Return true if the plist of interval I has any of the
properties of PLIST, regardless of their values. */
static int
static bool
interval_has_some_properties (Lisp_Object plist, INTERVAL i)
{
register Lisp_Object tail1, tail2, sym;
Lisp_Object tail1, tail2, sym;
/* Go through each element of PLIST. */
for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
@ -274,10 +273,10 @@ interval_has_some_properties (Lisp_Object plist, INTERVAL i)
/* Return nonzero if the plist of interval I has any of the
property names in LIST, regardless of their values. */
static int
static bool
interval_has_some_properties_list (Lisp_Object list, INTERVAL i)
{
register Lisp_Object tail1, tail2, sym;
Lisp_Object tail1, tail2, sym;
/* Go through each element of LIST. */
for (tail1 = list; CONSP (tail1); tail1 = XCDR (tail1))
@ -358,15 +357,14 @@ set_properties (Lisp_Object properties, INTERVAL interval, Lisp_Object object)
OBJECT should be the string or buffer the interval is in.
Return nonzero if this changes I (i.e., if any members of PLIST
Return true if this changes I (i.e., if any members of PLIST
are actually added to I's plist) */
static int
static bool
add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object)
{
Lisp_Object tail1, tail2, sym1, val1;
register int changed = 0;
register int found;
bool changed = 0;
struct gcpro gcpro1, gcpro2, gcpro3;
tail1 = plist;
@ -380,9 +378,9 @@ add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object)
/* Go through each element of PLIST. */
for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
{
bool found = 0;
sym1 = XCAR (tail1);
val1 = Fcar (XCDR (tail1));
found = 0;
/* Go through I's plist, looking for sym1 */
for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2)))
@ -410,7 +408,7 @@ add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object)
/* I's property has a different value -- change it */
Fsetcar (this_cdr, val1);
changed++;
changed = 1;
break;
}
@ -423,7 +421,7 @@ add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object)
sym1, Qnil, object);
}
set_interval_plist (i, Fcons (sym1, Fcons (val1, i->plist)));
changed++;
changed = 1;
}
}
@ -437,14 +435,14 @@ add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object)
(If PLIST is non-nil, use that, otherwise use LIST.)
OBJECT is the string or buffer containing I. */
static int
static bool
remove_properties (Lisp_Object plist, Lisp_Object list, INTERVAL i, Lisp_Object object)
{
register Lisp_Object tail1, tail2, sym, current_plist;
register int changed = 0;
Lisp_Object tail1, tail2, sym, current_plist;
bool changed = 0;
/* Nonzero means tail1 is a plist, otherwise it is a list. */
int use_plist;
/* True means tail1 is a plist, otherwise it is a list. */
bool use_plist;
current_plist = i->plist;
@ -467,7 +465,7 @@ remove_properties (Lisp_Object plist, Lisp_Object list, INTERVAL i, Lisp_Object
object);
current_plist = XCDR (XCDR (current_plist));
changed++;
changed = 1;
}
/* Go through I's plist, looking for SYM. */
@ -483,7 +481,7 @@ remove_properties (Lisp_Object plist, Lisp_Object list, INTERVAL i, Lisp_Object
sym, XCAR (XCDR (this)), object);
Fsetcdr (XCDR (tail2), XCDR (XCDR (this)));
changed++;
changed = 1;
}
tail2 = this;
}
@ -1129,11 +1127,10 @@ If OBJECT is a string, START and END are 0-based indices into it.
Return t if any property value actually changed, nil otherwise. */)
(Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object)
{
register INTERVAL i, unchanged;
register ptrdiff_t s, len;
register int modified = 0;
INTERVAL i, unchanged;
ptrdiff_t s, len;
bool modified = 0;
struct gcpro gcpro1;
ptrdiff_t got;
properties = validate_plist (properties);
if (NILP (properties))
@ -1156,14 +1153,17 @@ Return t if any property value actually changed, nil otherwise. */)
/* If this interval already has the properties, we can skip it. */
if (interval_has_all_properties (properties, i))
{
got = LENGTH (i) - (s - i->position);
do {
if (got >= len)
RETURN_UNGCPRO (Qnil);
len -= got;
i = next_interval (i);
got = LENGTH (i);
} while (interval_has_all_properties (properties, i));
ptrdiff_t got = LENGTH (i) - (s - i->position);
do
{
if (got >= len)
RETURN_UNGCPRO (Qnil);
len -= got;
i = next_interval (i);
got = LENGTH (i);
}
while (interval_has_all_properties (properties, i));
}
else if (i->position != s)
{
@ -1220,7 +1220,7 @@ Return t if any property value actually changed, nil otherwise. */)
}
len -= LENGTH (i);
modified += add_properties (properties, i, object);
modified |= add_properties (properties, i, object);
i = next_interval (i);
}
}
@ -1424,10 +1424,9 @@ Return t if any property was actually removed, nil otherwise.
Use `set-text-properties' if you want to remove all text properties. */)
(Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object)
{
register INTERVAL i, unchanged;
register ptrdiff_t s, len;
register int modified = 0;
ptrdiff_t got;
INTERVAL i, unchanged;
ptrdiff_t s, len;
bool modified = 0;
if (NILP (object))
XSETBUFFER (object, current_buffer);
@ -1442,14 +1441,17 @@ Use `set-text-properties' if you want to remove all text properties. */)
/* If there are no properties on this entire interval, return. */
if (! interval_has_some_properties (properties, i))
{
got = (LENGTH (i) - (s - i->position));
do {
if (got >= len)
return Qnil;
len -= got;
i = next_interval (i);
got = LENGTH (i);
} while (! interval_has_some_properties (properties, i));
ptrdiff_t got = LENGTH (i) - (s - i->position);
do
{
if (got >= len)
return Qnil;
len -= got;
i = next_interval (i);
got = LENGTH (i);
}
while (! interval_has_some_properties (properties, i));
}
/* Split away the beginning of this interval; what we don't
want to modify. */
@ -1500,7 +1502,7 @@ Use `set-text-properties' if you want to remove all text properties. */)
}
len -= LENGTH (i);
modified += remove_properties (properties, Qnil, i, object);
modified |= remove_properties (properties, Qnil, i, object);
i = next_interval (i);
}
}
@ -1515,11 +1517,10 @@ markers). If OBJECT is a string, START and END are 0-based indices into it.
Return t if any property was actually removed, nil otherwise. */)
(Lisp_Object start, Lisp_Object end, Lisp_Object list_of_properties, Lisp_Object object)
{
register INTERVAL i, unchanged;
register ptrdiff_t s, len;
register int modified = 0;
INTERVAL i, unchanged;
ptrdiff_t s, len;
bool modified = 0;
Lisp_Object properties;
ptrdiff_t got;
properties = list_of_properties;
if (NILP (object))
@ -1535,14 +1536,17 @@ Return t if any property was actually removed, nil otherwise. */)
/* If there are no properties on the interval, return. */
if (! interval_has_some_properties_list (properties, i))
{
got = (LENGTH (i) - (s - i->position));
do {
if (got >= len)
return Qnil;
len -= got;
i = next_interval (i);
got = LENGTH (i);
} while (! interval_has_some_properties_list (properties, i));
ptrdiff_t got = LENGTH (i) - (s - i->position);
do
{
if (got >= len)
return Qnil;
len -= got;
i = next_interval (i);
got = LENGTH (i);
}
while (! interval_has_some_properties_list (properties, i));
}
/* Split away the beginning of this interval; what we don't
want to modify. */
@ -1697,7 +1701,7 @@ int
text_property_stickiness (Lisp_Object prop, Lisp_Object pos, Lisp_Object buffer)
{
Lisp_Object prev_pos, front_sticky;
int is_rear_sticky = 1, is_front_sticky = 0; /* defaults */
bool is_rear_sticky = 1, is_front_sticky = 0; /* defaults */
Lisp_Object defalt = Fassq (prop, Vtext_property_default_nonsticky);
if (NILP (buffer))
@ -1772,7 +1776,7 @@ copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_
Lisp_Object stuff;
Lisp_Object plist;
ptrdiff_t s, e, e2, p, len;
int modified = 0;
bool modified = 0;
struct gcpro gcpro1, gcpro2;
i = validate_interval_range (src, &start, &end, soft);
@ -1843,7 +1847,7 @@ copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_
res = Fadd_text_properties (Fcar (res), Fcar (Fcdr (res)),
Fcar (Fcdr (Fcdr (res))), dest);
if (! NILP (res))
modified++;
modified = 1;
stuff = Fcdr (stuff);
}
@ -1914,33 +1918,28 @@ text_property_list (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp
/* Add text properties to OBJECT from LIST. LIST is a list of triples
(START END PLIST), where START and END are positions and PLIST is a
property list containing the text properties to add. Adjust START
and END positions by DELTA before adding properties. Value is
non-zero if OBJECT was modified. */
and END positions by DELTA before adding properties. */
int
void
add_text_properties_from_list (Lisp_Object object, Lisp_Object list, Lisp_Object delta)
{
struct gcpro gcpro1, gcpro2;
int modified_p = 0;
GCPRO2 (list, object);
for (; CONSP (list); list = XCDR (list))
{
Lisp_Object item, start, end, plist, tem;
Lisp_Object item, start, end, plist;
item = XCAR (list);
start = make_number (XINT (XCAR (item)) + XINT (delta));
end = make_number (XINT (XCAR (XCDR (item))) + XINT (delta));
plist = XCAR (XCDR (XCDR (item)));
tem = Fadd_text_properties (start, end, plist, object);
if (!NILP (tem))
modified_p = 1;
Fadd_text_properties (start, end, plist, object);
}
UNGCPRO;
return modified_p;
}

View file

@ -5177,7 +5177,7 @@ displayed_window_lines (struct window *w)
DEFUN ("recenter", Frecenter, Srecenter, 0, 1, "P",
doc: /* Center point in selected window and maybe redisplay frame.
With prefix argument ARG, recenter putting point on screen line ARG
With a numeric prefix argument ARG, recenter putting point on screen line ARG
relative to the selected window. If ARG is negative, it counts up from the
bottom of the window. (ARG should be less than the height of the window.)