diff options
| author | Sam Steingold | 2000-07-14 20:29:04 +0000 |
|---|---|---|
| committer | Sam Steingold | 2000-07-14 20:29:04 +0000 |
| commit | 178c5d9c65da7c156e1f1263b54f339ef7db0d80 (patch) | |
| tree | 7cb1b66bc866a65c14f011ea06ee94f7f76f947c | |
| parent | e5acf0cab8a1fc29f7f1ace0b261067a329b28a1 (diff) | |
| download | emacs-178c5d9c65da7c156e1f1263b54f339ef7db0d80.tar.gz emacs-178c5d9c65da7c156e1f1263b54f339ef7db0d80.zip | |
check default_face before dereferencing
| -rw-r--r-- | src/ChangeLog | 47 | ||||
| -rw-r--r-- | src/xfaces.c | 386 |
2 files changed, 219 insertions, 214 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c3901a758e9..3ccc751a414 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2000-07-14 Sam Steingold <sds@gnu.org> | ||
| 2 | |||
| 3 | * xfaces.c (realize_x_face): Fix the last patch: | ||
| 4 | check `default_face' before dereferencing. | ||
| 5 | |||
| 1 | 2000-07-14 Dave Love <fx@gnu.org> | 6 | 2000-07-14 Dave Love <fx@gnu.org> |
| 2 | 7 | ||
| 3 | * syntax.c (back_comment): Add null default in switch for pcc. | 8 | * syntax.c (back_comment): Add null default in switch for pcc. |
| @@ -5,7 +10,7 @@ | |||
| 5 | 2000-07-14 Kenichi Handa <handa@etl.go.jp> | 10 | 2000-07-14 Kenichi Handa <handa@etl.go.jp> |
| 6 | 11 | ||
| 7 | * xfaces.c (realize_x_face): Make fontset using the base of the | 12 | * xfaces.c (realize_x_face): Make fontset using the base of the |
| 8 | default'face's fontset, not using the default fontset. | 13 | default_face's fontset, not using the default fontset. |
| 9 | 14 | ||
| 10 | * coding.c (inhibit_iso_escape_detection): New variable. | 15 | * coding.c (inhibit_iso_escape_detection): New variable. |
| 11 | (syms_of_coding): Make it a Lisp variable. | 16 | (syms_of_coding): Make it a Lisp variable. |
| @@ -29,7 +34,7 @@ | |||
| 29 | (kbd_buffer_get_event): Construct the Lisp help-event differently. | 34 | (kbd_buffer_get_event): Construct the Lisp help-event differently. |
| 30 | (read_char): Call show_help_echo with new parameters. | 35 | (read_char): Call show_help_echo with new parameters. |
| 31 | 36 | ||
| 32 | * keyboard.h (gen_help_event, kbd_buffer_store_help_event): | 37 | * keyboard.h (gen_help_event, kbd_buffer_store_help_event): |
| 33 | Add prototypes. | 38 | Add prototypes. |
| 34 | 39 | ||
| 35 | * xterm.c (help_echo_object, help_echo_pos): New variables. | 40 | * xterm.c (help_echo_object, help_echo_pos): New variables. |
| @@ -132,7 +137,7 @@ | |||
| 132 | * fontset.c (AREF, ASIZE): Remove definitions. | 137 | * fontset.c (AREF, ASIZE): Remove definitions. |
| 133 | 138 | ||
| 134 | * fns.c (AREF): Remove definition. | 139 | * fns.c (AREF): Remove definition. |
| 135 | 140 | ||
| 136 | * composite.c (AREF): Remove definition. | 141 | * composite.c (AREF): Remove definition. |
| 137 | 142 | ||
| 138 | 2000-07-12 Gerd Moellmann <gerd@gnu.org> | 143 | 2000-07-12 Gerd Moellmann <gerd@gnu.org> |
| @@ -243,7 +248,7 @@ | |||
| 243 | 2000-07-06 Gerd Moellmann <gerd@gnu.org> | 248 | 2000-07-06 Gerd Moellmann <gerd@gnu.org> |
| 244 | 249 | ||
| 245 | * window.c (window_loop): Add missing gcpro1 local variable. | 250 | * window.c (window_loop): Add missing gcpro1 local variable. |
| 246 | 251 | ||
| 247 | * window.c (Fwindow_list): Reverse list at the end. | 252 | * window.c (Fwindow_list): Reverse list at the end. |
| 248 | (candidate_window_p): Add parameter OWINDOW. ALL_FRAMES nil | 253 | (candidate_window_p): Add parameter OWINDOW. ALL_FRAMES nil |
| 249 | means allow windows on OWINDOW's frame, only. | 254 | means allow windows on OWINDOW's frame, only. |
| @@ -260,7 +265,7 @@ | |||
| 260 | (Fsignal): Abort if handling_signal is non-zero. | 265 | (Fsignal): Abort if handling_signal is non-zero. |
| 261 | 266 | ||
| 262 | * lisp.h (handling_signal): External declaration. | 267 | * lisp.h (handling_signal): External declaration. |
| 263 | 268 | ||
| 264 | * s/freebsd.h (WAITTYPE, WRETCODE): Put in #if 0. | 269 | * s/freebsd.h (WAITTYPE, WRETCODE): Put in #if 0. |
| 265 | 270 | ||
| 266 | 2000-07-05 Ken Raeburn <raeburn@gnu.org> | 271 | 2000-07-05 Ken Raeburn <raeburn@gnu.org> |
| @@ -293,7 +298,7 @@ | |||
| 293 | * syswait.h: Use the autoconf recommended approach. Old code | 298 | * syswait.h: Use the autoconf recommended approach. Old code |
| 294 | #if'd out in case we need to revert. | 299 | #if'd out in case we need to revert. |
| 295 | 300 | ||
| 296 | * config.in (HAVE_SYS_WAIT_H): Added. | 301 | * config.in (HAVE_SYS_WAIT_H): Added. |
| 297 | 302 | ||
| 298 | 2000-07-05 Andrew Innes <andrewi@gnu.org> | 303 | 2000-07-05 Andrew Innes <andrewi@gnu.org> |
| 299 | 304 | ||
| @@ -333,9 +338,9 @@ | |||
| 333 | (read_char): Use it. | 338 | (read_char): Use it. |
| 334 | (follow_key): Pass `autoload' to get_keyelt. | 339 | (follow_key): Pass `autoload' to get_keyelt. |
| 335 | 340 | ||
| 336 | * xterm.c (note_mode_line_highlight, note_mouse_highlight) | 341 | * xterm.c (note_mode_line_highlight, note_mouse_highlight) |
| 337 | (note_tool_bar_highlight, XTread_socket): | 342 | (note_tool_bar_highlight, XTread_socket): |
| 338 | * msdos.c (IT_note_mode_line_highlight, IT_note_mouse_highlight) | 343 | * msdos.c (IT_note_mode_line_highlight, IT_note_mouse_highlight) |
| 339 | (dos_rawgetc): | 344 | (dos_rawgetc): |
| 340 | * w32term.c (note_mode_line_highlight, note_mouse_highlight) | 345 | * w32term.c (note_mode_line_highlight, note_mouse_highlight) |
| 341 | (note_tool_bar_highlight, w32_read_socket): | 346 | (note_tool_bar_highlight, w32_read_socket): |
| @@ -359,7 +364,7 @@ | |||
| 359 | similar. | 364 | similar. |
| 360 | 365 | ||
| 361 | * dispnew.c (clear_glyph_row): Add debug code in #if 0. | 366 | * dispnew.c (clear_glyph_row): Add debug code in #if 0. |
| 362 | 367 | ||
| 363 | * dispextern.h: Add some comments. | 368 | * dispextern.h: Add some comments. |
| 364 | 369 | ||
| 365 | * window.c (add_window_to_list): Add parameter LIST. | 370 | * window.c (add_window_to_list): Add parameter LIST. |
| @@ -411,7 +416,7 @@ | |||
| 411 | 416 | ||
| 412 | * m/macppc.h (LINKER, LD_SWITCH_MACHINE) [LINUX]: Define. | 417 | * m/macppc.h (LINKER, LD_SWITCH_MACHINE) [LINUX]: Define. |
| 413 | 418 | ||
| 414 | * fns.c (sweep_weak_table): Mark only objects that are not | 419 | * fns.c (sweep_weak_table): Mark only objects that are not |
| 415 | marked already. | 420 | marked already. |
| 416 | 421 | ||
| 417 | * frame.c (next_frame, prev_frame): If MINIBUF is a window, | 422 | * frame.c (next_frame, prev_frame): If MINIBUF is a window, |
| @@ -482,7 +487,7 @@ | |||
| 482 | 487 | ||
| 483 | 2000-06-26 Gerd Moellmann <gerd@gnu.org> | 488 | 2000-06-26 Gerd Moellmann <gerd@gnu.org> |
| 484 | 489 | ||
| 485 | * xterm.c (xim_initialize) [!USE_XIM]: Don't set up the | 490 | * xterm.c (xim_initialize) [!USE_XIM]: Don't set up the |
| 486 | display info for XIM. | 491 | display info for XIM. |
| 487 | (xim_open_dpy): Likewise. | 492 | (xim_open_dpy): Likewise. |
| 488 | (xim_close_dpy): Don't free the display info's XIM. | 493 | (xim_close_dpy): Don't free the display info's XIM. |
| @@ -581,13 +586,13 @@ | |||
| 581 | * xrdb.c (x_load_resources): Add default resource for scroll bar's | 586 | * xrdb.c (x_load_resources): Add default resource for scroll bar's |
| 582 | trough color and main window's background color. | 587 | trough color and main window's background color. |
| 583 | 588 | ||
| 584 | * xfns.c (Fx_file_dialog) [HAVE_MOTIF_2_1]: Handle events | 589 | * xfns.c (Fx_file_dialog) [HAVE_MOTIF_2_1]: Handle events |
| 585 | differently. | 590 | differently. |
| 586 | 591 | ||
| 587 | * xterm.h (Xt_app_con): External declaration. | 592 | * xterm.h (Xt_app_con): External declaration. |
| 588 | 593 | ||
| 589 | * widget.c (EmacsFrameRealize): Fix typo. | 594 | * widget.c (EmacsFrameRealize): Fix typo. |
| 590 | 595 | ||
| 591 | * widget.c (EmacsFrameRealize): Remove SubstructureRedirectMask. | 596 | * widget.c (EmacsFrameRealize): Remove SubstructureRedirectMask. |
| 592 | 597 | ||
| 593 | * xdisp.c (handle_stop): Initialize it->add_overlay_start to zero. | 598 | * xdisp.c (handle_stop): Initialize it->add_overlay_start to zero. |
| @@ -619,7 +624,7 @@ | |||
| 619 | 624 | ||
| 620 | 2000-06-21 Dave Love <fx@gnu.org> | 625 | 2000-06-21 Dave Love <fx@gnu.org> |
| 621 | 626 | ||
| 622 | * Makefile.in (GETLOADAVG_OBJ): Removed -- LIBOBJS does it. | 627 | * Makefile.in (GETLOADAVG_OBJ): Removed -- LIBOBJS does it. |
| 623 | 628 | ||
| 624 | 2000-06-21 Stefan Monnier <monnier@cs.yale.edu> | 629 | 2000-06-21 Stefan Monnier <monnier@cs.yale.edu> |
| 625 | 630 | ||
| @@ -651,7 +656,7 @@ | |||
| 651 | * fns.c (make_hash_table, maybe_resize_hash_table): | 656 | * fns.c (make_hash_table, maybe_resize_hash_table): |
| 652 | Cast arg of next_almost_prime. | 657 | Cast arg of next_almost_prime. |
| 653 | 658 | ||
| 654 | * tparam.c [emacs]: Include lisp.h. | 659 | * tparam.c [emacs]: Include lisp.h. |
| 655 | 660 | ||
| 656 | * termcap.c [emacs]: Test HAVE_FCNTL_H, not USG5. Include lisp.h | 661 | * termcap.c [emacs]: Test HAVE_FCNTL_H, not USG5. Include lisp.h |
| 657 | and unistd.h. | 662 | and unistd.h. |
| @@ -662,13 +667,13 @@ | |||
| 662 | property should be treated as intangible by looking at its | 667 | property should be treated as intangible by looking at its |
| 663 | value. | 668 | value. |
| 664 | 669 | ||
| 665 | * xdisp.c (single_display_prop_intangible_p) | 670 | * xdisp.c (single_display_prop_intangible_p) |
| 666 | (display_prop_intangible_p): New functions. | 671 | (display_prop_intangible_p): New functions. |
| 667 | 672 | ||
| 668 | * dispextern.h (display_prop_intangible_p): Add prototype. | 673 | * dispextern.h (display_prop_intangible_p): Add prototype. |
| 669 | 674 | ||
| 670 | * xdisp.c (dump_glyph_row): Show type of glyph->object. | 675 | * xdisp.c (dump_glyph_row): Show type of glyph->object. |
| 671 | 676 | ||
| 672 | * s/isc4-0.h (sigblock): Redefined to pass a pointer as second | 677 | * s/isc4-0.h (sigblock): Redefined to pass a pointer as second |
| 673 | argument to sigprocmask. | 678 | argument to sigprocmask. |
| 674 | 679 | ||
| @@ -12485,7 +12490,7 @@ Sun Jan 3 08:41:10 1999 Masatake Yamato <masata-y@is.aist-nara.ac.jp> | |||
| 12485 | 12490 | ||
| 12486 | The first line of the following paragraph was garbled for an | 12491 | The first line of the following paragraph was garbled for an |
| 12487 | unknown reason. It couldn't be fully reconstructed. | 12492 | unknown reason. It couldn't be fully reconstructed. |
| 12488 | 12493 | ||
| 12489 | * xterm.c (XTread_socket, XTset_terminal_window): Ditto. | 12494 | * xterm.c (XTread_socket, XTset_terminal_window): Ditto. |
| 12490 | (x_lower_frame): Ditto. | 12495 | (x_lower_frame): Ditto. |
| 12491 | (x_scroll_bar_clear): Ditto. | 12496 | (x_scroll_bar_clear): Ditto. |
| @@ -13773,14 +13778,14 @@ Sun Jan 3 08:41:10 1999 Masatake Yamato <masata-y@is.aist-nara.ac.jp> | |||
| 13773 | based on text properties for an overlay string. | 13778 | based on text properties for an overlay string. |
| 13774 | (next_element_from_overlay_string): Check invisible and face text | 13779 | (next_element_from_overlay_string): Check invisible and face text |
| 13775 | properties. | 13780 | properties. |
| 13776 | 13781 | ||
| 13777 | (set_iterator_to_next_overlay_string): Restore face id before | 13782 | (set_iterator_to_next_overlay_string): Restore face id before |
| 13778 | overlay strings when no more overlay strings are found to return. | 13783 | overlay strings when no more overlay strings are found to return. |
| 13779 | Initialize next_ovstr_.*check_pos for each new overlay string | 13784 | Initialize next_ovstr_.*check_pos for each new overlay string |
| 13780 | 13785 | ||
| 13781 | A line in the following paragraph was garbled for an unknown | 13786 | A line in the following paragraph was garbled for an unknown |
| 13782 | reason. It couldn't be fully reconstructed. | 13787 | reason. It couldn't be fully reconstructed. |
| 13783 | 13788 | ||
| 13784 | (compute_base_face): Made public. | 13789 | (compute_base_face): Made public. |
| 13785 | (merge_face_list): Ditto. | 13790 | (merge_face_list): Ditto. |
| 13786 | (intern_computed_face): Ditto. | 13791 | (intern_computed_face): Ditto. |
diff --git a/src/xfaces.c b/src/xfaces.c index 91655c8086a..136b0376fe1 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -27,18 +27,18 @@ Boston, MA 02111-1307, USA. */ | |||
| 27 | display attributes: | 27 | display attributes: |
| 28 | 28 | ||
| 29 | 1. Font family name. | 29 | 1. Font family name. |
| 30 | 30 | ||
| 31 | 2. Relative proportionate width, aka character set width or set | 31 | 2. Relative proportionate width, aka character set width or set |
| 32 | width (swidth), e.g. `semi-compressed'. | 32 | width (swidth), e.g. `semi-compressed'. |
| 33 | 33 | ||
| 34 | 3. Font height in 1/10pt. | 34 | 3. Font height in 1/10pt. |
| 35 | 35 | ||
| 36 | 4. Font weight, e.g. `bold'. | 36 | 4. Font weight, e.g. `bold'. |
| 37 | 37 | ||
| 38 | 5. Font slant, e.g. `italic'. | 38 | 5. Font slant, e.g. `italic'. |
| 39 | 39 | ||
| 40 | 6. Foreground color. | 40 | 6. Foreground color. |
| 41 | 41 | ||
| 42 | 7. Background color. | 42 | 7. Background color. |
| 43 | 43 | ||
| 44 | 8. Whether or not characters should be underlined, and in what color. | 44 | 8. Whether or not characters should be underlined, and in what color. |
| @@ -75,7 +75,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 75 | There is also a global face alist `Vface_new_frame_defaults'. Face | 75 | There is also a global face alist `Vface_new_frame_defaults'. Face |
| 76 | definitions from this list are used to initialize faces of newly | 76 | definitions from this list are used to initialize faces of newly |
| 77 | created frames. | 77 | created frames. |
| 78 | 78 | ||
| 79 | A face doesn't have to specify all attributes. Those not specified | 79 | A face doesn't have to specify all attributes. Those not specified |
| 80 | have a value of `unspecified'. Faces specifying all attributes but | 80 | have a value of `unspecified'. Faces specifying all attributes but |
| 81 | the 14th are called `fully-specified'. | 81 | the 14th are called `fully-specified'. |
| @@ -92,7 +92,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 92 | 92 | ||
| 93 | 93 | ||
| 94 | Face realization. | 94 | Face realization. |
| 95 | 95 | ||
| 96 | After all face attributes for a character have been determined by | 96 | After all face attributes for a character have been determined by |
| 97 | merging faces of that character, that face is `realized'. The | 97 | merging faces of that character, that face is `realized'. The |
| 98 | realization process maps face attributes to what is physically | 98 | realization process maps face attributes to what is physically |
| @@ -159,7 +159,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 159 | face doesn't exist. | 159 | face doesn't exist. |
| 160 | 160 | ||
| 161 | 161 | ||
| 162 | Character compositition. | 162 | Character compositition. |
| 163 | 163 | ||
| 164 | Usually, the realization process is already finished when Emacs | 164 | Usually, the realization process is already finished when Emacs |
| 165 | actually reflects the desired glyph matrix on the screen. However, | 165 | actually reflects the desired glyph matrix on the screen. However, |
| @@ -169,7 +169,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 169 | screen, i.e. the realization process is delayed but in principle | 169 | screen, i.e. the realization process is delayed but in principle |
| 170 | the same. | 170 | the same. |
| 171 | 171 | ||
| 172 | 172 | ||
| 173 | Initialization of basic faces. | 173 | Initialization of basic faces. |
| 174 | 174 | ||
| 175 | The faces `default', `modeline' are considered `basic faces'. | 175 | The faces `default', `modeline' are considered `basic faces'. |
| @@ -267,7 +267,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 267 | 267 | ||
| 268 | #define DIM(VECTOR) (sizeof (VECTOR) / sizeof *(VECTOR)) | 268 | #define DIM(VECTOR) (sizeof (VECTOR) / sizeof *(VECTOR)) |
| 269 | 269 | ||
| 270 | /* Make a copy of string S on the stack using alloca. Value is a pointer | 270 | /* Make a copy of string S on the stack using alloca. Value is a pointer |
| 271 | to the copy. */ | 271 | to the copy. */ |
| 272 | 272 | ||
| 273 | #define STRDUPA(S) strcpy ((char *) alloca (strlen ((S)) + 1), (S)) | 273 | #define STRDUPA(S) strcpy ((char *) alloca (strlen ((S)) + 1), (S)) |
| @@ -277,7 +277,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 277 | 277 | ||
| 278 | #define LSTRDUPA(S) STRDUPA (XSTRING ((S))->data) | 278 | #define LSTRDUPA(S) STRDUPA (XSTRING ((S))->data) |
| 279 | 279 | ||
| 280 | /* Size of hash table of realized faces in face caches (should be a | 280 | /* Size of hash table of realized faces in face caches (should be a |
| 281 | prime number). */ | 281 | prime number). */ |
| 282 | 282 | ||
| 283 | #define FACE_CACHE_BUCKETS_SIZE 1001 | 283 | #define FACE_CACHE_BUCKETS_SIZE 1001 |
| @@ -596,7 +596,7 @@ DEFUN ("dump-colors", Fdump_colors, Sdump_colors, 0, 0, 0, | |||
| 596 | int i, n; | 596 | int i, n; |
| 597 | 597 | ||
| 598 | fputc ('\n', stderr); | 598 | fputc ('\n', stderr); |
| 599 | 599 | ||
| 600 | for (i = n = 0; i < sizeof color_count / sizeof color_count[0]; ++i) | 600 | for (i = n = 0; i < sizeof color_count / sizeof color_count[0]; ++i) |
| 601 | if (color_count[i]) | 601 | if (color_count[i]) |
| 602 | { | 602 | { |
| @@ -795,7 +795,7 @@ frame_or_selected_frame (frame, nparam) | |||
| 795 | { | 795 | { |
| 796 | if (NILP (frame)) | 796 | if (NILP (frame)) |
| 797 | frame = selected_frame; | 797 | frame = selected_frame; |
| 798 | 798 | ||
| 799 | CHECK_LIVE_FRAME (frame, nparam); | 799 | CHECK_LIVE_FRAME (frame, nparam); |
| 800 | return XFRAME (frame); | 800 | return XFRAME (frame); |
| 801 | } | 801 | } |
| @@ -814,7 +814,7 @@ init_frame_faces (f) | |||
| 814 | /* Make a face cache, if F doesn't have one. */ | 814 | /* Make a face cache, if F doesn't have one. */ |
| 815 | if (FRAME_FACE_CACHE (f) == NULL) | 815 | if (FRAME_FACE_CACHE (f) == NULL) |
| 816 | FRAME_FACE_CACHE (f) = make_face_cache (f); | 816 | FRAME_FACE_CACHE (f) = make_face_cache (f); |
| 817 | 817 | ||
| 818 | #ifdef HAVE_WINDOW_SYSTEM | 818 | #ifdef HAVE_WINDOW_SYSTEM |
| 819 | /* Make the image cache. */ | 819 | /* Make the image cache. */ |
| 820 | if (FRAME_WINDOW_P (f)) | 820 | if (FRAME_WINDOW_P (f)) |
| @@ -825,7 +825,7 @@ init_frame_faces (f) | |||
| 825 | } | 825 | } |
| 826 | #endif /* HAVE_WINDOW_SYSTEM */ | 826 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 827 | 827 | ||
| 828 | /* Realize basic faces. Must have enough information in frame | 828 | /* Realize basic faces. Must have enough information in frame |
| 829 | parameters to realize basic faces at this point. */ | 829 | parameters to realize basic faces at this point. */ |
| 830 | #ifdef HAVE_X_WINDOWS | 830 | #ifdef HAVE_X_WINDOWS |
| 831 | if (!FRAME_X_P (f) || FRAME_X_WINDOW (f)) | 831 | if (!FRAME_X_P (f) || FRAME_X_WINDOW (f)) |
| @@ -845,7 +845,7 @@ free_frame_faces (f) | |||
| 845 | struct frame *f; | 845 | struct frame *f; |
| 846 | { | 846 | { |
| 847 | struct face_cache *face_cache = FRAME_FACE_CACHE (f); | 847 | struct face_cache *face_cache = FRAME_FACE_CACHE (f); |
| 848 | 848 | ||
| 849 | if (face_cache) | 849 | if (face_cache) |
| 850 | { | 850 | { |
| 851 | free_face_cache (face_cache); | 851 | free_face_cache (face_cache); |
| @@ -1011,7 +1011,7 @@ the pixmap. Bits are stored row by row, each row occupies\n\ | |||
| 1011 | Lisp_Object object; | 1011 | Lisp_Object object; |
| 1012 | { | 1012 | { |
| 1013 | int pixmap_p = 0; | 1013 | int pixmap_p = 0; |
| 1014 | 1014 | ||
| 1015 | if (STRINGP (object)) | 1015 | if (STRINGP (object)) |
| 1016 | /* If OBJECT is a string, it's a file name. */ | 1016 | /* If OBJECT is a string, it's a file name. */ |
| 1017 | pixmap_p = 1; | 1017 | pixmap_p = 1; |
| @@ -1023,7 +1023,7 @@ the pixmap. Bits are stored row by row, each row occupies\n\ | |||
| 1023 | Lisp_Object width, height, data; | 1023 | Lisp_Object width, height, data; |
| 1024 | 1024 | ||
| 1025 | height = width = data = Qnil; | 1025 | height = width = data = Qnil; |
| 1026 | 1026 | ||
| 1027 | if (CONSP (object)) | 1027 | if (CONSP (object)) |
| 1028 | { | 1028 | { |
| 1029 | width = XCAR (object); | 1029 | width = XCAR (object); |
| @@ -1138,7 +1138,7 @@ frame_update_line_height (f) | |||
| 1138 | struct frame *f; | 1138 | struct frame *f; |
| 1139 | { | 1139 | { |
| 1140 | int line_height, changed_p; | 1140 | int line_height, changed_p; |
| 1141 | 1141 | ||
| 1142 | line_height = FONT_HEIGHT (FRAME_FONT (f)); | 1142 | line_height = FONT_HEIGHT (FRAME_FONT (f)); |
| 1143 | changed_p = line_height != FRAME_LINE_HEIGHT (f); | 1143 | changed_p = line_height != FRAME_LINE_HEIGHT (f); |
| 1144 | FRAME_LINE_HEIGHT (f) = line_height; | 1144 | FRAME_LINE_HEIGHT (f) = line_height; |
| @@ -1166,7 +1166,7 @@ load_face_font (f, face, c) | |||
| 1166 | { | 1166 | { |
| 1167 | struct font_info *font_info = NULL; | 1167 | struct font_info *font_info = NULL; |
| 1168 | char *font_name; | 1168 | char *font_name; |
| 1169 | 1169 | ||
| 1170 | face->font_info_id = -1; | 1170 | face->font_info_id = -1; |
| 1171 | face->font = NULL; | 1171 | face->font = NULL; |
| 1172 | 1172 | ||
| @@ -1354,7 +1354,7 @@ face_color_gray_p (f, color_name) | |||
| 1354 | < max (color.blue, color.red) / 20)); | 1354 | < max (color.blue, color.red) / 20)); |
| 1355 | else | 1355 | else |
| 1356 | gray_p = 0; | 1356 | gray_p = 0; |
| 1357 | 1357 | ||
| 1358 | return gray_p; | 1358 | return gray_p; |
| 1359 | } | 1359 | } |
| 1360 | 1360 | ||
| @@ -1438,7 +1438,7 @@ load_color (f, face, name, target_index) | |||
| 1438 | enum lface_attribute_index target_index; | 1438 | enum lface_attribute_index target_index; |
| 1439 | { | 1439 | { |
| 1440 | XColor color; | 1440 | XColor color; |
| 1441 | 1441 | ||
| 1442 | xassert (STRINGP (name)); | 1442 | xassert (STRINGP (name)); |
| 1443 | xassert (target_index == LFACE_FOREGROUND_INDEX | 1443 | xassert (target_index == LFACE_FOREGROUND_INDEX |
| 1444 | || target_index == LFACE_BACKGROUND_INDEX | 1444 | || target_index == LFACE_BACKGROUND_INDEX |
| @@ -1446,40 +1446,40 @@ load_color (f, face, name, target_index) | |||
| 1446 | || target_index == LFACE_OVERLINE_INDEX | 1446 | || target_index == LFACE_OVERLINE_INDEX |
| 1447 | || target_index == LFACE_STRIKE_THROUGH_INDEX | 1447 | || target_index == LFACE_STRIKE_THROUGH_INDEX |
| 1448 | || target_index == LFACE_BOX_INDEX); | 1448 | || target_index == LFACE_BOX_INDEX); |
| 1449 | 1449 | ||
| 1450 | /* if the color map is full, defined_color will return a best match | 1450 | /* if the color map is full, defined_color will return a best match |
| 1451 | to the values in an existing cell. */ | 1451 | to the values in an existing cell. */ |
| 1452 | if (!defined_color (f, XSTRING (name)->data, &color, 1)) | 1452 | if (!defined_color (f, XSTRING (name)->data, &color, 1)) |
| 1453 | { | 1453 | { |
| 1454 | add_to_log ("Unable to load color \"%s\"", name, Qnil); | 1454 | add_to_log ("Unable to load color \"%s\"", name, Qnil); |
| 1455 | 1455 | ||
| 1456 | switch (target_index) | 1456 | switch (target_index) |
| 1457 | { | 1457 | { |
| 1458 | case LFACE_FOREGROUND_INDEX: | 1458 | case LFACE_FOREGROUND_INDEX: |
| 1459 | face->foreground_defaulted_p = 1; | 1459 | face->foreground_defaulted_p = 1; |
| 1460 | color.pixel = FRAME_FOREGROUND_PIXEL (f); | 1460 | color.pixel = FRAME_FOREGROUND_PIXEL (f); |
| 1461 | break; | 1461 | break; |
| 1462 | 1462 | ||
| 1463 | case LFACE_BACKGROUND_INDEX: | 1463 | case LFACE_BACKGROUND_INDEX: |
| 1464 | face->background_defaulted_p = 1; | 1464 | face->background_defaulted_p = 1; |
| 1465 | color.pixel = FRAME_BACKGROUND_PIXEL (f); | 1465 | color.pixel = FRAME_BACKGROUND_PIXEL (f); |
| 1466 | break; | 1466 | break; |
| 1467 | 1467 | ||
| 1468 | case LFACE_UNDERLINE_INDEX: | 1468 | case LFACE_UNDERLINE_INDEX: |
| 1469 | face->underline_defaulted_p = 1; | 1469 | face->underline_defaulted_p = 1; |
| 1470 | color.pixel = FRAME_FOREGROUND_PIXEL (f); | 1470 | color.pixel = FRAME_FOREGROUND_PIXEL (f); |
| 1471 | break; | 1471 | break; |
| 1472 | 1472 | ||
| 1473 | case LFACE_OVERLINE_INDEX: | 1473 | case LFACE_OVERLINE_INDEX: |
| 1474 | face->overline_color_defaulted_p = 1; | 1474 | face->overline_color_defaulted_p = 1; |
| 1475 | color.pixel = FRAME_FOREGROUND_PIXEL (f); | 1475 | color.pixel = FRAME_FOREGROUND_PIXEL (f); |
| 1476 | break; | 1476 | break; |
| 1477 | 1477 | ||
| 1478 | case LFACE_STRIKE_THROUGH_INDEX: | 1478 | case LFACE_STRIKE_THROUGH_INDEX: |
| 1479 | face->strike_through_color_defaulted_p = 1; | 1479 | face->strike_through_color_defaulted_p = 1; |
| 1480 | color.pixel = FRAME_FOREGROUND_PIXEL (f); | 1480 | color.pixel = FRAME_FOREGROUND_PIXEL (f); |
| 1481 | break; | 1481 | break; |
| 1482 | 1482 | ||
| 1483 | case LFACE_BOX_INDEX: | 1483 | case LFACE_BOX_INDEX: |
| 1484 | face->box_color_defaulted_p = 1; | 1484 | face->box_color_defaulted_p = 1; |
| 1485 | color.pixel = FRAME_FOREGROUND_PIXEL (f); | 1485 | color.pixel = FRAME_FOREGROUND_PIXEL (f); |
| @@ -1493,7 +1493,7 @@ load_color (f, face, name, target_index) | |||
| 1493 | else | 1493 | else |
| 1494 | ++ncolors_allocated; | 1494 | ++ncolors_allocated; |
| 1495 | #endif | 1495 | #endif |
| 1496 | 1496 | ||
| 1497 | return color.pixel; | 1497 | return color.pixel; |
| 1498 | } | 1498 | } |
| 1499 | 1499 | ||
| @@ -1566,13 +1566,13 @@ free_face_colors (f, face) | |||
| 1566 | { | 1566 | { |
| 1567 | #ifdef HAVE_X_WINDOWS | 1567 | #ifdef HAVE_X_WINDOWS |
| 1568 | BLOCK_INPUT; | 1568 | BLOCK_INPUT; |
| 1569 | 1569 | ||
| 1570 | if (!face->foreground_defaulted_p) | 1570 | if (!face->foreground_defaulted_p) |
| 1571 | { | 1571 | { |
| 1572 | x_free_colors (f, &face->foreground, 1); | 1572 | x_free_colors (f, &face->foreground, 1); |
| 1573 | IF_DEBUG (--ncolors_allocated); | 1573 | IF_DEBUG (--ncolors_allocated); |
| 1574 | } | 1574 | } |
| 1575 | 1575 | ||
| 1576 | if (!face->background_defaulted_p) | 1576 | if (!face->background_defaulted_p) |
| 1577 | { | 1577 | { |
| 1578 | x_free_colors (f, &face->background, 1); | 1578 | x_free_colors (f, &face->background, 1); |
| @@ -1640,7 +1640,7 @@ enum xlfd_field | |||
| 1640 | XLFD_LAST | 1640 | XLFD_LAST |
| 1641 | }; | 1641 | }; |
| 1642 | 1642 | ||
| 1643 | /* An enumerator for each possible slant value of a font. Taken from | 1643 | /* An enumerator for each possible slant value of a font. Taken from |
| 1644 | the XLFD specification. */ | 1644 | the XLFD specification. */ |
| 1645 | 1645 | ||
| 1646 | enum xlfd_slant | 1646 | enum xlfd_slant |
| @@ -1810,7 +1810,7 @@ xlfd_lookup_field_contents (table, dim, font, field_index) | |||
| 1810 | { | 1810 | { |
| 1811 | mid = (low + high) / 2; | 1811 | mid = (low + high) / 2; |
| 1812 | cmp = strcmp (table[mid].name, s); | 1812 | cmp = strcmp (table[mid].name, s); |
| 1813 | 1813 | ||
| 1814 | if (cmp < 0) | 1814 | if (cmp < 0) |
| 1815 | low = mid + 1; | 1815 | low = mid + 1; |
| 1816 | else if (cmp > 0) | 1816 | else if (cmp > 0) |
| @@ -1928,7 +1928,7 @@ xlfd_symbolic_swidth (font) | |||
| 1928 | return xlfd_symbolic_value (swidth_table, DIM (swidth_table), | 1928 | return xlfd_symbolic_value (swidth_table, DIM (swidth_table), |
| 1929 | font, XLFD_SWIDTH, Qnormal); | 1929 | font, XLFD_SWIDTH, Qnormal); |
| 1930 | } | 1930 | } |
| 1931 | 1931 | ||
| 1932 | 1932 | ||
| 1933 | /* Look up the entry of SYMBOL in the vector TABLE which has DIM | 1933 | /* Look up the entry of SYMBOL in the vector TABLE which has DIM |
| 1934 | entries. Value is a pointer to the matching table entry or null if | 1934 | entries. Value is a pointer to the matching table entry or null if |
| @@ -1943,7 +1943,7 @@ face_value (table, dim, symbol) | |||
| 1943 | int i; | 1943 | int i; |
| 1944 | 1944 | ||
| 1945 | xassert (SYMBOLP (symbol)); | 1945 | xassert (SYMBOLP (symbol)); |
| 1946 | 1946 | ||
| 1947 | for (i = 0; i < dim; ++i) | 1947 | for (i = 0; i < dim; ++i) |
| 1948 | if (EQ (*table[i].symbol, symbol)) | 1948 | if (EQ (*table[i].symbol, symbol)) |
| 1949 | break; | 1949 | break; |
| @@ -2093,13 +2093,13 @@ split_font_name (f, font, numeric_p) | |||
| 2093 | { | 2093 | { |
| 2094 | font->fields[i] = p; | 2094 | font->fields[i] = p; |
| 2095 | ++i; | 2095 | ++i; |
| 2096 | 2096 | ||
| 2097 | while (*p && *p != '-') | 2097 | while (*p && *p != '-') |
| 2098 | ++p; | 2098 | ++p; |
| 2099 | 2099 | ||
| 2100 | if (*p != '-') | 2100 | if (*p != '-') |
| 2101 | break; | 2101 | break; |
| 2102 | 2102 | ||
| 2103 | *p++ = 0; | 2103 | *p++ = 0; |
| 2104 | } | 2104 | } |
| 2105 | } | 2105 | } |
| @@ -2123,7 +2123,7 @@ split_font_name (f, font, numeric_p) | |||
| 2123 | 2123 | ||
| 2124 | /* Build an XLFD font name from font name fields in FONT. Value is a | 2124 | /* Build an XLFD font name from font name fields in FONT. Value is a |
| 2125 | pointer to the font name, which is allocated via xmalloc. */ | 2125 | pointer to the font name, which is allocated via xmalloc. */ |
| 2126 | 2126 | ||
| 2127 | static char * | 2127 | static char * |
| 2128 | build_font_name (font) | 2128 | build_font_name (font) |
| 2129 | struct font_name *font; | 2129 | struct font_name *font; |
| @@ -2200,7 +2200,7 @@ sort_fonts (f, fonts, nfonts, cmpfn) | |||
| 2200 | For all fonts found, set FONTS[i].name to the name of the font, | 2200 | For all fonts found, set FONTS[i].name to the name of the font, |
| 2201 | allocated via xmalloc, and split font names into fields. Ignore | 2201 | allocated via xmalloc, and split font names into fields. Ignore |
| 2202 | fonts that we can't parse. Value is the number of fonts found. | 2202 | fonts that we can't parse. Value is the number of fonts found. |
| 2203 | 2203 | ||
| 2204 | This is similar to x_list_fonts. The differences are: | 2204 | This is similar to x_list_fonts. The differences are: |
| 2205 | 2205 | ||
| 2206 | 1. It avoids consing. | 2206 | 1. It avoids consing. |
| @@ -2296,7 +2296,7 @@ x_face_list_fonts (f, pattern, fonts, nfonts, try_alternatives_p, | |||
| 2296 | UNBLOCK_INPUT; | 2296 | UNBLOCK_INPUT; |
| 2297 | #endif | 2297 | #endif |
| 2298 | } | 2298 | } |
| 2299 | 2299 | ||
| 2300 | 2300 | ||
| 2301 | /* If no fonts found, try patterns from Valternate_fontname_alist. */ | 2301 | /* If no fonts found, try patterns from Valternate_fontname_alist. */ |
| 2302 | if (n == 0 && try_alternatives_p) | 2302 | if (n == 0 && try_alternatives_p) |
| @@ -2317,7 +2317,7 @@ x_face_list_fonts (f, pattern, fonts, nfonts, try_alternatives_p, | |||
| 2317 | { | 2317 | { |
| 2318 | Lisp_Object patterns = XCAR (list); | 2318 | Lisp_Object patterns = XCAR (list); |
| 2319 | Lisp_Object name; | 2319 | Lisp_Object name; |
| 2320 | 2320 | ||
| 2321 | while (CONSP (patterns) | 2321 | while (CONSP (patterns) |
| 2322 | /* If list is screwed up, give up. */ | 2322 | /* If list is screwed up, give up. */ |
| 2323 | && (name = XCAR (patterns), | 2323 | && (name = XCAR (patterns), |
| @@ -2332,10 +2332,10 @@ x_face_list_fonts (f, pattern, fonts, nfonts, try_alternatives_p, | |||
| 2332 | patterns = XCDR (patterns); | 2332 | patterns = XCDR (patterns); |
| 2333 | } | 2333 | } |
| 2334 | } | 2334 | } |
| 2335 | 2335 | ||
| 2336 | return n; | 2336 | return n; |
| 2337 | } | 2337 | } |
| 2338 | 2338 | ||
| 2339 | 2339 | ||
| 2340 | /* Determine the first font matching PATTERN on frame F. Return in | 2340 | /* Determine the first font matching PATTERN on frame F. Return in |
| 2341 | *FONT the matching font name, split into fields. Value is non-zero | 2341 | *FONT the matching font name, split into fields. Value is non-zero |
| @@ -2356,7 +2356,7 @@ first_font_matching (f, pattern, font) | |||
| 2356 | if (nfonts > 0) | 2356 | if (nfonts > 0) |
| 2357 | { | 2357 | { |
| 2358 | bcopy (&fonts[0], font, sizeof *font); | 2358 | bcopy (&fonts[0], font, sizeof *font); |
| 2359 | 2359 | ||
| 2360 | fonts[0].name = NULL; | 2360 | fonts[0].name = NULL; |
| 2361 | free_font_names (fonts, nfonts); | 2361 | free_font_names (fonts, nfonts); |
| 2362 | } | 2362 | } |
| @@ -2381,20 +2381,20 @@ sorted_font_list (f, pattern, cmpfn, fonts) | |||
| 2381 | struct font_name **fonts; | 2381 | struct font_name **fonts; |
| 2382 | { | 2382 | { |
| 2383 | int nfonts; | 2383 | int nfonts; |
| 2384 | 2384 | ||
| 2385 | /* Get the list of fonts matching pattern. 100 should suffice. */ | 2385 | /* Get the list of fonts matching pattern. 100 should suffice. */ |
| 2386 | nfonts = DEFAULT_FONT_LIST_LIMIT; | 2386 | nfonts = DEFAULT_FONT_LIST_LIMIT; |
| 2387 | if (INTEGERP (Vfont_list_limit) && XINT (Vfont_list_limit) > 0) | 2387 | if (INTEGERP (Vfont_list_limit) && XINT (Vfont_list_limit) > 0) |
| 2388 | nfonts = XFASTINT (Vfont_list_limit); | 2388 | nfonts = XFASTINT (Vfont_list_limit); |
| 2389 | 2389 | ||
| 2390 | *fonts = (struct font_name *) xmalloc (nfonts * sizeof **fonts); | 2390 | *fonts = (struct font_name *) xmalloc (nfonts * sizeof **fonts); |
| 2391 | #if SCALABLE_FONTS | 2391 | #if SCALABLE_FONTS |
| 2392 | nfonts = x_face_list_fonts (f, pattern, *fonts, nfonts, 1, 1); | 2392 | nfonts = x_face_list_fonts (f, pattern, *fonts, nfonts, 1, 1); |
| 2393 | #else | 2393 | #else |
| 2394 | nfonts = x_face_list_fonts (f, pattern, *fonts, nfonts, 1, 0); | 2394 | nfonts = x_face_list_fonts (f, pattern, *fonts, nfonts, 1, 0); |
| 2395 | #endif | 2395 | #endif |
| 2396 | 2396 | ||
| 2397 | /* Sort the resulting array and return it in *FONTS. If no | 2397 | /* Sort the resulting array and return it in *FONTS. If no |
| 2398 | fonts were found, make sure to set *FONTS to null. */ | 2398 | fonts were found, make sure to set *FONTS to null. */ |
| 2399 | if (nfonts) | 2399 | if (nfonts) |
| 2400 | sort_fonts (f, *fonts, nfonts, cmpfn); | 2400 | sort_fonts (f, *fonts, nfonts, cmpfn); |
| @@ -2429,7 +2429,7 @@ cmp_font_names (a, b) | |||
| 2429 | if (cmp == 0) | 2429 | if (cmp == 0) |
| 2430 | { | 2430 | { |
| 2431 | int i; | 2431 | int i; |
| 2432 | 2432 | ||
| 2433 | for (i = 0; i < DIM (font_sort_order) && cmp == 0; ++i) | 2433 | for (i = 0; i < DIM (font_sort_order) && cmp == 0; ++i) |
| 2434 | { | 2434 | { |
| 2435 | int j = font_sort_order[i]; | 2435 | int j = font_sort_order[i]; |
| @@ -2470,7 +2470,7 @@ font_list (f, pattern, family, registry, fonts) | |||
| 2470 | { | 2470 | { |
| 2471 | family_str = (NILP (family) ? "*" : (char *) XSTRING (family)->data); | 2471 | family_str = (NILP (family) ? "*" : (char *) XSTRING (family)->data); |
| 2472 | registry_str = (NILP (registry) ? "*" : (char *) XSTRING (registry)->data); | 2472 | registry_str = (NILP (registry) ? "*" : (char *) XSTRING (registry)->data); |
| 2473 | 2473 | ||
| 2474 | pattern_str = (char *) alloca (strlen (family_str) | 2474 | pattern_str = (char *) alloca (strlen (family_str) |
| 2475 | + strlen (registry_str) | 2475 | + strlen (registry_str) |
| 2476 | + 10); | 2476 | + 10); |
| @@ -2488,7 +2488,7 @@ font_list (f, pattern, family, registry, fonts) | |||
| 2488 | } | 2488 | } |
| 2489 | else | 2489 | else |
| 2490 | pattern_str = (char *) XSTRING (pattern)->data; | 2490 | pattern_str = (char *) XSTRING (pattern)->data; |
| 2491 | 2491 | ||
| 2492 | return sorted_font_list (f, pattern_str, cmp_font_names, fonts); | 2492 | return sorted_font_list (f, pattern_str, cmp_font_names, fonts); |
| 2493 | } | 2493 | } |
| 2494 | 2494 | ||
| @@ -2502,7 +2502,7 @@ remove_duplicates (list) | |||
| 2502 | Lisp_Object list; | 2502 | Lisp_Object list; |
| 2503 | { | 2503 | { |
| 2504 | Lisp_Object tail = list; | 2504 | Lisp_Object tail = list; |
| 2505 | 2505 | ||
| 2506 | while (!NILP (tail) && !NILP (XCDR (tail))) | 2506 | while (!NILP (tail) && !NILP (XCDR (tail))) |
| 2507 | { | 2507 | { |
| 2508 | Lisp_Object next = XCDR (tail); | 2508 | Lisp_Object next = XCDR (tail); |
| @@ -2541,7 +2541,7 @@ the face font sort order.") | |||
| 2541 | 2541 | ||
| 2542 | if (!NILP (family)) | 2542 | if (!NILP (family)) |
| 2543 | CHECK_STRING (family, 1); | 2543 | CHECK_STRING (family, 1); |
| 2544 | 2544 | ||
| 2545 | result = Qnil; | 2545 | result = Qnil; |
| 2546 | GCPRO1 (result); | 2546 | GCPRO1 (result); |
| 2547 | nfonts = font_list (f, Qnil, family, Qnil, &fonts); | 2547 | nfonts = font_list (f, Qnil, family, Qnil, &fonts); |
| @@ -2562,7 +2562,7 @@ the face font sort order.") | |||
| 2562 | fonts[i].fields[XLFD_ENCODING]); | 2562 | fonts[i].fields[XLFD_ENCODING]); |
| 2563 | ASET (v, 7, build_string (tem)); | 2563 | ASET (v, 7, build_string (tem)); |
| 2564 | xfree (tem); | 2564 | xfree (tem); |
| 2565 | 2565 | ||
| 2566 | result = Fcons (v, result); | 2566 | result = Fcons (v, result); |
| 2567 | } | 2567 | } |
| 2568 | 2568 | ||
| @@ -2597,7 +2597,7 @@ are fixed-pitch.") | |||
| 2597 | { | 2597 | { |
| 2598 | specbind (intern ("font-list-limit"), make_number (limit)); | 2598 | specbind (intern ("font-list-limit"), make_number (limit)); |
| 2599 | nfonts = font_list (f, Qnil, Qnil, Qnil, &fonts); | 2599 | nfonts = font_list (f, Qnil, Qnil, Qnil, &fonts); |
| 2600 | 2600 | ||
| 2601 | if (nfonts == limit) | 2601 | if (nfonts == limit) |
| 2602 | { | 2602 | { |
| 2603 | free_font_names (fonts, nfonts); | 2603 | free_font_names (fonts, nfonts); |
| @@ -2606,7 +2606,7 @@ are fixed-pitch.") | |||
| 2606 | else | 2606 | else |
| 2607 | break; | 2607 | break; |
| 2608 | } | 2608 | } |
| 2609 | 2609 | ||
| 2610 | result = Qnil; | 2610 | result = Qnil; |
| 2611 | GCPRO1 (result); | 2611 | GCPRO1 (result); |
| 2612 | for (i = nfonts - 1; i >= 0; --i) | 2612 | for (i = nfonts - 1; i >= 0; --i) |
| @@ -2650,7 +2650,7 @@ the WIDTH times as wide as FACE on FRAME.") | |||
| 2650 | 2650 | ||
| 2651 | check_x (); | 2651 | check_x (); |
| 2652 | CHECK_STRING (pattern, 0); | 2652 | CHECK_STRING (pattern, 0); |
| 2653 | 2653 | ||
| 2654 | if (NILP (maximum)) | 2654 | if (NILP (maximum)) |
| 2655 | maxnames = 2000; | 2655 | maxnames = 2000; |
| 2656 | else | 2656 | else |
| @@ -2751,7 +2751,7 @@ the WIDTH times as wide as FACE on FRAME.") | |||
| 2751 | && XVECTOR (LFACE)->size == LFACE_VECTOR_SIZE \ | 2751 | && XVECTOR (LFACE)->size == LFACE_VECTOR_SIZE \ |
| 2752 | && EQ (XVECTOR (LFACE)->contents[0], Qface)) | 2752 | && EQ (XVECTOR (LFACE)->contents[0], Qface)) |
| 2753 | 2753 | ||
| 2754 | 2754 | ||
| 2755 | #if GLYPH_DEBUG | 2755 | #if GLYPH_DEBUG |
| 2756 | 2756 | ||
| 2757 | /* Check consistency of Lisp face attribute vector ATTRS. */ | 2757 | /* Check consistency of Lisp face attribute vector ATTRS. */ |
| @@ -2831,7 +2831,7 @@ resolve_face_name (face_name) | |||
| 2831 | Lisp_Object face_name; | 2831 | Lisp_Object face_name; |
| 2832 | { | 2832 | { |
| 2833 | Lisp_Object aliased; | 2833 | Lisp_Object aliased; |
| 2834 | 2834 | ||
| 2835 | if (STRINGP (face_name)) | 2835 | if (STRINGP (face_name)) |
| 2836 | face_name = intern (XSTRING (face_name)->data); | 2836 | face_name = intern (XSTRING (face_name)->data); |
| 2837 | 2837 | ||
| @@ -2941,7 +2941,7 @@ lface_fully_specified_p (attrs) | |||
| 2941 | return 0 if MAY_FAIL_P is non-zero, otherwise set normal values | 2941 | return 0 if MAY_FAIL_P is non-zero, otherwise set normal values |
| 2942 | in LFACE and return 1. | 2942 | in LFACE and return 1. |
| 2943 | Otherwise, return 1. */ | 2943 | Otherwise, return 1. */ |
| 2944 | 2944 | ||
| 2945 | static int | 2945 | static int |
| 2946 | set_lface_from_font_name (f, lface, fontname, force_p, may_fail_p) | 2946 | set_lface_from_font_name (f, lface, fontname, force_p, may_fail_p) |
| 2947 | struct frame *f; | 2947 | struct frame *f; |
| @@ -2984,7 +2984,7 @@ set_lface_from_font_name (f, lface, fontname, force_p, may_fail_p) | |||
| 2984 | /* Set attributes only if unspecified, otherwise face defaults for | 2984 | /* Set attributes only if unspecified, otherwise face defaults for |
| 2985 | new frames would never take effect. If we couldn't get a font | 2985 | new frames would never take effect. If we couldn't get a font |
| 2986 | name conforming to XLFD, set normal values. */ | 2986 | name conforming to XLFD, set normal values. */ |
| 2987 | 2987 | ||
| 2988 | if (force_p || UNSPECIFIEDP (LFACE_FAMILY (lface))) | 2988 | if (force_p || UNSPECIFIEDP (LFACE_FAMILY (lface))) |
| 2989 | { | 2989 | { |
| 2990 | Lisp_Object val; | 2990 | Lisp_Object val; |
| @@ -3025,7 +3025,7 @@ set_lface_from_font_name (f, lface, fontname, force_p, may_fail_p) | |||
| 3025 | = have_xlfd_p ? xlfd_symbolic_slant (&font) : Qnormal; | 3025 | = have_xlfd_p ? xlfd_symbolic_slant (&font) : Qnormal; |
| 3026 | 3026 | ||
| 3027 | LFACE_FONT (lface) = fontname; | 3027 | LFACE_FONT (lface) = fontname; |
| 3028 | 3028 | ||
| 3029 | return 1; | 3029 | return 1; |
| 3030 | } | 3030 | } |
| 3031 | #endif /* HAVE_WINDOW_SYSTEM */ | 3031 | #endif /* HAVE_WINDOW_SYSTEM */ |
| @@ -3064,7 +3064,7 @@ merge_face_vectors (from, to) | |||
| 3064 | 3064 | ||
| 3065 | Face specifications earlier in lists take precedence over later | 3065 | Face specifications earlier in lists take precedence over later |
| 3066 | specifications. */ | 3066 | specifications. */ |
| 3067 | 3067 | ||
| 3068 | static void | 3068 | static void |
| 3069 | merge_face_vector_with_property (f, to, prop) | 3069 | merge_face_vector_with_property (f, to, prop) |
| 3070 | struct frame *f; | 3070 | struct frame *f; |
| @@ -3074,7 +3074,7 @@ merge_face_vector_with_property (f, to, prop) | |||
| 3074 | if (CONSP (prop)) | 3074 | if (CONSP (prop)) |
| 3075 | { | 3075 | { |
| 3076 | Lisp_Object first = XCAR (prop); | 3076 | Lisp_Object first = XCAR (prop); |
| 3077 | 3077 | ||
| 3078 | if (EQ (first, Qforeground_color) | 3078 | if (EQ (first, Qforeground_color) |
| 3079 | || EQ (first, Qbackground_color)) | 3079 | || EQ (first, Qbackground_color)) |
| 3080 | { | 3080 | { |
| @@ -3258,7 +3258,7 @@ Value is a vector of face attributes.") | |||
| 3258 | 3258 | ||
| 3259 | CHECK_SYMBOL (face, 0); | 3259 | CHECK_SYMBOL (face, 0); |
| 3260 | global_lface = lface_from_face_name (NULL, face, 0); | 3260 | global_lface = lface_from_face_name (NULL, face, 0); |
| 3261 | 3261 | ||
| 3262 | if (!NILP (frame)) | 3262 | if (!NILP (frame)) |
| 3263 | { | 3263 | { |
| 3264 | CHECK_LIVE_FRAME (frame, 1); | 3264 | CHECK_LIVE_FRAME (frame, 1); |
| @@ -3274,9 +3274,9 @@ Value is a vector of face attributes.") | |||
| 3274 | global_lface = Fmake_vector (make_number (LFACE_VECTOR_SIZE), | 3274 | global_lface = Fmake_vector (make_number (LFACE_VECTOR_SIZE), |
| 3275 | Qunspecified); | 3275 | Qunspecified); |
| 3276 | XVECTOR (global_lface)->contents[0] = Qface; | 3276 | XVECTOR (global_lface)->contents[0] = Qface; |
| 3277 | Vface_new_frame_defaults = Fcons (Fcons (face, global_lface), | 3277 | Vface_new_frame_defaults = Fcons (Fcons (face, global_lface), |
| 3278 | Vface_new_frame_defaults); | 3278 | Vface_new_frame_defaults); |
| 3279 | 3279 | ||
| 3280 | /* Assign the new Lisp face a unique ID. The mapping from Lisp | 3280 | /* Assign the new Lisp face a unique ID. The mapping from Lisp |
| 3281 | face id to Lisp face is given by the vector lface_id_to_name. | 3281 | face id to Lisp face is given by the vector lface_id_to_name. |
| 3282 | The mapping from Lisp face to Lisp face id is given by the | 3282 | The mapping from Lisp face to Lisp face id is given by the |
| @@ -3288,7 +3288,7 @@ Value is a vector of face attributes.") | |||
| 3288 | lface_id_to_name = (Lisp_Object *) xrealloc (lface_id_to_name, sz); | 3288 | lface_id_to_name = (Lisp_Object *) xrealloc (lface_id_to_name, sz); |
| 3289 | lface_id_to_name_size = new_size; | 3289 | lface_id_to_name_size = new_size; |
| 3290 | } | 3290 | } |
| 3291 | 3291 | ||
| 3292 | lface_id_to_name[next_lface_id] = face; | 3292 | lface_id_to_name[next_lface_id] = face; |
| 3293 | Fput (face, Qface, make_number (next_lface_id)); | 3293 | Fput (face, Qface, make_number (next_lface_id)); |
| 3294 | ++next_lface_id; | 3294 | ++next_lface_id; |
| @@ -3296,7 +3296,7 @@ Value is a vector of face attributes.") | |||
| 3296 | else if (f == NULL) | 3296 | else if (f == NULL) |
| 3297 | for (i = 1; i < LFACE_VECTOR_SIZE; ++i) | 3297 | for (i = 1; i < LFACE_VECTOR_SIZE; ++i) |
| 3298 | XVECTOR (global_lface)->contents[i] = Qunspecified; | 3298 | XVECTOR (global_lface)->contents[i] = Qunspecified; |
| 3299 | 3299 | ||
| 3300 | /* Add a frame-local definition. */ | 3300 | /* Add a frame-local definition. */ |
| 3301 | if (f) | 3301 | if (f) |
| 3302 | { | 3302 | { |
| @@ -3330,7 +3330,7 @@ Otherwise check for the existence of a global face.") | |||
| 3330 | Lisp_Object face, frame; | 3330 | Lisp_Object face, frame; |
| 3331 | { | 3331 | { |
| 3332 | Lisp_Object lface; | 3332 | Lisp_Object lface; |
| 3333 | 3333 | ||
| 3334 | if (!NILP (frame)) | 3334 | if (!NILP (frame)) |
| 3335 | { | 3335 | { |
| 3336 | CHECK_LIVE_FRAME (frame, 1); | 3336 | CHECK_LIVE_FRAME (frame, 1); |
| @@ -3356,7 +3356,7 @@ Value is TO.") | |||
| 3356 | Lisp_Object from, to, frame, new_frame; | 3356 | Lisp_Object from, to, frame, new_frame; |
| 3357 | { | 3357 | { |
| 3358 | Lisp_Object lface, copy; | 3358 | Lisp_Object lface, copy; |
| 3359 | 3359 | ||
| 3360 | CHECK_SYMBOL (from, 0); | 3360 | CHECK_SYMBOL (from, 0); |
| 3361 | CHECK_SYMBOL (to, 1); | 3361 | CHECK_SYMBOL (to, 1); |
| 3362 | if (NILP (new_frame)) | 3362 | if (NILP (new_frame)) |
| @@ -3377,10 +3377,10 @@ Value is TO.") | |||
| 3377 | lface = lface_from_face_name (XFRAME (frame), from, 1); | 3377 | lface = lface_from_face_name (XFRAME (frame), from, 1); |
| 3378 | copy = Finternal_make_lisp_face (to, new_frame); | 3378 | copy = Finternal_make_lisp_face (to, new_frame); |
| 3379 | } | 3379 | } |
| 3380 | 3380 | ||
| 3381 | bcopy (XVECTOR (lface)->contents, XVECTOR (copy)->contents, | 3381 | bcopy (XVECTOR (lface)->contents, XVECTOR (copy)->contents, |
| 3382 | LFACE_VECTOR_SIZE * sizeof (Lisp_Object)); | 3382 | LFACE_VECTOR_SIZE * sizeof (Lisp_Object)); |
| 3383 | 3383 | ||
| 3384 | return to; | 3384 | return to; |
| 3385 | } | 3385 | } |
| 3386 | 3386 | ||
| @@ -3401,7 +3401,7 @@ frame.") | |||
| 3401 | int font_attr_p = 0; | 3401 | int font_attr_p = 0; |
| 3402 | /* Set 1 if ATTR is one of font-related attributes other than QCfont. */ | 3402 | /* Set 1 if ATTR is one of font-related attributes other than QCfont. */ |
| 3403 | int font_related_attr_p = 0; | 3403 | int font_related_attr_p = 0; |
| 3404 | 3404 | ||
| 3405 | CHECK_SYMBOL (face, 0); | 3405 | CHECK_SYMBOL (face, 0); |
| 3406 | CHECK_SYMBOL (attr, 1); | 3406 | CHECK_SYMBOL (attr, 1); |
| 3407 | 3407 | ||
| @@ -3414,10 +3414,10 @@ frame.") | |||
| 3414 | { | 3414 | { |
| 3415 | if (NILP (frame)) | 3415 | if (NILP (frame)) |
| 3416 | frame = selected_frame; | 3416 | frame = selected_frame; |
| 3417 | 3417 | ||
| 3418 | CHECK_LIVE_FRAME (frame, 3); | 3418 | CHECK_LIVE_FRAME (frame, 3); |
| 3419 | lface = lface_from_face_name (XFRAME (frame), face, 0); | 3419 | lface = lface_from_face_name (XFRAME (frame), face, 0); |
| 3420 | 3420 | ||
| 3421 | /* If a frame-local face doesn't exist yet, create one. */ | 3421 | /* If a frame-local face doesn't exist yet, create one. */ |
| 3422 | if (NILP (lface)) | 3422 | if (NILP (lface)) |
| 3423 | lface = Finternal_make_lisp_face (face, frame); | 3423 | lface = Finternal_make_lisp_face (face, frame); |
| @@ -3481,7 +3481,7 @@ frame.") | |||
| 3481 | || (STRINGP (value) | 3481 | || (STRINGP (value) |
| 3482 | && XSTRING (value)->size == 0)) | 3482 | && XSTRING (value)->size == 0)) |
| 3483 | signal_error ("Invalid face underline", value); | 3483 | signal_error ("Invalid face underline", value); |
| 3484 | 3484 | ||
| 3485 | old_value = LFACE_UNDERLINE (lface); | 3485 | old_value = LFACE_UNDERLINE (lface); |
| 3486 | LFACE_UNDERLINE (lface) = value; | 3486 | LFACE_UNDERLINE (lface) = value; |
| 3487 | } | 3487 | } |
| @@ -3495,7 +3495,7 @@ frame.") | |||
| 3495 | || (STRINGP (value) | 3495 | || (STRINGP (value) |
| 3496 | && XSTRING (value)->size == 0)) | 3496 | && XSTRING (value)->size == 0)) |
| 3497 | signal_error ("Invalid face overline", value); | 3497 | signal_error ("Invalid face overline", value); |
| 3498 | 3498 | ||
| 3499 | old_value = LFACE_OVERLINE (lface); | 3499 | old_value = LFACE_OVERLINE (lface); |
| 3500 | LFACE_OVERLINE (lface) = value; | 3500 | LFACE_OVERLINE (lface) = value; |
| 3501 | } | 3501 | } |
| @@ -3509,14 +3509,14 @@ frame.") | |||
| 3509 | || (STRINGP (value) | 3509 | || (STRINGP (value) |
| 3510 | && XSTRING (value)->size == 0)) | 3510 | && XSTRING (value)->size == 0)) |
| 3511 | signal_error ("Invalid face strike-through", value); | 3511 | signal_error ("Invalid face strike-through", value); |
| 3512 | 3512 | ||
| 3513 | old_value = LFACE_STRIKE_THROUGH (lface); | 3513 | old_value = LFACE_STRIKE_THROUGH (lface); |
| 3514 | LFACE_STRIKE_THROUGH (lface) = value; | 3514 | LFACE_STRIKE_THROUGH (lface) = value; |
| 3515 | } | 3515 | } |
| 3516 | else if (EQ (attr, QCbox)) | 3516 | else if (EQ (attr, QCbox)) |
| 3517 | { | 3517 | { |
| 3518 | int valid_p; | 3518 | int valid_p; |
| 3519 | 3519 | ||
| 3520 | /* Allow t meaning a simple box of width 1 in foreground color | 3520 | /* Allow t meaning a simple box of width 1 in foreground color |
| 3521 | of the face. */ | 3521 | of the face. */ |
| 3522 | if (EQ (value, Qt)) | 3522 | if (EQ (value, Qt)) |
| @@ -3533,7 +3533,7 @@ frame.") | |||
| 3533 | else if (CONSP (value)) | 3533 | else if (CONSP (value)) |
| 3534 | { | 3534 | { |
| 3535 | Lisp_Object tem; | 3535 | Lisp_Object tem; |
| 3536 | 3536 | ||
| 3537 | tem = value; | 3537 | tem = value; |
| 3538 | while (CONSP (tem)) | 3538 | while (CONSP (tem)) |
| 3539 | { | 3539 | { |
| @@ -3545,7 +3545,7 @@ frame.") | |||
| 3545 | break; | 3545 | break; |
| 3546 | v = XCAR (tem); | 3546 | v = XCAR (tem); |
| 3547 | tem = XCDR (tem); | 3547 | tem = XCDR (tem); |
| 3548 | 3548 | ||
| 3549 | if (EQ (k, QCline_width)) | 3549 | if (EQ (k, QCline_width)) |
| 3550 | { | 3550 | { |
| 3551 | if (!INTEGERP (v) || XINT (v) <= 0) | 3551 | if (!INTEGERP (v) || XINT (v) <= 0) |
| @@ -3572,7 +3572,7 @@ frame.") | |||
| 3572 | 3572 | ||
| 3573 | if (!valid_p) | 3573 | if (!valid_p) |
| 3574 | signal_error ("Invalid face box", value); | 3574 | signal_error ("Invalid face box", value); |
| 3575 | 3575 | ||
| 3576 | old_value = LFACE_BOX (lface); | 3576 | old_value = LFACE_BOX (lface); |
| 3577 | LFACE_BOX (lface) = value; | 3577 | LFACE_BOX (lface) = value; |
| 3578 | } | 3578 | } |
| @@ -3652,7 +3652,7 @@ frame.") | |||
| 3652 | f = SELECTED_FRAME (); | 3652 | f = SELECTED_FRAME (); |
| 3653 | else | 3653 | else |
| 3654 | f = check_x_frame (frame); | 3654 | f = check_x_frame (frame); |
| 3655 | 3655 | ||
| 3656 | /* VALUE may be a fontset name or an alias of fontset. In such | 3656 | /* VALUE may be a fontset name or an alias of fontset. In such |
| 3657 | a case, use the base fontset name. */ | 3657 | a case, use the base fontset name. */ |
| 3658 | tmp = Fquery_fontset (value, Qnil); | 3658 | tmp = Fquery_fontset (value, Qnil); |
| @@ -3710,7 +3710,7 @@ frame.") | |||
| 3710 | Lisp_Object param; | 3710 | Lisp_Object param; |
| 3711 | 3711 | ||
| 3712 | param = Qnil; | 3712 | param = Qnil; |
| 3713 | 3713 | ||
| 3714 | if (EQ (face, Qdefault)) | 3714 | if (EQ (face, Qdefault)) |
| 3715 | { | 3715 | { |
| 3716 | /* Changed font-related attributes of the `default' face are | 3716 | /* Changed font-related attributes of the `default' face are |
| @@ -3761,7 +3761,7 @@ frame.") | |||
| 3761 | } | 3761 | } |
| 3762 | 3762 | ||
| 3763 | #endif /* HAVE_WINDOW_SYSTEM */ | 3763 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 3764 | 3764 | ||
| 3765 | return face; | 3765 | return face; |
| 3766 | } | 3766 | } |
| 3767 | 3767 | ||
| @@ -3814,7 +3814,7 @@ update_face_from_frame_parameter (f, param, new_value) | |||
| 3814 | face-set-after-frame-defaults. */ | 3814 | face-set-after-frame-defaults. */ |
| 3815 | if (NILP (f->face_alist)) | 3815 | if (NILP (f->face_alist)) |
| 3816 | return; | 3816 | return; |
| 3817 | 3817 | ||
| 3818 | if (EQ (param, Qforeground_color)) | 3818 | if (EQ (param, Qforeground_color)) |
| 3819 | { | 3819 | { |
| 3820 | lface = lface_from_face_name (f, Qdefault, 1); | 3820 | lface = lface_from_face_name (f, Qdefault, 1); |
| @@ -3831,7 +3831,7 @@ update_face_from_frame_parameter (f, param, new_value) | |||
| 3831 | frame-update-face-colors to do that. */ | 3831 | frame-update-face-colors to do that. */ |
| 3832 | XSETFRAME (frame, f); | 3832 | XSETFRAME (frame, f); |
| 3833 | call1 (Qframe_update_face_colors, frame); | 3833 | call1 (Qframe_update_face_colors, frame); |
| 3834 | 3834 | ||
| 3835 | lface = lface_from_face_name (f, Qdefault, 1); | 3835 | lface = lface_from_face_name (f, Qdefault, 1); |
| 3836 | LFACE_BACKGROUND (lface) = (STRINGP (new_value) | 3836 | LFACE_BACKGROUND (lface) = (STRINGP (new_value) |
| 3837 | ? new_value : Qunspecified); | 3837 | ? new_value : Qunspecified); |
| @@ -3885,7 +3885,7 @@ DEFUN ("internal-face-x-get-resource", Finternal_face_x_get_resource, | |||
| 3885 | If VALUE is "on" or "true", return t. If VALUE is "off" or | 3885 | If VALUE is "on" or "true", return t. If VALUE is "off" or |
| 3886 | "false", return nil. Otherwise, if SIGNAL_P is non-zero, signal an | 3886 | "false", return nil. Otherwise, if SIGNAL_P is non-zero, signal an |
| 3887 | error; if SIGNAL_P is zero, return 0. */ | 3887 | error; if SIGNAL_P is zero, return 0. */ |
| 3888 | 3888 | ||
| 3889 | static Lisp_Object | 3889 | static Lisp_Object |
| 3890 | face_boolean_x_resource_value (value, signal_p) | 3890 | face_boolean_x_resource_value (value, signal_p) |
| 3891 | Lisp_Object value; | 3891 | Lisp_Object value; |
| @@ -3894,7 +3894,7 @@ face_boolean_x_resource_value (value, signal_p) | |||
| 3894 | Lisp_Object result = make_number (0); | 3894 | Lisp_Object result = make_number (0); |
| 3895 | 3895 | ||
| 3896 | xassert (STRINGP (value)); | 3896 | xassert (STRINGP (value)); |
| 3897 | 3897 | ||
| 3898 | if (xstricmp (XSTRING (value)->data, "on") == 0 | 3898 | if (xstricmp (XSTRING (value)->data, "on") == 0 |
| 3899 | || xstricmp (XSTRING (value)->data, "true") == 0) | 3899 | || xstricmp (XSTRING (value)->data, "true") == 0) |
| 3900 | result = Qt; | 3900 | result = Qt; |
| @@ -3991,7 +3991,7 @@ xm_apply_resources (w, p) | |||
| 3991 | { | 3991 | { |
| 3992 | Widget submenu = 0; | 3992 | Widget submenu = 0; |
| 3993 | struct x_resources *res = (struct x_resources *) p; | 3993 | struct x_resources *res = (struct x_resources *) p; |
| 3994 | 3994 | ||
| 3995 | XtSetValues (w, res->av, res->ac); | 3995 | XtSetValues (w, res->av, res->ac); |
| 3996 | XtVaGetValues (w, XmNsubMenuId, &submenu, NULL); | 3996 | XtVaGetValues (w, XmNsubMenuId, &submenu, NULL); |
| 3997 | if (submenu) | 3997 | if (submenu) |
| @@ -4054,11 +4054,11 @@ xm_set_menu_resources_from_menu_face (f, widget) | |||
| 4054 | } | 4054 | } |
| 4055 | 4055 | ||
| 4056 | xassert (ac <= sizeof av / sizeof *av); | 4056 | xassert (ac <= sizeof av / sizeof *av); |
| 4057 | 4057 | ||
| 4058 | if (ac) | 4058 | if (ac) |
| 4059 | { | 4059 | { |
| 4060 | struct x_resources res; | 4060 | struct x_resources res; |
| 4061 | 4061 | ||
| 4062 | XtSetValues (widget, av, ac); | 4062 | XtSetValues (widget, av, ac); |
| 4063 | res.av = av, res.ac = ac; | 4063 | res.av = av, res.ac = ac; |
| 4064 | XtApplyToWidgets (widget, xm_apply_resources, &res); | 4064 | XtApplyToWidgets (widget, xm_apply_resources, &res); |
| @@ -4131,7 +4131,7 @@ xl_set_menu_resources_from_menu_face (f, widget) | |||
| 4131 | if (ac) | 4131 | if (ac) |
| 4132 | { | 4132 | { |
| 4133 | struct x_resources res; | 4133 | struct x_resources res; |
| 4134 | 4134 | ||
| 4135 | XtSetValues (widget, av, ac); | 4135 | XtSetValues (widget, av, ac); |
| 4136 | 4136 | ||
| 4137 | /* We must do children here in case we're handling a pop-up menu | 4137 | /* We must do children here in case we're handling a pop-up menu |
| @@ -4157,7 +4157,7 @@ x_set_menu_resources_from_menu_face (f, widget) | |||
| 4157 | will need the `menu' face. */ | 4157 | will need the `menu' face. */ |
| 4158 | if (f->face_cache->used == 0) | 4158 | if (f->face_cache->used == 0) |
| 4159 | recompute_basic_faces (f); | 4159 | recompute_basic_faces (f); |
| 4160 | 4160 | ||
| 4161 | #ifdef USE_LUCID | 4161 | #ifdef USE_LUCID |
| 4162 | xl_set_menu_resources_from_menu_face (f, widget); | 4162 | xl_set_menu_resources_from_menu_face (f, widget); |
| 4163 | #endif | 4163 | #endif |
| @@ -4185,7 +4185,7 @@ frames). If FRAME is omitted or nil, use the selected frame.") | |||
| 4185 | Lisp_Object symbol, keyword, frame; | 4185 | Lisp_Object symbol, keyword, frame; |
| 4186 | { | 4186 | { |
| 4187 | Lisp_Object lface, value = Qnil; | 4187 | Lisp_Object lface, value = Qnil; |
| 4188 | 4188 | ||
| 4189 | CHECK_SYMBOL (symbol, 0); | 4189 | CHECK_SYMBOL (symbol, 0); |
| 4190 | CHECK_SYMBOL (keyword, 1); | 4190 | CHECK_SYMBOL (keyword, 1); |
| 4191 | 4191 | ||
| @@ -4244,9 +4244,9 @@ Value is nil if ATTR doesn't have a discrete set of valid values.") | |||
| 4244 | Lisp_Object attr; | 4244 | Lisp_Object attr; |
| 4245 | { | 4245 | { |
| 4246 | Lisp_Object result = Qnil; | 4246 | Lisp_Object result = Qnil; |
| 4247 | 4247 | ||
| 4248 | CHECK_SYMBOL (attr, 0); | 4248 | CHECK_SYMBOL (attr, 0); |
| 4249 | 4249 | ||
| 4250 | if (EQ (attr, QCweight) | 4250 | if (EQ (attr, QCweight) |
| 4251 | || EQ (attr, QCslant) | 4251 | || EQ (attr, QCslant) |
| 4252 | || EQ (attr, QCwidth)) | 4252 | || EQ (attr, QCwidth)) |
| @@ -4254,7 +4254,7 @@ Value is nil if ATTR doesn't have a discrete set of valid values.") | |||
| 4254 | /* Extract permissible symbols from tables. */ | 4254 | /* Extract permissible symbols from tables. */ |
| 4255 | struct table_entry *table; | 4255 | struct table_entry *table; |
| 4256 | int i, dim; | 4256 | int i, dim; |
| 4257 | 4257 | ||
| 4258 | if (EQ (attr, QCweight)) | 4258 | if (EQ (attr, QCweight)) |
| 4259 | table = weight_table, dim = DIM (weight_table); | 4259 | table = weight_table, dim = DIM (weight_table); |
| 4260 | else if (EQ (attr, QCslant)) | 4260 | else if (EQ (attr, QCslant)) |
| @@ -4286,10 +4286,10 @@ Value is nil if ATTR doesn't have a discrete set of valid values.") | |||
| 4286 | 4286 | ||
| 4287 | return result; | 4287 | return result; |
| 4288 | } | 4288 | } |
| 4289 | 4289 | ||
| 4290 | 4290 | ||
| 4291 | DEFUN ("internal-merge-in-global-face", Finternal_merge_in_global_face, | 4291 | DEFUN ("internal-merge-in-global-face", Finternal_merge_in_global_face, |
| 4292 | Sinternal_merge_in_global_face, 2, 2, 0, | 4292 | Sinternal_merge_in_global_face, 2, 2, 0, |
| 4293 | "Add attributes from frame-default definition of FACE to FACE on FRAME.") | 4293 | "Add attributes from frame-default definition of FACE to FACE on FRAME.") |
| 4294 | (face, frame) | 4294 | (face, frame) |
| 4295 | Lisp_Object face, frame; | 4295 | Lisp_Object face, frame; |
| @@ -4311,7 +4311,7 @@ DEFUN ("internal-merge-in-global-face", Finternal_merge_in_global_face, | |||
| 4311 | return fonts with the same size as the font of a face. This is | 4311 | return fonts with the same size as the font of a face. This is |
| 4312 | done in fontset.el. */ | 4312 | done in fontset.el. */ |
| 4313 | 4313 | ||
| 4314 | DEFUN ("face-font", Fface_font, Sface_font, 1, 2, 0, | 4314 | DEFUN ("face-font", Fface_font, Sface_font, 1, 2, 0, |
| 4315 | "Return the font name of face FACE, or nil if it is unspecified.\n\ | 4315 | "Return the font name of face FACE, or nil if it is unspecified.\n\ |
| 4316 | If the optional argument FRAME is given, report on face FACE in that frame.\n\ | 4316 | If the optional argument FRAME is given, report on face FACE in that frame.\n\ |
| 4317 | If FRAME is t, report on the defaults for face FACE (for new frames).\n\ | 4317 | If FRAME is t, report on the defaults for face FACE (for new frames).\n\ |
| @@ -4329,11 +4329,11 @@ If FRAME is omitted or nil, use the selected frame.") | |||
| 4329 | if (!UNSPECIFIEDP (LFACE_WEIGHT (lface)) | 4329 | if (!UNSPECIFIEDP (LFACE_WEIGHT (lface)) |
| 4330 | && !EQ (LFACE_WEIGHT (lface), Qnormal)) | 4330 | && !EQ (LFACE_WEIGHT (lface), Qnormal)) |
| 4331 | result = Fcons (Qbold, result); | 4331 | result = Fcons (Qbold, result); |
| 4332 | 4332 | ||
| 4333 | if (!NILP (LFACE_SLANT (lface)) | 4333 | if (!NILP (LFACE_SLANT (lface)) |
| 4334 | && !EQ (LFACE_SLANT (lface), Qnormal)) | 4334 | && !EQ (LFACE_SLANT (lface), Qnormal)) |
| 4335 | result = Fcons (Qitalic, result); | 4335 | result = Fcons (Qitalic, result); |
| 4336 | 4336 | ||
| 4337 | return result; | 4337 | return result; |
| 4338 | } | 4338 | } |
| 4339 | else | 4339 | else |
| @@ -4376,19 +4376,19 @@ lface_equal_p (v1, v2) | |||
| 4376 | && bcmp (XSTRING (a)->data, XSTRING (b)->data, | 4376 | && bcmp (XSTRING (a)->data, XSTRING (b)->data, |
| 4377 | XSTRING (a)->size) == 0); | 4377 | XSTRING (a)->size) == 0); |
| 4378 | break; | 4378 | break; |
| 4379 | 4379 | ||
| 4380 | case Lisp_Int: | 4380 | case Lisp_Int: |
| 4381 | case Lisp_Symbol: | 4381 | case Lisp_Symbol: |
| 4382 | equal_p = 0; | 4382 | equal_p = 0; |
| 4383 | break; | 4383 | break; |
| 4384 | 4384 | ||
| 4385 | default: | 4385 | default: |
| 4386 | equal_p = !NILP (Fequal (a, b)); | 4386 | equal_p = !NILP (Fequal (a, b)); |
| 4387 | break; | 4387 | break; |
| 4388 | } | 4388 | } |
| 4389 | } | 4389 | } |
| 4390 | } | 4390 | } |
| 4391 | 4391 | ||
| 4392 | return equal_p; | 4392 | return equal_p; |
| 4393 | } | 4393 | } |
| 4394 | 4394 | ||
| @@ -4405,7 +4405,7 @@ If FRAME is omitted or nil, use the selected frame.") | |||
| 4405 | int equal_p; | 4405 | int equal_p; |
| 4406 | struct frame *f; | 4406 | struct frame *f; |
| 4407 | Lisp_Object lface1, lface2; | 4407 | Lisp_Object lface1, lface2; |
| 4408 | 4408 | ||
| 4409 | if (EQ (frame, Qt)) | 4409 | if (EQ (frame, Qt)) |
| 4410 | f = NULL; | 4410 | f = NULL; |
| 4411 | else | 4411 | else |
| @@ -4422,7 +4422,7 @@ If FRAME is omitted or nil, use the selected frame.") | |||
| 4422 | return equal_p ? Qt : Qnil; | 4422 | return equal_p ? Qt : Qnil; |
| 4423 | } | 4423 | } |
| 4424 | 4424 | ||
| 4425 | 4425 | ||
| 4426 | DEFUN ("internal-lisp-face-empty-p", Finternal_lisp_face_empty_p, | 4426 | DEFUN ("internal-lisp-face-empty-p", Finternal_lisp_face_empty_p, |
| 4427 | Sinternal_lisp_face_empty_p, 1, 2, 0, | 4427 | Sinternal_lisp_face_empty_p, 1, 2, 0, |
| 4428 | "True if FACE has no attribute specified.\n\ | 4428 | "True if FACE has no attribute specified.\n\ |
| @@ -4440,7 +4440,7 @@ If FRAME is omitted or nil, use the selected frame.") | |||
| 4440 | frame = selected_frame; | 4440 | frame = selected_frame; |
| 4441 | CHECK_LIVE_FRAME (frame, 0); | 4441 | CHECK_LIVE_FRAME (frame, 0); |
| 4442 | f = XFRAME (frame); | 4442 | f = XFRAME (frame); |
| 4443 | 4443 | ||
| 4444 | if (EQ (frame, Qt)) | 4444 | if (EQ (frame, Qt)) |
| 4445 | lface = lface_from_face_name (NULL, face, 1); | 4445 | lface = lface_from_face_name (NULL, face, 1); |
| 4446 | else | 4446 | else |
| @@ -4449,13 +4449,13 @@ If FRAME is omitted or nil, use the selected frame.") | |||
| 4449 | for (i = 1; i < LFACE_VECTOR_SIZE; ++i) | 4449 | for (i = 1; i < LFACE_VECTOR_SIZE; ++i) |
| 4450 | if (!UNSPECIFIEDP (XVECTOR (lface)->contents[i])) | 4450 | if (!UNSPECIFIEDP (XVECTOR (lface)->contents[i])) |
| 4451 | break; | 4451 | break; |
| 4452 | 4452 | ||
| 4453 | return i == LFACE_VECTOR_SIZE ? Qt : Qnil; | 4453 | return i == LFACE_VECTOR_SIZE ? Qt : Qnil; |
| 4454 | } | 4454 | } |
| 4455 | 4455 | ||
| 4456 | 4456 | ||
| 4457 | DEFUN ("frame-face-alist", Fframe_face_alist, Sframe_face_alist, | 4457 | DEFUN ("frame-face-alist", Fframe_face_alist, Sframe_face_alist, |
| 4458 | 0, 1, 0, | 4458 | 0, 1, 0, |
| 4459 | "Return an alist of frame-local faces defined on FRAME.\n\ | 4459 | "Return an alist of frame-local faces defined on FRAME.\n\ |
| 4460 | For internal use only.") | 4460 | For internal use only.") |
| 4461 | (frame) | 4461 | (frame) |
| @@ -4565,7 +4565,7 @@ free_realized_face (f, face) | |||
| 4565 | x_free_gc (f, face->gc); | 4565 | x_free_gc (f, face->gc); |
| 4566 | face->gc = 0; | 4566 | face->gc = 0; |
| 4567 | } | 4567 | } |
| 4568 | 4568 | ||
| 4569 | free_face_colors (f, face); | 4569 | free_face_colors (f, face); |
| 4570 | x_destroy_bitmap (f, face->stipple); | 4570 | x_destroy_bitmap (f, face->stipple); |
| 4571 | } | 4571 | } |
| @@ -4587,7 +4587,7 @@ prepare_face_for_display (f, face) | |||
| 4587 | { | 4587 | { |
| 4588 | #ifdef HAVE_WINDOW_SYSTEM | 4588 | #ifdef HAVE_WINDOW_SYSTEM |
| 4589 | xassert (FRAME_WINDOW_P (f)); | 4589 | xassert (FRAME_WINDOW_P (f)); |
| 4590 | 4590 | ||
| 4591 | if (face->gc == 0) | 4591 | if (face->gc == 0) |
| 4592 | { | 4592 | { |
| 4593 | XGCValues xgcv; | 4593 | XGCValues xgcv; |
| @@ -4701,7 +4701,7 @@ free_realized_faces (c) | |||
| 4701 | free_realized_face (f, c->faces_by_id[i]); | 4701 | free_realized_face (f, c->faces_by_id[i]); |
| 4702 | c->faces_by_id[i] = NULL; | 4702 | c->faces_by_id[i] = NULL; |
| 4703 | } | 4703 | } |
| 4704 | 4704 | ||
| 4705 | c->used = 0; | 4705 | c->used = 0; |
| 4706 | size = FACE_CACHE_BUCKETS_SIZE * sizeof *c->buckets; | 4706 | size = FACE_CACHE_BUCKETS_SIZE * sizeof *c->buckets; |
| 4707 | bzero (c->buckets, size); | 4707 | bzero (c->buckets, size); |
| @@ -4737,7 +4737,7 @@ free_realized_multibyte_face (f, fontset) | |||
| 4737 | while only some faces are freed, or when the frame's current | 4737 | while only some faces are freed, or when the frame's current |
| 4738 | matrix still references freed faces. */ | 4738 | matrix still references freed faces. */ |
| 4739 | BLOCK_INPUT; | 4739 | BLOCK_INPUT; |
| 4740 | 4740 | ||
| 4741 | for (i = 0; i < cache->used; i++) | 4741 | for (i = 0; i < cache->used; i++) |
| 4742 | { | 4742 | { |
| 4743 | face = cache->faces_by_id[i]; | 4743 | face = cache->faces_by_id[i]; |
| @@ -4749,7 +4749,7 @@ free_realized_multibyte_face (f, fontset) | |||
| 4749 | free_realized_face (f, face); | 4749 | free_realized_face (f, face); |
| 4750 | } | 4750 | } |
| 4751 | } | 4751 | } |
| 4752 | 4752 | ||
| 4753 | /* Must do a thorough redisplay the next time. Mark current | 4753 | /* Must do a thorough redisplay the next time. Mark current |
| 4754 | matrices as invalid because they will reference faces freed | 4754 | matrices as invalid because they will reference faces freed |
| 4755 | above. This function is also called when a frame is destroyed. | 4755 | above. This function is also called when a frame is destroyed. |
| @@ -4759,7 +4759,7 @@ free_realized_multibyte_face (f, fontset) | |||
| 4759 | clear_current_matrices (f); | 4759 | clear_current_matrices (f); |
| 4760 | ++windows_or_buffers_changed; | 4760 | ++windows_or_buffers_changed; |
| 4761 | } | 4761 | } |
| 4762 | 4762 | ||
| 4763 | UNBLOCK_INPUT; | 4763 | UNBLOCK_INPUT; |
| 4764 | } | 4764 | } |
| 4765 | 4765 | ||
| @@ -4847,7 +4847,7 @@ cache_face (c, face, hash) | |||
| 4847 | if (c->faces_by_id[i] == NULL) | 4847 | if (c->faces_by_id[i] == NULL) |
| 4848 | break; | 4848 | break; |
| 4849 | face->id = i; | 4849 | face->id = i; |
| 4850 | 4850 | ||
| 4851 | /* Maybe enlarge C->faces_by_id. */ | 4851 | /* Maybe enlarge C->faces_by_id. */ |
| 4852 | if (i == c->used && c->used == c->size) | 4852 | if (i == c->used && c->used == c->size) |
| 4853 | { | 4853 | { |
| @@ -4871,7 +4871,7 @@ cache_face (c, face, hash) | |||
| 4871 | xassert (n == 1); | 4871 | xassert (n == 1); |
| 4872 | } | 4872 | } |
| 4873 | #endif /* GLYPH_DEBUG */ | 4873 | #endif /* GLYPH_DEBUG */ |
| 4874 | 4874 | ||
| 4875 | c->faces_by_id[i] = face; | 4875 | c->faces_by_id[i] = face; |
| 4876 | if (i == c->used) | 4876 | if (i == c->used) |
| 4877 | ++c->used; | 4877 | ++c->used; |
| @@ -4886,15 +4886,15 @@ uncache_face (c, face) | |||
| 4886 | struct face *face; | 4886 | struct face *face; |
| 4887 | { | 4887 | { |
| 4888 | int i = face->hash % FACE_CACHE_BUCKETS_SIZE; | 4888 | int i = face->hash % FACE_CACHE_BUCKETS_SIZE; |
| 4889 | 4889 | ||
| 4890 | if (face->prev) | 4890 | if (face->prev) |
| 4891 | face->prev->next = face->next; | 4891 | face->prev->next = face->next; |
| 4892 | else | 4892 | else |
| 4893 | c->buckets[i] = face->next; | 4893 | c->buckets[i] = face->next; |
| 4894 | 4894 | ||
| 4895 | if (face->next) | 4895 | if (face->next) |
| 4896 | face->next->prev = face->prev; | 4896 | face->next->prev = face->prev; |
| 4897 | 4897 | ||
| 4898 | c->faces_by_id[face->id] = NULL; | 4898 | c->faces_by_id[face->id] = NULL; |
| 4899 | if (face->id == c->used) | 4899 | if (face->id == c->used) |
| 4900 | --c->used; | 4900 | --c->used; |
| @@ -4925,7 +4925,7 @@ lookup_face (f, attr, c, base_face) | |||
| 4925 | /* Look up ATTR in the face cache. */ | 4925 | /* Look up ATTR in the face cache. */ |
| 4926 | hash = lface_hash (attr); | 4926 | hash = lface_hash (attr); |
| 4927 | i = hash % FACE_CACHE_BUCKETS_SIZE; | 4927 | i = hash % FACE_CACHE_BUCKETS_SIZE; |
| 4928 | 4928 | ||
| 4929 | for (face = cache->buckets[i]; face; face = face->next) | 4929 | for (face = cache->buckets[i]; face; face = face->next) |
| 4930 | if (face->hash == hash | 4930 | if (face->hash == hash |
| 4931 | && (!FRAME_WINDOW_P (f) | 4931 | && (!FRAME_WINDOW_P (f) |
| @@ -4950,7 +4950,7 @@ lookup_face (f, attr, c, base_face) | |||
| 4950 | xassert (FACE_SUITABLE_FOR_CHAR_P (face, c)); | 4950 | xassert (FACE_SUITABLE_FOR_CHAR_P (face, c)); |
| 4951 | #endif | 4951 | #endif |
| 4952 | #endif /* GLYPH_DEBUG */ | 4952 | #endif /* GLYPH_DEBUG */ |
| 4953 | 4953 | ||
| 4954 | return face->id; | 4954 | return face->id; |
| 4955 | } | 4955 | } |
| 4956 | 4956 | ||
| @@ -4984,7 +4984,7 @@ ascii_face_of_lisp_face (f, lface_id) | |||
| 4984 | int lface_id; | 4984 | int lface_id; |
| 4985 | { | 4985 | { |
| 4986 | int face_id; | 4986 | int face_id; |
| 4987 | 4987 | ||
| 4988 | if (lface_id >= 0 && lface_id < lface_id_to_name_size) | 4988 | if (lface_id >= 0 && lface_id < lface_id_to_name_size) |
| 4989 | { | 4989 | { |
| 4990 | Lisp_Object face_name = lface_id_to_name[lface_id]; | 4990 | Lisp_Object face_name = lface_id_to_name[lface_id]; |
| @@ -5021,7 +5021,7 @@ smaller_face (f, face_id, steps) | |||
| 5021 | /* Try in increments of 1/2 pt. */ | 5021 | /* Try in increments of 1/2 pt. */ |
| 5022 | delta = steps < 0 ? 5 : -5; | 5022 | delta = steps < 0 ? 5 : -5; |
| 5023 | steps = abs (steps); | 5023 | steps = abs (steps); |
| 5024 | 5024 | ||
| 5025 | face = FACE_FROM_ID (f, face_id); | 5025 | face = FACE_FROM_ID (f, face_id); |
| 5026 | bcopy (face->lface, attrs, sizeof attrs); | 5026 | bcopy (face->lface, attrs, sizeof attrs); |
| 5027 | pt = last_pt = XFASTINT (attrs[LFACE_HEIGHT_INDEX]); | 5027 | pt = last_pt = XFASTINT (attrs[LFACE_HEIGHT_INDEX]); |
| @@ -5053,7 +5053,7 @@ smaller_face (f, face_id, steps) | |||
| 5053 | #else /* not HAVE_WINDOW_SYSTEM */ | 5053 | #else /* not HAVE_WINDOW_SYSTEM */ |
| 5054 | 5054 | ||
| 5055 | return face_id; | 5055 | return face_id; |
| 5056 | 5056 | ||
| 5057 | #endif /* not HAVE_WINDOW_SYSTEM */ | 5057 | #endif /* not HAVE_WINDOW_SYSTEM */ |
| 5058 | } | 5058 | } |
| 5059 | 5059 | ||
| @@ -5080,7 +5080,7 @@ face_with_height (f, face_id, height) | |||
| 5080 | attrs[LFACE_HEIGHT_INDEX] = make_number (height); | 5080 | attrs[LFACE_HEIGHT_INDEX] = make_number (height); |
| 5081 | face_id = lookup_face (f, attrs, 0, NULL); | 5081 | face_id = lookup_face (f, attrs, 0, NULL); |
| 5082 | #endif /* HAVE_WINDOW_SYSTEM */ | 5082 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 5083 | 5083 | ||
| 5084 | return face_id; | 5084 | return face_id; |
| 5085 | } | 5085 | } |
| 5086 | 5086 | ||
| @@ -5133,7 +5133,7 @@ Value is ORDER.") | |||
| 5133 | Lisp_Object list; | 5133 | Lisp_Object list; |
| 5134 | int i; | 5134 | int i; |
| 5135 | int indices[4]; | 5135 | int indices[4]; |
| 5136 | 5136 | ||
| 5137 | CHECK_LIST (order, 0); | 5137 | CHECK_LIST (order, 0); |
| 5138 | bzero (indices, sizeof indices); | 5138 | bzero (indices, sizeof indices); |
| 5139 | i = 0; | 5139 | i = 0; |
| @@ -5174,7 +5174,7 @@ Value is ORDER.") | |||
| 5174 | bcopy (indices, font_sort_order, sizeof font_sort_order); | 5174 | bcopy (indices, font_sort_order, sizeof font_sort_order); |
| 5175 | free_all_realized_faces (Qnil); | 5175 | free_all_realized_faces (Qnil); |
| 5176 | } | 5176 | } |
| 5177 | 5177 | ||
| 5178 | return Qnil; | 5178 | return Qnil; |
| 5179 | } | 5179 | } |
| 5180 | 5180 | ||
| @@ -5232,7 +5232,7 @@ better_font_p (values, font1, font2, compare_pt_p) | |||
| 5232 | int compare_pt_p; | 5232 | int compare_pt_p; |
| 5233 | { | 5233 | { |
| 5234 | int i; | 5234 | int i; |
| 5235 | 5235 | ||
| 5236 | for (i = 0; i < 4; ++i) | 5236 | for (i = 0; i < 4; ++i) |
| 5237 | { | 5237 | { |
| 5238 | int xlfd_idx = font_sort_order[i]; | 5238 | int xlfd_idx = font_sort_order[i]; |
| @@ -5241,7 +5241,7 @@ better_font_p (values, font1, font2, compare_pt_p) | |||
| 5241 | { | 5241 | { |
| 5242 | int delta1 = abs (values[i] - font1->numeric[xlfd_idx]); | 5242 | int delta1 = abs (values[i] - font1->numeric[xlfd_idx]); |
| 5243 | int delta2 = abs (values[i] - font2->numeric[xlfd_idx]); | 5243 | int delta2 = abs (values[i] - font2->numeric[xlfd_idx]); |
| 5244 | 5244 | ||
| 5245 | if (delta1 > delta2) | 5245 | if (delta1 > delta2) |
| 5246 | return 0; | 5246 | return 0; |
| 5247 | else if (delta1 < delta2) | 5247 | else if (delta1 < delta2) |
| @@ -5258,7 +5258,7 @@ better_font_p (values, font1, font2, compare_pt_p) | |||
| 5258 | } | 5258 | } |
| 5259 | } | 5259 | } |
| 5260 | } | 5260 | } |
| 5261 | 5261 | ||
| 5262 | return 0; | 5262 | return 0; |
| 5263 | } | 5263 | } |
| 5264 | 5264 | ||
| @@ -5275,7 +5275,7 @@ exact_face_match_p (specified, font) | |||
| 5275 | struct font_name *font; | 5275 | struct font_name *font; |
| 5276 | { | 5276 | { |
| 5277 | int i; | 5277 | int i; |
| 5278 | 5278 | ||
| 5279 | for (i = 0; i < 4; ++i) | 5279 | for (i = 0; i < 4; ++i) |
| 5280 | if (specified[i] != font->numeric[font_sort_order[i]]) | 5280 | if (specified[i] != font->numeric[font_sort_order[i]]) |
| 5281 | break; | 5281 | break; |
| @@ -5312,17 +5312,17 @@ build_scalable_font_name (f, font, specified_pt) | |||
| 5312 | pt = specified_pt; | 5312 | pt = specified_pt; |
| 5313 | pixel_value = resy / 720.0 * pt; | 5313 | pixel_value = resy / 720.0 * pt; |
| 5314 | } | 5314 | } |
| 5315 | 5315 | ||
| 5316 | /* Set point size of the font. */ | 5316 | /* Set point size of the font. */ |
| 5317 | sprintf (point_size, "%d", (int) pt); | 5317 | sprintf (point_size, "%d", (int) pt); |
| 5318 | font->fields[XLFD_POINT_SIZE] = point_size; | 5318 | font->fields[XLFD_POINT_SIZE] = point_size; |
| 5319 | font->numeric[XLFD_POINT_SIZE] = pt; | 5319 | font->numeric[XLFD_POINT_SIZE] = pt; |
| 5320 | 5320 | ||
| 5321 | /* Set pixel size. */ | 5321 | /* Set pixel size. */ |
| 5322 | sprintf (pixel_size, "%d", pixel_value); | 5322 | sprintf (pixel_size, "%d", pixel_value); |
| 5323 | font->fields[XLFD_PIXEL_SIZE] = pixel_size; | 5323 | font->fields[XLFD_PIXEL_SIZE] = pixel_size; |
| 5324 | font->numeric[XLFD_PIXEL_SIZE] = pixel_value; | 5324 | font->numeric[XLFD_PIXEL_SIZE] = pixel_value; |
| 5325 | 5325 | ||
| 5326 | /* If font doesn't specify its resolution, use the | 5326 | /* If font doesn't specify its resolution, use the |
| 5327 | resolution of the display. */ | 5327 | resolution of the display. */ |
| 5328 | if (font->numeric[XLFD_RESY] == 0) | 5328 | if (font->numeric[XLFD_RESY] == 0) |
| @@ -5332,7 +5332,7 @@ build_scalable_font_name (f, font, specified_pt) | |||
| 5332 | font->fields[XLFD_RESY] = buffer; | 5332 | font->fields[XLFD_RESY] = buffer; |
| 5333 | font->numeric[XLFD_RESY] = resy; | 5333 | font->numeric[XLFD_RESY] = resy; |
| 5334 | } | 5334 | } |
| 5335 | 5335 | ||
| 5336 | if (strcmp (font->fields[XLFD_RESX], "0") == 0) | 5336 | if (strcmp (font->fields[XLFD_RESX], "0") == 0) |
| 5337 | { | 5337 | { |
| 5338 | char buffer[20]; | 5338 | char buffer[20]; |
| @@ -5360,7 +5360,7 @@ may_use_scalable_font_p (font, name) | |||
| 5360 | else if (CONSP (Vscalable_fonts_allowed)) | 5360 | else if (CONSP (Vscalable_fonts_allowed)) |
| 5361 | { | 5361 | { |
| 5362 | Lisp_Object tail, regexp; | 5362 | Lisp_Object tail, regexp; |
| 5363 | 5363 | ||
| 5364 | for (tail = Vscalable_fonts_allowed; CONSP (tail); tail = XCDR (tail)) | 5364 | for (tail = Vscalable_fonts_allowed; CONSP (tail); tail = XCDR (tail)) |
| 5365 | { | 5365 | { |
| 5366 | regexp = XCAR (tail); | 5366 | regexp = XCAR (tail); |
| @@ -5369,7 +5369,7 @@ may_use_scalable_font_p (font, name) | |||
| 5369 | return 1; | 5369 | return 1; |
| 5370 | } | 5370 | } |
| 5371 | } | 5371 | } |
| 5372 | 5372 | ||
| 5373 | return 0; | 5373 | return 0; |
| 5374 | } | 5374 | } |
| 5375 | 5375 | ||
| @@ -5402,7 +5402,7 @@ best_matching_font (f, attrs, fonts, nfonts) | |||
| 5402 | for (i = 0; i < DIM (font_sort_order); ++i) | 5402 | for (i = 0; i < DIM (font_sort_order); ++i) |
| 5403 | { | 5403 | { |
| 5404 | int xlfd_idx = font_sort_order[i]; | 5404 | int xlfd_idx = font_sort_order[i]; |
| 5405 | 5405 | ||
| 5406 | if (xlfd_idx == XLFD_SWIDTH) | 5406 | if (xlfd_idx == XLFD_SWIDTH) |
| 5407 | specified[i] = face_numeric_swidth (attrs[LFACE_SWIDTH_INDEX]); | 5407 | specified[i] = face_numeric_swidth (attrs[LFACE_SWIDTH_INDEX]); |
| 5408 | else if (xlfd_idx == XLFD_POINT_SIZE) | 5408 | else if (xlfd_idx == XLFD_POINT_SIZE) |
| @@ -5419,7 +5419,7 @@ best_matching_font (f, attrs, fonts, nfonts) | |||
| 5419 | 5419 | ||
| 5420 | /* Set to 1 */ | 5420 | /* Set to 1 */ |
| 5421 | exact_p = 0; | 5421 | exact_p = 0; |
| 5422 | 5422 | ||
| 5423 | /* Start with the first non-scalable font in the list. */ | 5423 | /* Start with the first non-scalable font in the list. */ |
| 5424 | for (i = 0; i < nfonts; ++i) | 5424 | for (i = 0; i < nfonts; ++i) |
| 5425 | if (!font_scalable_p (fonts + i)) | 5425 | if (!font_scalable_p (fonts + i)) |
| @@ -5429,7 +5429,7 @@ best_matching_font (f, attrs, fonts, nfonts) | |||
| 5429 | if (i < nfonts) | 5429 | if (i < nfonts) |
| 5430 | { | 5430 | { |
| 5431 | best = fonts + i; | 5431 | best = fonts + i; |
| 5432 | 5432 | ||
| 5433 | for (i = 1; i < nfonts; ++i) | 5433 | for (i = 1; i < nfonts; ++i) |
| 5434 | if (!font_scalable_p (fonts + i) | 5434 | if (!font_scalable_p (fonts + i) |
| 5435 | && better_font_p (specified, fonts + i, best, 1)) | 5435 | && better_font_p (specified, fonts + i, best, 1)) |
| @@ -5440,7 +5440,7 @@ best_matching_font (f, attrs, fonts, nfonts) | |||
| 5440 | if (exact_p) | 5440 | if (exact_p) |
| 5441 | break; | 5441 | break; |
| 5442 | } | 5442 | } |
| 5443 | 5443 | ||
| 5444 | } | 5444 | } |
| 5445 | else | 5445 | else |
| 5446 | best = NULL; | 5446 | best = NULL; |
| @@ -5452,7 +5452,7 @@ best_matching_font (f, attrs, fonts, nfonts) | |||
| 5452 | /* A scalable font is better if | 5452 | /* A scalable font is better if |
| 5453 | 5453 | ||
| 5454 | 1. its weight, slant, swidth attributes are better, or. | 5454 | 1. its weight, slant, swidth attributes are better, or. |
| 5455 | 5455 | ||
| 5456 | 2. the best non-scalable font doesn't have the required | 5456 | 2. the best non-scalable font doesn't have the required |
| 5457 | point size, and the scalable fonts weight, slant, swidth | 5457 | point size, and the scalable fonts weight, slant, swidth |
| 5458 | isn't worse. */ | 5458 | isn't worse. */ |
| @@ -5463,7 +5463,7 @@ best_matching_font (f, attrs, fonts, nfonts) | |||
| 5463 | non_scalable_has_exact_height_p = 1; | 5463 | non_scalable_has_exact_height_p = 1; |
| 5464 | else | 5464 | else |
| 5465 | non_scalable_has_exact_height_p = 0; | 5465 | non_scalable_has_exact_height_p = 0; |
| 5466 | 5466 | ||
| 5467 | for (i = 0; i < nfonts; ++i) | 5467 | for (i = 0; i < nfonts; ++i) |
| 5468 | if (font_scalable_p (fonts + i)) | 5468 | if (font_scalable_p (fonts + i)) |
| 5469 | { | 5469 | { |
| @@ -5479,26 +5479,26 @@ best_matching_font (f, attrs, fonts, nfonts) | |||
| 5479 | font_name = build_scalable_font_name (f, best, pt); | 5479 | font_name = build_scalable_font_name (f, best, pt); |
| 5480 | else | 5480 | else |
| 5481 | font_name = build_font_name (best); | 5481 | font_name = build_font_name (best); |
| 5482 | 5482 | ||
| 5483 | #else /* !SCALABLE_FONTS */ | 5483 | #else /* !SCALABLE_FONTS */ |
| 5484 | 5484 | ||
| 5485 | /* Find the best non-scalable font. */ | 5485 | /* Find the best non-scalable font. */ |
| 5486 | best = fonts; | 5486 | best = fonts; |
| 5487 | 5487 | ||
| 5488 | for (i = 1; i < nfonts; ++i) | 5488 | for (i = 1; i < nfonts; ++i) |
| 5489 | { | 5489 | { |
| 5490 | xassert (!font_scalable_p (fonts + i)); | 5490 | xassert (!font_scalable_p (fonts + i)); |
| 5491 | if (better_font_p (specified, fonts + i, best, 1)) | 5491 | if (better_font_p (specified, fonts + i, best, 1)) |
| 5492 | best = fonts + i; | 5492 | best = fonts + i; |
| 5493 | } | 5493 | } |
| 5494 | 5494 | ||
| 5495 | font_name = build_font_name (best); | 5495 | font_name = build_font_name (best); |
| 5496 | 5496 | ||
| 5497 | #endif /* !SCALABLE_FONTS */ | 5497 | #endif /* !SCALABLE_FONTS */ |
| 5498 | 5498 | ||
| 5499 | /* Free font_name structures. */ | 5499 | /* Free font_name structures. */ |
| 5500 | free_font_names (fonts, nfonts); | 5500 | free_font_names (fonts, nfonts); |
| 5501 | 5501 | ||
| 5502 | return font_name; | 5502 | return font_name; |
| 5503 | } | 5503 | } |
| 5504 | 5504 | ||
| @@ -5519,13 +5519,13 @@ try_font_list (f, attrs, pattern, family, registry, fonts) | |||
| 5519 | 5519 | ||
| 5520 | if (NILP (family) && STRINGP (attrs[LFACE_FAMILY_INDEX])) | 5520 | if (NILP (family) && STRINGP (attrs[LFACE_FAMILY_INDEX])) |
| 5521 | family = attrs[LFACE_FAMILY_INDEX]; | 5521 | family = attrs[LFACE_FAMILY_INDEX]; |
| 5522 | 5522 | ||
| 5523 | nfonts = font_list (f, pattern, family, registry, fonts); | 5523 | nfonts = font_list (f, pattern, family, registry, fonts); |
| 5524 | 5524 | ||
| 5525 | if (nfonts == 0 && !NILP (family)) | 5525 | if (nfonts == 0 && !NILP (family)) |
| 5526 | { | 5526 | { |
| 5527 | Lisp_Object alter; | 5527 | Lisp_Object alter; |
| 5528 | 5528 | ||
| 5529 | /* Try alternative font families from | 5529 | /* Try alternative font families from |
| 5530 | Vface_alternative_font_family_alist. */ | 5530 | Vface_alternative_font_family_alist. */ |
| 5531 | alter = Fassoc (family, Vface_alternative_font_family_alist); | 5531 | alter = Fassoc (family, Vface_alternative_font_family_alist); |
| @@ -5537,7 +5537,7 @@ try_font_list (f, attrs, pattern, family, registry, fonts) | |||
| 5537 | if (STRINGP (XCAR (alter))) | 5537 | if (STRINGP (XCAR (alter))) |
| 5538 | nfonts = font_list (f, Qnil, XCAR (alter), registry, fonts); | 5538 | nfonts = font_list (f, Qnil, XCAR (alter), registry, fonts); |
| 5539 | } | 5539 | } |
| 5540 | 5540 | ||
| 5541 | /* Try font family of the default face or "fixed". */ | 5541 | /* Try font family of the default face or "fixed". */ |
| 5542 | if (nfonts == 0) | 5542 | if (nfonts == 0) |
| 5543 | { | 5543 | { |
| @@ -5548,7 +5548,7 @@ try_font_list (f, attrs, pattern, family, registry, fonts) | |||
| 5548 | family = build_string ("fixed"); | 5548 | family = build_string ("fixed"); |
| 5549 | nfonts = font_list (f, Qnil, family, registry, fonts); | 5549 | nfonts = font_list (f, Qnil, family, registry, fonts); |
| 5550 | } | 5550 | } |
| 5551 | 5551 | ||
| 5552 | /* Try any family with the given registry. */ | 5552 | /* Try any family with the given registry. */ |
| 5553 | if (nfonts == 0) | 5553 | if (nfonts == 0) |
| 5554 | nfonts = font_list (f, Qnil, Qnil, registry, fonts); | 5554 | nfonts = font_list (f, Qnil, Qnil, registry, fonts); |
| @@ -5568,7 +5568,7 @@ face_fontset (attrs) | |||
| 5568 | { | 5568 | { |
| 5569 | Lisp_Object name; | 5569 | Lisp_Object name; |
| 5570 | int fontset; | 5570 | int fontset; |
| 5571 | 5571 | ||
| 5572 | name = attrs[LFACE_FONT_INDEX]; | 5572 | name = attrs[LFACE_FONT_INDEX]; |
| 5573 | if (!STRINGP (name)) | 5573 | if (!STRINGP (name)) |
| 5574 | return -1; | 5574 | return -1; |
| @@ -5595,7 +5595,7 @@ choose_face_font (f, attrs, fontset, c) | |||
| 5595 | char *font_name = NULL; | 5595 | char *font_name = NULL; |
| 5596 | struct font_name *fonts; | 5596 | struct font_name *fonts; |
| 5597 | int nfonts; | 5597 | int nfonts; |
| 5598 | 5598 | ||
| 5599 | /* Get (foundry and) family name and registry (and encoding) name of | 5599 | /* Get (foundry and) family name and registry (and encoding) name of |
| 5600 | a font for C. */ | 5600 | a font for C. */ |
| 5601 | pattern = fontset_font_pattern (f, fontset, c); | 5601 | pattern = fontset_font_pattern (f, fontset, c); |
| @@ -5615,7 +5615,7 @@ choose_face_font (f, attrs, fontset, c) | |||
| 5615 | && SINGLE_BYTE_CHAR_P (c)) | 5615 | && SINGLE_BYTE_CHAR_P (c)) |
| 5616 | XCAR (pattern) = Qnil; | 5616 | XCAR (pattern) = Qnil; |
| 5617 | 5617 | ||
| 5618 | /* Get a list of fonts matching that pattern and choose the | 5618 | /* Get a list of fonts matching that pattern and choose the |
| 5619 | best match for the specified face attributes from it. */ | 5619 | best match for the specified face attributes from it. */ |
| 5620 | nfonts = try_font_list (f, attrs, Qnil, XCAR (pattern), XCDR (pattern), | 5620 | nfonts = try_font_list (f, attrs, Qnil, XCAR (pattern), XCDR (pattern), |
| 5621 | &fonts); | 5621 | &fonts); |
| @@ -5644,7 +5644,7 @@ realize_basic_faces (f) | |||
| 5644 | /* Block input there so that we won't be surprised by an X expose | 5644 | /* Block input there so that we won't be surprised by an X expose |
| 5645 | event, for instance without having the faces set up. */ | 5645 | event, for instance without having the faces set up. */ |
| 5646 | BLOCK_INPUT; | 5646 | BLOCK_INPUT; |
| 5647 | 5647 | ||
| 5648 | if (realize_default_face (f)) | 5648 | if (realize_default_face (f)) |
| 5649 | { | 5649 | { |
| 5650 | realize_named_face (f, Qmode_line, MODE_LINE_FACE_ID); | 5650 | realize_named_face (f, Qmode_line, MODE_LINE_FACE_ID); |
| @@ -5707,28 +5707,28 @@ realize_default_face (f) | |||
| 5707 | LFACE_WEIGHT (lface) = Qnormal; | 5707 | LFACE_WEIGHT (lface) = Qnormal; |
| 5708 | LFACE_SLANT (lface) = Qnormal; | 5708 | LFACE_SLANT (lface) = Qnormal; |
| 5709 | } | 5709 | } |
| 5710 | 5710 | ||
| 5711 | if (UNSPECIFIEDP (LFACE_UNDERLINE (lface))) | 5711 | if (UNSPECIFIEDP (LFACE_UNDERLINE (lface))) |
| 5712 | LFACE_UNDERLINE (lface) = Qnil; | 5712 | LFACE_UNDERLINE (lface) = Qnil; |
| 5713 | 5713 | ||
| 5714 | if (UNSPECIFIEDP (LFACE_OVERLINE (lface))) | 5714 | if (UNSPECIFIEDP (LFACE_OVERLINE (lface))) |
| 5715 | LFACE_OVERLINE (lface) = Qnil; | 5715 | LFACE_OVERLINE (lface) = Qnil; |
| 5716 | 5716 | ||
| 5717 | if (UNSPECIFIEDP (LFACE_STRIKE_THROUGH (lface))) | 5717 | if (UNSPECIFIEDP (LFACE_STRIKE_THROUGH (lface))) |
| 5718 | LFACE_STRIKE_THROUGH (lface) = Qnil; | 5718 | LFACE_STRIKE_THROUGH (lface) = Qnil; |
| 5719 | 5719 | ||
| 5720 | if (UNSPECIFIEDP (LFACE_BOX (lface))) | 5720 | if (UNSPECIFIEDP (LFACE_BOX (lface))) |
| 5721 | LFACE_BOX (lface) = Qnil; | 5721 | LFACE_BOX (lface) = Qnil; |
| 5722 | 5722 | ||
| 5723 | if (UNSPECIFIEDP (LFACE_INVERSE (lface))) | 5723 | if (UNSPECIFIEDP (LFACE_INVERSE (lface))) |
| 5724 | LFACE_INVERSE (lface) = Qnil; | 5724 | LFACE_INVERSE (lface) = Qnil; |
| 5725 | 5725 | ||
| 5726 | if (UNSPECIFIEDP (LFACE_FOREGROUND (lface))) | 5726 | if (UNSPECIFIEDP (LFACE_FOREGROUND (lface))) |
| 5727 | { | 5727 | { |
| 5728 | /* This function is called so early that colors are not yet | 5728 | /* This function is called so early that colors are not yet |
| 5729 | set in the frame parameter list. */ | 5729 | set in the frame parameter list. */ |
| 5730 | Lisp_Object color = Fassq (Qforeground_color, f->param_alist); | 5730 | Lisp_Object color = Fassq (Qforeground_color, f->param_alist); |
| 5731 | 5731 | ||
| 5732 | if (CONSP (color) && STRINGP (XCDR (color))) | 5732 | if (CONSP (color) && STRINGP (XCDR (color))) |
| 5733 | LFACE_FOREGROUND (lface) = XCDR (color); | 5733 | LFACE_FOREGROUND (lface) = XCDR (color); |
| 5734 | else if (FRAME_WINDOW_P (f)) | 5734 | else if (FRAME_WINDOW_P (f)) |
| @@ -5738,7 +5738,7 @@ realize_default_face (f) | |||
| 5738 | else | 5738 | else |
| 5739 | abort (); | 5739 | abort (); |
| 5740 | } | 5740 | } |
| 5741 | 5741 | ||
| 5742 | if (UNSPECIFIEDP (LFACE_BACKGROUND (lface))) | 5742 | if (UNSPECIFIEDP (LFACE_BACKGROUND (lface))) |
| 5743 | { | 5743 | { |
| 5744 | /* This function is called so early that colors are not yet | 5744 | /* This function is called so early that colors are not yet |
| @@ -5753,7 +5753,7 @@ realize_default_face (f) | |||
| 5753 | else | 5753 | else |
| 5754 | abort (); | 5754 | abort (); |
| 5755 | } | 5755 | } |
| 5756 | 5756 | ||
| 5757 | if (UNSPECIFIEDP (LFACE_STIPPLE (lface))) | 5757 | if (UNSPECIFIEDP (LFACE_STIPPLE (lface))) |
| 5758 | LFACE_STIPPLE (lface) = Qnil; | 5758 | LFACE_STIPPLE (lface) = Qnil; |
| 5759 | 5759 | ||
| @@ -5820,7 +5820,7 @@ realize_face (cache, attrs, c, base_face, former_face_id) | |||
| 5820 | int former_face_id; | 5820 | int former_face_id; |
| 5821 | { | 5821 | { |
| 5822 | struct face *face; | 5822 | struct face *face; |
| 5823 | 5823 | ||
| 5824 | /* LFACE must be fully specified. */ | 5824 | /* LFACE must be fully specified. */ |
| 5825 | xassert (cache != NULL); | 5825 | xassert (cache != NULL); |
| 5826 | check_lface_attrs (attrs); | 5826 | check_lface_attrs (attrs); |
| @@ -5891,11 +5891,11 @@ realize_x_face (cache, attrs, c, base_face) | |||
| 5891 | /* Don't try to free the colors copied bitwise from BASE_FACE. */ | 5891 | /* Don't try to free the colors copied bitwise from BASE_FACE. */ |
| 5892 | face->foreground_defaulted_p = 1; | 5892 | face->foreground_defaulted_p = 1; |
| 5893 | face->background_defaulted_p = 1; | 5893 | face->background_defaulted_p = 1; |
| 5894 | face->underline_defaulted_p = 1; | 5894 | face->underline_defaulted_p = 1; |
| 5895 | face->overline_color_defaulted_p = 1; | 5895 | face->overline_color_defaulted_p = 1; |
| 5896 | face->strike_through_color_defaulted_p = 1; | 5896 | face->strike_through_color_defaulted_p = 1; |
| 5897 | face->box_color_defaulted_p = 1; | 5897 | face->box_color_defaulted_p = 1; |
| 5898 | 5898 | ||
| 5899 | /* to force realize_face to load font */ | 5899 | /* to force realize_face to load font */ |
| 5900 | face->font = NULL; | 5900 | face->font = NULL; |
| 5901 | return face; | 5901 | return face; |
| @@ -5932,14 +5932,14 @@ realize_x_face (cache, attrs, c, base_face) | |||
| 5932 | are constructed from ATTRS. */ | 5932 | are constructed from ATTRS. */ |
| 5933 | int fontset = face_fontset (attrs); | 5933 | int fontset = face_fontset (attrs); |
| 5934 | 5934 | ||
| 5935 | if (fontset == -1) | 5935 | if ((fontset == -1) && default_face) |
| 5936 | fontset = default_face->fontset; | 5936 | fontset = default_face->fontset; |
| 5937 | face->fontset = make_fontset_for_ascii_face (f, fontset); | 5937 | face->fontset = make_fontset_for_ascii_face (f, fontset); |
| 5938 | face->font = NULL; /* to force realize_face to load font */ | 5938 | face->font = NULL; /* to force realize_face to load font */ |
| 5939 | } | 5939 | } |
| 5940 | 5940 | ||
| 5941 | /* Load colors, and set remaining attributes. */ | 5941 | /* Load colors, and set remaining attributes. */ |
| 5942 | 5942 | ||
| 5943 | load_face_colors (f, face, attrs); | 5943 | load_face_colors (f, face, attrs); |
| 5944 | 5944 | ||
| 5945 | /* Set up box. */ | 5945 | /* Set up box. */ |
| @@ -6009,9 +6009,9 @@ realize_x_face (cache, attrs, c, base_face) | |||
| 6009 | } | 6009 | } |
| 6010 | 6010 | ||
| 6011 | /* Text underline, overline, strike-through. */ | 6011 | /* Text underline, overline, strike-through. */ |
| 6012 | 6012 | ||
| 6013 | if (EQ (attrs[LFACE_UNDERLINE_INDEX], Qt)) | 6013 | if (EQ (attrs[LFACE_UNDERLINE_INDEX], Qt)) |
| 6014 | { | 6014 | { |
| 6015 | /* Use default color (same as foreground color). */ | 6015 | /* Use default color (same as foreground color). */ |
| 6016 | face->underline_p = 1; | 6016 | face->underline_p = 1; |
| 6017 | face->underline_defaulted_p = 1; | 6017 | face->underline_defaulted_p = 1; |
| @@ -6094,12 +6094,12 @@ realize_tty_face (cache, attrs, c) | |||
| 6094 | 6094 | ||
| 6095 | /* Frame must be a termcap frame. */ | 6095 | /* Frame must be a termcap frame. */ |
| 6096 | xassert (FRAME_TERMCAP_P (cache->f) || FRAME_MSDOS_P (cache->f)); | 6096 | xassert (FRAME_TERMCAP_P (cache->f) || FRAME_MSDOS_P (cache->f)); |
| 6097 | 6097 | ||
| 6098 | /* Allocate a new realized face. */ | 6098 | /* Allocate a new realized face. */ |
| 6099 | face = make_realized_face (attrs); | 6099 | face = make_realized_face (attrs); |
| 6100 | face->font_name = FRAME_MSDOS_P (cache->f) ? "ms-dos" : "tty"; | 6100 | face->font_name = FRAME_MSDOS_P (cache->f) ? "ms-dos" : "tty"; |
| 6101 | 6101 | ||
| 6102 | /* Map face attributes to TTY appearances. We map slant to | 6102 | /* Map face attributes to TTY appearances. We map slant to |
| 6103 | dimmed text because we want italic text to appear differently | 6103 | dimmed text because we want italic text to appear differently |
| 6104 | and because dimmed text is probably used infrequently. */ | 6104 | and because dimmed text is probably used infrequently. */ |
| 6105 | weight = face_numeric_weight (attrs[LFACE_WEIGHT_INDEX]); | 6105 | weight = face_numeric_weight (attrs[LFACE_WEIGHT_INDEX]); |
| @@ -6266,7 +6266,7 @@ compute_char_face (f, ch, prop) | |||
| 6266 | 6266 | ||
| 6267 | if (NILP (current_buffer->enable_multibyte_characters)) | 6267 | if (NILP (current_buffer->enable_multibyte_characters)) |
| 6268 | ch = -1; | 6268 | ch = -1; |
| 6269 | 6269 | ||
| 6270 | if (NILP (prop)) | 6270 | if (NILP (prop)) |
| 6271 | { | 6271 | { |
| 6272 | struct face *face = FACE_FROM_ID (f, DEFAULT_FACE_ID); | 6272 | struct face *face = FACE_FROM_ID (f, DEFAULT_FACE_ID); |
| @@ -6369,7 +6369,7 @@ face_at_buffer_position (w, pos, region_beg, region_end, | |||
| 6369 | *endptr = endpos; | 6369 | *endptr = endpos; |
| 6370 | 6370 | ||
| 6371 | default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); | 6371 | default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); |
| 6372 | 6372 | ||
| 6373 | /* Optimize common cases where we can use the default face. */ | 6373 | /* Optimize common cases where we can use the default face. */ |
| 6374 | if (noverlays == 0 | 6374 | if (noverlays == 0 |
| 6375 | && NILP (prop) | 6375 | && NILP (prop) |
| @@ -6405,7 +6405,7 @@ face_at_buffer_position (w, pos, region_beg, region_end, | |||
| 6405 | { | 6405 | { |
| 6406 | Lisp_Object region_face = lface_from_face_name (f, Qregion, 0); | 6406 | Lisp_Object region_face = lface_from_face_name (f, Qregion, 0); |
| 6407 | merge_face_vectors (XVECTOR (region_face)->contents, attrs); | 6407 | merge_face_vectors (XVECTOR (region_face)->contents, attrs); |
| 6408 | 6408 | ||
| 6409 | if (region_end < endpos) | 6409 | if (region_end < endpos) |
| 6410 | endpos = region_end; | 6410 | endpos = region_end; |
| 6411 | } | 6411 | } |
| @@ -6429,7 +6429,7 @@ face_at_buffer_position (w, pos, region_beg, region_end, | |||
| 6429 | id of the basic face to merge with. It is usually equal to | 6429 | id of the basic face to merge with. It is usually equal to |
| 6430 | DEFAULT_FACE_ID but can be MODE_LINE_FACE_ID or HEADER_LINE_FACE_ID | 6430 | DEFAULT_FACE_ID but can be MODE_LINE_FACE_ID or HEADER_LINE_FACE_ID |
| 6431 | for strings displayed in the mode or top line. | 6431 | for strings displayed in the mode or top line. |
| 6432 | 6432 | ||
| 6433 | Set *ENDPTR to the next position where to check for faces in | 6433 | Set *ENDPTR to the next position where to check for faces in |
| 6434 | STRING; -1 if the face is constant from POS to the end of the | 6434 | STRING; -1 if the face is constant from POS to the end of the |
| 6435 | string. | 6435 | string. |
| @@ -6559,7 +6559,7 @@ DEFUN ("dump-face", Fdump_face, Sdump_face, 0, 1, 0, "") | |||
| 6559 | if (NILP (n)) | 6559 | if (NILP (n)) |
| 6560 | { | 6560 | { |
| 6561 | int i; | 6561 | int i; |
| 6562 | 6562 | ||
| 6563 | fprintf (stderr, "font selection order: "); | 6563 | fprintf (stderr, "font selection order: "); |
| 6564 | for (i = 0; i < DIM (font_sort_order); ++i) | 6564 | for (i = 0; i < DIM (font_sort_order); ++i) |
| 6565 | fprintf (stderr, "%d ", font_sort_order[i]); | 6565 | fprintf (stderr, "%d ", font_sort_order[i]); |
| @@ -6568,7 +6568,7 @@ DEFUN ("dump-face", Fdump_face, Sdump_face, 0, 1, 0, "") | |||
| 6568 | fprintf (stderr, "alternative fonts: "); | 6568 | fprintf (stderr, "alternative fonts: "); |
| 6569 | debug_print (Vface_alternative_font_family_alist); | 6569 | debug_print (Vface_alternative_font_family_alist); |
| 6570 | fprintf (stderr, "\n"); | 6570 | fprintf (stderr, "\n"); |
| 6571 | 6571 | ||
| 6572 | for (i = 0; i < FRAME_FACE_CACHE (SELECTED_FRAME ())->used; ++i) | 6572 | for (i = 0; i < FRAME_FACE_CACHE (SELECTED_FRAME ())->used; ++i) |
| 6573 | Fdump_face (make_number (i)); | 6573 | Fdump_face (make_number (i)); |
| 6574 | } | 6574 | } |
| @@ -6581,7 +6581,7 @@ DEFUN ("dump-face", Fdump_face, Sdump_face, 0, 1, 0, "") | |||
| 6581 | error ("Not a valid face"); | 6581 | error ("Not a valid face"); |
| 6582 | dump_realized_face (face); | 6582 | dump_realized_face (face); |
| 6583 | } | 6583 | } |
| 6584 | 6584 | ||
| 6585 | return Qnil; | 6585 | return Qnil; |
| 6586 | } | 6586 | } |
| 6587 | 6587 | ||
| @@ -6613,7 +6613,7 @@ syms_of_xfaces () | |||
| 6613 | staticpro (&Qbitmap_spec_p); | 6613 | staticpro (&Qbitmap_spec_p); |
| 6614 | Qframe_update_face_colors = intern ("frame-update-face-colors"); | 6614 | Qframe_update_face_colors = intern ("frame-update-face-colors"); |
| 6615 | staticpro (&Qframe_update_face_colors); | 6615 | staticpro (&Qframe_update_face_colors); |
| 6616 | 6616 | ||
| 6617 | /* Lisp face attribute keywords. */ | 6617 | /* Lisp face attribute keywords. */ |
| 6618 | QCfamily = intern (":family"); | 6618 | QCfamily = intern (":family"); |
| 6619 | staticpro (&QCfamily); | 6619 | staticpro (&QCfamily); |
| @@ -6626,7 +6626,7 @@ syms_of_xfaces () | |||
| 6626 | QCunderline = intern (":underline"); | 6626 | QCunderline = intern (":underline"); |
| 6627 | staticpro (&QCunderline); | 6627 | staticpro (&QCunderline); |
| 6628 | QCinverse_video = intern (":inverse-video"); | 6628 | QCinverse_video = intern (":inverse-video"); |
| 6629 | staticpro (&QCinverse_video); | 6629 | staticpro (&QCinverse_video); |
| 6630 | QCreverse_video = intern (":reverse-video"); | 6630 | QCreverse_video = intern (":reverse-video"); |
| 6631 | staticpro (&QCreverse_video); | 6631 | staticpro (&QCreverse_video); |
| 6632 | QCforeground = intern (":foreground"); | 6632 | QCforeground = intern (":foreground"); |
| @@ -6775,7 +6775,7 @@ that number of fonts when searching for a matching font."); | |||
| 6775 | DEFVAR_LISP ("face-new-frame-defaults", &Vface_new_frame_defaults, | 6775 | DEFVAR_LISP ("face-new-frame-defaults", &Vface_new_frame_defaults, |
| 6776 | "List of global face definitions (for internal use only.)"); | 6776 | "List of global face definitions (for internal use only.)"); |
| 6777 | Vface_new_frame_defaults = Qnil; | 6777 | Vface_new_frame_defaults = Qnil; |
| 6778 | 6778 | ||
| 6779 | DEFVAR_LISP ("face-default-stipple", &Vface_default_stipple, | 6779 | DEFVAR_LISP ("face-default-stipple", &Vface_default_stipple, |
| 6780 | "*Default stipple pattern used on monochrome displays.\n\ | 6780 | "*Default stipple pattern used on monochrome displays.\n\ |
| 6781 | This stipple pattern is used on monochrome displays\n\ | 6781 | This stipple pattern is used on monochrome displays\n\ |
| @@ -6788,7 +6788,7 @@ See `set-face-stipple' for possible values for this variable."); | |||
| 6788 | Vface_alternative_font_family_alist = Qnil; | 6788 | Vface_alternative_font_family_alist = Qnil; |
| 6789 | 6789 | ||
| 6790 | #if SCALABLE_FONTS | 6790 | #if SCALABLE_FONTS |
| 6791 | 6791 | ||
| 6792 | DEFVAR_LISP ("scalable-fonts-allowed", &Vscalable_fonts_allowed, | 6792 | DEFVAR_LISP ("scalable-fonts-allowed", &Vscalable_fonts_allowed, |
| 6793 | "Allowed scalable fonts.\n\ | 6793 | "Allowed scalable fonts.\n\ |
| 6794 | A value of nil means don't allow any scalable fonts.\n\ | 6794 | A value of nil means don't allow any scalable fonts.\n\ |