aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2003-12-30 17:05:05 +0000
committerKaroly Lorentey2003-12-30 17:05:05 +0000
commit7c3a26158711d76ee77b0bd75fa9df56db5eb57d (patch)
treef808bf77a5b47ce2c8aec0a31187626860d566b6 /src
parentc1c63edb7907e35085f2d61507e1047db85d52c7 (diff)
parent8a37230a70acc8943ba45f52504179ddcc1a5468 (diff)
downloademacs-7c3a26158711d76ee77b0bd75fa9df56db5eb57d.tar.gz
emacs-7c3a26158711d76ee77b0bd75fa9df56db5eb57d.zip
Merged in changes from CVS head
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-5 Add =cvs-sync-make-log script * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-6 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-7 Use absolute tla-tools filenames in =cvs-sync-make-log * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-8 Use proper arch-tag: syntax for lispintro/texinfo.tex * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-9 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-24
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog43
-rw-r--r--src/buffer.h22
-rw-r--r--src/data.c32
-rw-r--r--src/dispextern.h1
-rw-r--r--src/eval.c2
-rw-r--r--src/fileio.c26
-rw-r--r--src/fns.c10
-rw-r--r--src/fontset.c170
-rw-r--r--src/minibuf.c2
-rw-r--r--src/xfaces.c63
10 files changed, 335 insertions, 36 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f471cc99230..121142703c9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,46 @@
12003-12-29 James Clark <jjc@jclark.com> (tiny change)
2
3 * fns.c (internal_equal): Return t for two NaN arguments.
4
52003-12-29 Richard M. Stallman <rms@gnu.org>
6
7 * data.c (store_symval_forwarding): Handle setting
8 default-fill-column, etc., by changing the value in
9 buffers that use the default.
10
11 * minibuf.c (Fset_minibuffer_window): Doc fix.
12
13 * fileio.c (choose_write_coding_system): Ignore auto_saving
14 if using the visited file for auto saves.
15 (Fwrite_region): Don't update SAVE_MODIFF
16 if auto-saving in visited file.
17
182003-12-29 Kenichi Handa <handa@m17n.org>
19
20 * dispextern.h (face_font_available_p): Extern it.
21
22 * fontset.c (Voverriding_fontspec_alist): New variable.
23 (lookup_overriding_fontspec): New function.
24 (fontset_ref_via_base): Call lookup_overriding_fontspec if
25 necessary.
26 (fontset_font_pattern): Likewise.
27 (regulalize_fontname): New function.
28 (Fset_fontset_font): Call regulalize_fontname.
29 (Fset_overriding_fontspec_internal): New function.
30 (syms_of_fontset): Initialize and staticprop
31 Voverriding_fontspec_alist. Defsubr
32 Sset_overriding_fontspec_internal.
33
34 * xfaces.c (face_font_available_p): New function.
35
362003-12-28 Richard M. Stallman <rms@gnu.org>
37
38 * buffer.c (Fother_buffer): Don't crash if BUF is nil
39 or if its name is nil.
40
41 * buffer.c (Fkill_buffer): Don't delete auto-save file
42 if it's the same as the visited file.
43
12003-12-28 Luc Teirlinck <teirllm@auburn.edu> 442003-12-28 Luc Teirlinck <teirllm@auburn.edu>
2 45
3 * coding.c (Fcheck_coding_system): Doc fix. 46 * coding.c (Fcheck_coding_system): Doc fix.
diff --git a/src/buffer.h b/src/buffer.h
index 14d3aa6d5ee..930424b0b49 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -906,8 +906,26 @@ extern int last_per_buffer_idx;
906 (B)->local_flags[IDX] = (VAL); \ 906 (B)->local_flags[IDX] = (VAL); \
907 } while (0) 907 } while (0)
908 908
909/* Return the index of the per-buffer variable at offset OFFSET in the 909/* Return the index value of the per-buffer variable at offset OFFSET
910 buffer structure. */ 910 in the buffer structure.
911
912 If the slot OFFSET has a corresponding default value in
913 buffer_defaults, the index value is positive and has only one
914 nonzero bit. When a buffer has its own local value for a slot, the
915 bit for that slot (found in the same slot in this structure) is
916 turned on in the buffer's local_flags array.
917
918 If the index value is -1, even though there may be a
919 DEFVAR_PER_BUFFER for the slot, there is no default value for it;
920 and the corresponding slot in buffer_defaults is not used.
921
922 If the index value is -2, then there is no DEFVAR_PER_BUFFER for
923 the slot, but there is a default value which is copied into each
924 new buffer.
925
926 If a slot in this structure corresponding to a DEFVAR_PER_BUFFER is
927 zero, that is a bug */
928
911 929
912#define PER_BUFFER_IDX(OFFSET) \ 930#define PER_BUFFER_IDX(OFFSET) \
913 XINT (*(Lisp_Object *)((OFFSET) + (char *) &buffer_local_flags)) 931 XINT (*(Lisp_Object *)((OFFSET) + (char *) &buffer_local_flags))
diff --git a/src/data.c b/src/data.c
index a246271c1f6..c4e3937f3fa 100644
--- a/src/data.c
+++ b/src/data.c
@@ -873,6 +873,8 @@ store_symval_forwarding (symbol, valcontents, newval, buf)
873 register Lisp_Object valcontents, newval; 873 register Lisp_Object valcontents, newval;
874 struct buffer *buf; 874 struct buffer *buf;
875{ 875{
876 int offset;
877
876 switch (SWITCH_ENUM_CAST (XTYPE (valcontents))) 878 switch (SWITCH_ENUM_CAST (XTYPE (valcontents)))
877 { 879 {
878 case Lisp_Misc: 880 case Lisp_Misc:
@@ -892,6 +894,36 @@ store_symval_forwarding (symbol, valcontents, newval, buf)
892 894
893 case Lisp_Misc_Objfwd: 895 case Lisp_Misc_Objfwd:
894 *XOBJFWD (valcontents)->objvar = newval; 896 *XOBJFWD (valcontents)->objvar = newval;
897
898 /* If this variable is a default for something stored
899 in the buffer itself, such as default-fill-column,
900 find the buffers that don't have local values for it
901 and update them. */
902 if (XOBJFWD (valcontents)->objvar > (Lisp_Object *) &buffer_defaults
903 && XOBJFWD (valcontents)->objvar < (Lisp_Object *) (&buffer_defaults + 1))
904 {
905 int offset = ((char *) XOBJFWD (valcontents)->objvar
906 - (char *) &buffer_defaults);
907 int idx = PER_BUFFER_IDX (offset);
908
909 Lisp_Object tail, buf;
910
911 if (idx <= 0)
912 break;
913
914 for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
915 {
916 Lisp_Object buf;
917 struct buffer *b;
918
919 buf = Fcdr (XCAR (tail));
920 if (!BUFFERP (buf)) continue;
921 b = XBUFFER (buf);
922
923 if (! PER_BUFFER_VALUE_P (b, idx))
924 PER_BUFFER_VALUE (b, offset) = newval;
925 }
926 }
895 break; 927 break;
896 928
897 case Lisp_Misc_Buffer_Objfwd: 929 case Lisp_Misc_Buffer_Objfwd:
diff --git a/src/dispextern.h b/src/dispextern.h
index cb0a7a7d91d..e53f36d4a01 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2582,6 +2582,7 @@ void clear_face_cache P_ ((int));
2582unsigned long load_color P_ ((struct frame *, struct face *, Lisp_Object, 2582unsigned long load_color P_ ((struct frame *, struct face *, Lisp_Object,
2583 enum lface_attribute_index)); 2583 enum lface_attribute_index));
2584void unload_color P_ ((struct frame *, unsigned long)); 2584void unload_color P_ ((struct frame *, unsigned long));
2585int face_font_available_p P_ ((struct frame *, Lisp_Object));
2585int ascii_face_of_lisp_face P_ ((struct frame *, int)); 2586int ascii_face_of_lisp_face P_ ((struct frame *, int));
2586void prepare_face_for_display P_ ((struct frame *, struct face *)); 2587void prepare_face_for_display P_ ((struct frame *, struct face *));
2587int xstricmp P_ ((const unsigned char *, const unsigned char *)); 2588int xstricmp P_ ((const unsigned char *, const unsigned char *));
diff --git a/src/eval.c b/src/eval.c
index e5dba1b888f..8a6d0d3ff54 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2641,6 +2641,8 @@ call6 (fn, arg1, arg2, arg3, arg4, arg5, arg6)
2641#endif /* not NO_ARG_ARRAY */ 2641#endif /* not NO_ARG_ARRAY */
2642} 2642}
2643 2643
2644/* The caller should GCPRO all the elements of ARGS. */
2645
2644DEFUN ("funcall", Ffuncall, Sfuncall, 1, MANY, 0, 2646DEFUN ("funcall", Ffuncall, Sfuncall, 1, MANY, 0,
2645 doc: /* Call first argument as a function, passing remaining arguments to it. 2647 doc: /* Call first argument as a function, passing remaining arguments to it.
2646Return the value that function returns. 2648Return the value that function returns.
diff --git a/src/fileio.c b/src/fileio.c
index e586407cecc..a2b207169cf 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4685,7 +4685,9 @@ choose_write_coding_system (start, end, filename,
4685{ 4685{
4686 Lisp_Object val; 4686 Lisp_Object val;
4687 4687
4688 if (auto_saving) 4688 if (auto_saving
4689 && NILP (Fstring_equal (current_buffer->filename,
4690 current_buffer->auto_save_file_name)))
4689 { 4691 {
4690 /* We use emacs-mule for auto saving... */ 4692 /* We use emacs-mule for auto saving... */
4691 setup_coding_system (Qemacs_mule, coding); 4693 setup_coding_system (Qemacs_mule, coding);
@@ -5221,7 +5223,14 @@ This does code conversion according to the value of
5221 update_mode_lines++; 5223 update_mode_lines++;
5222 } 5224 }
5223 else if (quietly) 5225 else if (quietly)
5224 return Qnil; 5226 {
5227 if (auto_saving
5228 && ! NILP (Fstring_equal (current_buffer->filename,
5229 current_buffer->auto_save_file_name)))
5230 SAVE_MODIFF = MODIFF;
5231
5232 return Qnil;
5233 }
5225 5234
5226 if (!auto_saving) 5235 if (!auto_saving)
5227 message_with_string ((INTEGERP (append) 5236 message_with_string ((INTEGERP (append)
@@ -5776,11 +5785,14 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
5776 minibuffer_auto_raise = 0; 5785 minibuffer_auto_raise = 0;
5777 auto_saving = 1; 5786 auto_saving = 1;
5778 5787
5779 /* First, save all files which don't have handlers. If Emacs is 5788 /* On first pass, save all files that don't have handlers.
5780 crashing, the handlers may tweak what is causing Emacs to crash 5789 On second pass, save all files that do have handlers.
5781 in the first place, and it would be a shame if Emacs failed to 5790
5782 autosave perfectly ordinary files because it couldn't handle some 5791 If Emacs is crashing, the handlers may tweak what is causing
5783 ange-ftp'd file. */ 5792 Emacs to crash in the first place, and it would be a shame if
5793 Emacs failed to autosave perfectly ordinary files because it
5794 couldn't handle some ange-ftp'd file. */
5795
5784 for (do_handled_files = 0; do_handled_files < 2; do_handled_files++) 5796 for (do_handled_files = 0; do_handled_files < 2; do_handled_files++)
5785 for (tail = Vbuffer_alist; GC_CONSP (tail); tail = XCDR (tail)) 5797 for (tail = Vbuffer_alist; GC_CONSP (tail); tail = XCDR (tail))
5786 { 5798 {
diff --git a/src/fns.c b/src/fns.c
index e4252c98ca5..ff40c706edd 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2169,7 +2169,15 @@ internal_equal (o1, o2, depth)
2169 switch (XTYPE (o1)) 2169 switch (XTYPE (o1))
2170 { 2170 {
2171 case Lisp_Float: 2171 case Lisp_Float:
2172 return (extract_float (o1) == extract_float (o2)); 2172 {
2173 double d1, d2;
2174
2175 d1 = extract_float (o1);
2176 d2 = extract_float (o2);
2177 /* If d is a NaN, then d != d. Two NaNs should be `equal' even
2178 though they are not =. */
2179 return d1 == d2 || (d1 != d1 && d2 != d2);
2180 }
2173 2181
2174 case Lisp_Cons: 2182 case Lisp_Cons:
2175 if (!internal_equal (XCAR (o1), XCAR (o2), depth + 1)) 2183 if (!internal_equal (XCAR (o1), XCAR (o2), depth + 1))
diff --git a/src/fontset.c b/src/fontset.c
index e462387beae..b199f53df17 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -140,6 +140,10 @@ static int next_fontset_id;
140 font for each characters. */ 140 font for each characters. */
141static Lisp_Object Vdefault_fontset; 141static Lisp_Object Vdefault_fontset;
142 142
143/* Alist of font specifications. It override the font specification
144 in the default fontset. */
145static Lisp_Object Voverriding_fontspec_alist;
146
143Lisp_Object Vfont_encoding_alist; 147Lisp_Object Vfont_encoding_alist;
144Lisp_Object Vuse_default_ascent; 148Lisp_Object Vuse_default_ascent;
145Lisp_Object Vignore_relative_composition; 149Lisp_Object Vignore_relative_composition;
@@ -184,11 +188,13 @@ void (*check_window_system_func) P_ ((void));
184 188
185/* Prototype declarations for static functions. */ 189/* Prototype declarations for static functions. */
186static Lisp_Object fontset_ref P_ ((Lisp_Object, int)); 190static Lisp_Object fontset_ref P_ ((Lisp_Object, int));
191static Lisp_Object lookup_overriding_fontspec P_ ((Lisp_Object, int));
187static void fontset_set P_ ((Lisp_Object, int, Lisp_Object)); 192static void fontset_set P_ ((Lisp_Object, int, Lisp_Object));
188static Lisp_Object make_fontset P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); 193static Lisp_Object make_fontset P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
189static int fontset_id_valid_p P_ ((int)); 194static int fontset_id_valid_p P_ ((int));
190static Lisp_Object fontset_pattern_regexp P_ ((Lisp_Object)); 195static Lisp_Object fontset_pattern_regexp P_ ((Lisp_Object));
191static Lisp_Object font_family_registry P_ ((Lisp_Object, int)); 196static Lisp_Object font_family_registry P_ ((Lisp_Object, int));
197static Lisp_Object regulalize_fontname P_ ((Lisp_Object));
192 198
193 199
194/********** MACROS AND FUNCTIONS TO HANDLE FONTSET **********/ 200/********** MACROS AND FUNCTIONS TO HANDLE FONTSET **********/
@@ -241,6 +247,46 @@ fontset_ref (fontset, c)
241} 247}
242 248
243 249
250static Lisp_Object
251lookup_overriding_fontspec (frame, c)
252 Lisp_Object frame;
253 int c;
254{
255 Lisp_Object tail;
256
257 for (tail = Voverriding_fontspec_alist; CONSP (tail); tail = XCDR (tail))
258 {
259 Lisp_Object val, target, elt;
260
261 val = XCAR (tail);
262 target = XCAR (val);
263 val = XCDR (val);
264 /* Now VAL is (NO-FRAME-LIST OK-FRAME-LIST CHAR FONTNAME). */
265 if (NILP (Fmemq (frame, XCAR (val)))
266 && (CHAR_TABLE_P (target)
267 ? ! NILP (CHAR_TABLE_REF (target, c))
268 : XINT (target) == CHAR_CHARSET (c)))
269 {
270 val = XCDR (val);
271 elt = XCDR (val);
272 if (NILP (Fmemq (frame, XCAR (val))))
273 {
274 if (! face_font_available_p (XFRAME (frame), XCDR (elt)))
275 {
276 val = XCDR (XCAR (tail));
277 XSETCAR (val, Fcons (frame, XCAR (val)));
278 continue;
279 }
280 XSETCAR (val, Fcons (frame, XCAR (val)));
281 }
282 if (NILP (XCAR (elt)))
283 XSETCAR (elt, make_number (c));
284 return elt;
285 }
286 }
287 return Qnil;
288}
289
244#define FONTSET_REF_VIA_BASE(fontset, c) fontset_ref_via_base (fontset, &c) 290#define FONTSET_REF_VIA_BASE(fontset, c) fontset_ref_via_base (fontset, &c)
245 291
246static Lisp_Object 292static Lisp_Object
@@ -254,8 +300,12 @@ fontset_ref_via_base (fontset, c)
254 if (SINGLE_BYTE_CHAR_P (*c)) 300 if (SINGLE_BYTE_CHAR_P (*c))
255 return FONTSET_ASCII (fontset); 301 return FONTSET_ASCII (fontset);
256 302
257 elt = FONTSET_REF (FONTSET_BASE (fontset), *c); 303 elt = Qnil;
258 if (NILP (elt) && ! EQ (fontset, Vdefault_fontset)) 304 if (! EQ (FONTSET_BASE (fontset), Vdefault_fontset))
305 elt = FONTSET_REF (FONTSET_BASE (fontset), *c);
306 if (NILP (elt))
307 elt = lookup_overriding_fontspec (FONTSET_FRAME (fontset), *c);
308 if (NILP (elt) && ! EQ (FONTSET_BASE (fontset), Vdefault_fontset))
259 elt = FONTSET_REF (Vdefault_fontset, *c); 309 elt = FONTSET_REF (Vdefault_fontset, *c);
260 if (NILP (elt)) 310 if (NILP (elt))
261 return Qnil; 311 return Qnil;
@@ -551,6 +601,13 @@ fontset_font_pattern (f, id, c)
551 elt = FONTSET_REF (fontset, c); 601 elt = FONTSET_REF (fontset, c);
552 } 602 }
553 if (NILP (elt)) 603 if (NILP (elt))
604 {
605 Lisp_Object frame;
606
607 XSETFRAME (frame, f);
608 elt = lookup_overriding_fontspec (frame, c);
609 }
610 if (NILP (elt))
554 elt = FONTSET_REF (Vdefault_fontset, c); 611 elt = FONTSET_REF (Vdefault_fontset, c);
555 612
556 if (!CONSP (elt)) 613 if (!CONSP (elt))
@@ -980,6 +1037,33 @@ check_fontset_name (name)
980 return FONTSET_FROM_ID (id); 1037 return FONTSET_FROM_ID (id);
981} 1038}
982 1039
1040/* Downcase FONTNAME or car and cdr of FONTNAME. If FONTNAME is a
1041 string, maybe change FONTNAME to (FAMILY . REGISTRY). */
1042
1043static Lisp_Object
1044regulalize_fontname (Lisp_Object fontname)
1045{
1046 Lisp_Object family, registry;
1047
1048 if (STRINGP (fontname))
1049 return font_family_registry (Fdowncase (fontname), 0);
1050
1051 CHECK_CONS (fontname);
1052 family = XCAR (fontname);
1053 registry = XCDR (fontname);
1054 if (!NILP (family))
1055 {
1056 CHECK_STRING (family);
1057 family = Fdowncase (family);
1058 }
1059 if (!NILP (registry))
1060 {
1061 CHECK_STRING (registry);
1062 registry = Fdowncase (registry);
1063 }
1064 return Fcons (family, registry);
1065}
1066
983DEFUN ("set-fontset-font", Fset_fontset_font, Sset_fontset_font, 3, 4, 0, 1067DEFUN ("set-fontset-font", Fset_fontset_font, Sset_fontset_font, 3, 4, 0,
984 doc: /* Modify fontset NAME to use FONTNAME for CHARACTER. 1068 doc: /* Modify fontset NAME to use FONTNAME for CHARACTER.
985 1069
@@ -1043,34 +1127,12 @@ name of a font, REGISTRY is a registry name of a font. */)
1043 error ("Can't change font for a single byte character"); 1127 error ("Can't change font for a single byte character");
1044 } 1128 }
1045 1129
1046 if (STRINGP (fontname))
1047 {
1048 fontname = Fdowncase (fontname);
1049 elt = Fcons (make_number (from), font_family_registry (fontname, 0));
1050 }
1051 else
1052 {
1053 CHECK_CONS (fontname);
1054 family = XCAR (fontname);
1055 registry = XCDR (fontname);
1056 if (!NILP (family))
1057 {
1058 CHECK_STRING (family);
1059 family = Fdowncase (family);
1060 }
1061 if (!NILP (registry))
1062 {
1063 CHECK_STRING (registry);
1064 registry = Fdowncase (registry);
1065 }
1066 elt = Fcons (make_number (from), Fcons (family, registry));
1067 }
1068
1069 /* The arg FRAME is kept for backward compatibility. We only check 1130 /* The arg FRAME is kept for backward compatibility. We only check
1070 the validity. */ 1131 the validity. */
1071 if (!NILP (frame)) 1132 if (!NILP (frame))
1072 CHECK_LIVE_FRAME (frame); 1133 CHECK_LIVE_FRAME (frame);
1073 1134
1135 elt = Fcons (make_number (from), regulalize_fontname (fontname));
1074 for (; from <= to; from++) 1136 for (; from <= to; from++)
1075 FONTSET_SET (fontset, from, elt); 1137 FONTSET_SET (fontset, from, elt);
1076 Foptimize_char_table (fontset); 1138 Foptimize_char_table (fontset);
@@ -1445,6 +1507,60 @@ DEFUN ("fontset-list", Ffontset_list, Sfontset_list, 0, 0, 0,
1445 return list; 1507 return list;
1446} 1508}
1447 1509
1510DEFUN ("set-overriding-fontspec-internal", Fset_overriding_fontspec_internal,
1511 Sset_overriding_fontspec_internal, 1, 1, 0,
1512 doc: /* Internal use only.
1513
1514FONTLIST is an alist of TARGET vs FONTNAME, where TARGET is a charset
1515or a char-table, FONTNAME have the same meanings as in
1516`set-fontset-font'.
1517
1518It overrides the font specifications for each TARGET in the default
1519fontset by the corresponding FONTNAME.
1520
1521If TARGET is a charset, targets are all characters in the charset. If
1522TARGET is a char-table, targets are characters whose value is non-nil
1523in the table.
1524
1525It is intended that this function is called only from
1526`set-language-environment'. */)
1527 (fontlist)
1528 Lisp_Object fontlist;
1529{
1530 Lisp_Object tail;
1531
1532 fontlist = Fcopy_sequence (fontlist);
1533 /* Now FONTLIST is ((TARGET . FONTNAME) ...). Reform it to ((TARGET
1534 nil nil nil FONTSPEC) ...), where TARGET is a charset-id or a
1535 char-table. */
1536 for (tail = fontlist; CONSP (tail); tail = XCDR (tail))
1537 {
1538 Lisp_Object elt, target;
1539
1540 elt = XCAR (tail);
1541 target = Fcar (elt);
1542 elt = Fcons (Qnil, regulalize_fontname (Fcdr (elt)));
1543 if (! CHAR_TABLE_P (target))
1544 {
1545 int charset, c;
1546
1547 CHECK_SYMBOL (target);
1548 charset = get_charset_id (target);
1549 if (charset < 0)
1550 error ("Invalid charset %s", SDATA (SYMBOL_NAME (target)));
1551 target = make_number (charset);
1552 c = MAKE_CHAR (charset, 0, 0);
1553 XSETCAR (elt, make_number (c));
1554 }
1555 elt = Fcons (target, Fcons (Qnil, Fcons (Qnil, elt)));
1556 XSETCAR (tail, elt);
1557 }
1558 Voverriding_fontspec_alist = fontlist;
1559 clear_face_cache (0);
1560 ++windows_or_buffers_changed;
1561 return Qnil;
1562}
1563
1448void 1564void
1449syms_of_fontset () 1565syms_of_fontset ()
1450{ 1566{
@@ -1483,6 +1599,9 @@ syms_of_fontset ()
1483 AREF (Vfontset_table, 0) = Vdefault_fontset; 1599 AREF (Vfontset_table, 0) = Vdefault_fontset;
1484 next_fontset_id = 1; 1600 next_fontset_id = 1;
1485 1601
1602 Voverriding_fontspec_alist = Qnil;
1603 staticpro (&Voverriding_fontspec_alist);
1604
1486 DEFVAR_LISP ("font-encoding-alist", &Vfont_encoding_alist, 1605 DEFVAR_LISP ("font-encoding-alist", &Vfont_encoding_alist,
1487 doc: /* Alist of fontname patterns vs corresponding encoding info. 1606 doc: /* Alist of fontname patterns vs corresponding encoding info.
1488Each element looks like (REGEXP . ENCODING-INFO), 1607Each element looks like (REGEXP . ENCODING-INFO),
@@ -1548,6 +1667,7 @@ at the vertical center of lines. */);
1548 defsubr (&Sfontset_info); 1667 defsubr (&Sfontset_info);
1549 defsubr (&Sfontset_font); 1668 defsubr (&Sfontset_font);
1550 defsubr (&Sfontset_list); 1669 defsubr (&Sfontset_list);
1670 defsubr (&Sset_overriding_fontspec_internal);
1551} 1671}
1552 1672
1553/* arch-tag: ea861585-2f5f-4e5b-9849-d04a9c3a3537 1673/* arch-tag: ea861585-2f5f-4e5b-9849-d04a9c3a3537
diff --git a/src/minibuf.c b/src/minibuf.c
index baeb0cef7b5..9a05a4d1ce0 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -189,7 +189,7 @@ choose_minibuf_frame_1 (ignore)
189DEFUN ("set-minibuffer-window", Fset_minibuffer_window, 189DEFUN ("set-minibuffer-window", Fset_minibuffer_window,
190 Sset_minibuffer_window, 1, 1, 0, 190 Sset_minibuffer_window, 1, 1, 0,
191 doc: /* Specify which minibuffer window to use for the minibuffer. 191 doc: /* Specify which minibuffer window to use for the minibuffer.
192This effects where the minibuffer is displayed if you put text in it 192This affects where the minibuffer is displayed if you put text in it
193without invoking the usual minibuffer commands. */) 193without invoking the usual minibuffer commands. */)
194 (window) 194 (window)
195 Lisp_Object window; 195 Lisp_Object window;
diff --git a/src/xfaces.c b/src/xfaces.c
index 84d49e30a9b..47f406d7012 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -2564,6 +2564,69 @@ x_face_list_fonts (f, pattern, pfonts, nfonts, try_alternatives_p)
2564} 2564}
2565 2565
2566 2566
2567/* Check if a font matching pattern_offset_t on frame F is available
2568 or not. PATTERN may be a cons (FAMILY . REGISTRY), in which case,
2569 a font name pattern is generated from FAMILY and REGISTRY. */
2570
2571int
2572face_font_available_p (f, pattern)
2573 struct frame *f;
2574 Lisp_Object pattern;
2575{
2576 Lisp_Object fonts;
2577
2578 if (! STRINGP (pattern))
2579 {
2580 Lisp_Object family, registry;
2581 char *family_str, *registry_str, *pattern_str;
2582
2583 CHECK_CONS (pattern);
2584 family = XCAR (pattern);
2585 if (NILP (family))
2586 family_str = "*";
2587 else
2588 {
2589 CHECK_STRING (family);
2590 family_str = (char *) SDATA (family);
2591 }
2592 registry = XCDR (pattern);
2593 if (NILP (registry))
2594 registry_str = "*";
2595 else
2596 {
2597 CHECK_STRING (registry);
2598 registry_str = (char *) SDATA (registry);
2599 }
2600
2601 pattern_str = (char *) alloca (strlen (family_str)
2602 + strlen (registry_str)
2603 + 10);
2604 strcpy (pattern_str, index (family_str, '-') ? "-" : "-*-");
2605 strcat (pattern_str, family_str);
2606 strcat (pattern_str, "-*-");
2607 strcat (pattern_str, registry_str);
2608 if (!index (registry_str, '-'))
2609 {
2610 if (registry_str[strlen (registry_str) - 1] == '*')
2611 strcat (pattern_str, "-*");
2612 else
2613 strcat (pattern_str, "*-*");
2614 }
2615 pattern = build_string (pattern_str);
2616 }
2617
2618 /* Get the list of fonts matching PATTERN. */
2619#ifdef WINDOWSNT
2620 BLOCK_INPUT;
2621 fonts = w32_list_fonts (f, pattern, 0, 1);
2622 UNBLOCK_INPUT;
2623#else
2624 fonts = x_list_fonts (f, pattern, -1, 1);
2625#endif
2626 return XINT (Flength (fonts));
2627}
2628
2629
2567/* Determine fonts matching PATTERN on frame F. Sort resulting fonts 2630/* Determine fonts matching PATTERN on frame F. Sort resulting fonts
2568 using comparison function CMPFN. Value is the number of fonts 2631 using comparison function CMPFN. Value is the number of fonts
2569 found. If value is non-zero, *FONTS is set to a vector of 2632 found. If value is non-zero, *FONTS is set to a vector of