Mercurial > hg > xemacs-beta
comparison src/objects-tty.c @ 5015:d95c102a96d3
cleanups for specifier font stages, from ben-unicode-internal (preparation for eliminating shadowed warnings)
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-02-08 Ben Wing <ben@xemacs.org>
* faces.c:
* faces.c (face_property_matching_instance):
* faces.c (ensure_face_cachel_contains_charset):
* faces.h (FACE_FONT):
* lisp.h:
* lisp.h (enum font_specifier_matchspec_stages):
* objects-msw.c:
* objects-msw.c (mswindows_font_spec_matches_charset):
* objects-msw.c (mswindows_find_charset_font):
* objects-tty.c:
* objects-tty.c (tty_font_spec_matches_charset):
* objects-tty.c (tty_find_charset_font):
* objects-xlike-inc.c:
* objects-xlike-inc.c (XFUN):
* objects-xlike-inc.c (xft_find_charset_font):
* objects.c:
* objects.c (font_instantiate):
* objects.c (FROB):
* specifier.c:
* specifier.c (charset_matches_specifier_tag_set_p):
* specifier.c (call_charset_predicate):
* specifier.c (define_specifier_tag):
* specifier.c (Fdefine_specifier_tag):
* specifier.c (setup_charset_initial_specifier_tags):
* specifier.c (specifier_instance_from_inst_list):
* specifier.c (FROB):
* specifier.c (vars_of_specifier):
* specifier.h:
Rename the specifier-font-matching stages in preparation for
eliminating shadowed warnings, some other related fixes from
ben-unicode-internal.
1. Rename raw enums:
initial -> STAGE_INITIAL
final -> STAGE_FINAL
impossible -> NUM_MATCHSPEC_STAGES
2. Move `enum font_specifier_matchspec_stages' from
specifier.h to lisp.h.
3. Whitespace changes to match coding standards.
4. Eliminate unused second argument STAGE in charset predicates
that don't use it -- the code that calls the charset predicates
is now smart enough to supply the right number of arguments
automatically.
5. Add some long(ish) comments and authorial notices, esp. in
objects.c.
6. In specifier.c, change Vcharset_tag_lists from a vector over
leading bytes to a hash table over charsets. This change is
unnecessary currently but doesn't hurt and will be required
when we merge in Unicode-internal.
7. In specifier.c, extract out the code that calls charset predicates
into a function call_charset_predicate().
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 08 Feb 2010 16:51:25 -0600 |
parents | 16112448d484 |
children | d4f666cda5e6 b5df3737028a |
comparison
equal
deleted
inserted
replaced
5014:c2e0c3af5fe3 | 5015:d95c102a96d3 |
---|---|
1 /* TTY-specific Lisp objects. | 1 /* TTY-specific Lisp objects. |
2 Copyright (C) 1995 Board of Trustees, University of Illinois. | 2 Copyright (C) 1995 Board of Trustees, University of Illinois. |
3 Copyright (C) 1995, 1996, 2001, 2002 Ben Wing. | 3 Copyright (C) 1995, 1996, 2001, 2002, 2010 Ben Wing. |
4 | 4 |
5 This file is part of XEmacs. | 5 This file is part of XEmacs. |
6 | 6 |
7 XEmacs is free software; you can redistribute it and/or modify it | 7 XEmacs is free software; you can redistribute it and/or modify it |
8 under the terms of the GNU General Public License as published by the | 8 under the terms of the GNU General Public License as published by the |
343 Bytecount offset, Bytecount length, | 343 Bytecount offset, Bytecount length, |
344 enum font_specifier_matchspec_stages stage) | 344 enum font_specifier_matchspec_stages stage) |
345 { | 345 { |
346 const Ibyte *the_nonreloc = nonreloc; | 346 const Ibyte *the_nonreloc = nonreloc; |
347 | 347 |
348 if (stage) | 348 if (stage == STAGE_FINAL) |
349 return 0; | 349 return 0; |
350 | 350 |
351 if (!the_nonreloc) | 351 if (!the_nonreloc) |
352 the_nonreloc = XSTRING_DATA (reloc); | 352 the_nonreloc = XSTRING_DATA (reloc); |
353 fixup_internal_substring (nonreloc, reloc, offset, &length); | 353 fixup_internal_substring (nonreloc, reloc, offset, &length); |
372 Lisp_Object charset, | 372 Lisp_Object charset, |
373 enum font_specifier_matchspec_stages stage) | 373 enum font_specifier_matchspec_stages stage) |
374 { | 374 { |
375 Ibyte *fontname = XSTRING_DATA (font); | 375 Ibyte *fontname = XSTRING_DATA (font); |
376 | 376 |
377 if (stage) | 377 if (stage == STAGE_FINAL) |
378 return Qnil; | 378 return Qnil; |
379 | 379 |
380 if (strchr ((const char *) fontname, '/')) | 380 if (strchr ((const char *) fontname, '/')) |
381 { | 381 { |
382 if (tty_font_spec_matches_charset (XDEVICE (device), charset, 0, | 382 if (tty_font_spec_matches_charset (XDEVICE (device), charset, 0, |
383 font, 0, -1, initial)) | 383 font, 0, -1, STAGE_INITIAL)) |
384 return font; | 384 return font; |
385 return Qnil; | 385 return Qnil; |
386 } | 386 } |
387 | 387 |
388 if (NILP (charset)) | 388 if (NILP (charset)) |