Mercurial > hg > xemacs-beta
changeset 4669:2c1fa63dddbc
automatic merge
| author | Stephen J. Turnbull <stephen@xemacs.org> |
|---|---|
| date | Tue, 28 Jul 2009 23:29:22 +0900 |
| parents | 8b2a8ecf91cd (diff) d71d2cefa42d (current diff) |
| children | 5a54ce6dc945 |
| files | |
| diffstat | 7 files changed, 161 insertions(+), 78 deletions(-) [+] |
line wrap: on
line diff
--- a/lib-src/ChangeLog Tue Jul 28 15:56:22 2009 +0200 +++ b/lib-src/ChangeLog Tue Jul 28 23:29:22 2009 +0900 @@ -1,3 +1,7 @@ +2009-07-28 Stephen Turnbull <stephen@xemacs.org> + + * make-docfile.c (write_c_args): Parse UNUSED and USED_IF right. + 2009-05-18 Stephen J. Turnbull <stephen@xemacs.org> * XEmacs 21.5.29 "garbanzo" is released.
--- a/lib-src/make-docfile.c Tue Jul 28 15:56:22 2009 +0200 +++ b/lib-src/make-docfile.c Tue Jul 28 23:29:22 2009 +0900 @@ -533,6 +533,8 @@ /* Write to file OUT the argument names of function FUNC, whose text is in BUF. MINARGS and MAXARGS are the minimum and maximum number of arguments. */ +#define SKIPWHITE do { while (isspace ((unsigned char) (*p))) p++; } while (0) + static void write_c_args (FILE *out, const char *UNUSED (func), char *buf, int minargs, int maxargs) @@ -540,6 +542,7 @@ register char *p; int in_ident = 0; int just_spaced = 0; + int need_paren = 0; #if 0 int need_space = 1; @@ -560,76 +563,68 @@ for (p = buf; *p; p++) { char c = *p; +#if 0 int ident_start = 0; +#endif - /* XEmacs addition: add support for ANSI prototypes and the UNUSED - macros. Hop over them. "Lisp_Object" is the only C type allowed - in DEFUNs. For the UNUSED macros we need to eat parens, too. */ + /* XEmacs addition: used for ANSI prototypes and UNUSED macros. */ static char uu [] = "UNUSED"; static char ui [] = "USED_IF_"; - static char lo[] = "Lisp_Object"; - - /* aren't these all vulnerable to buffer overrun? I guess that - means that the .c is busted, so we may as well just die ... */ - /* skip over "Lisp_Object" */ - if ((C_IDENTIFIER_CHAR_P (c) != in_ident) && !in_ident && - (strncmp (p, lo, sizeof (lo) - 1) == 0) && - isspace ((unsigned char) p[sizeof (lo) - 1])) - { - p += (sizeof (lo) - 1); - while (isspace ((unsigned char) (*p))) - p++; - c = *p; - } + static char lo [] = "Lisp_Object"; - /* skip over "UNUSED" invocation */ - if ((C_IDENTIFIER_CHAR_P (c) != in_ident) && !in_ident && - (strncmp (p, uu, sizeof (uu) - 1) == 0)) - { - char *here = p; - p += (sizeof (uu) - 1); - while (isspace ((unsigned char) (*p))) - p++; - if (*p == '(') - { - while (isspace ((unsigned char) (*++p))) - ; - c = *p; - } - else - p = here; - } - - /* skip over "USED_IF_*" invocation (only if USED failed) */ - else if ((C_IDENTIFIER_CHAR_P (c) != in_ident) && !in_ident && - (strncmp (p, ui, sizeof (ui) - 1) == 0)) - { - char *here = p; - p += (sizeof (ui) - 1); - /* There should be a law against parsing in C: - this allows a broken USED_IF call, skipping to next macro's - parens. *You* can fix that, I don't see how offhand. ;-) */ - while (*p && *p++ != '(') - ; - if (*p) - { - while (isspace ((unsigned char) (*p))) - p++; - c = *p; - } - else - p = here; - } - - /* Notice when we start printing a new identifier. */ + /* Notice when we enter or leave an identifier. */ if (C_IDENTIFIER_CHAR_P (c) != in_ident) { if (!in_ident) { + /* Entering identifier. Print as we parse. */ + char *here; /* Target for backtracking. */ + + /* XEmacs addition: add support for ANSI prototypes and the + UNUSED macros. Hop over them. "Lisp_Object" is the only + C type allowed in DEFUNs. For the UNUSED macros we need + to eat parens, too. */ + /* Aren't these all vulnerable to buffer overrun? I guess that + means that the .c is busted, so we may as well just die ... */ + + /* Skip over "Lisp_Object". */ + if ((strncmp (p, lo, sizeof (lo) - 1) == 0) && + isspace ((unsigned char) p[sizeof (lo) - 1])) + { + p += (sizeof (lo) - 1); + SKIPWHITE; + } + /* Skip over "UNUSED" or "USED_IF_*" invocation. */ + need_paren = 1; + here = p; + if (strncmp (p, uu, sizeof (uu) - 1) == 0) + p += (sizeof (uu) - 1); + else if (strncmp (p, ui, sizeof (ui) - 1) == 0) + p += (sizeof (ui) - 1); + else + need_paren = 0; + + if (need_paren) + { + /* Skip rest of macro name, open paren, whitespace. */ + while (*p && C_IDENTIFIER_CHAR_P (*p)) + p++; + SKIPWHITE; + if (*p++ == '(') + SKIPWHITE; + else + { + need_paren = 0; + p = here; + } + } + c = *p; + + /* Do bookkeeping. Maybe output lambda keywords. */ in_ident = 1; - ident_start = 1; #if 0 /* XEmacs - This goes along with the change above. */ + ident_start = 1; if (need_space) putc (' ', out); #endif @@ -641,7 +636,18 @@ maxargs--; } else - in_ident = 0; + { + /* Leaving identifier. */ + in_ident = 0; + if (need_paren) + { + SKIPWHITE; + if (*p == ')') + p++; + c = *p; + need_paren = 0; + } + } } /* Print the C argument list as it would appear in lisp: @@ -705,6 +711,8 @@ if (!ellcc) putc ('\n', out); } +#undef SKIPWHITE + /* Read through a c file. If a .o or .obj file is named, the corresponding .c file is read instead.
--- a/man/ChangeLog Tue Jul 28 15:56:22 2009 +0200 +++ b/man/ChangeLog Tue Jul 28 23:29:22 2009 +0900 @@ -1,3 +1,14 @@ +2009-07-28 Stephen Turnbull <stephen@xemacs.org> + + * internals/internals.texi (Redisplay Piece by Piece): + Small improvements. + +2009-07-08 Stephen Turnbull <stephen@xemacs.org> + + * xemacs/custom.texi (Xft Font Customization): Change references + from XftFont (now deprecated) to FcFontName. + Thanks, Raymond Toy <raymond.toy@stericsson.com>. + 2009-05-18 Stephen J. Turnbull <stephen@xemacs.org> * XEmacs 21.5.29 "garbanzo" is released.
--- a/man/internals/internals.texi Tue Jul 28 15:56:22 2009 +0200 +++ b/man/internals/internals.texi Tue Jul 28 23:29:22 2009 +0900 @@ -18221,21 +18221,25 @@ @section Redisplay Piece by Piece @cindex redisplay piece by piece -As you can begin to see redisplay is complex and also not well -documented. Chuck no longer works on XEmacs so this section is my take -on the workings of redisplay. +Redisplay is complex and not very well documented. Chuck Thompson no +longer works on XEmacs so this section is my [presumably Ben's] take on +the workings of redisplay. Redisplay happens in three phases: @enumerate @item Determine desired display in area that needs redisplay. -Implemented by @code{redisplay.c} + +Implemented in @code{redisplay.c} @item Compare desired display with current display -Implemented by @code{redisplay-output.c} -@item -Output changes Implemented by @code{redisplay-output.c}, + +Implemented in @code{redisplay-output.c} +@item +Output changes + +Implemented in @code{redisplay-output.c}, @code{redisplay-x.c}, @code{redisplay-msw.c} and @code{redisplay-tty.c} @end enumerate @@ -18255,6 +18259,8 @@ modeline. Hence the @code{display_line} generation routines are duplicated for generating the modeline. This means that the modeline display code has many bugs that the standard redisplay code does not. +Perhaps the modeline redisplay could be unified with gutter redisplay +(see below). The guts of @code{display_line} generation are in @code{create_text_block}, which creates a single display line for the @@ -18268,6 +18274,46 @@ @code{create_text_block} to do with cursor handling and selective display have been removed. +In the following, @code{create_text_block} only will be described, so +keep in mind in the fact that modeline and gutter redisplay are somewhat +different. + +@code{create_text_block} takes a @code{struct window *}, the index of a +line in the text (a @code{Bytebpos}) and a @code{struct display_line *}, +as well as two arguments @code{prop} and @code{type} (as yet +undocumented). Given the window, it can derive the relevant buffer, and +use the @code{Bytebpos} to find the line of text. It then walks over +the characters in the text and regenerates the display line information +for each. + +@code{create_text_block} calls out to @code{extent_fragment_update} to +get information about faces (fonts and colors), which are represented as +a @code{face_index}, an index into a table of merged faces. Faces must +be merged because (1) a face may inherit properties from their parents +and (2) faces may be only partially specified, in which case redisplay +must fall back to faces associated with extents earlier in the extent +order (@pxref{Extent Ordering}). Since getting complete information +about a face involves instantantiating many specifiers, we keep a cache +of this information, and a @code{face_index} is an index into the cache. + +@code{extent_fragment_update} calls out to +@code{get_extent_fragment_face_cache_index}, which in turn calls +@code{merge_face_cachel_data} on each relevant face. +@code{merge_face_cachel_data} is straightforward, except for font +handling. In the case of fonts, the legacy XLFD model has a different +font for each Mule charset (in fact, both the XLFD model of I18N and +that of Mule are derived from the same root, ISO 2022, and so mesh +well---or as well as anything based on ISO 2022 can). This means that +@code{merge_face_cachel_data} has to iterate over the list of Mule +charsets, and update the font for each one. + +@code{create_text_block} is not responsible for creating face cachels. +That is done by @code{redisplay_output_layout}, +@code{redisplay_text_width_string} or +@code{redisplay_text_width_ichar_string}, via +@code{ensure_face_cachel_complete}, with the actual work being done by +@code{ensure_face_cachel_contains_charset}. + @node Modules for the Redisplay Mechanism, Modules for other Display-Related Lisp Objects, Redisplay Piece by Piece, The Redisplay Mechanism @section Modules for the Redisplay Mechanism @cindex modules for the redisplay mechanism
--- a/man/xemacs/custom.texi Tue Jul 28 15:56:22 2009 +0200 +++ b/man/xemacs/custom.texi Tue Jul 28 23:29:22 2009 +0900 @@ -2566,16 +2566,19 @@ Here are the resources I use. @strong{Warning:} @emph{This interface will change. Pay attention to beta announcements, and complain loudly if changes aren't documented here!} The tab control and menubar have -separate Font and XftFont resources, and use the X resource manager to -instantiate a FontStruct from the Font resource. There is no converter -facility for XftFont yet, and creating one that handles both FontStruct -and XftFont depending on XEmacs's configuration and the font name seems -error-prone at best. Probably we will use a simple string -representation for this resource, and convert to a face in XEmacs rather -than a font in Xt/Xft. +separate @code{Font} and @code{FcFontName} resources, and use the X +resource manager to instantiate a FontStruct from the @code{Font} +resource. There is no converter facility for @code{FcFontName} yet, and +creating one that handles both FontStruct and XftFont depending on +XEmacs's configuration and the font name seems error-prone at best. +Probably we will use a simple string representation for this resource, +and convert to a face in XEmacs rather than a font in Xt/Xft. (The +older @code{XftFont} resource is deprecated. There is code intended to +implement backward compatibility, but there are repots that it doesn't +work properly.) @example -XEmacs*Tabs.xftFont: Bitstream Vera Sans-16 -XEmacs*menubar*xftFont: Bitstream Vera Sans-16 +XEmacs*Tabs.fcFontName: Bitstream Vera Sans-16 +XEmacs*menubar*fcFontName: Bitstream Vera Sans-16 XEmacs.modeline.attributeFont: Bitstream Charter-16 XEmacs.default.attributeFont: Bitstream Vera Sans Mono-16 @end example
--- a/src/ChangeLog Tue Jul 28 15:56:22 2009 +0200 +++ b/src/ChangeLog Tue Jul 28 23:29:22 2009 +0900 @@ -1,3 +1,10 @@ +2009-07-28 Stephen Turnbull <stephen@xemacs.org> + + * faces.c (ensure_face_cachel_contains_charset): + (add_face_cachel): + (update_face_cachel_data): + Fix typos in comments and otherwise improve them. + 2009-07-27 Stephen J. Turnbull <stephen@xemacs.org> * eval.c (debug-on-error): Document interaction with process filters.
--- a/src/faces.c Tue Jul 28 15:56:22 2009 +0200 +++ b/src/faces.c Tue Jul 28 23:29:22 2009 +0900 @@ -1171,7 +1171,11 @@ /* Lookup the face again, this time allowing the fallback. If this succeeds, it'll give a font intended for the script in question, which is preferable to translating to ISO10646-1 and using the - fixed-width fallback. */ + fixed-width fallback. + + #### This is questionable. The problem is that unusual scripts + will typically fallback to the hard-coded values as the user is + unlikely to have specified them herself, a common complaint. */ new_val = face_property_matching_instance (face, Qfont, charset, domain, ERROR_ME_DEBUG_WARN, 0, @@ -1353,7 +1357,7 @@ Dynarr_add (w->face_cachels, new_cachel); /* The face's background pixmap have not yet been frobbed (see comment - int update_face_cachel_data), so we have to do it now */ + in update_face_cachel_data), so we have to do it now */ if (must_finish_frobbing) { int default_face = EQ (face, Vdefault_face); @@ -1394,7 +1398,7 @@ which in turn might require that the cache we're building be up to date, hence a crash. Here's a typical scenario of this: - - a new window is created and it's face cache elements are + - a new window is created and its face cache elements are initialized through a call to reset_face_cachels[1]. At that point, the cache for the default and modeline faces (normaly taken care of by redisplay itself) are null.
