diff options
| author | Karoly Lorentey | 2005-09-09 20:52:13 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-09-09 20:52:13 +0000 |
| commit | f0ed0a6c895c49f50c9cbcafe36b1a86a25a8620 (patch) | |
| tree | 2599e82aa2fadfdc3b4de6039adee9461d14570b /src | |
| parent | af520c4a4e04e55c854bb782af8df8412028c481 (diff) | |
| parent | b948abc811f0911a02e63ee55ad36504ddd981d6 (diff) | |
| download | emacs-f0ed0a6c895c49f50c9cbcafe36b1a86a25a8620.tar.gz emacs-f0ed0a6c895c49f50c9cbcafe36b1a86a25a8620.zip | |
Merged in changes from CVS trunk.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-404
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 46 | ||||
| -rw-r--r-- | src/doc.c | 13 | ||||
| -rw-r--r-- | src/frame.h | 3 | ||||
| -rw-r--r-- | src/macterm.c | 445 | ||||
| -rw-r--r-- | src/xdisp.c | 39 | ||||
| -rw-r--r-- | src/xfaces.c | 5 |
6 files changed, 439 insertions, 112 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index bc76f96208a..deb2b4ce3eb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,39 @@ | |||
| 1 | 2005-09-09 Kim F. Storm <storm@cua.dk> | ||
| 2 | |||
| 3 | * doc.c (Fsubstitute_command_keys): Lookup key binding for | ||
| 4 | commands that are remapped from some other command. | ||
| 5 | |||
| 6 | * xdisp.c (try_window_reusing_current_matrix): Clear mode_line_p | ||
| 7 | flag in disabled rows below the window. | ||
| 8 | |||
| 9 | * frame.h (struct frame): New member updated_p. | ||
| 10 | |||
| 11 | * xdisp.c (redisplay_internal): Mark updated frames in new updated_p | ||
| 12 | member. Remove local `updated' array and associated variables. | ||
| 13 | |||
| 14 | 2005-09-07 Kim F. Storm <storm@cua.dk> | ||
| 15 | |||
| 16 | * xdisp.c (handle_display_prop): Respect overlay window property. | ||
| 17 | |||
| 18 | * xdisp.c (try_window): Remove superfluous cursor_height calculation. | ||
| 19 | Fixes crash reported by YAMAMOTO Mitsuharu. | ||
| 20 | |||
| 21 | 2005-09-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 22 | |||
| 23 | * macterm.c (struct xlfdpat_block, struct xlfdpat): New structs. | ||
| 24 | (xlfdpat_destroy, xlfdpat_create, xlfdpat_exact_p) | ||
| 25 | (xlfdpat_block_match_1, xlfdpat_match): New functions. | ||
| 26 | (xlfdpat_block_match): New macro. | ||
| 27 | (mac_to_x_fontname): Don't use tolower for non-ASCII characters. | ||
| 28 | (x_font_name_to_mac_font_name): Set coding.dst_multibyte to 0. | ||
| 29 | (add_font_name_table_entry): Increase font_name_table_size more | ||
| 30 | rapidly. | ||
| 31 | (mac_c_string_match): Remove function. | ||
| 32 | (mac_do_list_fonts): Use XLFD pattern match instead of regular | ||
| 33 | expression match. | ||
| 34 | |||
| 35 | * xfaces.c (xstrlwr): Don't use tolower for non-ASCII characters. | ||
| 36 | |||
| 1 | 2005-09-03 Richard M. Stallman <rms@gnu.org> | 37 | 2005-09-03 Richard M. Stallman <rms@gnu.org> |
| 2 | 38 | ||
| 3 | * xdisp.c (redisplay_internal): Make UPDATED as long as needed. | 39 | * xdisp.c (redisplay_internal): Make UPDATED as long as needed. |
| @@ -8,8 +44,18 @@ | |||
| 8 | 44 | ||
| 9 | * editfns.c (Fpropertize): Don't insist that properties be symbols. | 45 | * editfns.c (Fpropertize): Don't insist that properties be symbols. |
| 10 | 46 | ||
| 47 | 2005-09-02 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 48 | |||
| 49 | * dired.c (directory_files_internal_unwind, directory_files_internal) | ||
| 50 | (file_name_completion): Use a Save_Value object rather than a cons of | ||
| 51 | two 16bit ints to store the DIR*. | ||
| 52 | (directory_files_internal, file_name_completion): Handle both EINTR and | ||
| 53 | EAGAIN consistently after `readdir'. | ||
| 54 | |||
| 11 | 2005-09-01 Stefan Monnier <monnier@iro.umontreal.ca> | 55 | 2005-09-01 Stefan Monnier <monnier@iro.umontreal.ca> |
| 12 | 56 | ||
| 57 | * intervals.c (update_interval): Add position info in error. | ||
| 58 | |||
| 13 | * dispnew.c (window_to_frame_hpos, update_window): | 59 | * dispnew.c (window_to_frame_hpos, update_window): |
| 14 | Avoid gcc warning about unused variable `f'. | 60 | Avoid gcc warning about unused variable `f'. |
| 15 | 61 | ||
| @@ -57,6 +57,8 @@ static Lisp_Object Vbuild_files; | |||
| 57 | 57 | ||
| 58 | extern Lisp_Object Voverriding_local_map; | 58 | extern Lisp_Object Voverriding_local_map; |
| 59 | 59 | ||
| 60 | extern Lisp_Object Qremap; | ||
| 61 | |||
| 60 | /* For VMS versions with limited file name syntax, | 62 | /* For VMS versions with limited file name syntax, |
| 61 | convert the name to something VMS will allow. */ | 63 | convert the name to something VMS will allow. */ |
| 62 | static void | 64 | static void |
| @@ -812,6 +814,7 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int | |||
| 812 | else if (strp[0] == '\\' && strp[1] == '[') | 814 | else if (strp[0] == '\\' && strp[1] == '[') |
| 813 | { | 815 | { |
| 814 | int start_idx; | 816 | int start_idx; |
| 817 | int follow_remap = 1; | ||
| 815 | 818 | ||
| 816 | changed = 1; | 819 | changed = 1; |
| 817 | strp += 2; /* skip \[ */ | 820 | strp += 2; /* skip \[ */ |
| @@ -830,11 +833,21 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int | |||
| 830 | idx = strp - SDATA (string); | 833 | idx = strp - SDATA (string); |
| 831 | name = Fintern (make_string (start, length_byte), Qnil); | 834 | name = Fintern (make_string (start, length_byte), Qnil); |
| 832 | 835 | ||
| 836 | do_remap: | ||
| 833 | /* Ignore remappings unless there are no ordinary bindings. */ | 837 | /* Ignore remappings unless there are no ordinary bindings. */ |
| 834 | tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qt); | 838 | tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qt); |
| 835 | if (NILP (tem)) | 839 | if (NILP (tem)) |
| 836 | tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qnil); | 840 | tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qnil); |
| 837 | 841 | ||
| 842 | if (VECTORP (tem) && XVECTOR (tem)->size > 1 | ||
| 843 | && EQ (AREF (tem, 0), Qremap) && SYMBOLP (AREF (tem, 1)) | ||
| 844 | && follow_remap) | ||
| 845 | { | ||
| 846 | name = AREF (tem, 1); | ||
| 847 | follow_remap = 0; | ||
| 848 | goto do_remap; | ||
| 849 | } | ||
| 850 | |||
| 838 | /* Note the Fwhere_is_internal can GC, so we have to take | 851 | /* Note the Fwhere_is_internal can GC, so we have to take |
| 839 | relocation of string contents into account. */ | 852 | relocation of string contents into account. */ |
| 840 | strp = SDATA (string) + idx; | 853 | strp = SDATA (string) + idx; |
diff --git a/src/frame.h b/src/frame.h index 838b61bb703..e8155ac8212 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -448,6 +448,9 @@ struct frame | |||
| 448 | /* Set to non-zero if this frame has already been hscrolled during | 448 | /* Set to non-zero if this frame has already been hscrolled during |
| 449 | current redisplay. */ | 449 | current redisplay. */ |
| 450 | unsigned already_hscrolled_p : 1; | 450 | unsigned already_hscrolled_p : 1; |
| 451 | |||
| 452 | /* Set to non-zero when current redisplay has updated frame. */ | ||
| 453 | unsigned updated_p : 1; | ||
| 451 | }; | 454 | }; |
| 452 | 455 | ||
| 453 | #ifdef MULTI_KBOARD | 456 | #ifdef MULTI_KBOARD |
diff --git a/src/macterm.c b/src/macterm.c index d6dbecfe800..f727c013809 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -6084,6 +6084,335 @@ x_wm_set_icon_position (f, icon_x, icon_y) | |||
| 6084 | 6084 | ||
| 6085 | 6085 | ||
| 6086 | /*********************************************************************** | 6086 | /*********************************************************************** |
| 6087 | XLFD Pattern Match | ||
| 6088 | ***********************************************************************/ | ||
| 6089 | |||
| 6090 | /* An XLFD pattern is divided into blocks delimited by '*'. This | ||
| 6091 | structure holds information for each block. */ | ||
| 6092 | struct xlfdpat_block | ||
| 6093 | { | ||
| 6094 | /* Length of the pattern string in this block. Non-zero except for | ||
| 6095 | the first and the last blocks. */ | ||
| 6096 | int len; | ||
| 6097 | |||
| 6098 | /* Pattern string except the last character in this block. The last | ||
| 6099 | character is replaced with NUL in order to use it as a | ||
| 6100 | sentinel. */ | ||
| 6101 | unsigned char *pattern; | ||
| 6102 | |||
| 6103 | /* Last character of the pattern string. Must not be '?'. */ | ||
| 6104 | unsigned char last_char; | ||
| 6105 | |||
| 6106 | /* One of the tables for the Boyer-Moore string search. It | ||
| 6107 | specifies the number of positions to proceed for each character | ||
| 6108 | with which the match fails. */ | ||
| 6109 | int skip[256]; | ||
| 6110 | |||
| 6111 | /* The skip value for the last character in the above `skip' is | ||
| 6112 | assigned to `infinity' in order to simplify a loop condition. | ||
| 6113 | The original value is saved here. */ | ||
| 6114 | int last_char_skip; | ||
| 6115 | }; | ||
| 6116 | |||
| 6117 | struct xlfdpat | ||
| 6118 | { | ||
| 6119 | /* Normalized pattern string. "Normalized" means that capital | ||
| 6120 | letters are lowered, blocks are not empty except the first and | ||
| 6121 | the last ones, and trailing '?'s in a block that is not the last | ||
| 6122 | one are moved to the next one. The last character in each block | ||
| 6123 | is replaced with NUL. */ | ||
| 6124 | unsigned char *buf; | ||
| 6125 | |||
| 6126 | /* Number of characters except '*'s and trailing '?'s in the | ||
| 6127 | normalized pattern string. */ | ||
| 6128 | int nchars; | ||
| 6129 | |||
| 6130 | /* Number of trailing '?'s in the normalized pattern string. */ | ||
| 6131 | int trailing_anychars; | ||
| 6132 | |||
| 6133 | /* Number of blocks and information for each block. The latter is | ||
| 6134 | NULL if the pattern is exact (no '*' or '?' in it). */ | ||
| 6135 | int nblocks; | ||
| 6136 | struct xlfdpat_block *blocks; | ||
| 6137 | }; | ||
| 6138 | |||
| 6139 | static void | ||
| 6140 | xlfdpat_destroy (pat) | ||
| 6141 | struct xlfdpat *pat; | ||
| 6142 | { | ||
| 6143 | if (pat) | ||
| 6144 | { | ||
| 6145 | if (pat->buf) | ||
| 6146 | { | ||
| 6147 | if (pat->blocks) | ||
| 6148 | xfree (pat->blocks); | ||
| 6149 | xfree (pat->buf); | ||
| 6150 | } | ||
| 6151 | xfree (pat); | ||
| 6152 | } | ||
| 6153 | } | ||
| 6154 | |||
| 6155 | static struct xlfdpat * | ||
| 6156 | xlfdpat_create (pattern) | ||
| 6157 | char *pattern; | ||
| 6158 | { | ||
| 6159 | struct xlfdpat *pat; | ||
| 6160 | int nblocks, i, skip; | ||
| 6161 | unsigned char last_char, *p, *q, *anychar_head; | ||
| 6162 | struct xlfdpat_block *blk; | ||
| 6163 | |||
| 6164 | pat = xmalloc (sizeof (struct xlfdpat)); | ||
| 6165 | if (pat == NULL) | ||
| 6166 | goto error; | ||
| 6167 | |||
| 6168 | pat->buf = xmalloc (strlen (pattern) + 1); | ||
| 6169 | if (pat->buf == NULL) | ||
| 6170 | goto error; | ||
| 6171 | |||
| 6172 | /* Normalize the pattern string and store it to `pat->buf'. */ | ||
| 6173 | nblocks = 0; | ||
| 6174 | anychar_head = NULL; | ||
| 6175 | q = pat->buf; | ||
| 6176 | last_char = '\0'; | ||
| 6177 | for (p = pattern; *p; p++) | ||
| 6178 | { | ||
| 6179 | unsigned char c = *p; | ||
| 6180 | |||
| 6181 | if (c == '*') | ||
| 6182 | if (last_char == '*') | ||
| 6183 | /* ...a** -> ...a* */ | ||
| 6184 | continue; | ||
| 6185 | else | ||
| 6186 | { | ||
| 6187 | if (last_char == '?') | ||
| 6188 | if (anychar_head > pat->buf && *(anychar_head - 1) == '*') | ||
| 6189 | /* ...*??* -> ...*?? */ | ||
| 6190 | continue; | ||
| 6191 | else | ||
| 6192 | /* ...a??* -> ...a*?? */ | ||
| 6193 | { | ||
| 6194 | *anychar_head++ = '*'; | ||
| 6195 | c = '?'; | ||
| 6196 | } | ||
| 6197 | nblocks++; | ||
| 6198 | } | ||
| 6199 | else if (c == '?') | ||
| 6200 | { | ||
| 6201 | if (last_char != '?') | ||
| 6202 | anychar_head = q; | ||
| 6203 | } | ||
| 6204 | else | ||
| 6205 | /* On Mac OS X 10.3, tolower also converts non-ASCII | ||
| 6206 | characters for some locales. */ | ||
| 6207 | if (isascii (c)) | ||
| 6208 | c = tolower (c); | ||
| 6209 | |||
| 6210 | *q++ = last_char = c; | ||
| 6211 | } | ||
| 6212 | *q = '\0'; | ||
| 6213 | nblocks++; | ||
| 6214 | pat->nblocks = nblocks; | ||
| 6215 | if (last_char != '?') | ||
| 6216 | pat->trailing_anychars = 0; | ||
| 6217 | else | ||
| 6218 | { | ||
| 6219 | pat->trailing_anychars = q - anychar_head; | ||
| 6220 | q = anychar_head; | ||
| 6221 | } | ||
| 6222 | pat->nchars = q - pat->buf - (nblocks - 1); | ||
| 6223 | |||
| 6224 | if (anychar_head == NULL && nblocks == 1) | ||
| 6225 | { | ||
| 6226 | /* The pattern is exact. */ | ||
| 6227 | pat->blocks = NULL; | ||
| 6228 | return pat; | ||
| 6229 | } | ||
| 6230 | |||
| 6231 | pat->blocks = xmalloc (sizeof (struct xlfdpat_block) * nblocks); | ||
| 6232 | if (pat->blocks == NULL) | ||
| 6233 | goto error; | ||
| 6234 | |||
| 6235 | /* Divide the normalized pattern into blocks. */ | ||
| 6236 | p = pat->buf; | ||
| 6237 | for (blk = pat->blocks; blk < pat->blocks + nblocks - 1; blk++) | ||
| 6238 | { | ||
| 6239 | blk->pattern = p; | ||
| 6240 | while (*p != '*') | ||
| 6241 | p++; | ||
| 6242 | blk->len = p - blk->pattern; | ||
| 6243 | p++; | ||
| 6244 | } | ||
| 6245 | blk->pattern = p; | ||
| 6246 | blk->len = q - blk->pattern; | ||
| 6247 | |||
| 6248 | /* Setup a table for the Boyer-Moore string search. */ | ||
| 6249 | for (blk = pat->blocks; blk < pat->blocks + nblocks; blk++) | ||
| 6250 | if (blk->len != 0) | ||
| 6251 | { | ||
| 6252 | blk->last_char = blk->pattern[blk->len - 1]; | ||
| 6253 | blk->pattern[blk->len - 1] = '\0'; | ||
| 6254 | |||
| 6255 | for (skip = 1; skip < blk->len; skip++) | ||
| 6256 | if (blk->pattern[blk->len - skip - 1] == '?') | ||
| 6257 | break; | ||
| 6258 | |||
| 6259 | for (i = 0; i < 256; i++) | ||
| 6260 | blk->skip[i] = skip; | ||
| 6261 | |||
| 6262 | p = blk->pattern + (blk->len - skip); | ||
| 6263 | while (--skip > 0) | ||
| 6264 | blk->skip[*p++] = skip; | ||
| 6265 | |||
| 6266 | blk->last_char_skip = blk->skip[blk->last_char]; | ||
| 6267 | } | ||
| 6268 | |||
| 6269 | return pat; | ||
| 6270 | |||
| 6271 | error: | ||
| 6272 | xlfdpat_destroy (pat); | ||
| 6273 | return NULL; | ||
| 6274 | } | ||
| 6275 | |||
| 6276 | static INLINE int | ||
| 6277 | xlfdpat_exact_p (pat) | ||
| 6278 | struct xlfdpat *pat; | ||
| 6279 | { | ||
| 6280 | return (pat)->blocks == NULL; | ||
| 6281 | } | ||
| 6282 | |||
| 6283 | /* Return the first string in STRING + 0, ..., STRING + START_MAX such | ||
| 6284 | that the pattern in *BLK matches with its prefix. Return NULL | ||
| 6285 | there is no such strings. STRING must be lowered in advance. */ | ||
| 6286 | |||
| 6287 | static char * | ||
| 6288 | xlfdpat_block_match_1 (blk, string, start_max) | ||
| 6289 | struct xlfdpat_block *blk; | ||
| 6290 | unsigned char *string; | ||
| 6291 | int start_max; | ||
| 6292 | { | ||
| 6293 | int start, infinity; | ||
| 6294 | unsigned char *p, *s; | ||
| 6295 | |||
| 6296 | xassert (blk->len > 0); | ||
| 6297 | xassert (start_max + blk->len <= strlen (string)); | ||
| 6298 | xassert (blk->pattern[blk->len - 1] != '?'); | ||
| 6299 | |||
| 6300 | /* See the comments in the function `boyer_moore' (search.c) for the | ||
| 6301 | use of `infinity'. */ | ||
| 6302 | infinity = start_max + blk->len + 1; | ||
| 6303 | blk->skip[blk->last_char] = infinity; | ||
| 6304 | |||
| 6305 | start = 0; | ||
| 6306 | do | ||
| 6307 | { | ||
| 6308 | /* Check the last character of the pattern. */ | ||
| 6309 | s = string + blk->len - 1; | ||
| 6310 | do | ||
| 6311 | { | ||
| 6312 | start += blk->skip[*(s + start)]; | ||
| 6313 | } | ||
| 6314 | while (start <= start_max); | ||
| 6315 | |||
| 6316 | if (start < infinity) | ||
| 6317 | /* Couldn't find the last character. */ | ||
| 6318 | return NULL; | ||
| 6319 | |||
| 6320 | /* No less than `infinity' means we could find the last | ||
| 6321 | character at `s[start - infinity]'. */ | ||
| 6322 | start -= infinity; | ||
| 6323 | |||
| 6324 | /* Check the remaining characters. We prefer making no-'?' | ||
| 6325 | cases faster because the use of '?' is really rare. */ | ||
| 6326 | p = blk->pattern; | ||
| 6327 | s = string + start; | ||
| 6328 | do | ||
| 6329 | { | ||
| 6330 | while (*p++ == *s++) | ||
| 6331 | ; | ||
| 6332 | } | ||
| 6333 | while (*(p - 1) == '?'); | ||
| 6334 | |||
| 6335 | if (*(p - 1) == '\0') | ||
| 6336 | /* Matched. */ | ||
| 6337 | return string + start; | ||
| 6338 | |||
| 6339 | /* Didn't match. */ | ||
| 6340 | start += blk->last_char_skip; | ||
| 6341 | } | ||
| 6342 | while (start <= start_max); | ||
| 6343 | |||
| 6344 | return NULL; | ||
| 6345 | } | ||
| 6346 | |||
| 6347 | #define xlfdpat_block_match(b, s, m) \ | ||
| 6348 | ((b)->len == 1 ? memchr ((s), (b)->last_char, (m) + 1) \ | ||
| 6349 | : xlfdpat_block_match_1 (b, s, m)) | ||
| 6350 | |||
| 6351 | /* Check if XLFD pattern PAT, which is generated by `xfldpat_create', | ||
| 6352 | matches with STRING. STRING must be lowered in advance. */ | ||
| 6353 | |||
| 6354 | static int | ||
| 6355 | xlfdpat_match (pat, string) | ||
| 6356 | struct xlfdpat *pat; | ||
| 6357 | unsigned char *string; | ||
| 6358 | { | ||
| 6359 | int str_len, nblocks, i, start_max; | ||
| 6360 | struct xlfdpat_block *blk; | ||
| 6361 | unsigned char *s; | ||
| 6362 | |||
| 6363 | xassert (pat->nblocks > 0); | ||
| 6364 | |||
| 6365 | if (xlfdpat_exact_p (pat)) | ||
| 6366 | return strcmp (pat->buf, string) == 0; | ||
| 6367 | |||
| 6368 | /* The number of the characters in the string must not be smaller | ||
| 6369 | than that in the pattern. */ | ||
| 6370 | str_len = strlen (string); | ||
| 6371 | if (str_len < pat->nchars + pat->trailing_anychars) | ||
| 6372 | return 0; | ||
| 6373 | |||
| 6374 | /* Chop off the trailing '?'s. */ | ||
| 6375 | str_len -= pat->trailing_anychars; | ||
| 6376 | |||
| 6377 | /* The last block. When it is non-empty, it must match at the end | ||
| 6378 | of the string. */ | ||
| 6379 | nblocks = pat->nblocks; | ||
| 6380 | blk = pat->blocks + (nblocks - 1); | ||
| 6381 | if (nblocks == 1) | ||
| 6382 | /* The last block is also the first one. */ | ||
| 6383 | return (str_len == blk->len | ||
| 6384 | && (blk->len == 0 || xlfdpat_block_match (blk, string, 0))); | ||
| 6385 | else if (blk->len != 0) | ||
| 6386 | if (!xlfdpat_block_match (blk, string + (str_len - blk->len), 0)) | ||
| 6387 | return 0; | ||
| 6388 | |||
| 6389 | /* The first block. When it is non-empty, it must match at the | ||
| 6390 | beginning of the string. */ | ||
| 6391 | blk = pat->blocks; | ||
| 6392 | if (blk->len != 0) | ||
| 6393 | { | ||
| 6394 | s = xlfdpat_block_match (blk, string, 0); | ||
| 6395 | if (s == NULL) | ||
| 6396 | return 0; | ||
| 6397 | string = s + blk->len; | ||
| 6398 | } | ||
| 6399 | |||
| 6400 | /* The rest of the blocks. */ | ||
| 6401 | start_max = str_len - pat->nchars; | ||
| 6402 | for (i = 1, blk++; i < nblocks - 1; i++, blk++) | ||
| 6403 | { | ||
| 6404 | s = xlfdpat_block_match (blk, string, start_max); | ||
| 6405 | if (s == NULL) | ||
| 6406 | return 0; | ||
| 6407 | start_max -= s - string; | ||
| 6408 | string = s + blk->len; | ||
| 6409 | } | ||
| 6410 | |||
| 6411 | return 1; | ||
| 6412 | } | ||
| 6413 | |||
| 6414 | |||
| 6415 | /*********************************************************************** | ||
| 6087 | Fonts | 6416 | Fonts |
| 6088 | ***********************************************************************/ | 6417 | ***********************************************************************/ |
| 6089 | 6418 | ||
| @@ -6178,7 +6507,8 @@ mac_to_x_fontname (name, size, style, charset) | |||
| 6178 | { | 6507 | { |
| 6179 | Str31 foundry, cs; | 6508 | Str31 foundry, cs; |
| 6180 | Str255 family; | 6509 | Str255 family; |
| 6181 | char xf[256], *result, *p; | 6510 | char xf[256], *result; |
| 6511 | unsigned char *p; | ||
| 6182 | 6512 | ||
| 6183 | if (sscanf (name, "%31[^-]-%255[^-]-%31s", foundry, family, cs) == 3) | 6513 | if (sscanf (name, "%31[^-]-%255[^-]-%31s", foundry, family, cs) == 3) |
| 6184 | charset = cs; | 6514 | charset = cs; |
| @@ -6195,7 +6525,10 @@ mac_to_x_fontname (name, size, style, charset) | |||
| 6195 | result = xmalloc (strlen (foundry) + strlen (family) + strlen (xf) + 3 + 1); | 6525 | result = xmalloc (strlen (foundry) + strlen (family) + strlen (xf) + 3 + 1); |
| 6196 | sprintf (result, "-%s-%s-%s", foundry, family, xf); | 6526 | sprintf (result, "-%s-%s-%s", foundry, family, xf); |
| 6197 | for (p = result; *p; p++) | 6527 | for (p = result; *p; p++) |
| 6198 | *p = tolower(*p); | 6528 | /* On Mac OS X 10.3, tolower also converts non-ASCII characters |
| 6529 | for some locales. */ | ||
| 6530 | if (isascii (*p)) | ||
| 6531 | *p = tolower (*p); | ||
| 6199 | return result; | 6532 | return result; |
| 6200 | } | 6533 | } |
| 6201 | 6534 | ||
| @@ -6253,7 +6586,7 @@ x_font_name_to_mac_font_name (xf, mf, mf_decoded, style, cs) | |||
| 6253 | { | 6586 | { |
| 6254 | setup_coding_system (coding_system, &coding); | 6587 | setup_coding_system (coding_system, &coding); |
| 6255 | coding.src_multibyte = 1; | 6588 | coding.src_multibyte = 1; |
| 6256 | coding.dst_multibyte = 1; | 6589 | coding.dst_multibyte = 0; |
| 6257 | coding.mode |= CODING_MODE_LAST_BLOCK; | 6590 | coding.mode |= CODING_MODE_LAST_BLOCK; |
| 6258 | encode_coding (&coding, mf_decoded, mf, | 6591 | encode_coding (&coding, mf_decoded, mf, |
| 6259 | strlen (mf_decoded), sizeof (Str255) - 1); | 6592 | strlen (mf_decoded), sizeof (Str255) - 1); |
| @@ -6267,13 +6600,13 @@ add_font_name_table_entry (char *font_name) | |||
| 6267 | { | 6600 | { |
| 6268 | if (font_name_table_size == 0) | 6601 | if (font_name_table_size == 0) |
| 6269 | { | 6602 | { |
| 6270 | font_name_table_size = 16; | 6603 | font_name_table_size = 256; |
| 6271 | font_name_table = (char **) | 6604 | font_name_table = (char **) |
| 6272 | xmalloc (font_name_table_size * sizeof (char *)); | 6605 | xmalloc (font_name_table_size * sizeof (char *)); |
| 6273 | } | 6606 | } |
| 6274 | else if (font_name_count + 1 >= font_name_table_size) | 6607 | else if (font_name_count + 1 >= font_name_table_size) |
| 6275 | { | 6608 | { |
| 6276 | font_name_table_size += 16; | 6609 | font_name_table_size *= 2; |
| 6277 | font_name_table = (char **) | 6610 | font_name_table = (char **) |
| 6278 | xrealloc (font_name_table, | 6611 | xrealloc (font_name_table, |
| 6279 | font_name_table_size * sizeof (char *)); | 6612 | font_name_table_size * sizeof (char *)); |
| @@ -6498,39 +6831,16 @@ static int xlfd_scalable_fields[] = | |||
| 6498 | }; | 6831 | }; |
| 6499 | 6832 | ||
| 6500 | static Lisp_Object | 6833 | static Lisp_Object |
| 6501 | mac_c_string_match (regexp, string, nonspecial, exact) | ||
| 6502 | Lisp_Object regexp; | ||
| 6503 | const char *string, *nonspecial; | ||
| 6504 | int exact; | ||
| 6505 | { | ||
| 6506 | if (exact) | ||
| 6507 | { | ||
| 6508 | if (strcmp (string, nonspecial) == 0) | ||
| 6509 | return build_string (string); | ||
| 6510 | } | ||
| 6511 | else if (strstr (string, nonspecial)) | ||
| 6512 | { | ||
| 6513 | Lisp_Object str = build_string (string); | ||
| 6514 | |||
| 6515 | if (fast_string_match (regexp, str) >= 0) | ||
| 6516 | return str; | ||
| 6517 | } | ||
| 6518 | |||
| 6519 | return Qnil; | ||
| 6520 | } | ||
| 6521 | |||
| 6522 | static Lisp_Object | ||
| 6523 | mac_do_list_fonts (pattern, maxnames) | 6834 | mac_do_list_fonts (pattern, maxnames) |
| 6524 | char *pattern; | 6835 | char *pattern; |
| 6525 | int maxnames; | 6836 | int maxnames; |
| 6526 | { | 6837 | { |
| 6527 | int i, n_fonts = 0; | 6838 | int i, n_fonts = 0; |
| 6528 | Lisp_Object font_list = Qnil, pattern_regex, fontname; | 6839 | Lisp_Object font_list = Qnil; |
| 6529 | char *regex = (char *) alloca (strlen (pattern) * 2 + 3); | 6840 | struct xlfdpat *pat; |
| 6530 | char *scaled, *ptr; | 6841 | char *scaled, *ptr; |
| 6531 | int scl_val[XLFD_SCL_LAST], *field, *val; | 6842 | int scl_val[XLFD_SCL_LAST], *field, *val; |
| 6532 | char *longest_start, *cur_start, *nonspecial; | 6843 | int exact; |
| 6533 | int longest_len, exact; | ||
| 6534 | 6844 | ||
| 6535 | if (font_name_table == NULL) /* Initialize when first used. */ | 6845 | if (font_name_table == NULL) /* Initialize when first used. */ |
| 6536 | init_font_name_table (); | 6846 | init_font_name_table (); |
| @@ -6588,61 +6898,17 @@ mac_do_list_fonts (pattern, maxnames) | |||
| 6588 | else | 6898 | else |
| 6589 | scl_val[XLFD_SCL_PIXEL_SIZE] = -1; | 6899 | scl_val[XLFD_SCL_PIXEL_SIZE] = -1; |
| 6590 | 6900 | ||
| 6591 | ptr = regex; | 6901 | pat = xlfdpat_create (pattern); |
| 6592 | *ptr++ = '^'; | 6902 | if (pat == NULL) |
| 6593 | 6903 | return Qnil; | |
| 6594 | longest_start = cur_start = ptr; | ||
| 6595 | longest_len = 0; | ||
| 6596 | exact = 1; | ||
| 6597 | |||
| 6598 | /* Turn pattern into a regexp and do a regexp match. Also find the | ||
| 6599 | longest substring containing no special characters. */ | ||
| 6600 | for (; *pattern; pattern++) | ||
| 6601 | { | ||
| 6602 | if (*pattern == '?' || *pattern == '*') | ||
| 6603 | { | ||
| 6604 | if (ptr - cur_start > longest_len) | ||
| 6605 | { | ||
| 6606 | longest_start = cur_start; | ||
| 6607 | longest_len = ptr - cur_start; | ||
| 6608 | } | ||
| 6609 | exact = 0; | ||
| 6610 | |||
| 6611 | if (*pattern == '?') | ||
| 6612 | *ptr++ = '.'; | ||
| 6613 | else /* if (*pattern == '*') */ | ||
| 6614 | { | ||
| 6615 | *ptr++ = '.'; | ||
| 6616 | *ptr++ = '*'; | ||
| 6617 | } | ||
| 6618 | cur_start = ptr; | ||
| 6619 | } | ||
| 6620 | else | ||
| 6621 | *ptr++ = tolower (*pattern); | ||
| 6622 | } | ||
| 6623 | |||
| 6624 | if (ptr - cur_start > longest_len) | ||
| 6625 | { | ||
| 6626 | longest_start = cur_start; | ||
| 6627 | longest_len = ptr - cur_start; | ||
| 6628 | } | ||
| 6629 | |||
| 6630 | *ptr = '$'; | ||
| 6631 | *(ptr + 1) = '\0'; | ||
| 6632 | |||
| 6633 | nonspecial = xmalloc (longest_len + 1); | ||
| 6634 | strncpy (nonspecial, longest_start, longest_len); | ||
| 6635 | nonspecial[longest_len] = '\0'; | ||
| 6636 | 6904 | ||
| 6637 | pattern_regex = build_string (regex); | 6905 | exact = xlfdpat_exact_p (pat); |
| 6638 | 6906 | ||
| 6639 | for (i = 0; i < font_name_count; i++) | 6907 | for (i = 0; i < font_name_count; i++) |
| 6640 | { | 6908 | { |
| 6641 | fontname = mac_c_string_match (pattern_regex, font_name_table[i], | 6909 | if (xlfdpat_match (pat, font_name_table[i])) |
| 6642 | nonspecial, exact); | ||
| 6643 | if (!NILP (fontname)) | ||
| 6644 | { | 6910 | { |
| 6645 | font_list = Fcons (fontname, font_list); | 6911 | font_list = Fcons (build_string (font_name_table[i]), font_list); |
| 6646 | if (exact || maxnames > 0 && ++n_fonts >= maxnames) | 6912 | if (exact || maxnames > 0 && ++n_fonts >= maxnames) |
| 6647 | break; | 6913 | break; |
| 6648 | } | 6914 | } |
| @@ -6652,6 +6918,8 @@ mac_do_list_fonts (pattern, maxnames) | |||
| 6652 | int former_len = ptr - font_name_table[i]; | 6918 | int former_len = ptr - font_name_table[i]; |
| 6653 | 6919 | ||
| 6654 | scaled = xmalloc (strlen (font_name_table[i]) + 20 + 1); | 6920 | scaled = xmalloc (strlen (font_name_table[i]) + 20 + 1); |
| 6921 | if (scaled == NULL) | ||
| 6922 | continue; | ||
| 6655 | memcpy (scaled, font_name_table[i], former_len); | 6923 | memcpy (scaled, font_name_table[i], former_len); |
| 6656 | sprintf (scaled + former_len, | 6924 | sprintf (scaled + former_len, |
| 6657 | "-%d-%d-75-75-m-%d-%s", | 6925 | "-%d-%d-75-75-m-%d-%s", |
| @@ -6659,19 +6927,20 @@ mac_do_list_fonts (pattern, maxnames) | |||
| 6659 | scl_val[XLFD_SCL_POINT_SIZE], | 6927 | scl_val[XLFD_SCL_POINT_SIZE], |
| 6660 | scl_val[XLFD_SCL_AVGWIDTH], | 6928 | scl_val[XLFD_SCL_AVGWIDTH], |
| 6661 | ptr + sizeof ("-0-0-0-0-m-0-") - 1); | 6929 | ptr + sizeof ("-0-0-0-0-m-0-") - 1); |
| 6662 | fontname = mac_c_string_match (pattern_regex, scaled, | 6930 | |
| 6663 | nonspecial, exact); | 6931 | if (xlfdpat_match (pat, scaled)) |
| 6664 | xfree (scaled); | ||
| 6665 | if (!NILP (fontname)) | ||
| 6666 | { | 6932 | { |
| 6667 | font_list = Fcons (fontname, font_list); | 6933 | font_list = Fcons (build_string (scaled), font_list); |
| 6934 | xfree (scaled); | ||
| 6668 | if (exact || maxnames > 0 && ++n_fonts >= maxnames) | 6935 | if (exact || maxnames > 0 && ++n_fonts >= maxnames) |
| 6669 | break; | 6936 | break; |
| 6670 | } | 6937 | } |
| 6938 | else | ||
| 6939 | xfree (scaled); | ||
| 6671 | } | 6940 | } |
| 6672 | } | 6941 | } |
| 6673 | 6942 | ||
| 6674 | xfree (nonspecial); | 6943 | xlfdpat_destroy (pat); |
| 6675 | 6944 | ||
| 6676 | return font_list; | 6945 | return font_list; |
| 6677 | } | 6946 | } |
diff --git a/src/xdisp.c b/src/xdisp.c index b887c8d702c..bc016fb7c79 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -3415,7 +3415,7 @@ handle_display_prop (it) | |||
| 3415 | } | 3415 | } |
| 3416 | else | 3416 | else |
| 3417 | { | 3417 | { |
| 3418 | object = it->w->buffer; | 3418 | XSETWINDOW (object, it->w); |
| 3419 | position = &it->current.pos; | 3419 | position = &it->current.pos; |
| 3420 | } | 3420 | } |
| 3421 | 3421 | ||
| @@ -3436,6 +3436,9 @@ handle_display_prop (it) | |||
| 3436 | if (NILP (prop)) | 3436 | if (NILP (prop)) |
| 3437 | return HANDLED_NORMALLY; | 3437 | return HANDLED_NORMALLY; |
| 3438 | 3438 | ||
| 3439 | if (!STRINGP (it->string)) | ||
| 3440 | object = it->w->buffer; | ||
| 3441 | |||
| 3439 | if (CONSP (prop) | 3442 | if (CONSP (prop) |
| 3440 | /* Simple properties. */ | 3443 | /* Simple properties. */ |
| 3441 | && !EQ (XCAR (prop), Qimage) | 3444 | && !EQ (XCAR (prop), Qimage) |
| @@ -10616,13 +10619,9 @@ redisplay_internal (preserve_echo_area) | |||
| 10616 | if (consider_all_windows_p) | 10619 | if (consider_all_windows_p) |
| 10617 | { | 10620 | { |
| 10618 | Lisp_Object tail, frame; | 10621 | Lisp_Object tail, frame; |
| 10619 | int i, n = 0, size = 5; | ||
| 10620 | struct frame **updated; | ||
| 10621 | 10622 | ||
| 10622 | FOR_EACH_FRAME (tail, frame) | 10623 | FOR_EACH_FRAME (tail, frame) |
| 10623 | size++; | 10624 | XFRAME (frame)->updated_p = 0; |
| 10624 | |||
| 10625 | updated = (struct frame **) alloca (size * sizeof *updated); | ||
| 10626 | 10625 | ||
| 10627 | /* Recompute # windows showing selected buffer. This will be | 10626 | /* Recompute # windows showing selected buffer. This will be |
| 10628 | incremented each time such a window is displayed. */ | 10627 | incremented each time such a window is displayed. */ |
| @@ -10684,15 +10683,7 @@ redisplay_internal (preserve_echo_area) | |||
| 10684 | break; | 10683 | break; |
| 10685 | #endif | 10684 | #endif |
| 10686 | 10685 | ||
| 10687 | if (n == size) | 10686 | f->updated_p = 1; |
| 10688 | { | ||
| 10689 | int nbytes = size * sizeof *updated; | ||
| 10690 | struct frame **p = (struct frame **) alloca (2 * nbytes); | ||
| 10691 | bcopy (updated, p, nbytes); | ||
| 10692 | size *= 2; | ||
| 10693 | } | ||
| 10694 | |||
| 10695 | updated[n++] = f; | ||
| 10696 | } | 10687 | } |
| 10697 | } | 10688 | } |
| 10698 | } | 10689 | } |
| @@ -10702,12 +10693,15 @@ redisplay_internal (preserve_echo_area) | |||
| 10702 | /* Do the mark_window_display_accurate after all windows have | 10693 | /* Do the mark_window_display_accurate after all windows have |
| 10703 | been redisplayed because this call resets flags in buffers | 10694 | been redisplayed because this call resets flags in buffers |
| 10704 | which are needed for proper redisplay. */ | 10695 | which are needed for proper redisplay. */ |
| 10705 | for (i = 0; i < n; ++i) | 10696 | FOR_EACH_FRAME (tail, frame) |
| 10706 | { | 10697 | { |
| 10707 | struct frame *f = updated[i]; | 10698 | struct frame *f = XFRAME (frame); |
| 10708 | mark_window_display_accurate (f->root_window, 1); | 10699 | if (f->updated_p) |
| 10709 | if (FRAME_DEVICE (f)->frame_up_to_date_hook) | 10700 | { |
| 10710 | FRAME_DEVICE (f)->frame_up_to_date_hook (f); | 10701 | mark_window_display_accurate (f->root_window, 1); |
| 10702 | if (FRAME_DEVICE (f)->frame_up_to_date_hook) | ||
| 10703 | FRAME_DEVICE (f)->frame_up_to_date_hook (f); | ||
| 10704 | } | ||
| 10711 | } | 10705 | } |
| 10712 | } | 10706 | } |
| 10713 | } | 10707 | } |
| @@ -12842,12 +12836,11 @@ try_window (window, pos, check_margins) | |||
| 12842 | if (check_margins | 12836 | if (check_margins |
| 12843 | && !MINI_WINDOW_P (w)) | 12837 | && !MINI_WINDOW_P (w)) |
| 12844 | { | 12838 | { |
| 12845 | int this_scroll_margin, cursor_height; | 12839 | int this_scroll_margin; |
| 12846 | 12840 | ||
| 12847 | this_scroll_margin = max (0, scroll_margin); | 12841 | this_scroll_margin = max (0, scroll_margin); |
| 12848 | this_scroll_margin = min (this_scroll_margin, WINDOW_TOTAL_LINES (w) / 4); | 12842 | this_scroll_margin = min (this_scroll_margin, WINDOW_TOTAL_LINES (w) / 4); |
| 12849 | this_scroll_margin *= FRAME_LINE_HEIGHT (it.f); | 12843 | this_scroll_margin *= FRAME_LINE_HEIGHT (it.f); |
| 12850 | cursor_height = MATRIX_ROW (w->desired_matrix, w->cursor.vpos)->height; | ||
| 12851 | 12844 | ||
| 12852 | if ((w->cursor.y < this_scroll_margin | 12845 | if ((w->cursor.y < this_scroll_margin |
| 12853 | && CHARPOS (pos) > BEGV) | 12846 | && CHARPOS (pos) > BEGV) |
| @@ -13098,7 +13091,7 @@ try_window_reusing_current_matrix (w) | |||
| 13098 | /* Disable lines in the current matrix which are now | 13091 | /* Disable lines in the current matrix which are now |
| 13099 | below the window. */ | 13092 | below the window. */ |
| 13100 | for (++row; row < bottom_row; ++row) | 13093 | for (++row; row < bottom_row; ++row) |
| 13101 | row->enabled_p = 0; | 13094 | row->enabled_p = row->mode_line_p = 0; |
| 13102 | } | 13095 | } |
| 13103 | 13096 | ||
| 13104 | /* Update window_end_pos etc.; last_reused_text_row is the last | 13097 | /* Update window_end_pos etc.; last_reused_text_row is the last |
diff --git a/src/xfaces.c b/src/xfaces.c index 06022383cb9..d9fd4d2f989 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -838,7 +838,10 @@ xstrlwr (s) | |||
| 838 | unsigned char *p = s; | 838 | unsigned char *p = s; |
| 839 | 839 | ||
| 840 | for (p = s; *p; ++p) | 840 | for (p = s; *p; ++p) |
| 841 | *p = tolower (*p); | 841 | /* On Mac OS X 10.3, tolower also converts non-ASCII characters |
| 842 | for some locales. */ | ||
| 843 | if (isascii (*p)) | ||
| 844 | *p = tolower (*p); | ||
| 842 | 845 | ||
| 843 | return s; | 846 | return s; |
| 844 | } | 847 | } |