aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog59
-rw-r--r--src/category.c1
-rw-r--r--src/charset.c4
-rw-r--r--src/dispnew.c1
-rw-r--r--src/doc.c7
-rw-r--r--src/doprnt.c1
-rw-r--r--src/editfns.c1
-rw-r--r--src/fileio.c17
-rw-r--r--src/font.c9
-rw-r--r--src/frame.c8
-rw-r--r--src/gtkutil.c6
-rw-r--r--src/image.c34
-rw-r--r--src/intervals.c47
-rw-r--r--src/lisp.h1
-rw-r--r--src/makefile.w32-in13
-rw-r--r--src/nsfont.m2
-rw-r--r--src/nsimage.m3
-rw-r--r--src/nsterm.m8
-rw-r--r--src/syntax.c1
-rw-r--r--src/sysdep.c6
-rw-r--r--src/term.c1
-rw-r--r--src/xfaces.c55
-rw-r--r--src/xfns.c1
-rw-r--r--src/xterm.c1
24 files changed, 189 insertions, 98 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 95140401eb2..72a11c177c4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,61 @@
12012-08-17 Chong Yidong <cyd@gnu.org>
2
3 * xfaces.c (merge_face_vectors): If the target font specfies a
4 font spec, make the font's attributes take precedence over
5 directly-specified attributes.
6 (merge_face_ref): Recognize :font.
7
82012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
9
10 Do not use memcpy for copying intervals.
11 * intervals.c (reproduce_interval): New function.
12 (reproduce_tree, reproduce_tree_obj): Use it.
13 (reproduce_tree_obj): Remove prototype.
14
152012-08-17 Paul Eggert <eggert@cs.ucla.edu>
16
17 * lisp.h (duration_to_sec_usec): Remove unused decl.
18
192012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
20
21 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
22 to an allocated instance of NSString, not to the class itself.
23
242012-08-17 Juanma Barranquero <lekktu@gmail.com>
25
26 * makefile.w32-in (C_CTYPE_H): New macro.
27 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
28 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
29 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
30
312012-08-16 Paul Eggert <eggert@cs.ucla.edu>
32
33 Use ASCII tests for character types.
34 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
35 * xfns.c, xterm.c:
36 Don't include <ctype.h>; was not needed.
37 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
38 * sysdep.c, xfaces.c:
39 Include <c-ctype.h> instead of <ctype.h>.
40 * nsterm.m: Include <c-ctype.h>.
41 * charset.c (read_hex):
42 * doc.c (Fsnarf_documentation):
43 * fileio.c (IS_DRIVE) [WINDOWSNT]:
44 (DRIVE_LETTER) [DOS_NT]:
45 (Ffile_name_directory, Fexpand_file_name)
46 (Fsubstitute_in_file_name):
47 * font.c (font_parse_xlfd, font_parse_fcname):
48 * frame.c (x_set_font_backend):
49 * gtkutil.c (xg_get_font):
50 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
51 * nsimage.m (hexchar):
52 * nsterm.m (ns_xlfd_to_fontname):
53 * sysdep.c (system_process_attributes):
54 * xfaces.c (hash_string_case_insensitive):
55 Use C-locale tests instead of locale-specific tests for character
56 types, since we want the ASCII interpretation here, not the
57 interpretation suitable for whatever happens to be the current locale.
58
12012-08-16 Martin Rudalics <rudalics@gmx.at> 592012-08-16 Martin Rudalics <rudalics@gmx.at>
2 60
3 Consistently check windows for validity/liveness 61 Consistently check windows for validity/liveness
@@ -3411,6 +3469,7 @@
3411 has at least microseconds now. All uses removed. 3469 has at least microseconds now. All uses removed.
3412 (update_frame, update_single_window, update_window, update_frame_1) 3470 (update_frame, update_single_window, update_window, update_frame_1)
3413 (Fsleep_for, sit_for): Port to higher-resolution time stamps. 3471 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
3472 (duration_to_sec_usec): Remove; no longer needed.
3414 3473
3415 * editfns.c (time_overflow): Now extern. 3474 * editfns.c (time_overflow): Now extern.
3416 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument) 3475 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
diff --git a/src/category.c b/src/category.c
index 3d5b3cff04a..246a7d35a6d 100644
--- a/src/category.c
+++ b/src/category.c
@@ -32,7 +32,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
32 32
33#define CATEGORY_INLINE EXTERN_INLINE 33#define CATEGORY_INLINE EXTERN_INLINE
34 34
35#include <ctype.h>
36#include <setjmp.h> 35#include <setjmp.h>
37#include "lisp.h" 36#include "lisp.h"
38#include "character.h" 37#include "character.h"
diff --git a/src/charset.c b/src/charset.c
index fbbcefc4915..87c16e12008 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -30,10 +30,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30 30
31#include <stdio.h> 31#include <stdio.h>
32#include <unistd.h> 32#include <unistd.h>
33#include <ctype.h>
34#include <limits.h> 33#include <limits.h>
35#include <sys/types.h> 34#include <sys/types.h>
36#include <setjmp.h> 35#include <setjmp.h>
36#include <c-ctype.h>
37#include "lisp.h" 37#include "lisp.h"
38#include "character.h" 38#include "character.h"
39#include "charset.h" 39#include "charset.h"
@@ -446,7 +446,7 @@ read_hex (FILE *fp, int *eof, int *overflow)
446 return 0; 446 return 0;
447 } 447 }
448 n = 0; 448 n = 0;
449 while (isxdigit (c = getc (fp))) 449 while (c_isxdigit (c = getc (fp)))
450 { 450 {
451 if (UINT_MAX >> 4 < n) 451 if (UINT_MAX >> 4 < n)
452 *overflow = 1; 452 *overflow = 1;
diff --git a/src/dispnew.c b/src/dispnew.c
index b82761f8cad..3288faba61b 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -23,7 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23 23
24#include <signal.h> 24#include <signal.h>
25#include <stdio.h> 25#include <stdio.h>
26#include <ctype.h>
27#include <setjmp.h> 26#include <setjmp.h>
28#include <unistd.h> 27#include <unistd.h>
29 28
diff --git a/src/doc.c b/src/doc.c
index d17e90f11c0..ed311d918d7 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -22,11 +22,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22 22
23#include <sys/types.h> 23#include <sys/types.h>
24#include <sys/file.h> /* Must be after sys/types.h for USG*/ 24#include <sys/file.h> /* Must be after sys/types.h for USG*/
25#include <ctype.h>
26#include <setjmp.h> 25#include <setjmp.h>
27#include <fcntl.h> 26#include <fcntl.h>
28#include <unistd.h> 27#include <unistd.h>
29 28
29#include <c-ctype.h>
30
30#include "lisp.h" 31#include "lisp.h"
31#include "character.h" 32#include "character.h"
32#include "buffer.h" 33#include "buffer.h"
@@ -597,9 +598,9 @@ the same file name is found in the `doc-directory'. */)
597 { 598 {
598 ptrdiff_t len; 599 ptrdiff_t len;
599 600
600 while (*beg && isspace (*beg)) ++beg; 601 while (*beg && c_isspace (*beg)) ++beg;
601 602
602 for (end = beg; *end && ! isspace (*end); ++end) 603 for (end = beg; *end && ! c_isspace (*end); ++end)
603 if (*end == '/') beg = end+1; /* skip directory part */ 604 if (*end == '/') beg = end+1; /* skip directory part */
604 605
605 len = end - beg; 606 len = end - beg;
diff --git a/src/doprnt.c b/src/doprnt.c
index 63f05cb74e2..b36e946005d 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -102,7 +102,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
102 102
103#include <config.h> 103#include <config.h>
104#include <stdio.h> 104#include <stdio.h>
105#include <ctype.h>
106#include <setjmp.h> 105#include <setjmp.h>
107#include <float.h> 106#include <float.h>
108#include <unistd.h> 107#include <unistd.h>
diff --git a/src/editfns.c b/src/editfns.c
index 5ac012c8378..b7feb733782 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -44,7 +44,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
44#include <sys/resource.h> 44#include <sys/resource.h>
45#endif 45#endif
46 46
47#include <ctype.h>
48#include <float.h> 47#include <float.h>
49#include <limits.h> 48#include <limits.h>
50#include <intprops.h> 49#include <intprops.h>
diff --git a/src/fileio.c b/src/fileio.c
index eba157ea042..5991a238ffc 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -30,7 +30,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30#include <pwd.h> 30#include <pwd.h>
31#endif 31#endif
32 32
33#include <ctype.h>
34#include <errno.h> 33#include <errno.h>
35 34
36#ifdef HAVE_LIBSELINUX 35#ifdef HAVE_LIBSELINUX
@@ -38,6 +37,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
38#include <selinux/context.h> 37#include <selinux/context.h>
39#endif 38#endif
40 39
40#include <c-ctype.h>
41
41#include "lisp.h" 42#include "lisp.h"
42#include "intervals.h" 43#include "intervals.h"
43#include "character.h" 44#include "character.h"
@@ -67,12 +68,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
67#define IS_DRIVE(x) ((x) >= 'A' && (x) <= 'z') 68#define IS_DRIVE(x) ((x) >= 'A' && (x) <= 'z')
68#endif 69#endif
69#ifdef WINDOWSNT 70#ifdef WINDOWSNT
70#define IS_DRIVE(x) isalpha ((unsigned char) (x)) 71#define IS_DRIVE(x) c_isalpha (x)
71#endif 72#endif
72/* Need to lower-case the drive letter, or else expanded 73/* Need to lower-case the drive letter, or else expanded
73 filenames will sometimes compare unequal, because 74 filenames will sometimes compare unequal, because
74 `expand-file-name' doesn't always down-case the drive letter. */ 75 `expand-file-name' doesn't always down-case the drive letter. */
75#define DRIVE_LETTER(x) (tolower ((unsigned char) (x))) 76#define DRIVE_LETTER(x) c_tolower (x)
76#endif 77#endif
77 78
78#include "systime.h" 79#include "systime.h"
@@ -364,7 +365,7 @@ Given a Unix syntax file name, returns a string ending in slash. */)
364 r += 2; 365 r += 2;
365 } 366 }
366 367
367 if (getdefdir (toupper ((unsigned char) *beg) - 'A' + 1, r)) 368 if (getdefdir (c_toupper (*beg) - 'A' + 1, r))
368 { 369 {
369 if (!IS_DIRECTORY_SEP (res[strlen (res) - 1])) 370 if (!IS_DIRECTORY_SEP (res[strlen (res) - 1]))
370 strcat (res, "/"); 371 strcat (res, "/");
@@ -1053,7 +1054,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
1053 if (!IS_DIRECTORY_SEP (nm[0])) 1054 if (!IS_DIRECTORY_SEP (nm[0]))
1054 { 1055 {
1055 adir = alloca (MAXPATHLEN + 1); 1056 adir = alloca (MAXPATHLEN + 1);
1056 if (!getdefdir (toupper (drive) - 'A' + 1, adir)) 1057 if (!getdefdir (c_toupper (drive) - 'A' + 1, adir))
1057 adir = NULL; 1058 adir = NULL;
1058 } 1059 }
1059 if (!adir) 1060 if (!adir)
@@ -1129,7 +1130,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
1129 adir = alloca (MAXPATHLEN + 1); 1130 adir = alloca (MAXPATHLEN + 1);
1130 if (drive) 1131 if (drive)
1131 { 1132 {
1132 if (!getdefdir (toupper (drive) - 'A' + 1, adir)) 1133 if (!getdefdir (c_toupper (drive) - 'A' + 1, adir))
1133 newdir = "/"; 1134 newdir = "/";
1134 } 1135 }
1135 else 1136 else
@@ -1635,7 +1636,7 @@ those `/' is discarded. */)
1635 else 1636 else
1636 { 1637 {
1637 o = p; 1638 o = p;
1638 while (p != endp && (isalnum (*p) || *p == '_')) p++; 1639 while (p != endp && (c_isalnum (*p) || *p == '_')) p++;
1639 s = p; 1640 s = p;
1640 } 1641 }
1641 1642
@@ -1698,7 +1699,7 @@ those `/' is discarded. */)
1698 else 1699 else
1699 { 1700 {
1700 o = p; 1701 o = p;
1701 while (p != endp && (isalnum (*p) || *p == '_')) p++; 1702 while (p != endp && (c_isalnum (*p) || *p == '_')) p++;
1702 s = p; 1703 s = p;
1703 } 1704 }
1704 1705
diff --git a/src/font.c b/src/font.c
index c3040b8aa3f..5b9e4f1cfcf 100644
--- a/src/font.c
+++ b/src/font.c
@@ -23,9 +23,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include <config.h> 23#include <config.h>
24#include <float.h> 24#include <float.h>
25#include <stdio.h> 25#include <stdio.h>
26#include <ctype.h>
27#include <setjmp.h> 26#include <setjmp.h>
28 27
28#include <c-ctype.h>
29
29#include "lisp.h" 30#include "lisp.h"
30#include "character.h" 31#include "character.h"
31#include "buffer.h" 32#include "buffer.h"
@@ -1079,7 +1080,7 @@ font_parse_xlfd (char *name, ptrdiff_t len, Lisp_Object font)
1079 p = f[XLFD_POINT_INDEX]; 1080 p = f[XLFD_POINT_INDEX];
1080 if (*p == '[') 1081 if (*p == '[')
1081 point_size = parse_matrix (p); 1082 point_size = parse_matrix (p);
1082 else if (isdigit (*p)) 1083 else if (c_isdigit (*p))
1083 point_size = atoi (p), point_size /= 10; 1084 point_size = atoi (p), point_size /= 10;
1084 if (point_size >= 0) 1085 if (point_size >= 0)
1085 ASET (font, FONT_SIZE_INDEX, make_float (point_size)); 1086 ASET (font, FONT_SIZE_INDEX, make_float (point_size));
@@ -1346,7 +1347,7 @@ font_parse_fcname (char *name, ptrdiff_t len, Lisp_Object font)
1346 { 1347 {
1347 int decimal = 0, size_found = 1; 1348 int decimal = 0, size_found = 1;
1348 for (q = p + 1; *q && *q != ':'; q++) 1349 for (q = p + 1; *q && *q != ':'; q++)
1349 if (! isdigit (*q)) 1350 if (! c_isdigit (*q))
1350 { 1351 {
1351 if (*q != '.' || decimal) 1352 if (*q != '.' || decimal)
1352 { 1353 {
@@ -1474,7 +1475,7 @@ font_parse_fcname (char *name, ptrdiff_t len, Lisp_Object font)
1474 1475
1475 /* Scan backwards from the end, looking for a size. */ 1476 /* Scan backwards from the end, looking for a size. */
1476 for (p = name + len - 1; p >= name; p--) 1477 for (p = name + len - 1; p >= name; p--)
1477 if (!isdigit (*p)) 1478 if (!c_isdigit (*p))
1478 break; 1479 break;
1479 1480
1480 if ((p < name + len - 1) && ((p + 1 == name) || *p == ' ')) 1481 if ((p < name + len - 1) && ((p + 1 == name) || *p == ' '))
diff --git a/src/frame.c b/src/frame.c
index ea682835a87..9dabae55abc 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -20,10 +20,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20#include <config.h> 20#include <config.h>
21 21
22#include <stdio.h> 22#include <stdio.h>
23#include <ctype.h>
24#include <errno.h> 23#include <errno.h>
25#include <limits.h> 24#include <limits.h>
26#include <setjmp.h> 25#include <setjmp.h>
26
27#include <c-ctype.h>
28
27#include "lisp.h" 29#include "lisp.h"
28#include "character.h" 30#include "character.h"
29#ifdef HAVE_X_WINDOWS 31#ifdef HAVE_X_WINDOWS
@@ -3271,7 +3273,7 @@ x_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
3271 new_value = Qnil; 3273 new_value = Qnil;
3272 while (*p0) 3274 while (*p0)
3273 { 3275 {
3274 while (*p1 && ! isspace (*p1) && *p1 != ',') p1++; 3276 while (*p1 && ! c_isspace (*p1) && *p1 != ',') p1++;
3275 if (p0 < p1) 3277 if (p0 < p1)
3276 new_value = Fcons (Fintern (make_string (p0, p1 - p0), Qnil), 3278 new_value = Fcons (Fintern (make_string (p0, p1 - p0), Qnil),
3277 new_value); 3279 new_value);
@@ -3279,7 +3281,7 @@ x_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
3279 { 3281 {
3280 int c; 3282 int c;
3281 3283
3282 while ((c = *++p1) && isspace (c)); 3284 while ((c = *++p1) && c_isspace (c));
3283 } 3285 }
3284 p0 = p1; 3286 p0 = p1;
3285 } 3287 }
diff --git a/src/gtkutil.c b/src/gtkutil.c
index a4de47f073c..2941605d448 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -24,7 +24,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
24#include <signal.h> 24#include <signal.h>
25#include <stdio.h> 25#include <stdio.h>
26#include <setjmp.h> 26#include <setjmp.h>
27#include <ctype.h> 27
28#include <c-ctype.h>
29
28#include "lisp.h" 30#include "lisp.h"
29#include "xterm.h" 31#include "xterm.h"
30#include "blockinput.h" 32#include "blockinput.h"
@@ -2072,7 +2074,7 @@ xg_get_font (FRAME_PTR f, const char *default_name)
2072 if (p) 2074 if (p)
2073 { 2075 {
2074 char *ep = p+1; 2076 char *ep = p+1;
2075 while (isdigit (*ep)) 2077 while (c_isdigit (*ep))
2076 ++ep; 2078 ++ep;
2077 if (*ep == '\0') *p = ' '; 2079 if (*ep == '\0') *p = ' ';
2078 } 2080 }
diff --git a/src/image.c b/src/image.c
index 8a318c2f6ec..f2778165ece 100644
--- a/src/image.c
+++ b/src/image.c
@@ -20,7 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20#include <config.h> 20#include <config.h>
21#include <stdio.h> 21#include <stdio.h>
22#include <math.h> 22#include <math.h>
23#include <ctype.h>
24#include <unistd.h> 23#include <unistd.h>
25 24
26#ifdef HAVE_PNG 25#ifdef HAVE_PNG
@@ -33,6 +32,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
33 32
34#include <setjmp.h> 33#include <setjmp.h>
35 34
35#include <c-ctype.h>
36
36/* This makes the fields of a Display accessible, in Xlib header files. */ 37/* This makes the fields of a Display accessible, in Xlib header files. */
37 38
38#define XLIB_ILLEGAL_ACCESS 39#define XLIB_ILLEGAL_ACCESS
@@ -2405,12 +2406,12 @@ xbm_scan (unsigned char **s, unsigned char *end, char *sval, int *ival)
2405 loop: 2406 loop:
2406 2407
2407 /* Skip white space. */ 2408 /* Skip white space. */
2408 while (*s < end && (c = *(*s)++, isspace (c))) 2409 while (*s < end && (c = *(*s)++, c_isspace (c)))
2409 ; 2410 ;
2410 2411
2411 if (*s >= end) 2412 if (*s >= end)
2412 c = 0; 2413 c = 0;
2413 else if (isdigit (c)) 2414 else if (c_isdigit (c))
2414 { 2415 {
2415 int value = 0, digit; 2416 int value = 0, digit;
2416 2417
@@ -2422,7 +2423,7 @@ xbm_scan (unsigned char **s, unsigned char *end, char *sval, int *ival)
2422 while (*s < end) 2423 while (*s < end)
2423 { 2424 {
2424 c = *(*s)++; 2425 c = *(*s)++;
2425 if (isdigit (c)) 2426 if (c_isdigit (c))
2426 digit = c - '0'; 2427 digit = c - '0';
2427 else if (c >= 'a' && c <= 'f') 2428 else if (c >= 'a' && c <= 'f')
2428 digit = c - 'a' + 10; 2429 digit = c - 'a' + 10;
@@ -2433,11 +2434,11 @@ xbm_scan (unsigned char **s, unsigned char *end, char *sval, int *ival)
2433 value = 16 * value + digit; 2434 value = 16 * value + digit;
2434 } 2435 }
2435 } 2436 }
2436 else if (isdigit (c)) 2437 else if (c_isdigit (c))
2437 { 2438 {
2438 value = c - '0'; 2439 value = c - '0';
2439 while (*s < end 2440 while (*s < end
2440 && (c = *(*s)++, isdigit (c))) 2441 && (c = *(*s)++, c_isdigit (c)))
2441 value = 8 * value + c - '0'; 2442 value = 8 * value + c - '0';
2442 } 2443 }
2443 } 2444 }
@@ -2445,7 +2446,7 @@ xbm_scan (unsigned char **s, unsigned char *end, char *sval, int *ival)
2445 { 2446 {
2446 value = c - '0'; 2447 value = c - '0';
2447 while (*s < end 2448 while (*s < end
2448 && (c = *(*s)++, isdigit (c))) 2449 && (c = *(*s)++, c_isdigit (c)))
2449 value = 10 * value + c - '0'; 2450 value = 10 * value + c - '0';
2450 } 2451 }
2451 2452
@@ -2454,11 +2455,11 @@ xbm_scan (unsigned char **s, unsigned char *end, char *sval, int *ival)
2454 *ival = value; 2455 *ival = value;
2455 c = XBM_TK_NUMBER; 2456 c = XBM_TK_NUMBER;
2456 } 2457 }
2457 else if (isalpha (c) || c == '_') 2458 else if (c_isalpha (c) || c == '_')
2458 { 2459 {
2459 *sval++ = c; 2460 *sval++ = c;
2460 while (*s < end 2461 while (*s < end
2461 && (c = *(*s)++, (isalnum (c) || c == '_'))) 2462 && (c = *(*s)++, (c_isalnum (c) || c == '_')))
2462 *sval++ = c; 2463 *sval++ = c;
2463 *sval = 0; 2464 *sval = 0;
2464 if (*s < end) 2465 if (*s < end)
@@ -3661,16 +3662,17 @@ xpm_scan (const unsigned char **s,
3661 while (*s < end) 3662 while (*s < end)
3662 { 3663 {
3663 /* Skip white-space. */ 3664 /* Skip white-space. */
3664 while (*s < end && (c = *(*s)++, isspace (c))) 3665 while (*s < end && (c = *(*s)++, c_isspace (c)))
3665 ; 3666 ;
3666 3667
3667 /* gnus-pointer.xpm uses '-' in its identifier. 3668 /* gnus-pointer.xpm uses '-' in its identifier.
3668 sb-dir-plus.xpm uses '+' in its identifier. */ 3669 sb-dir-plus.xpm uses '+' in its identifier. */
3669 if (isalpha (c) || c == '_' || c == '-' || c == '+') 3670 if (c_isalpha (c) || c == '_' || c == '-' || c == '+')
3670 { 3671 {
3671 *beg = *s - 1; 3672 *beg = *s - 1;
3672 while (*s < end 3673 while (*s < end
3673 && (c = **s, isalnum (c) || c == '_' || c == '-' || c == '+')) 3674 && (c = **s, c_isalnum (c)
3675 || c == '_' || c == '-' || c == '+'))
3674 ++*s; 3676 ++*s;
3675 *len = *s - *beg; 3677 *len = *s - *beg;
3676 return XPM_TK_IDENT; 3678 return XPM_TK_IDENT;
@@ -5014,7 +5016,7 @@ pbm_scan_number (unsigned char **s, unsigned char *end)
5014 while (*s < end) 5016 while (*s < end)
5015 { 5017 {
5016 /* Skip white-space. */ 5018 /* Skip white-space. */
5017 while (*s < end && (c = *(*s)++, isspace (c))) 5019 while (*s < end && (c = *(*s)++, c_isspace (c)))
5018 ; 5020 ;
5019 5021
5020 if (c == '#') 5022 if (c == '#')
@@ -5023,11 +5025,11 @@ pbm_scan_number (unsigned char **s, unsigned char *end)
5023 while (*s < end && (c = *(*s)++, c != '\n')) 5025 while (*s < end && (c = *(*s)++, c != '\n'))
5024 ; 5026 ;
5025 } 5027 }
5026 else if (isdigit (c)) 5028 else if (c_isdigit (c))
5027 { 5029 {
5028 /* Read decimal number. */ 5030 /* Read decimal number. */
5029 val = c - '0'; 5031 val = c - '0';
5030 while (*s < end && (c = *(*s)++, isdigit (c))) 5032 while (*s < end && (c = *(*s)++, c_isdigit (c)))
5031 val = 10 * val + c - '0'; 5033 val = 10 * val + c - '0';
5032 break; 5034 break;
5033 } 5035 }
@@ -8554,7 +8556,7 @@ gs_load (struct frame *f, struct image *img)
8554 don't either. Let the Lisp loader use `unwind-protect' instead. */ 8556 don't either. Let the Lisp loader use `unwind-protect' instead. */
8555 printnum1 = FRAME_X_WINDOW (f); 8557 printnum1 = FRAME_X_WINDOW (f);
8556 printnum2 = img->pixmap; 8558 printnum2 = img->pixmap;
8557 window_and_pixmap_id 8559 window_and_pixmap_id
8558 = make_formatted_string (buffer, "%"pMu" %"pMu, printnum1, printnum2); 8560 = make_formatted_string (buffer, "%"pMu" %"pMu, printnum1, printnum2);
8559 8561
8560 printnum1 = FRAME_FOREGROUND_PIXEL (f); 8562 printnum1 = FRAME_FOREGROUND_PIXEL (f);
diff --git a/src/intervals.c b/src/intervals.c
index 09949bbbd45..b0ef7c8d3b9 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -59,7 +59,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
59static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object); 59static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object);
60static INTERVAL merge_interval_right (INTERVAL); 60static INTERVAL merge_interval_right (INTERVAL);
61static INTERVAL reproduce_tree (INTERVAL, INTERVAL); 61static INTERVAL reproduce_tree (INTERVAL, INTERVAL);
62static INTERVAL reproduce_tree_obj (INTERVAL, Lisp_Object);
63 62
64/* Utility functions for intervals. */ 63/* Utility functions for intervals. */
65 64
@@ -1498,6 +1497,26 @@ merge_interval_left (register INTERVAL i)
1498 abort (); 1497 abort ();
1499} 1498}
1500 1499
1500/* Create a copy of SOURCE but with the default value of UP. */
1501
1502static INTERVAL
1503reproduce_interval (INTERVAL source)
1504{
1505 register INTERVAL target = make_interval ();
1506
1507 target->total_length = source->total_length;
1508 target->position = source->position;
1509
1510 copy_properties (source, target);
1511
1512 if (! NULL_LEFT_CHILD (source))
1513 interval_set_left (target, reproduce_tree (source->left, target));
1514 if (! NULL_RIGHT_CHILD (source))
1515 interval_set_right (target, reproduce_tree (source->right, target));
1516
1517 return target;
1518}
1519
1501/* Make an exact copy of interval tree SOURCE which descends from 1520/* Make an exact copy of interval tree SOURCE which descends from
1502 PARENT. This is done by recursing through SOURCE, copying 1521 PARENT. This is done by recursing through SOURCE, copying
1503 the current interval and its properties, and then adjusting 1522 the current interval and its properties, and then adjusting
@@ -1506,33 +1525,19 @@ merge_interval_left (register INTERVAL i)
1506static INTERVAL 1525static INTERVAL
1507reproduce_tree (INTERVAL source, INTERVAL parent) 1526reproduce_tree (INTERVAL source, INTERVAL parent)
1508{ 1527{
1509 register INTERVAL t = make_interval (); 1528 register INTERVAL target = reproduce_interval (source);
1510
1511 memcpy (t, source, sizeof *t);
1512 copy_properties (source, t);
1513 interval_set_parent (t, parent);
1514 if (! NULL_LEFT_CHILD (source))
1515 interval_set_left (t, reproduce_tree (source->left, t));
1516 if (! NULL_RIGHT_CHILD (source))
1517 interval_set_right (t, reproduce_tree (source->right, t));
1518 1529
1519 return t; 1530 interval_set_parent (target, parent);
1531 return target;
1520} 1532}
1521 1533
1522static INTERVAL 1534static INTERVAL
1523reproduce_tree_obj (INTERVAL source, Lisp_Object parent) 1535reproduce_tree_obj (INTERVAL source, Lisp_Object parent)
1524{ 1536{
1525 register INTERVAL t = make_interval (); 1537 register INTERVAL target = reproduce_interval (source);
1526
1527 memcpy (t, source, sizeof *t);
1528 copy_properties (source, t);
1529 interval_set_object (t, parent);
1530 if (! NULL_LEFT_CHILD (source))
1531 interval_set_left (t, reproduce_tree (source->left, t));
1532 if (! NULL_RIGHT_CHILD (source))
1533 interval_set_right (t, reproduce_tree (source->right, t));
1534 1538
1535 return t; 1539 interval_set_object (target, parent);
1540 return target;
1536} 1541}
1537 1542
1538/* Insert the intervals of SOURCE into BUFFER at POSITION. 1543/* Insert the intervals of SOURCE into BUFFER at POSITION.
diff --git a/src/lisp.h b/src/lisp.h
index fb0e44520d6..8ac01211a1f 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2682,7 +2682,6 @@ _Noreturn void __executable_start (void);
2682#endif 2682#endif
2683extern Lisp_Object selected_frame; 2683extern Lisp_Object selected_frame;
2684extern Lisp_Object Vwindow_system; 2684extern Lisp_Object Vwindow_system;
2685void duration_to_sec_usec (double, int *, int *);
2686extern Lisp_Object sit_for (Lisp_Object, int, int); 2685extern Lisp_Object sit_for (Lisp_Object, int, int);
2687extern void init_display (void); 2686extern void init_display (void);
2688extern void syms_of_display (void); 2687extern void syms_of_display (void);
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index 31dc94f7964..9c13f561a04 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -395,6 +395,8 @@ BLOCKINPUT_H = $(SRC)/blockinput.h \
395 $(ATIMER_H) 395 $(ATIMER_H)
396BUFFER_H = $(SRC)/buffer.h \ 396BUFFER_H = $(SRC)/buffer.h \
397 $(SYSTIME_H) 397 $(SYSTIME_H)
398C_CTYPE_H = $(GNU_LIB)/c-ctype.h \
399 $(NT_INC)/stdbool.h
398CAREADLINKAT_H = $(GNU_LIB)/careadlinkat.h \ 400CAREADLINKAT_H = $(GNU_LIB)/careadlinkat.h \
399 $(NT_INC)/unistd.h 401 $(NT_INC)/unistd.h
400CHARACTER_H = $(SRC)/character.h \ 402CHARACTER_H = $(SRC)/character.h \
@@ -441,7 +443,8 @@ LISP_H = $(SRC)/lisp.h \
441 $(SRC)/globals.h \ 443 $(SRC)/globals.h \
442 $(GNU_LIB)/intprops.h \ 444 $(GNU_LIB)/intprops.h \
443 $(INTTYPES_H) \ 445 $(INTTYPES_H) \
444 $(NT_INC)/stdalign.h 446 $(NT_INC)/stdalign.h \
447 $(NT_INC)/stdbool.h
445MD5_H = $(GNU_LIB)/md5.h \ 448MD5_H = $(GNU_LIB)/md5.h \
446 $(NT_INC)/stdint.h 449 $(NT_INC)/stdint.h
447MENU_H = $(SRC)/menu.h \ 450MENU_H = $(SRC)/menu.h \
@@ -626,6 +629,7 @@ $(BLD)/charset.$(O) : \
626 $(CHARSET_H) \ 629 $(CHARSET_H) \
627 $(CODING_H) \ 630 $(CODING_H) \
628 $(CONFIG_H) \ 631 $(CONFIG_H) \
632 $(C_CTYPE_H) \
629 $(LISP_H) 633 $(LISP_H)
630 634
631$(BLD)/chartab.$(O) : \ 635$(BLD)/chartab.$(O) : \
@@ -747,6 +751,7 @@ $(BLD)/doc.$(O) : \
747 $(BUFFER_H) \ 751 $(BUFFER_H) \
748 $(CHARACTER_H) \ 752 $(CHARACTER_H) \
749 $(CONFIG_H) \ 753 $(CONFIG_H) \
754 $(C_CTYPE_H) \
750 $(KEYBOARD_H) \ 755 $(KEYBOARD_H) \
751 $(LISP_H) 756 $(LISP_H)
752 757
@@ -820,6 +825,7 @@ $(BLD)/fileio.$(O) : \
820 $(CHARACTER_H) \ 825 $(CHARACTER_H) \
821 $(CODING_H) \ 826 $(CODING_H) \
822 $(CONFIG_H) \ 827 $(CONFIG_H) \
828 $(C_CTYPE_H) \
823 $(DISPEXTERN_H) \ 829 $(DISPEXTERN_H) \
824 $(FRAME_H) \ 830 $(FRAME_H) \
825 $(INTERVALS_H) \ 831 $(INTERVALS_H) \
@@ -881,6 +887,7 @@ $(BLD)/font.$(O) : \
881 $(CHARACTER_H) \ 887 $(CHARACTER_H) \
882 $(CHARSET_H) \ 888 $(CHARSET_H) \
883 $(CONFIG_H) \ 889 $(CONFIG_H) \
890 $(C_CTYPE_H) \
884 $(DISPEXTERN_H) \ 891 $(DISPEXTERN_H) \
885 $(FONT_H) \ 892 $(FONT_H) \
886 $(FRAME_H) \ 893 $(FRAME_H) \
@@ -916,6 +923,7 @@ $(BLD)/frame.$(O) : \
916 $(BUFFER_H) \ 923 $(BUFFER_H) \
917 $(CHARACTER_H) \ 924 $(CHARACTER_H) \
918 $(CONFIG_H) \ 925 $(CONFIG_H) \
926 $(C_CTYPE_H) \
919 $(DISPEXTERN_H) \ 927 $(DISPEXTERN_H) \
920 $(FONT_H) \ 928 $(FONT_H) \
921 $(FRAME_H) \ 929 $(FRAME_H) \
@@ -967,6 +975,7 @@ $(BLD)/image.$(O) : \
967 $(CHARACTER_H) \ 975 $(CHARACTER_H) \
968 $(CODING_H) \ 976 $(CODING_H) \
969 $(CONFIG_H) \ 977 $(CONFIG_H) \
978 $(C_CTYPE_H) \
970 $(DISPEXTERN_H) \ 979 $(DISPEXTERN_H) \
971 $(FONT_H) \ 980 $(FONT_H) \
972 $(FRAME_H) \ 981 $(FRAME_H) \
@@ -1354,6 +1363,7 @@ $(BLD)/sysdep.$(O) : \
1354 $(BLOCKINPUT_H) \ 1363 $(BLOCKINPUT_H) \
1355 $(CAREADLINKAT_H) \ 1364 $(CAREADLINKAT_H) \
1356 $(CONFIG_H) \ 1365 $(CONFIG_H) \
1366 $(C_CTYPE_H) \
1357 $(DISPEXTERN_H) \ 1367 $(DISPEXTERN_H) \
1358 $(FRAME_H) \ 1368 $(FRAME_H) \
1359 $(GRP_H) \ 1369 $(GRP_H) \
@@ -1499,6 +1509,7 @@ $(BLD)/xfaces.$(O) : \
1499 $(CHARACTER_H) \ 1509 $(CHARACTER_H) \
1500 $(CHARSET_H) \ 1510 $(CHARSET_H) \
1501 $(CONFIG_H) \ 1511 $(CONFIG_H) \
1512 $(C_CTYPE_H) \
1502 $(DISPEXTERN_H) \ 1513 $(DISPEXTERN_H) \
1503 $(FONT_H) \ 1514 $(FONT_H) \
1504 $(FRAME_H) \ 1515 $(FRAME_H) \
diff --git a/src/nsfont.m b/src/nsfont.m
index fdb6e0c33c1..1f8d28cd238 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -275,7 +275,7 @@ ns_ascii_average_width (NSFont *sfont)
275 for (ch = 0; ch < 95; ch++) 275 for (ch = 0; ch < 95; ch++)
276 chars[ch] = ' ' + ch; 276 chars[ch] = ' ' + ch;
277 277
278 ascii_printable = [NSString initWithFormat: @"%s", chars]; 278 ascii_printable = [[NSString alloc] initWithFormat: @"%s", chars];
279 } 279 }
280 280
281#ifdef NS_IMPL_COCOA 281#ifdef NS_IMPL_COCOA
diff --git a/src/nsimage.m b/src/nsimage.m
index 1479294948b..8a8a3ddaae4 100644
--- a/src/nsimage.m
+++ b/src/nsimage.m
@@ -302,7 +302,7 @@ static EmacsImage *ImageList = nil;
302 [bmRep release]; 302 [bmRep release];
303 return nil; 303 return nil;
304 } 304 }
305#define hexchar(x) (isdigit (x) ? x - '0' : x - 'a' + 10) 305#define hexchar(x) ('0' <= (x) && (x) <= '9' ? (x) - '0' : (x) - 'a' + 10)
306 s1 = *s++; 306 s1 = *s++;
307 s2 = *s++; 307 s2 = *s++;
308 c = hexchar (s1) * 0x10 + hexchar (s2); 308 c = hexchar (s1) * 0x10 + hexchar (s2);
@@ -501,4 +501,3 @@ static EmacsImage *ImageList = nil;
501} 501}
502 502
503@end 503@end
504
diff --git a/src/nsterm.m b/src/nsterm.m
index 76e6ee8fb40..a628a248c77 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -36,6 +36,8 @@ GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu)
36#include <signal.h> 36#include <signal.h>
37#include <unistd.h> 37#include <unistd.h>
38#include <setjmp.h> 38#include <setjmp.h>
39
40#include <c-ctype.h>
39#include <c-strcase.h> 41#include <c-strcase.h>
40#include <ftoastr.h> 42#include <ftoastr.h>
41 43
@@ -6785,20 +6787,20 @@ ns_xlfd_to_fontname (const char *xlfd)
6785 6787
6786 /* undo hack in ns_fontname_to_xlfd, converting '$' to '-', '_' to ' ' 6788 /* undo hack in ns_fontname_to_xlfd, converting '$' to '-', '_' to ' '
6787 also uppercase after '-' or ' ' */ 6789 also uppercase after '-' or ' ' */
6788 name[0] = toupper (name[0]); 6790 name[0] = c_toupper (name[0]);
6789 for (len =strlen (name), i =0; i<len; i++) 6791 for (len =strlen (name), i =0; i<len; i++)
6790 { 6792 {
6791 if (name[i] == '$') 6793 if (name[i] == '$')
6792 { 6794 {
6793 name[i] = '-'; 6795 name[i] = '-';
6794 if (i+1<len) 6796 if (i+1<len)
6795 name[i+1] = toupper (name[i+1]); 6797 name[i+1] = c_toupper (name[i+1]);
6796 } 6798 }
6797 else if (name[i] == '_') 6799 else if (name[i] == '_')
6798 { 6800 {
6799 name[i] = ' '; 6801 name[i] = ' ';
6800 if (i+1<len) 6802 if (i+1<len)
6801 name[i+1] = toupper (name[i+1]); 6803 name[i+1] = c_toupper (name[i+1]);
6802 } 6804 }
6803 } 6805 }
6804/*fprintf (stderr, "converted '%s' to '%s'\n",xlfd,name); */ 6806/*fprintf (stderr, "converted '%s' to '%s'\n",xlfd,name); */
diff --git a/src/syntax.c b/src/syntax.c
index 1cbad1ae0a4..69965d1d824 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -20,7 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21#include <config.h> 21#include <config.h>
22 22
23#include <ctype.h>
24#include <sys/types.h> 23#include <sys/types.h>
25#include <setjmp.h> 24#include <setjmp.h>
26#include "lisp.h" 25#include "lisp.h"
diff --git a/src/sysdep.c b/src/sysdep.c
index 01ca905a987..1dbe8938e46 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 21
22#define SYSTIME_INLINE EXTERN_INLINE 22#define SYSTIME_INLINE EXTERN_INLINE
23 23
24#include <ctype.h>
25#include <signal.h> 24#include <signal.h>
26#include <stdio.h> 25#include <stdio.h>
27#include <setjmp.h> 26#include <setjmp.h>
@@ -33,6 +32,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
33#include <unistd.h> 32#include <unistd.h>
34 33
35#include <allocator.h> 34#include <allocator.h>
35#include <c-ctype.h>
36#include <careadlinkat.h> 36#include <careadlinkat.h>
37#include <ignore-value.h> 37#include <ignore-value.h>
38#include <utimens.h> 38#include <utimens.h>
@@ -2733,7 +2733,7 @@ system_process_attributes (Lisp_Object pid)
2733 if (emacs_read (fd, &ch, 1) != 1) 2733 if (emacs_read (fd, &ch, 1) != 1)
2734 break; 2734 break;
2735 c = ch; 2735 c = ch;
2736 if (isspace (c) || c == '\\') 2736 if (c_isspace (c) || c == '\\')
2737 cmdline_size++; /* for later quoting, see below */ 2737 cmdline_size++; /* for later quoting, see below */
2738 } 2738 }
2739 if (cmdline_size) 2739 if (cmdline_size)
@@ -2757,7 +2757,7 @@ system_process_attributes (Lisp_Object pid)
2757 for (p = cmdline; p < cmdline + nread; p++) 2757 for (p = cmdline; p < cmdline + nread; p++)
2758 { 2758 {
2759 /* Escape-quote whitespace and backslashes. */ 2759 /* Escape-quote whitespace and backslashes. */
2760 if (isspace (*p) || *p == '\\') 2760 if (c_isspace (*p) || *p == '\\')
2761 { 2761 {
2762 memmove (p + 1, p, nread - (p - cmdline)); 2762 memmove (p + 1, p, nread - (p - cmdline));
2763 nread++; 2763 nread++;
diff --git a/src/term.c b/src/term.c
index 514c7ad11ec..c5cec3062e3 100644
--- a/src/term.c
+++ b/src/term.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 21
22#include <config.h> 22#include <config.h>
23#include <stdio.h> 23#include <stdio.h>
24#include <ctype.h>
25#include <errno.h> 24#include <errno.h>
26#include <sys/file.h> 25#include <sys/file.h>
27#include <sys/time.h> 26#include <sys/time.h>
diff --git a/src/xfaces.c b/src/xfaces.c
index ed372c6b419..8c6542ee725 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -279,7 +279,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
279 279
280#endif /* HAVE_X_WINDOWS */ 280#endif /* HAVE_X_WINDOWS */
281 281
282#include <ctype.h> 282#include <c-ctype.h>
283 283
284/* Number of pt per inch (from the TeXbook). */ 284/* Number of pt per inch (from the TeXbook). */
285 285
@@ -2281,6 +2281,7 @@ merge_face_vectors (struct frame *f, Lisp_Object *from, Lisp_Object *to,
2281 struct named_merge_point *named_merge_points) 2281 struct named_merge_point *named_merge_points)
2282{ 2282{
2283 int i; 2283 int i;
2284 Lisp_Object font = Qnil;
2284 2285
2285 /* If FROM inherits from some other faces, merge their attributes into 2286 /* If FROM inherits from some other faces, merge their attributes into
2286 TO before merging FROM's direct attributes. Note that an :inherit 2287 TO before merging FROM's direct attributes. Note that an :inherit
@@ -2291,24 +2292,13 @@ merge_face_vectors (struct frame *f, Lisp_Object *from, Lisp_Object *to,
2291 && !NILP (from[LFACE_INHERIT_INDEX])) 2292 && !NILP (from[LFACE_INHERIT_INDEX]))
2292 merge_face_ref (f, from[LFACE_INHERIT_INDEX], to, 0, named_merge_points); 2293 merge_face_ref (f, from[LFACE_INHERIT_INDEX], to, 0, named_merge_points);
2293 2294
2294 i = LFACE_FONT_INDEX; 2295 if (FONT_SPEC_P (from[LFACE_FONT_INDEX]))
2295 if (!UNSPECIFIEDP (from[i]))
2296 { 2296 {
2297 if (!UNSPECIFIEDP (to[i])) 2297 if (!UNSPECIFIEDP (to[LFACE_FONT_INDEX]))
2298 to[i] = merge_font_spec (from[i], to[i]); 2298 font = merge_font_spec (from[LFACE_FONT_INDEX], to[LFACE_FONT_INDEX]);
2299 else 2299 else
2300 to[i] = copy_font_spec (from[i]); 2300 font = copy_font_spec (from[LFACE_FONT_INDEX]);
2301 if (! NILP (AREF (to[i], FONT_FOUNDRY_INDEX))) 2301 to[LFACE_FONT_INDEX] = font;
2302 to[LFACE_FOUNDRY_INDEX] = SYMBOL_NAME (AREF (to[i], FONT_FOUNDRY_INDEX));
2303 if (! NILP (AREF (to[i], FONT_FAMILY_INDEX)))
2304 to[LFACE_FAMILY_INDEX] = SYMBOL_NAME (AREF (to[i], FONT_FAMILY_INDEX));
2305 if (! NILP (AREF (to[i], FONT_WEIGHT_INDEX)))
2306 to[LFACE_WEIGHT_INDEX] = FONT_WEIGHT_FOR_FACE (to[i]);
2307 if (! NILP (AREF (to[i], FONT_SLANT_INDEX)))
2308 to[LFACE_SLANT_INDEX] = FONT_SLANT_FOR_FACE (to[i]);
2309 if (! NILP (AREF (to[i], FONT_WIDTH_INDEX)))
2310 to[LFACE_SWIDTH_INDEX] = FONT_WIDTH_FOR_FACE (to[i]);
2311 ASET (to[i], FONT_SIZE_INDEX, Qnil);
2312 } 2302 }
2313 2303
2314 for (i = 1; i < LFACE_VECTOR_SIZE; ++i) 2304 for (i = 1; i < LFACE_VECTOR_SIZE; ++i)
@@ -2319,8 +2309,7 @@ merge_face_vectors (struct frame *f, Lisp_Object *from, Lisp_Object *to,
2319 to[i] = merge_face_heights (from[i], to[i], to[i]); 2309 to[i] = merge_face_heights (from[i], to[i], to[i]);
2320 font_clear_prop (to, FONT_SIZE_INDEX); 2310 font_clear_prop (to, FONT_SIZE_INDEX);
2321 } 2311 }
2322 else if (i != LFACE_FONT_INDEX 2312 else if (i != LFACE_FONT_INDEX && ! EQ (to[i], from[i]))
2323 && ! EQ (to[i], from[i]))
2324 { 2313 {
2325 to[i] = from[i]; 2314 to[i] = from[i];
2326 if (i >= LFACE_FAMILY_INDEX && i <=LFACE_SLANT_INDEX) 2315 if (i >= LFACE_FAMILY_INDEX && i <=LFACE_SLANT_INDEX)
@@ -2334,6 +2323,25 @@ merge_face_vectors (struct frame *f, Lisp_Object *from, Lisp_Object *to,
2334 } 2323 }
2335 } 2324 }
2336 2325
2326 /* If FROM specifies a font spec, make its contents take precedence
2327 over :family and other attributes. This is needed for face
2328 remapping using :font to work. */
2329
2330 if (!NILP (font))
2331 {
2332 if (! NILP (AREF (font, FONT_FOUNDRY_INDEX)))
2333 to[LFACE_FOUNDRY_INDEX] = SYMBOL_NAME (AREF (font, FONT_FOUNDRY_INDEX));
2334 if (! NILP (AREF (font, FONT_FAMILY_INDEX)))
2335 to[LFACE_FAMILY_INDEX] = SYMBOL_NAME (AREF (font, FONT_FAMILY_INDEX));
2336 if (! NILP (AREF (font, FONT_WEIGHT_INDEX)))
2337 to[LFACE_WEIGHT_INDEX] = FONT_WEIGHT_FOR_FACE (font);
2338 if (! NILP (AREF (font, FONT_SLANT_INDEX)))
2339 to[LFACE_SLANT_INDEX] = FONT_SLANT_FOR_FACE (font);
2340 if (! NILP (AREF (font, FONT_WIDTH_INDEX)))
2341 to[LFACE_SWIDTH_INDEX] = FONT_WIDTH_FOR_FACE (font);
2342 ASET (font, FONT_SIZE_INDEX, Qnil);
2343 }
2344
2337 /* TO is always an absolute face, which should inherit from nothing. 2345 /* TO is always an absolute face, which should inherit from nothing.
2338 We blindly copy the :inherit attribute above and fix it up here. */ 2346 We blindly copy the :inherit attribute above and fix it up here. */
2339 to[LFACE_INHERIT_INDEX] = Qnil; 2347 to[LFACE_INHERIT_INDEX] = Qnil;
@@ -2575,6 +2583,13 @@ merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to,
2575 else 2583 else
2576 err = 1; 2584 err = 1;
2577 } 2585 }
2586 else if (EQ (keyword, QCfont))
2587 {
2588 if (FONTP (value))
2589 to[LFACE_FONT_INDEX] = value;
2590 else
2591 err = 1;
2592 }
2578 else if (EQ (keyword, QCinherit)) 2593 else if (EQ (keyword, QCinherit))
2579 { 2594 {
2580 /* This is not really very useful; it's just like a 2595 /* This is not really very useful; it's just like a
@@ -4059,7 +4074,7 @@ hash_string_case_insensitive (Lisp_Object string)
4059 unsigned hash = 0; 4074 unsigned hash = 0;
4060 eassert (STRINGP (string)); 4075 eassert (STRINGP (string));
4061 for (s = SDATA (string); *s; ++s) 4076 for (s = SDATA (string); *s; ++s)
4062 hash = (hash << 1) ^ tolower (*s); 4077 hash = (hash << 1) ^ c_tolower (*s);
4063 return hash; 4078 return hash;
4064} 4079}
4065 4080
diff --git a/src/xfns.c b/src/xfns.c
index 2e7334b7d71..a9d22e7d3c6 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -49,7 +49,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
49 49
50#ifdef HAVE_X_WINDOWS 50#ifdef HAVE_X_WINDOWS
51 51
52#include <ctype.h>
53#include <sys/types.h> 52#include <sys/types.h>
54#include <sys/stat.h> 53#include <sys/stat.h>
55 54
diff --git a/src/xterm.c b/src/xterm.c
index 1b746f87d53..b1a73d07998 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -50,7 +50,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
50#include "systime.h" 50#include "systime.h"
51 51
52#include <fcntl.h> 52#include <fcntl.h>
53#include <ctype.h>
54#include <errno.h> 53#include <errno.h>
55#include <setjmp.h> 54#include <setjmp.h>
56#include <sys/stat.h> 55#include <sys/stat.h>