X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/dd559368b0db67654f643320b1d84afdabe60e97..73b0cd50031a714347109169ceb8bacae338612a:/src/disptab.h diff --git a/src/disptab.h b/src/disptab.h index 6d96f51f81..be611cb8a9 100644 --- a/src/disptab.h +++ b/src/disptab.h @@ -1,13 +1,12 @@ /* Things for GLYPHS and glyph tables. - Copyright (C) 1993, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 1993, 2001-2011 Free Software Foundation, Inc. This file is part of GNU Emacs. -GNU Emacs is free software; you can redistribute it and/or modify +GNU Emacs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3, or (at your option) -any later version. +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,9 +14,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GNU Emacs. If not, see . */ /* Access the slots of a display-table, according to their purpose. */ @@ -34,7 +31,7 @@ Boston, MA 02110-1301, USA. */ #define DISP_INVIS_VECTOR(dp) ((dp)->extras[4]) #define DISP_BORDER_GLYPH(dp) ((dp)->extras[5]) -extern Lisp_Object disp_char_vector P_ ((struct Lisp_Char_Table *, int)); +extern Lisp_Object disp_char_vector (struct Lisp_Char_Table *, int); #define DISP_CHAR_VECTOR(dp, c) \ (ASCII_CHAR_P(c) \ @@ -46,21 +43,14 @@ extern Lisp_Object disp_char_vector P_ ((struct Lisp_Char_Table *, int)); : disp_char_vector ((dp), (c))) /* Defined in window.c. */ -extern struct Lisp_Char_Table *window_display_table P_ ((struct window *)); +extern struct Lisp_Char_Table *window_display_table (struct window *); /* Defined in indent.c. */ -extern struct Lisp_Char_Table *buffer_display_table P_ ((void)); - -/* Display table to use for vectors that don't specify their own. */ -extern Lisp_Object Vstandard_display_table; +extern struct Lisp_Char_Table *buffer_display_table (void); /* This is the `purpose' slot of a display table. */ extern Lisp_Object Qdisplay_table; -/* Vector of GLYPH definitions. Indexed by GLYPH number, - the contents are a string which is how to output the GLYPH. */ -extern Lisp_Object Vglyph_table; - /* Return the current length of the GLYPH table, or 0 if the table isn't currently valid. */ #define GLYPH_TABLE_LENGTH \ @@ -74,38 +64,35 @@ extern Lisp_Object Vglyph_table; /* Given BASE and LEN returned by the two previous macros, return nonzero if the GLYPH code G should be output as a single character with code G. Return zero if G has a string in the table. */ -#define GLYPH_SIMPLE_P(base,len,g) ((g) >= (len) || !STRINGP (base[g])) +#define GLYPH_SIMPLE_P(base,len,g) \ + (GLYPH_FACE (g) != DEFAULT_FACE_ID || GLYPH_CHAR (g) >= (len) || !STRINGP (base[GLYPH_CHAR (g)])) /* Given BASE and LEN returned by the two previous macros, return nonzero if GLYPH code G is aliased to a different code. */ -#define GLYPH_ALIAS_P(base,len,g) ((g) < (len) && INTEGERP (base[g])) - -/* Assuming that GLYPH_SIMPLE_P (BASE, LEN, G) is 1, - return the alias for G. */ -#define GLYPH_ALIAS(base, g) XINT (base[g]) +#define GLYPH_ALIAS_P(base,len,g) \ + (GLYPH_FACE (g) == DEFAULT_FACE_ID && GLYPH_CHAR (g) < (len) && INTEGERP (base[GLYPH_CHAR (g)])) /* Follow all aliases for G in the glyph table given by (BASE, LENGTH), and set G to the final glyph. */ -#define GLYPH_FOLLOW_ALIASES(base, length, g) \ - do { \ - while (GLYPH_ALIAS_P ((base), (length), (g))) \ - (g) = GLYPH_ALIAS ((base), (g)); \ - if (!GLYPH_CHAR_VALID_P (FAST_GLYPH_CHAR (g))) \ - g = FAST_MAKE_GLYPH (' ', FAST_GLYPH_FACE (g)); \ +#define GLYPH_FOLLOW_ALIASES(base, length, g) \ + do { \ + while (GLYPH_ALIAS_P ((base), (length), (g))) \ + SET_GLYPH_CHAR ((g), XINT ((base)[GLYPH_CHAR (g)])); \ + if (!GLYPH_CHAR_VALID_P (g)) \ + SET_GLYPH_CHAR (g, ' '); \ } while (0) /* Assuming that GLYPH_SIMPLE_P (BASE, LEN, G) is 0, return the length and the address of the character-sequence used for outputting GLYPH G. */ -#define GLYPH_LENGTH(base,g) SCHARS (base[g]) -#define GLYPH_STRING(base,g) SDATA (base[g]) +#define GLYPH_LENGTH(base,g) SCHARS (base[GLYPH_CHAR (g)]) +#define GLYPH_STRING(base,g) SDATA (base[GLYPH_CHAR (g)]) /* GLYPH for a space character. */ #define SPACEGLYPH 040 #define NULL_GLYPH 00 -#define GLYPH_FROM_CHAR(c) (c) +#define SET_GLYPH_FROM_CHAR(glyph, c) \ + SET_GLYPH (glyph, c, DEFAULT_FACE_ID) -/* arch-tag: d7f792d2-f59c-4904-a91e-91522e3ab349 - (do not change this comment) */