aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2013-02-27 00:03:49 +0100
committerJoakim Verona2013-02-27 00:03:49 +0100
commit96fd57d9873b5c150e2632e5a1f60a78fac65aa8 (patch)
tree48261677f3fd1ca8b442918ba7237c4991d944fc
parent6f75e5103f0b1d6395fb5b0fea2a4a9c9f4601f7 (diff)
parent3b166f0908a04456bd91a42274a42d401b79c24d (diff)
downloademacs-96fd57d9873b5c150e2632e5a1f60a78fac65aa8.tar.gz
emacs-96fd57d9873b5c150e2632e5a1f60a78fac65aa8.zip
auto upstream
-rw-r--r--lisp/ChangeLog28
-rw-r--r--lisp/emacs-lisp/bytecomp.el6
-rw-r--r--lisp/emacs-lisp/easy-mmode.el37
-rw-r--r--lisp/net/tramp-sh.el6
-rw-r--r--src/ChangeLog21
-rw-r--r--src/intervals.h2
-rw-r--r--src/textprop.c159
-rw-r--r--src/window.c2
8 files changed, 140 insertions, 121 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d6de9baa118..c5a902d6442 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,19 @@
12013-02-26 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp-sh.el (tramp-sh-handle-insert-directory): Add
4 "2>/dev/null" to the ls command, in case "en_US.utf8" is not
5 defined. POSIX environments fall back to the "C" locale then and
6 emit a warning, which shall be suppressed.
7
82013-02-26 Stefan Monnier <monnier@iro.umontreal.ca>
9
10 * emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Tweak logic.
11 (easy-mmode-set-keymap-parents): Use make-composed-keymap.
12
132013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
14
15 * emacs-lisp/bytecomp.el (byte-compile-file): Use let.
16
12013-02-25 Juri Linkov <juri@jurta.org> 172013-02-25 Juri Linkov <juri@jurta.org>
2 18
3 * replace.el (read-regexp): Let-bind `default' to the first 19 * replace.el (read-regexp): Let-bind `default' to the first
@@ -57,8 +73,8 @@
57 (tramp-default-method): Adapt check for 73 (tramp-default-method): Adapt check for
58 `tramp-ssh-controlmaster-options'. 74 `tramp-ssh-controlmaster-options'.
59 75
60 * net/tramp-sh.el (tramp-methods): Replace 76 * net/tramp-sh.el (tramp-methods):
61 `tramp-ssh-controlmaster-template' by "%c". 77 Replace `tramp-ssh-controlmaster-template' by "%c".
62 (tramp-do-copy-or-rename-file-out-of-band) 78 (tramp-do-copy-or-rename-file-out-of-band)
63 (tramp-maybe-open-connection): Use it in format spec. Ensure, 79 (tramp-maybe-open-connection): Use it in format spec. Ensure,
64 that it is applied for the first hop only. 80 that it is applied for the first hop only.
@@ -80,8 +96,8 @@
80 96
81 * net/tramp.el (tramp-tramp-file-p): Fix docstring. 97 * net/tramp.el (tramp-tramp-file-p): Fix docstring.
82 98
83 * net/tramp-sh.el (tramp-sh-handle-insert-directory): Handle 99 * net/tramp-sh.el (tramp-sh-handle-insert-directory):
84 multibyte file names. 100 Handle multibyte file names.
85 101
862013-02-22 Glenn Morris <rgm@gnu.org> 1022013-02-22 Glenn Morris <rgm@gnu.org>
87 103
@@ -104,8 +120,8 @@
104 120
1052013-02-21 Fabián Ezequiel Gallina <fgallina@cuca> 1212013-02-21 Fabián Ezequiel Gallina <fgallina@cuca>
106 122
107 * progmodes/python.el (python-info-current-defun): Enhance 123 * progmodes/python.el (python-info-current-defun):
108 match-data cluttering prevention. 124 Enhance match-data cluttering prevention.
109 125
1102013-02-21 Glenn Morris <rgm@gnu.org> 1262013-02-21 Glenn Morris <rgm@gnu.org>
111 127
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index e0837033c74..5db1793a407 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1781,15 +1781,13 @@ The value is non-nil if there were no errors, nil if errors."
1781 (when byte-compile-verbose 1781 (when byte-compile-verbose
1782 (message "Compiling %s..." filename)) 1782 (message "Compiling %s..." filename))
1783 (setq byte-compiler-error-flag nil) 1783 (setq byte-compiler-error-flag nil)
1784 (setq byte-compile-level (1+ byte-compile-level))
1785 ;; It is important that input-buffer not be current at this call, 1784 ;; It is important that input-buffer not be current at this call,
1786 ;; so that the value of point set in input-buffer 1785 ;; so that the value of point set in input-buffer
1787 ;; within byte-compile-from-buffer lingers in that buffer. 1786 ;; within byte-compile-from-buffer lingers in that buffer.
1788 (setq output-buffer 1787 (setq output-buffer
1789 (save-current-buffer 1788 (save-current-buffer
1790 (unwind-protect 1789 (let ((byte-compile-level (1+ byte-compile-level)))
1791 (byte-compile-from-buffer input-buffer) 1790 (byte-compile-from-buffer input-buffer))))
1792 (setq byte-compile-level (1- byte-compile-level)))))
1793 (if byte-compiler-error-flag 1791 (if byte-compiler-error-flag
1794 nil 1792 nil
1795 (when byte-compile-verbose 1793 (when byte-compile-verbose
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 2088e690228..abe7b1ea741 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -359,10 +359,8 @@ on if the hook has explicitly disabled it."
359 (MODE-check-buffers 359 (MODE-check-buffers
360 (intern (concat global-mode-name "-check-buffers"))) 360 (intern (concat global-mode-name "-check-buffers")))
361 (MODE-cmhh (intern (concat global-mode-name "-cmhh"))) 361 (MODE-cmhh (intern (concat global-mode-name "-cmhh")))
362 (MODE-disable-in-buffer
363 (intern (concat global-mode-name "-disable-in-buffer")))
364 (minor-MODE-hook (intern (concat mode-name "-hook"))) 362 (minor-MODE-hook (intern (concat mode-name "-hook")))
365 (disable-MODE (intern (concat "disable-" mode-name))) 363 (MODE-set-explicitly (intern (concat mode-name "-set-explicitly")))
366 (MODE-major-mode (intern (concat (symbol-name mode) "-major-mode"))) 364 (MODE-major-mode (intern (concat (symbol-name mode) "-major-mode")))
367 keyw) 365 keyw)
368 366
@@ -409,8 +407,6 @@ See `%s' for more information on %s."
409 (add-hook 'find-file-hook ',MODE-check-buffers) 407 (add-hook 'find-file-hook ',MODE-check-buffers)
410 (add-hook 'change-major-mode-hook ',MODE-cmhh)) 408 (add-hook 'change-major-mode-hook ',MODE-cmhh))
411 (remove-hook 'after-change-major-mode-hook ',MODE-enable-in-buffers) 409 (remove-hook 'after-change-major-mode-hook ',MODE-enable-in-buffers)
412 (remove-hook 'change-major-mode-after-body-hook
413 ',MODE-enable-in-buffers)
414 (remove-hook 'find-file-hook ',MODE-check-buffers) 410 (remove-hook 'find-file-hook ',MODE-check-buffers)
415 (remove-hook 'change-major-mode-hook ',MODE-cmhh)) 411 (remove-hook 'change-major-mode-hook ',MODE-cmhh))
416 412
@@ -425,7 +421,7 @@ See `%s' for more information on %s."
425 421
426 ;; A function which checks whether MODE has been disabled in the major 422 ;; A function which checks whether MODE has been disabled in the major
427 ;; mode hook which has just been run. 423 ;; mode hook which has just been run.
428 (add-hook ',minor-MODE-hook ',MODE-disable-in-buffer) 424 (add-hook ',minor-MODE-hook ',MODE-set-explicitly)
429 425
430 ;; List of buffers left to process. 426 ;; List of buffers left to process.
431 (defvar ,MODE-buffers nil) 427 (defvar ,MODE-buffers nil)
@@ -435,8 +431,7 @@ See `%s' for more information on %s."
435 (dolist (buf ,MODE-buffers) 431 (dolist (buf ,MODE-buffers)
436 (when (buffer-live-p buf) 432 (when (buffer-live-p buf)
437 (with-current-buffer buf 433 (with-current-buffer buf
438 (if ,disable-MODE 434 (unless ,MODE-set-explicitly
439 (if ,mode (,mode -1))
440 (unless (eq ,MODE-major-mode major-mode) 435 (unless (eq ,MODE-major-mode major-mode)
441 (if ,mode 436 (if ,mode
442 (progn 437 (progn
@@ -457,30 +452,20 @@ See `%s' for more information on %s."
457 (add-to-list ',MODE-buffers (current-buffer)) 452 (add-to-list ',MODE-buffers (current-buffer))
458 (add-hook 'post-command-hook ',MODE-check-buffers)) 453 (add-hook 'post-command-hook ',MODE-check-buffers))
459 (put ',MODE-cmhh 'definition-name ',global-mode) 454 (put ',MODE-cmhh 'definition-name ',global-mode)
460 ;; disable-MODE is set in MODE-disable-in-buffer and cleared by 455 ;; MODE-set-explicitly is set in MODE-set-explicitly and cleared by
461 ;; kill-all-local-variables. 456 ;; kill-all-local-variables.
462 (defvar-local ,disable-MODE nil) 457 (defvar-local ,MODE-set-explicitly nil)
463 (defun ,MODE-disable-in-buffer () 458 (defun ,MODE-set-explicitly ()
464 (unless ,mode 459 (setq ,MODE-set-explicitly t))
465 (setq ,disable-MODE t))) 460 (put ',MODE-set-explicitly 'definition-name ',global-mode))))
466 (put ',MODE-disable-in-buffer 'definition-name ',global-mode))))
467 461
468;;; 462;;;
469;;; easy-mmode-defmap 463;;; easy-mmode-defmap
470;;; 464;;;
471 465
472(eval-and-compile 466(defun easy-mmode-set-keymap-parents (m parents)
473 (if (fboundp 'set-keymap-parents) 467 (set-keymap-parent
474 (defalias 'easy-mmode-set-keymap-parents 'set-keymap-parents) 468 m (if (cdr parents) (make-composed-keymap parents) (car parents))))
475 (defun easy-mmode-set-keymap-parents (m parents)
476 (set-keymap-parent
477 m
478 (cond
479 ((not (consp parents)) parents)
480 ((not (cdr parents)) (car parents))
481 (t (let ((m (copy-keymap (pop parents))))
482 (easy-mmode-set-keymap-parents m parents)
483 m)))))))
484 469
485;;;###autoload 470;;;###autoload
486(defun easy-mmode-define-keymap (bs &optional name m args) 471(defun easy-mmode-define-keymap (bs &optional name m args)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index e63acb6b40e..e2aaafb38dd 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2593,12 +2593,12 @@ This is like `dired-recursive-delete-directory' for Tramp files."
2593 ;; If `full-directory-p', we just say `ls -l FILENAME'. 2593 ;; If `full-directory-p', we just say `ls -l FILENAME'.
2594 ;; Else we chdir to the parent directory, then say `ls -ld BASENAME'. 2594 ;; Else we chdir to the parent directory, then say `ls -ld BASENAME'.
2595 ;; "--dired" returns byte positions. Therefore, the file names 2595 ;; "--dired" returns byte positions. Therefore, the file names
2596 ;; must be encoded, which is guaranteed by "LC_ALL=en_US.UTF8 2596 ;; must be encoded, which is guaranteed by "LC_ALL=en_US.utf8
2597 ;; LC_CTYPE=''". 2597 ;; LC_CTYPE=''".
2598 (if full-directory-p 2598 (if full-directory-p
2599 (tramp-send-command 2599 (tramp-send-command
2600 v 2600 v
2601 (format "env LC_ALL=en_US.UTF8 LC_CTYPE='' %s %s %s 2>/dev/null" 2601 (format "env LC_ALL=en_US.utf8 LC_CTYPE='' %s %s %s 2>/dev/null"
2602 (tramp-get-ls-command v) 2602 (tramp-get-ls-command v)
2603 switches 2603 switches
2604 (if wildcard 2604 (if wildcard
@@ -2614,7 +2614,7 @@ This is like `dired-recursive-delete-directory' for Tramp files."
2614 (tramp-run-real-handler 'file-name-directory (list localname)))) 2614 (tramp-run-real-handler 'file-name-directory (list localname))))
2615 (tramp-send-command 2615 (tramp-send-command
2616 v 2616 v
2617 (format "env LC_ALL=en_US.UTF8 LC_CTYPE='' %s %s %s" 2617 (format "env LC_ALL=en_US.utf8 LC_CTYPE='' %s %s %s 2>/dev/null"
2618 (tramp-get-ls-command v) 2618 (tramp-get-ls-command v)
2619 switches 2619 switches
2620 (if (or wildcard 2620 (if (or wildcard
diff --git a/src/ChangeLog b/src/ChangeLog
index 135d4d48b41..5e3112a26af 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,24 @@
12013-02-26 Bastien Guerry <bzg@gnu.org>
2
3 * window.c (Frecenter): Tiny docstring enhancement.
4
52013-02-26 Paul Eggert <eggert@cs.ucla.edu>
6
7 Minor textprop integer cleanup.
8 * intervals.h, textprop.c (add_text_properties_from_list):
9 Return void, not int, since nobody uses the return value.
10 * textprop.c (validate_plist, add_properties, remove_properties)
11 (Fadd_text_properties):
12 Don't assume list length fits in int.
13 (interval_has_all_properties, interval_has_some_properties)
14 (interval_has_some_properties_list, add_properties, remove_properties)
15 (Fadd_text_properties, Fremove_text_properties)
16 (Fremove_list_of_text_properties, text_property_stickiness):
17 Use bool for booleans.
18 (Fadd_text_properties, Fremove_text_properties):
19 (Fremove_list_of_text_properties):
20 Reindent do-while as per GNU style.
21
12013-02-25 Eli Zaretskii <eliz@gnu.org> 222013-02-25 Eli Zaretskii <eliz@gnu.org>
2 23
3 Implement CLASH_DETECTION for MS-Windows. 24 Implement CLASH_DETECTION for MS-Windows.
diff --git a/src/intervals.h b/src/intervals.h
index cded8c0abb2..d6191225b1f 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -293,7 +293,7 @@ extern void set_text_properties_1 (Lisp_Object, Lisp_Object,
293 293
294Lisp_Object text_property_list (Lisp_Object, Lisp_Object, Lisp_Object, 294Lisp_Object text_property_list (Lisp_Object, Lisp_Object, Lisp_Object,
295 Lisp_Object); 295 Lisp_Object);
296int add_text_properties_from_list (Lisp_Object, Lisp_Object, Lisp_Object); 296void add_text_properties_from_list (Lisp_Object, Lisp_Object, Lisp_Object);
297Lisp_Object extend_property_ranges (Lisp_Object, Lisp_Object); 297Lisp_Object extend_property_ranges (Lisp_Object, Lisp_Object);
298Lisp_Object get_char_property_and_overlay (Lisp_Object, Lisp_Object, 298Lisp_Object get_char_property_and_overlay (Lisp_Object, Lisp_Object,
299 Lisp_Object, Lisp_Object*); 299 Lisp_Object, Lisp_Object*);
diff --git a/src/textprop.c b/src/textprop.c
index 49fe427913c..9499b53301f 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -198,14 +198,14 @@ validate_plist (Lisp_Object list)
198 198
199 if (CONSP (list)) 199 if (CONSP (list))
200 { 200 {
201 register int i; 201 bool odd_length = 0;
202 register Lisp_Object tail; 202 Lisp_Object tail;
203 for (i = 0, tail = list; CONSP (tail); i++) 203 for (tail = list; CONSP (tail); tail = XCDR (tail))
204 { 204 {
205 tail = XCDR (tail); 205 odd_length ^= 1;
206 QUIT; 206 QUIT;
207 } 207 }
208 if (i & 1) 208 if (odd_length)
209 error ("Odd length text property list"); 209 error ("Odd length text property list");
210 return list; 210 return list;
211 } 211 }
@@ -213,20 +213,19 @@ validate_plist (Lisp_Object list)
213 return Fcons (list, Fcons (Qnil, Qnil)); 213 return Fcons (list, Fcons (Qnil, Qnil));
214} 214}
215 215
216/* Return nonzero if interval I has all the properties, 216/* Return true if interval I has all the properties,
217 with the same values, of list PLIST. */ 217 with the same values, of list PLIST. */
218 218
219static int 219static bool
220interval_has_all_properties (Lisp_Object plist, INTERVAL i) 220interval_has_all_properties (Lisp_Object plist, INTERVAL i)
221{ 221{
222 register Lisp_Object tail1, tail2, sym1; 222 Lisp_Object tail1, tail2;
223 register int found;
224 223
225 /* Go through each element of PLIST. */ 224 /* Go through each element of PLIST. */
226 for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1))) 225 for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
227 { 226 {
228 sym1 = XCAR (tail1); 227 Lisp_Object sym1 = XCAR (tail1);
229 found = 0; 228 bool found = 0;
230 229
231 /* Go through I's plist, looking for sym1 */ 230 /* Go through I's plist, looking for sym1 */
232 for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2))) 231 for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2)))
@@ -249,13 +248,13 @@ interval_has_all_properties (Lisp_Object plist, INTERVAL i)
249 return 1; 248 return 1;
250} 249}
251 250
252/* Return nonzero if the plist of interval I has any of the 251/* Return true if the plist of interval I has any of the
253 properties of PLIST, regardless of their values. */ 252 properties of PLIST, regardless of their values. */
254 253
255static int 254static bool
256interval_has_some_properties (Lisp_Object plist, INTERVAL i) 255interval_has_some_properties (Lisp_Object plist, INTERVAL i)
257{ 256{
258 register Lisp_Object tail1, tail2, sym; 257 Lisp_Object tail1, tail2, sym;
259 258
260 /* Go through each element of PLIST. */ 259 /* Go through each element of PLIST. */
261 for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1))) 260 for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
@@ -274,10 +273,10 @@ interval_has_some_properties (Lisp_Object plist, INTERVAL i)
274/* Return nonzero if the plist of interval I has any of the 273/* Return nonzero if the plist of interval I has any of the
275 property names in LIST, regardless of their values. */ 274 property names in LIST, regardless of their values. */
276 275
277static int 276static bool
278interval_has_some_properties_list (Lisp_Object list, INTERVAL i) 277interval_has_some_properties_list (Lisp_Object list, INTERVAL i)
279{ 278{
280 register Lisp_Object tail1, tail2, sym; 279 Lisp_Object tail1, tail2, sym;
281 280
282 /* Go through each element of LIST. */ 281 /* Go through each element of LIST. */
283 for (tail1 = list; CONSP (tail1); tail1 = XCDR (tail1)) 282 for (tail1 = list; CONSP (tail1); tail1 = XCDR (tail1))
@@ -358,15 +357,14 @@ set_properties (Lisp_Object properties, INTERVAL interval, Lisp_Object object)
358 357
359 OBJECT should be the string or buffer the interval is in. 358 OBJECT should be the string or buffer the interval is in.
360 359
361 Return nonzero if this changes I (i.e., if any members of PLIST 360 Return true if this changes I (i.e., if any members of PLIST
362 are actually added to I's plist) */ 361 are actually added to I's plist) */
363 362
364static int 363static bool
365add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object) 364add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object)
366{ 365{
367 Lisp_Object tail1, tail2, sym1, val1; 366 Lisp_Object tail1, tail2, sym1, val1;
368 register int changed = 0; 367 bool changed = 0;
369 register int found;
370 struct gcpro gcpro1, gcpro2, gcpro3; 368 struct gcpro gcpro1, gcpro2, gcpro3;
371 369
372 tail1 = plist; 370 tail1 = plist;
@@ -380,9 +378,9 @@ add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object)
380 /* Go through each element of PLIST. */ 378 /* Go through each element of PLIST. */
381 for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1))) 379 for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
382 { 380 {
381 bool found = 0;
383 sym1 = XCAR (tail1); 382 sym1 = XCAR (tail1);
384 val1 = Fcar (XCDR (tail1)); 383 val1 = Fcar (XCDR (tail1));
385 found = 0;
386 384
387 /* Go through I's plist, looking for sym1 */ 385 /* Go through I's plist, looking for sym1 */
388 for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2))) 386 for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2)))
@@ -410,7 +408,7 @@ add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object)
410 408
411 /* I's property has a different value -- change it */ 409 /* I's property has a different value -- change it */
412 Fsetcar (this_cdr, val1); 410 Fsetcar (this_cdr, val1);
413 changed++; 411 changed = 1;
414 break; 412 break;
415 } 413 }
416 414
@@ -423,7 +421,7 @@ add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object)
423 sym1, Qnil, object); 421 sym1, Qnil, object);
424 } 422 }
425 set_interval_plist (i, Fcons (sym1, Fcons (val1, i->plist))); 423 set_interval_plist (i, Fcons (sym1, Fcons (val1, i->plist)));
426 changed++; 424 changed = 1;
427 } 425 }
428 } 426 }
429 427
@@ -437,14 +435,14 @@ add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object)
437 (If PLIST is non-nil, use that, otherwise use LIST.) 435 (If PLIST is non-nil, use that, otherwise use LIST.)
438 OBJECT is the string or buffer containing I. */ 436 OBJECT is the string or buffer containing I. */
439 437
440static int 438static bool
441remove_properties (Lisp_Object plist, Lisp_Object list, INTERVAL i, Lisp_Object object) 439remove_properties (Lisp_Object plist, Lisp_Object list, INTERVAL i, Lisp_Object object)
442{ 440{
443 register Lisp_Object tail1, tail2, sym, current_plist; 441 Lisp_Object tail1, tail2, sym, current_plist;
444 register int changed = 0; 442 bool changed = 0;
445 443
446 /* Nonzero means tail1 is a plist, otherwise it is a list. */ 444 /* True means tail1 is a plist, otherwise it is a list. */
447 int use_plist; 445 bool use_plist;
448 446
449 current_plist = i->plist; 447 current_plist = i->plist;
450 448
@@ -467,7 +465,7 @@ remove_properties (Lisp_Object plist, Lisp_Object list, INTERVAL i, Lisp_Object
467 object); 465 object);
468 466
469 current_plist = XCDR (XCDR (current_plist)); 467 current_plist = XCDR (XCDR (current_plist));
470 changed++; 468 changed = 1;
471 } 469 }
472 470
473 /* Go through I's plist, looking for SYM. */ 471 /* Go through I's plist, looking for SYM. */
@@ -483,7 +481,7 @@ remove_properties (Lisp_Object plist, Lisp_Object list, INTERVAL i, Lisp_Object
483 sym, XCAR (XCDR (this)), object); 481 sym, XCAR (XCDR (this)), object);
484 482
485 Fsetcdr (XCDR (tail2), XCDR (XCDR (this))); 483 Fsetcdr (XCDR (tail2), XCDR (XCDR (this)));
486 changed++; 484 changed = 1;
487 } 485 }
488 tail2 = this; 486 tail2 = this;
489 } 487 }
@@ -1129,11 +1127,10 @@ If OBJECT is a string, START and END are 0-based indices into it.
1129Return t if any property value actually changed, nil otherwise. */) 1127Return t if any property value actually changed, nil otherwise. */)
1130 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object) 1128 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object)
1131{ 1129{
1132 register INTERVAL i, unchanged; 1130 INTERVAL i, unchanged;
1133 register ptrdiff_t s, len; 1131 ptrdiff_t s, len;
1134 register int modified = 0; 1132 bool modified = 0;
1135 struct gcpro gcpro1; 1133 struct gcpro gcpro1;
1136 ptrdiff_t got;
1137 1134
1138 properties = validate_plist (properties); 1135 properties = validate_plist (properties);
1139 if (NILP (properties)) 1136 if (NILP (properties))
@@ -1156,14 +1153,17 @@ Return t if any property value actually changed, nil otherwise. */)
1156 /* If this interval already has the properties, we can skip it. */ 1153 /* If this interval already has the properties, we can skip it. */
1157 if (interval_has_all_properties (properties, i)) 1154 if (interval_has_all_properties (properties, i))
1158 { 1155 {
1159 got = LENGTH (i) - (s - i->position); 1156 ptrdiff_t got = LENGTH (i) - (s - i->position);
1160 do { 1157
1161 if (got >= len) 1158 do
1162 RETURN_UNGCPRO (Qnil); 1159 {
1163 len -= got; 1160 if (got >= len)
1164 i = next_interval (i); 1161 RETURN_UNGCPRO (Qnil);
1165 got = LENGTH (i); 1162 len -= got;
1166 } while (interval_has_all_properties (properties, i)); 1163 i = next_interval (i);
1164 got = LENGTH (i);
1165 }
1166 while (interval_has_all_properties (properties, i));
1167 } 1167 }
1168 else if (i->position != s) 1168 else if (i->position != s)
1169 { 1169 {
@@ -1220,7 +1220,7 @@ Return t if any property value actually changed, nil otherwise. */)
1220 } 1220 }
1221 1221
1222 len -= LENGTH (i); 1222 len -= LENGTH (i);
1223 modified += add_properties (properties, i, object); 1223 modified |= add_properties (properties, i, object);
1224 i = next_interval (i); 1224 i = next_interval (i);
1225 } 1225 }
1226} 1226}
@@ -1424,10 +1424,9 @@ Return t if any property was actually removed, nil otherwise.
1424Use `set-text-properties' if you want to remove all text properties. */) 1424Use `set-text-properties' if you want to remove all text properties. */)
1425 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object) 1425 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object)
1426{ 1426{
1427 register INTERVAL i, unchanged; 1427 INTERVAL i, unchanged;
1428 register ptrdiff_t s, len; 1428 ptrdiff_t s, len;
1429 register int modified = 0; 1429 bool modified = 0;
1430 ptrdiff_t got;
1431 1430
1432 if (NILP (object)) 1431 if (NILP (object))
1433 XSETBUFFER (object, current_buffer); 1432 XSETBUFFER (object, current_buffer);
@@ -1442,14 +1441,17 @@ Use `set-text-properties' if you want to remove all text properties. */)
1442 /* If there are no properties on this entire interval, return. */ 1441 /* If there are no properties on this entire interval, return. */
1443 if (! interval_has_some_properties (properties, i)) 1442 if (! interval_has_some_properties (properties, i))
1444 { 1443 {
1445 got = (LENGTH (i) - (s - i->position)); 1444 ptrdiff_t got = LENGTH (i) - (s - i->position);
1446 do { 1445
1447 if (got >= len) 1446 do
1448 return Qnil; 1447 {
1449 len -= got; 1448 if (got >= len)
1450 i = next_interval (i); 1449 return Qnil;
1451 got = LENGTH (i); 1450 len -= got;
1452 } while (! interval_has_some_properties (properties, i)); 1451 i = next_interval (i);
1452 got = LENGTH (i);
1453 }
1454 while (! interval_has_some_properties (properties, i));
1453 } 1455 }
1454 /* Split away the beginning of this interval; what we don't 1456 /* Split away the beginning of this interval; what we don't
1455 want to modify. */ 1457 want to modify. */
@@ -1500,7 +1502,7 @@ Use `set-text-properties' if you want to remove all text properties. */)
1500 } 1502 }
1501 1503
1502 len -= LENGTH (i); 1504 len -= LENGTH (i);
1503 modified += remove_properties (properties, Qnil, i, object); 1505 modified |= remove_properties (properties, Qnil, i, object);
1504 i = next_interval (i); 1506 i = next_interval (i);
1505 } 1507 }
1506} 1508}
@@ -1515,11 +1517,10 @@ markers). If OBJECT is a string, START and END are 0-based indices into it.
1515Return t if any property was actually removed, nil otherwise. */) 1517Return t if any property was actually removed, nil otherwise. */)
1516 (Lisp_Object start, Lisp_Object end, Lisp_Object list_of_properties, Lisp_Object object) 1518 (Lisp_Object start, Lisp_Object end, Lisp_Object list_of_properties, Lisp_Object object)
1517{ 1519{
1518 register INTERVAL i, unchanged; 1520 INTERVAL i, unchanged;
1519 register ptrdiff_t s, len; 1521 ptrdiff_t s, len;
1520 register int modified = 0; 1522 bool modified = 0;
1521 Lisp_Object properties; 1523 Lisp_Object properties;
1522 ptrdiff_t got;
1523 properties = list_of_properties; 1524 properties = list_of_properties;
1524 1525
1525 if (NILP (object)) 1526 if (NILP (object))
@@ -1535,14 +1536,17 @@ Return t if any property was actually removed, nil otherwise. */)
1535 /* If there are no properties on the interval, return. */ 1536 /* If there are no properties on the interval, return. */
1536 if (! interval_has_some_properties_list (properties, i)) 1537 if (! interval_has_some_properties_list (properties, i))
1537 { 1538 {
1538 got = (LENGTH (i) - (s - i->position)); 1539 ptrdiff_t got = LENGTH (i) - (s - i->position);
1539 do { 1540
1540 if (got >= len) 1541 do
1541 return Qnil; 1542 {
1542 len -= got; 1543 if (got >= len)
1543 i = next_interval (i); 1544 return Qnil;
1544 got = LENGTH (i); 1545 len -= got;
1545 } while (! interval_has_some_properties_list (properties, i)); 1546 i = next_interval (i);
1547 got = LENGTH (i);
1548 }
1549 while (! interval_has_some_properties_list (properties, i));
1546 } 1550 }
1547 /* Split away the beginning of this interval; what we don't 1551 /* Split away the beginning of this interval; what we don't
1548 want to modify. */ 1552 want to modify. */
@@ -1697,7 +1701,7 @@ int
1697text_property_stickiness (Lisp_Object prop, Lisp_Object pos, Lisp_Object buffer) 1701text_property_stickiness (Lisp_Object prop, Lisp_Object pos, Lisp_Object buffer)
1698{ 1702{
1699 Lisp_Object prev_pos, front_sticky; 1703 Lisp_Object prev_pos, front_sticky;
1700 int is_rear_sticky = 1, is_front_sticky = 0; /* defaults */ 1704 bool is_rear_sticky = 1, is_front_sticky = 0; /* defaults */
1701 Lisp_Object defalt = Fassq (prop, Vtext_property_default_nonsticky); 1705 Lisp_Object defalt = Fassq (prop, Vtext_property_default_nonsticky);
1702 1706
1703 if (NILP (buffer)) 1707 if (NILP (buffer))
@@ -1772,7 +1776,7 @@ copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_
1772 Lisp_Object stuff; 1776 Lisp_Object stuff;
1773 Lisp_Object plist; 1777 Lisp_Object plist;
1774 ptrdiff_t s, e, e2, p, len; 1778 ptrdiff_t s, e, e2, p, len;
1775 int modified = 0; 1779 bool modified = 0;
1776 struct gcpro gcpro1, gcpro2; 1780 struct gcpro gcpro1, gcpro2;
1777 1781
1778 i = validate_interval_range (src, &start, &end, soft); 1782 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_
1843 res = Fadd_text_properties (Fcar (res), Fcar (Fcdr (res)), 1847 res = Fadd_text_properties (Fcar (res), Fcar (Fcdr (res)),
1844 Fcar (Fcdr (Fcdr (res))), dest); 1848 Fcar (Fcdr (Fcdr (res))), dest);
1845 if (! NILP (res)) 1849 if (! NILP (res))
1846 modified++; 1850 modified = 1;
1847 stuff = Fcdr (stuff); 1851 stuff = Fcdr (stuff);
1848 } 1852 }
1849 1853
@@ -1914,33 +1918,28 @@ text_property_list (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp
1914/* Add text properties to OBJECT from LIST. LIST is a list of triples 1918/* Add text properties to OBJECT from LIST. LIST is a list of triples
1915 (START END PLIST), where START and END are positions and PLIST is a 1919 (START END PLIST), where START and END are positions and PLIST is a
1916 property list containing the text properties to add. Adjust START 1920 property list containing the text properties to add. Adjust START
1917 and END positions by DELTA before adding properties. Value is 1921 and END positions by DELTA before adding properties. */
1918 non-zero if OBJECT was modified. */
1919 1922
1920int 1923void
1921add_text_properties_from_list (Lisp_Object object, Lisp_Object list, Lisp_Object delta) 1924add_text_properties_from_list (Lisp_Object object, Lisp_Object list, Lisp_Object delta)
1922{ 1925{
1923 struct gcpro gcpro1, gcpro2; 1926 struct gcpro gcpro1, gcpro2;
1924 int modified_p = 0;
1925 1927
1926 GCPRO2 (list, object); 1928 GCPRO2 (list, object);
1927 1929
1928 for (; CONSP (list); list = XCDR (list)) 1930 for (; CONSP (list); list = XCDR (list))
1929 { 1931 {
1930 Lisp_Object item, start, end, plist, tem; 1932 Lisp_Object item, start, end, plist;
1931 1933
1932 item = XCAR (list); 1934 item = XCAR (list);
1933 start = make_number (XINT (XCAR (item)) + XINT (delta)); 1935 start = make_number (XINT (XCAR (item)) + XINT (delta));
1934 end = make_number (XINT (XCAR (XCDR (item))) + XINT (delta)); 1936 end = make_number (XINT (XCAR (XCDR (item))) + XINT (delta));
1935 plist = XCAR (XCDR (XCDR (item))); 1937 plist = XCAR (XCDR (XCDR (item)));
1936 1938
1937 tem = Fadd_text_properties (start, end, plist, object); 1939 Fadd_text_properties (start, end, plist, object);
1938 if (!NILP (tem))
1939 modified_p = 1;
1940 } 1940 }
1941 1941
1942 UNGCPRO; 1942 UNGCPRO;
1943 return modified_p;
1944} 1943}
1945 1944
1946 1945
diff --git a/src/window.c b/src/window.c
index 587ed8365c6..687fe7fb940 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5177,7 +5177,7 @@ displayed_window_lines (struct window *w)
5177 5177
5178DEFUN ("recenter", Frecenter, Srecenter, 0, 1, "P", 5178DEFUN ("recenter", Frecenter, Srecenter, 0, 1, "P",
5179 doc: /* Center point in selected window and maybe redisplay frame. 5179 doc: /* Center point in selected window and maybe redisplay frame.
5180With prefix argument ARG, recenter putting point on screen line ARG 5180With a numeric prefix argument ARG, recenter putting point on screen line ARG
5181relative to the selected window. If ARG is negative, it counts up from the 5181relative to the selected window. If ARG is negative, it counts up from the
5182bottom of the window. (ARG should be less than the height of the window.) 5182bottom of the window. (ARG should be less than the height of the window.)
5183 5183