aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2005-05-02 14:38:00 +0000
committerKaroly Lorentey2005-05-02 14:38:00 +0000
commit09a1444abb2494d0db3d71e4c942f5210786b619 (patch)
tree0fa0b9bb0d41ed6dea6cffc07681d931431704e7 /src
parent030cd69ff13d95f439ca0d13a03215fc45959789 (diff)
parentb21eabf6259ac5761aac04e68692384f2d23a5c3 (diff)
downloademacs-09a1444abb2494d0db3d71e4c942f5210786b619.tar.gz
emacs-09a1444abb2494d0db3d71e4c942f5210786b619.zip
Merged from miles@gnu.org--gnu-2005 (patch 281-285)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-281 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-282 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-283 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-284 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-285 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-336
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog51
-rw-r--r--src/data.c1
-rw-r--r--src/emacs.c5
-rw-r--r--src/eval.c9
-rw-r--r--src/fileio.c17
-rw-r--r--src/indent.c7
-rw-r--r--src/mac.c3
-rw-r--r--src/macfns.c7
-rw-r--r--src/macgui.h4
-rw-r--r--src/sysdep.c10
-rw-r--r--src/window.c20
-rw-r--r--src/xdisp.c2
-rw-r--r--src/xfaces.c48
13 files changed, 137 insertions, 47 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9fc43e0bd4a..47d24852a66 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,52 @@
12005-05-01 Thien-Thi Nguyen <ttn@gnu.org>
2
3 * sysdep.c (get_frame_size) [VMS]: Use a fresh i/o channel.
4
52005-04-30 Richard M. Stallman <rms@gnu.org>
6
7 * fileio.c (Ffind_file_name_handler): Handle the `operations'
8 property of the file name handler.
9 (Qoperations): New variable.
10 (syms_of_fileio): Initialize and staticpro it.
11
12 * xdisp.c (set_message_1): Delete xassert.
13
142005-04-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15
16 * mac.c: Don't include time.h. Include sysselect.h after
17 systime.h.
18
19 * macfns.c (Fx_server_version): Add BLOCK_INPUT around Gestalt.
20
21 * macgui.h [HAVE_CARBON && MAC_OSX]: Don't undefine/define mktime
22 before/after including Carbon.h if there is a working mktime.
23
242005-04-28 Kim F. Storm <storm@cua.dk>
25
26 * xfaces.c (resolve_face_name): Add arg SIGNAL_P. Calls changed.
27 Fix cyclic alias check. If alias loop is detected, signal
28 circular-list error if SIGNAL_P, and return Qdefault if !SIGNAL_P.
29
302005-04-28 Lute Kamstra <lute@gnu.org>
31
32 * eval.c (do_autoload): Record only autoloads in the autoload
33 property of symbols.
34
352005-04-28 Nick Roberts <nickrob@snap.net.nz>
36
37 * emacs.c (USAGE1): Add --basic-display and --quick options.
38
392005-04-27 Kim F. Storm <storm@cua.dk>
40
41 * data.c (syms_of_data) Staticpro Qcyclic_variable_indirection.
42
432005-04-26 Richard M. Stallman <rms@gnu.org>
44
45 * window.c (Fsame_window_p, Fspecial_display_p): Doc fixes.
46 (syms_of_window): Doc fixes.
47
48 * indent.c (Fvertical_motion): Undo previous change.
49
12005-04-26 Kenichi Handa <handa@m17n.org> 502005-04-26 Kenichi Handa <handa@m17n.org>
2 51
3 * fns.c (char_table_range): New function. 52 * fns.c (char_table_range): New function.
@@ -61,7 +110,7 @@
61 [USE_CARBON_EVENTS && MAC_OSX] (Qpreferences, Qservices, Qpaste) 110 [USE_CARBON_EVENTS && MAC_OSX] (Qpreferences, Qservices, Qpaste)
62 (Qperform): New variables. 111 (Qperform): New variables.
63 (syms_of_mac) [USE_CARBON_EVENTS && MAC_OSX]: Initialize them. 112 (syms_of_mac) [USE_CARBON_EVENTS && MAC_OSX]: Initialize them.
64 (do_get_menus) [!TARGET_API_MAC_CARBON]: Don't call AppendResMenu. 113 (do_get_menus) [TARGET_API_MAC_CARBON]: Don't call AppendResMenu.
65 (do_menu_choice): Unhighlight menu bar also when menu_id is 0. 114 (do_menu_choice): Unhighlight menu bar also when menu_id is 0.
66 (mac_store_application_menu_event, init_menu_bar): New functions. 115 (mac_store_application_menu_event, init_menu_bar): New functions.
67 [USE_CARBON_EVENTS] (mac_handle_command_event) 116 [USE_CARBON_EVENTS] (mac_handle_command_event)
diff --git a/src/data.c b/src/data.c
index f6285320315..7bbb45ae043 100644
--- a/src/data.c
+++ b/src/data.c
@@ -3181,6 +3181,7 @@ syms_of_data ()
3181 staticpro (&Qargs_out_of_range); 3181 staticpro (&Qargs_out_of_range);
3182 staticpro (&Qvoid_function); 3182 staticpro (&Qvoid_function);
3183 staticpro (&Qcyclic_function_indirection); 3183 staticpro (&Qcyclic_function_indirection);
3184 staticpro (&Qcyclic_variable_indirection);
3184 staticpro (&Qvoid_variable); 3185 staticpro (&Qvoid_variable);
3185 staticpro (&Qsetting_constant); 3186 staticpro (&Qsetting_constant);
3186 staticpro (&Qinvalid_read_syntax); 3187 staticpro (&Qinvalid_read_syntax);
diff --git a/src/emacs.c b/src/emacs.c
index 1a6f323ed06..c084f61fd07 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -265,7 +265,8 @@ Initialization options:\n\
265--no-shared-memory, -nl do not use shared memory\n\ 265--no-shared-memory, -nl do not use shared memory\n\
266--no-site-file do not load site-start.el\n\ 266--no-site-file do not load site-start.el\n\
267--no-splash do not display a splash screen on startup\n\ 267--no-splash do not display a splash screen on startup\n\
268--no-window-system, -nw don't communicate with X, ignoring $DISPLAY\n\ 268--no-window-system, -nw do not communicate with X, ignoring $DISPLAY\n\
269--quick, -Q equivalent to -q --no-site-file\n\
269--script FILE run FILE as an Emacs Lisp script\n\ 270--script FILE run FILE as an Emacs Lisp script\n\
270--terminal, -t DEVICE use DEVICE for terminal I/O\n\ 271--terminal, -t DEVICE use DEVICE for terminal I/O\n\
271--unibyte, --no-multibyte run Emacs in unibyte mode\n\ 272--unibyte, --no-multibyte run Emacs in unibyte mode\n\
@@ -295,6 +296,8 @@ FILE visit FILE using find-file\n\
295Display options:\n\ 296Display options:\n\
296\n\ 297\n\
297--background-color, -bg COLOR window background color\n\ 298--background-color, -bg COLOR window background color\n\
299--basic-display, -D disable many display features;\n\
300 used for debugging Emacs\n\
298--border-color, -bd COLOR main border color\n\ 301--border-color, -bd COLOR main border color\n\
299--border-width, -bw WIDTH width of main border\n\ 302--border-width, -bw WIDTH width of main border\n\
300--color, --color=MODE color mode for character terminals;\n\ 303--color, --color=MODE color mode for character terminals;\n\
diff --git a/src/eval.c b/src/eval.c
index 8700ca222ce..6832f3197ad 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1,6 +1,6 @@
1/* Evaluator for GNU Emacs Lisp interpreter. 1/* Evaluator for GNU Emacs Lisp interpreter.
2 Copyright (C) 1985, 86, 87, 93, 94, 95, 99, 2000, 2001, 02, 2004 2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1999, 2000, 2001,
3 Free Software Foundation, Inc. 3 2002, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -1982,10 +1982,7 @@ do_autoload (fundef, funname)
1982 second = Fcdr (first); 1982 second = Fcdr (first);
1983 first = Fcar (first); 1983 first = Fcar (first);
1984 1984
1985 /* Note: This test is subtle. The cdr of an autoload-queue entry 1985 if (CONSP (second) && EQ (XCAR (second), Qautoload))
1986 may be an atom if the autoload entry was generated by a defalias
1987 or fset. */
1988 if (CONSP (second))
1989 Fput (first, Qautoload, (XCDR (second))); 1986 Fput (first, Qautoload, (XCDR (second)));
1990 1987
1991 queue = XCDR (queue); 1988 queue = XCDR (queue);
diff --git a/src/fileio.c b/src/fileio.c
index 340a8a36cfd..d8a0a5a729f 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -177,6 +177,10 @@ Lisp_Object Vdefault_file_name_coding_system;
177 whose I/O is done with a special handler. */ 177 whose I/O is done with a special handler. */
178Lisp_Object Vfile_name_handler_alist; 178Lisp_Object Vfile_name_handler_alist;
179 179
180/* Property name of a file name handler,
181 which gives a list of operations it handles.. */
182Lisp_Object Qoperations;
183
180/* Lisp functions for translating file formats */ 184/* Lisp functions for translating file formats */
181Lisp_Object Qformat_decode, Qformat_annotate_function; 185Lisp_Object Qformat_decode, Qformat_annotate_function;
182 186
@@ -368,13 +372,16 @@ use the standard functions without calling themselves recursively. */)
368 elt = XCAR (chain); 372 elt = XCAR (chain);
369 if (CONSP (elt)) 373 if (CONSP (elt))
370 { 374 {
371 Lisp_Object string; 375 Lisp_Object string = XCAR (elt);
372 int match_pos; 376 int match_pos;
373 string = XCAR (elt); 377 Lisp_Object handler = XCDR (elt);
378 Lisp_Object operations = Fget (handler, Qoperations);
379
374 if (STRINGP (string) 380 if (STRINGP (string)
375 && (match_pos = fast_string_match (string, filename)) > pos) 381 && (match_pos = fast_string_match (string, filename)) > pos
382 && (NILP (operations) || ! NILP (Fmemq (operation, operations))))
376 { 383 {
377 Lisp_Object handler, tem; 384 Lisp_Object tem;
378 385
379 handler = XCDR (elt); 386 handler = XCDR (elt);
380 tem = Fmemq (handler, inhibited_handlers); 387 tem = Fmemq (handler, inhibited_handlers);
@@ -6439,6 +6446,7 @@ init_fileio_once ()
6439void 6446void
6440syms_of_fileio () 6447syms_of_fileio ()
6441{ 6448{
6449 Qoperations = intern ("operations");
6442 Qexpand_file_name = intern ("expand-file-name"); 6450 Qexpand_file_name = intern ("expand-file-name");
6443 Qsubstitute_in_file_name = intern ("substitute-in-file-name"); 6451 Qsubstitute_in_file_name = intern ("substitute-in-file-name");
6444 Qdirectory_file_name = intern ("directory-file-name"); 6452 Qdirectory_file_name = intern ("directory-file-name");
@@ -6473,6 +6481,7 @@ syms_of_fileio ()
6473 Qset_visited_file_modtime = intern ("set-visited-file-modtime"); 6481 Qset_visited_file_modtime = intern ("set-visited-file-modtime");
6474 Qauto_save_coding = intern ("auto-save-coding"); 6482 Qauto_save_coding = intern ("auto-save-coding");
6475 6483
6484 staticpro (&Qoperations);
6476 staticpro (&Qexpand_file_name); 6485 staticpro (&Qexpand_file_name);
6477 staticpro (&Qsubstitute_in_file_name); 6486 staticpro (&Qsubstitute_in_file_name);
6478 staticpro (&Qdirectory_file_name); 6487 staticpro (&Qdirectory_file_name);
diff --git a/src/indent.c b/src/indent.c
index d6709d56ee8..39602c60d16 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -67,8 +67,6 @@ static double position_indentation P_ ((int));
67 67
68int current_column_bol_cache; 68int current_column_bol_cache;
69 69
70extern Lisp_Object Qfontification_functions;
71
72/* Get the display table to use for the current buffer. */ 70/* Get the display table to use for the current buffer. */
73 71
74struct Lisp_Char_Table * 72struct Lisp_Char_Table *
@@ -2051,7 +2049,6 @@ whether or not it is currently displayed in some window. */)
2051 struct window *w; 2049 struct window *w;
2052 Lisp_Object old_buffer; 2050 Lisp_Object old_buffer;
2053 struct gcpro gcpro1; 2051 struct gcpro gcpro1;
2054 int count = SPECPDL_INDEX ();
2055 2052
2056 CHECK_NUMBER (lines); 2053 CHECK_NUMBER (lines);
2057 if (! NILP (window)) 2054 if (! NILP (window))
@@ -2069,9 +2066,6 @@ whether or not it is currently displayed in some window. */)
2069 XSETBUFFER (w->buffer, current_buffer); 2066 XSETBUFFER (w->buffer, current_buffer);
2070 } 2067 }
2071 2068
2072 /* Don't fontify text that we just move across. */
2073 specbind (Qfontification_functions, Qnil);
2074
2075 if (noninteractive) 2069 if (noninteractive)
2076 { 2070 {
2077 struct position pos; 2071 struct position pos;
@@ -2117,7 +2111,6 @@ whether or not it is currently displayed in some window. */)
2117 if (BUFFERP (old_buffer)) 2111 if (BUFFERP (old_buffer))
2118 w->buffer = old_buffer; 2112 w->buffer = old_buffer;
2119 2113
2120 unbind_to (count, Qnil);
2121 RETURN_UNGCPRO (make_number (it.vpos)); 2114 RETURN_UNGCPRO (make_number (it.vpos));
2122} 2115}
2123 2116
diff --git a/src/mac.c b/src/mac.c
index 0a1b94eb2c5..e9930ada151 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -24,12 +24,11 @@ Boston, MA 02111-1307, USA. */
24 24
25#include <stdio.h> 25#include <stdio.h>
26#include <errno.h> 26#include <errno.h>
27#include <time.h>
28 27
29#include "lisp.h" 28#include "lisp.h"
30#include "process.h" 29#include "process.h"
31#include "sysselect.h"
32#include "systime.h" 30#include "systime.h"
31#include "sysselect.h"
33#include "blockinput.h" 32#include "blockinput.h"
34 33
35#include "macterm.h" 34#include "macterm.h"
diff --git a/src/macfns.c b/src/macfns.c
index b85c4f01795..a8b685582d5 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -2969,8 +2969,13 @@ If omitted or nil, that stands for the selected frame's display. */)
2969{ 2969{
2970 int mac_major_version; 2970 int mac_major_version;
2971 SInt32 response; 2971 SInt32 response;
2972 OSErr err;
2972 2973
2973 if (Gestalt (gestaltSystemVersion, &response) != noErr) 2974 BLOCK_INPUT;
2975 err = Gestalt (gestaltSystemVersion, &response);
2976 UNBLOCK_INPUT;
2977
2978 if (err != noErr)
2974 error ("Cannot get Mac OS version"); 2979 error ("Cannot get Mac OS version");
2975 2980
2976 mac_major_version = (response >> 8) & 0xff; 2981 mac_major_version = (response >> 8) & 0xff;
diff --git a/src/macgui.h b/src/macgui.h
index 5d4f1894e2e..939496aaeef 100644
--- a/src/macgui.h
+++ b/src/macgui.h
@@ -32,7 +32,9 @@ typedef unsigned long Time;
32#ifdef HAVE_CARBON 32#ifdef HAVE_CARBON
33#undef Z 33#undef Z
34#ifdef MAC_OSX 34#ifdef MAC_OSX
35#if ! HAVE_MKTIME || BROKEN_MKTIME
35#undef mktime 36#undef mktime
37#endif
36#undef DEBUG 38#undef DEBUG
37#undef free 39#undef free
38#undef malloc 40#undef malloc
@@ -43,8 +45,10 @@ typedef unsigned long Time;
43#undef min 45#undef min
44#undef init_process 46#undef init_process
45#include <Carbon/Carbon.h> 47#include <Carbon/Carbon.h>
48#if ! HAVE_MKTIME || BROKEN_MKTIME
46#undef mktime 49#undef mktime
47#define mktime emacs_mktime 50#define mktime emacs_mktime
51#endif
48#undef free 52#undef free
49#define free unexec_free 53#define free unexec_free
50#undef malloc 54#undef malloc
diff --git a/src/sysdep.c b/src/sysdep.c
index 706f0e1305e..4127517b98f 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1793,10 +1793,16 @@ get_tty_size (int fd, int *widthp, int *heightp)
1793#else 1793#else
1794#ifdef VMS 1794#ifdef VMS
1795 1795
1796 /* Use a fresh channel since the current one may have stale info
1797 (for example, from prior to a suspend); and to avoid a dependency
1798 in the init sequence. */
1799 int chan;
1796 struct sensemode tty; 1800 struct sensemode tty;
1797 1801
1798 SYS$QIOW (0, fd, IO$_SENSEMODE, &tty, 0, 0, 1802 SYS$ASSIGN (&input_dsc, &chan, 0, 0);
1799 &tty.class, 12, 0, 0, 0, 0); 1803 SYS$QIOW (0, chan, IO$_SENSEMODE, &tty, 0, 0,
1804 &tty.class, 12, 0, 0, 0, 0);
1805 SYS$DASSGN (chan);
1800 *widthp = tty.scr_wid; 1806 *widthp = tty.scr_wid;
1801 *heightp = tty.scr_len; 1807 *heightp = tty.scr_len;
1802 1808
diff --git a/src/window.c b/src/window.c
index ed177693e53..67cbd73bc50 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3265,9 +3265,10 @@ display_buffer_1 (window)
3265 3265
3266DEFUN ("special-display-p", Fspecial_display_p, Sspecial_display_p, 1, 1, 0, 3266DEFUN ("special-display-p", Fspecial_display_p, Sspecial_display_p, 1, 1, 0,
3267 doc: /* Returns non-nil if a buffer named BUFFER-NAME gets a special frame. 3267 doc: /* Returns non-nil if a buffer named BUFFER-NAME gets a special frame.
3268If the value is t, a frame would be created for that buffer 3268If the value is t, `display-buffer' or `pop-to-buffer' would create a
3269using the default frame parameters. If the value is a list, 3269special frame for that buffer using the default frame parameters.
3270it is a list of frame parameters that would be used 3270
3271If the value is a list, it is a list of frame parameters that would be used
3271to make a frame for that buffer. 3272to make a frame for that buffer.
3272The variables `special-display-buffer-names' 3273The variables `special-display-buffer-names'
3273and `special-display-regexps' control this. */) 3274and `special-display-regexps' control this. */)
@@ -3301,7 +3302,9 @@ and `special-display-regexps' control this. */)
3301} 3302}
3302 3303
3303DEFUN ("same-window-p", Fsame_window_p, Ssame_window_p, 1, 1, 0, 3304DEFUN ("same-window-p", Fsame_window_p, Ssame_window_p, 1, 1, 0,
3304 doc: /* Returns non-nil if a new buffer named BUFFER-NAME would use the same window. 3305 doc: /* Returns non-nil if a buffer named BUFFER-NAME would use the same window.
3306More precisely, if `display-buffer' or `pop-to-buffer' would display
3307that buffer in the selected window rather than (as usual) in some other window.
3305See `same-window-buffer-names' and `same-window-regexps'. */) 3308See `same-window-buffer-names' and `same-window-regexps'. */)
3306 (buffer_name) 3309 (buffer_name)
3307 Lisp_Object buffer_name; 3310 Lisp_Object buffer_name;
@@ -6750,7 +6753,8 @@ where `pop-up-frame-alist' would hold the default frame parameters. */);
6750 6753
6751 DEFVAR_LISP ("special-display-buffer-names", &Vspecial_display_buffer_names, 6754 DEFVAR_LISP ("special-display-buffer-names", &Vspecial_display_buffer_names,
6752 doc: /* *List of buffer names that should have their own special frames. 6755 doc: /* *List of buffer names that should have their own special frames.
6753Displaying a buffer whose name is in this list makes a special frame for it 6756Displaying a buffer with `display-buffer' or `pop-to-buffer',
6757if its name is in this list, makes a special frame for it
6754using `special-display-function'. See also `special-display-regexps'. 6758using `special-display-function'. See also `special-display-regexps'.
6755 6759
6756An element of the list can be a list instead of just a string. 6760An element of the list can be a list instead of just a string.
@@ -6775,9 +6779,9 @@ Those variables take precedence over this one. */);
6775 6779
6776 DEFVAR_LISP ("special-display-regexps", &Vspecial_display_regexps, 6780 DEFVAR_LISP ("special-display-regexps", &Vspecial_display_regexps,
6777 doc: /* *List of regexps saying which buffers should have their own special frames. 6781 doc: /* *List of regexps saying which buffers should have their own special frames.
6778If a buffer name matches one of these regexps, it gets its own frame. 6782When displaying a buffer with `display-buffer' or `pop-to-buffer',
6779Displaying a buffer whose name is in this list makes a special frame for it 6783if any regexp in this list matches the buffer name, it makes a
6780using `special-display-function'. 6784special frame for the buffer by calling `special-display-function'.
6781 6785
6782An element of the list can be a list instead of just a string. 6786An element of the list can be a list instead of just a string.
6783There are two ways to use a list as an element: 6787There are two ways to use a list as an element:
diff --git a/src/xdisp.c b/src/xdisp.c
index 9c15313efa3..288b6356b49 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -7901,8 +7901,6 @@ set_message_1 (a1, a2, nbytes, multibyte_p)
7901 const char *s = (const char *) a1; 7901 const char *s = (const char *) a1;
7902 Lisp_Object string = a2; 7902 Lisp_Object string = a2;
7903 7903
7904 xassert (BEG == Z);
7905
7906 /* Change multibyteness of the echo buffer appropriately. */ 7904 /* Change multibyteness of the echo buffer appropriately. */
7907 if (message_enable_multibyte 7905 if (message_enable_multibyte
7908 != !NILP (current_buffer->enable_multibyte_characters)) 7906 != !NILP (current_buffer->enable_multibyte_characters))
diff --git a/src/xfaces.c b/src/xfaces.c
index 1960e72b710..2884bccb3b9 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -336,6 +336,8 @@ extern Lisp_Object Qmode_line;
336 336
337Lisp_Object Qface_alias; 337Lisp_Object Qface_alias;
338 338
339extern Lisp_Object Qcircular_list;
340
339/* Default stipple pattern used on monochrome displays. This stipple 341/* Default stipple pattern used on monochrome displays. This stipple
340 pattern is used on monochrome displays instead of shades of gray 342 pattern is used on monochrome displays instead of shades of gray
341 for a face background color. See `set-face-stipple' for possible 343 for a face background color. See `set-face-stipple' for possible
@@ -471,7 +473,7 @@ struct named_merge_point;
471 473
472static void map_tty_color P_ ((struct frame *, struct face *, 474static void map_tty_color P_ ((struct frame *, struct face *,
473 enum lface_attribute_index, int *)); 475 enum lface_attribute_index, int *));
474static Lisp_Object resolve_face_name P_ ((Lisp_Object)); 476static Lisp_Object resolve_face_name P_ ((Lisp_Object, int));
475static int may_use_scalable_font_p P_ ((const char *)); 477static int may_use_scalable_font_p P_ ((const char *));
476static void set_font_frame_param P_ ((Lisp_Object, Lisp_Object)); 478static void set_font_frame_param P_ ((Lisp_Object, Lisp_Object));
477static int better_font_p P_ ((int *, struct font_name *, struct font_name *, 479static int better_font_p P_ ((int *, struct font_name *, struct font_name *,
@@ -3220,27 +3222,47 @@ resolve_face_name_error (ignore)
3220} 3222}
3221 3223
3222/* Resolve face name FACE_NAME. If FACE_NAME is a string, intern it 3224/* Resolve face name FACE_NAME. If FACE_NAME is a string, intern it
3223 to make it a symvol. If FACE_NAME is an alias for another face, 3225 to make it a symbol. If FACE_NAME is an alias for another face,
3224 return that face's name. */ 3226 return that face's name.
3227
3228 Return default face in case of errors. */
3225 3229
3226static Lisp_Object 3230static Lisp_Object
3227resolve_face_name (face_name) 3231resolve_face_name (face_name, signal_p)
3228 Lisp_Object face_name; 3232 Lisp_Object face_name;
3233 int signal_p;
3229{ 3234{
3230 Lisp_Object aliased; 3235 Lisp_Object orig_face;
3231 int alias_loop_max = 10; 3236 Lisp_Object tortoise, hare;
3232 3237
3233 if (STRINGP (face_name)) 3238 if (STRINGP (face_name))
3234 face_name = intern (SDATA (face_name)); 3239 face_name = intern (SDATA (face_name));
3235 3240
3236 while (SYMBOLP (face_name)) 3241 if (NILP (face_name) || !SYMBOLP (face_name))
3242 return face_name;
3243
3244 orig_face = face_name;
3245 tortoise = hare = face_name;
3246
3247 while (1)
3237 { 3248 {
3238 aliased = Fget (face_name, Qface_alias); 3249 face_name = hare;
3239 if (NILP (aliased)) 3250 hare = Fget (hare, Qface_alias);
3251 if (NILP (hare) || !SYMBOLP (hare))
3240 break; 3252 break;
3241 if (--alias_loop_max == 0) 3253
3254 face_name = hare;
3255 hare = Fget (hare, Qface_alias);
3256 if (NILP (hare) || !SYMBOLP (hare))
3242 break; 3257 break;
3243 face_name = aliased; 3258
3259 tortoise = Fget (tortoise, Qface_alias);
3260 if (EQ (hare, tortoise))
3261 {
3262 if (signal_p)
3263 Fsignal (Qcircular_list, Fcons (orig_face, Qnil));
3264 return Qdefault;
3265 }
3244 } 3266 }
3245 3267
3246 return face_name; 3268 return face_name;
@@ -3264,7 +3286,7 @@ lface_from_face_name (f, face_name, signal_p)
3264{ 3286{
3265 Lisp_Object lface; 3287 Lisp_Object lface;
3266 3288
3267 face_name = resolve_face_name (face_name); 3289 face_name = resolve_face_name (face_name, signal_p);
3268 3290
3269 if (f) 3291 if (f)
3270 lface = assq_no_quit (face_name, f->face_alist); 3292 lface = assq_no_quit (face_name, f->face_alist);
@@ -3999,7 +4021,7 @@ FRAME 0 means change the face on all frames, and change the default
3999 CHECK_SYMBOL (face); 4021 CHECK_SYMBOL (face);
4000 CHECK_SYMBOL (attr); 4022 CHECK_SYMBOL (attr);
4001 4023
4002 face = resolve_face_name (face); 4024 face = resolve_face_name (face, 1);
4003 4025
4004 /* If FRAME is 0, change face on all frames, and change the 4026 /* If FRAME is 0, change face on all frames, and change the
4005 default for new frames. */ 4027 default for new frames. */