diff options
| author | Karoly Lorentey | 2004-02-26 00:39:34 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-02-26 00:39:34 +0000 |
| commit | 49c04a9f6d18e3df5fd0aa832061d4da75a4d8ff (patch) | |
| tree | 3a68f8a8c66c5c84d8d9c2774fc5207feddc1521 /src | |
| parent | 1a10e2b72257d3c594dbd92216a4a2bd7b066e74 (diff) | |
| parent | dd341dd9c2dfa102585d11d0ad773c0ff074507f (diff) | |
| download | emacs-49c04a9f6d18e3df5fd0aa832061d4da75a4d8ff.tar.gz emacs-49c04a9f6d18e3df5fd0aa832061d4da75a4d8ff.zip | |
Merged in changes from CVS HEAD
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-113
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-114
Merge some minor redisplay bug-fixes from emacs--tiling--0
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-115
Update from CVS
* miles@gnu.org--gnu-2004/emacs--tiling--0--patch-9
Remove bogus xassert
* miles@gnu.org--gnu-2004/emacs--tiling--0--patch-10
Avoid negative descents for images with ascent > height
* miles@gnu.org--gnu-2004/emacs--tiling--0--patch-13
Fix iterator-inconsistency bug in redisplay
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-101
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 29 | ||||
| -rw-r--r-- | src/w32fns.c | 26 | ||||
| -rw-r--r-- | src/xdisp.c | 127 | ||||
| -rw-r--r-- | src/xfns.c | 3 |
4 files changed, 127 insertions, 58 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1a2f7f4e20b..ddd92927a17 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,32 @@ | |||
| 1 | 2004-02-26 Kim F. Storm <storm@cua.dk> | ||
| 2 | |||
| 3 | * xdisp.c (handle_single_display_prop): Handle left-fringe and | ||
| 4 | right-fringe similar to a display margin image. Specifically, | ||
| 5 | the characters having the fringe prop are no longer shown, and | ||
| 6 | we use IT_IMAGE/next_element_from_image with image_id = -1 to | ||
| 7 | do this. Set fringe bitmap face_id in it->face_id. | ||
| 8 | (produce_image_glyph): Handle image_id < 0 as "no image" case, but | ||
| 9 | still realize it->face (i.e. the fringe bitmap face). | ||
| 10 | |||
| 11 | 2004-02-25 Miles Bader <miles@gnu.org> | ||
| 12 | |||
| 13 | * xdisp.c (check_it): Check string/string_pos consistency. | ||
| 14 | (init_iterator): Initialize string-related fields properly. | ||
| 15 | |||
| 16 | 2004-02-11 Miles Bader <miles@gnu.org> | ||
| 17 | |||
| 18 | * xdisp.c (produce_image_glyph): Force negative descents to zero. | ||
| 19 | |||
| 20 | 2004-02-10 Miles Bader <miles@gnu.org> | ||
| 21 | |||
| 22 | * xfns.c (lookup_image): Remove xassert(!interrupt_input_blocked); | ||
| 23 | BLOCK_INPUT can be nested, so it doesn't make much sense. | ||
| 24 | |||
| 25 | 2004-02-24 Michael Mauger <mmaug@yahoo.com> | ||
| 26 | |||
| 27 | * w32fns.c (slurp_file, xbm_scan, xbm_load_image) | ||
| 28 | (xbm_read_bitmap_data): Use unsigned char for image data. | ||
| 29 | |||
| 1 | 2004-02-23 Luc Teirlinck <teirllm@auburn.edu> | 30 | 2004-02-23 Luc Teirlinck <teirllm@auburn.edu> |
| 2 | 31 | ||
| 3 | * abbrev.c (Finsert_abbrev_table_description): Doc fix. | 32 | * abbrev.c (Finsert_abbrev_table_description): Doc fix. |
diff --git a/src/w32fns.c b/src/w32fns.c index 3b53bade2ad..015b406db88 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -8243,7 +8243,7 @@ x_put_x_image (f, ximg, pixmap, width, height) | |||
| 8243 | ***********************************************************************/ | 8243 | ***********************************************************************/ |
| 8244 | 8244 | ||
| 8245 | static Lisp_Object x_find_image_file P_ ((Lisp_Object)); | 8245 | static Lisp_Object x_find_image_file P_ ((Lisp_Object)); |
| 8246 | static char *slurp_file P_ ((char *, int *)); | 8246 | static unsigned char *slurp_file P_ ((char *, int *)); |
| 8247 | 8247 | ||
| 8248 | 8248 | ||
| 8249 | /* Find image file FILE. Look in data-directory, then | 8249 | /* Find image file FILE. Look in data-directory, then |
| @@ -8279,13 +8279,13 @@ x_find_image_file (file) | |||
| 8279 | with xmalloc holding FILE's contents. Value is null if an error | 8279 | with xmalloc holding FILE's contents. Value is null if an error |
| 8280 | occurred. *SIZE is set to the size of the file. */ | 8280 | occurred. *SIZE is set to the size of the file. */ |
| 8281 | 8281 | ||
| 8282 | static char * | 8282 | static unsigned char * |
| 8283 | slurp_file (file, size) | 8283 | slurp_file (file, size) |
| 8284 | char *file; | 8284 | char *file; |
| 8285 | int *size; | 8285 | int *size; |
| 8286 | { | 8286 | { |
| 8287 | FILE *fp = NULL; | 8287 | FILE *fp = NULL; |
| 8288 | char *buf = NULL; | 8288 | unsigned char *buf = NULL; |
| 8289 | struct stat st; | 8289 | struct stat st; |
| 8290 | 8290 | ||
| 8291 | if (stat (file, &st) == 0 | 8291 | if (stat (file, &st) == 0 |
| @@ -8316,13 +8316,13 @@ slurp_file (file, size) | |||
| 8316 | XBM images | 8316 | XBM images |
| 8317 | ***********************************************************************/ | 8317 | ***********************************************************************/ |
| 8318 | 8318 | ||
| 8319 | static int xbm_scan P_ ((char **, char *, char *, int *)); | 8319 | static int xbm_scan P_ ((unsigned char **, unsigned char *, char *, int *)); |
| 8320 | static int xbm_load P_ ((struct frame *f, struct image *img)); | 8320 | static int xbm_load P_ ((struct frame *f, struct image *img)); |
| 8321 | static int xbm_load_image P_ ((struct frame *f, struct image *img, | 8321 | static int xbm_load_image P_ ((struct frame *f, struct image *img, |
| 8322 | char *, char *)); | 8322 | unsigned char *, unsigned char *)); |
| 8323 | static int xbm_image_p P_ ((Lisp_Object object)); | 8323 | static int xbm_image_p P_ ((Lisp_Object object)); |
| 8324 | static int xbm_read_bitmap_data P_ ((char *, char *, int *, int *, | 8324 | static int xbm_read_bitmap_data P_ ((unsigned char *, unsigned char *, |
| 8325 | unsigned char **)); | 8325 | int *, int *, unsigned char **)); |
| 8326 | static int xbm_file_p P_ ((Lisp_Object)); | 8326 | static int xbm_file_p P_ ((Lisp_Object)); |
| 8327 | 8327 | ||
| 8328 | 8328 | ||
| @@ -8511,11 +8511,11 @@ xbm_image_p (object) | |||
| 8511 | 8511 | ||
| 8512 | static int | 8512 | static int |
| 8513 | xbm_scan (s, end, sval, ival) | 8513 | xbm_scan (s, end, sval, ival) |
| 8514 | char **s, *end; | 8514 | unsigned char **s, *end; |
| 8515 | char *sval; | 8515 | char *sval; |
| 8516 | int *ival; | 8516 | int *ival; |
| 8517 | { | 8517 | { |
| 8518 | int c; | 8518 | unsigned int c; |
| 8519 | 8519 | ||
| 8520 | loop: | 8520 | loop: |
| 8521 | 8521 | ||
| @@ -8645,11 +8645,11 @@ w32_create_pixmap_from_bitmap_data (int width, int height, char *data) | |||
| 8645 | 8645 | ||
| 8646 | static int | 8646 | static int |
| 8647 | xbm_read_bitmap_data (contents, end, width, height, data) | 8647 | xbm_read_bitmap_data (contents, end, width, height, data) |
| 8648 | char *contents, *end; | 8648 | unsigned char *contents, *end; |
| 8649 | int *width, *height; | 8649 | int *width, *height; |
| 8650 | unsigned char **data; | 8650 | unsigned char **data; |
| 8651 | { | 8651 | { |
| 8652 | char *s = contents; | 8652 | unsigned char *s = contents; |
| 8653 | char buffer[BUFSIZ]; | 8653 | char buffer[BUFSIZ]; |
| 8654 | int padding_p = 0; | 8654 | int padding_p = 0; |
| 8655 | int v10 = 0; | 8655 | int v10 = 0; |
| @@ -8827,7 +8827,7 @@ static int | |||
| 8827 | xbm_load_image (f, img, contents, end) | 8827 | xbm_load_image (f, img, contents, end) |
| 8828 | struct frame *f; | 8828 | struct frame *f; |
| 8829 | struct image *img; | 8829 | struct image *img; |
| 8830 | char *contents, *end; | 8830 | unsigned char *contents, *end; |
| 8831 | { | 8831 | { |
| 8832 | int rc; | 8832 | int rc; |
| 8833 | unsigned char *data; | 8833 | unsigned char *data; |
| @@ -8915,7 +8915,7 @@ xbm_load (f, img) | |||
| 8915 | if (STRINGP (file_name)) | 8915 | if (STRINGP (file_name)) |
| 8916 | { | 8916 | { |
| 8917 | Lisp_Object file; | 8917 | Lisp_Object file; |
| 8918 | char *contents; | 8918 | unsigned char *contents; |
| 8919 | int size; | 8919 | int size; |
| 8920 | struct gcpro gcpro1; | 8920 | struct gcpro gcpro1; |
| 8921 | 8921 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index 246b30549f6..67f21446320 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1900,10 +1900,14 @@ check_it (it) | |||
| 1900 | xassert (STRINGP (it->string)); | 1900 | xassert (STRINGP (it->string)); |
| 1901 | xassert (IT_STRING_CHARPOS (*it) >= 0); | 1901 | xassert (IT_STRING_CHARPOS (*it) >= 0); |
| 1902 | } | 1902 | } |
| 1903 | else if (it->method == next_element_from_buffer) | 1903 | else |
| 1904 | { | 1904 | { |
| 1905 | /* Check that character and byte positions agree. */ | 1905 | xassert (IT_STRING_CHARPOS (*it) < 0); |
| 1906 | xassert (IT_CHARPOS (*it) == BYTE_TO_CHAR (IT_BYTEPOS (*it))); | 1906 | if (it->method == next_element_from_buffer) |
| 1907 | { | ||
| 1908 | /* Check that character and byte positions agree. */ | ||
| 1909 | xassert (IT_CHARPOS (*it) == BYTE_TO_CHAR (IT_BYTEPOS (*it))); | ||
| 1910 | } | ||
| 1907 | } | 1911 | } |
| 1908 | 1912 | ||
| 1909 | if (it->dpvec) | 1913 | if (it->dpvec) |
| @@ -2016,6 +2020,8 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id) | |||
| 2016 | it->current.overlay_string_index = -1; | 2020 | it->current.overlay_string_index = -1; |
| 2017 | it->current.dpvec_index = -1; | 2021 | it->current.dpvec_index = -1; |
| 2018 | it->base_face_id = base_face_id; | 2022 | it->base_face_id = base_face_id; |
| 2023 | it->string = Qnil; | ||
| 2024 | IT_STRING_CHARPOS (*it) = IT_STRING_BYTEPOS (*it) = -1; | ||
| 2019 | 2025 | ||
| 2020 | /* The window in which we iterate over current_buffer: */ | 2026 | /* The window in which we iterate over current_buffer: */ |
| 2021 | XSETWINDOW (it->window, w); | 2027 | XSETWINDOW (it->window, w); |
| @@ -3482,43 +3488,6 @@ handle_single_display_prop (it, prop, object, position, | |||
| 3482 | } | 3488 | } |
| 3483 | #endif /* HAVE_WINDOW_SYSTEM */ | 3489 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 3484 | } | 3490 | } |
| 3485 | else if (CONSP (prop) | ||
| 3486 | && (EQ (XCAR (prop), Qleft_fringe) | ||
| 3487 | || EQ (XCAR (prop), Qright_fringe)) | ||
| 3488 | && CONSP (XCDR (prop))) | ||
| 3489 | { | ||
| 3490 | unsigned face_id = DEFAULT_FACE_ID; | ||
| 3491 | |||
| 3492 | /* `(left-fringe BITMAP FACE)'. */ | ||
| 3493 | if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f)) | ||
| 3494 | return 0; | ||
| 3495 | |||
| 3496 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 3497 | value = XCAR (XCDR (prop)); | ||
| 3498 | if (!NUMBERP (value) | ||
| 3499 | || !valid_fringe_bitmap_id_p (XINT (value))) | ||
| 3500 | return 0; | ||
| 3501 | |||
| 3502 | if (CONSP (XCDR (XCDR (prop)))) | ||
| 3503 | { | ||
| 3504 | Lisp_Object face_name = XCAR (XCDR (XCDR (prop))); | ||
| 3505 | face_id = lookup_named_face (it->f, face_name, 'A'); | ||
| 3506 | if (face_id < 0) | ||
| 3507 | return 0; | ||
| 3508 | } | ||
| 3509 | |||
| 3510 | if (EQ (XCAR (prop), Qleft_fringe)) | ||
| 3511 | { | ||
| 3512 | it->left_user_fringe_bitmap = XINT (value); | ||
| 3513 | it->left_user_fringe_face_id = face_id; | ||
| 3514 | } | ||
| 3515 | else | ||
| 3516 | { | ||
| 3517 | it->right_user_fringe_bitmap = XINT (value); | ||
| 3518 | it->right_user_fringe_face_id = face_id; | ||
| 3519 | } | ||
| 3520 | #endif /* HAVE_WINDOW_SYSTEM */ | ||
| 3521 | } | ||
| 3522 | else if (!it->string_from_display_prop_p) | 3491 | else if (!it->string_from_display_prop_p) |
| 3523 | { | 3492 | { |
| 3524 | /* `((margin left-margin) VALUE)' or `((margin right-margin) | 3493 | /* `((margin left-margin) VALUE)' or `((margin right-margin) |
| @@ -3537,6 +3506,64 @@ handle_single_display_prop (it, prop, object, position, | |||
| 3537 | text properties change there. */ | 3506 | text properties change there. */ |
| 3538 | it->stop_charpos = position->charpos; | 3507 | it->stop_charpos = position->charpos; |
| 3539 | 3508 | ||
| 3509 | if (CONSP (prop) | ||
| 3510 | && (EQ (XCAR (prop), Qleft_fringe) | ||
| 3511 | || EQ (XCAR (prop), Qright_fringe)) | ||
| 3512 | && CONSP (XCDR (prop))) | ||
| 3513 | { | ||
| 3514 | unsigned face_id = DEFAULT_FACE_ID; | ||
| 3515 | |||
| 3516 | /* Save current settings of IT so that we can restore them | ||
| 3517 | when we are finished with the glyph property value. */ | ||
| 3518 | |||
| 3519 | /* `(left-fringe BITMAP FACE)'. */ | ||
| 3520 | if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f)) | ||
| 3521 | return 0; | ||
| 3522 | |||
| 3523 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 3524 | value = XCAR (XCDR (prop)); | ||
| 3525 | if (!NUMBERP (value) | ||
| 3526 | || !valid_fringe_bitmap_id_p (XINT (value))) | ||
| 3527 | return 0; | ||
| 3528 | |||
| 3529 | if (CONSP (XCDR (XCDR (prop)))) | ||
| 3530 | { | ||
| 3531 | Lisp_Object face_name = XCAR (XCDR (XCDR (prop))); | ||
| 3532 | |||
| 3533 | face_id = lookup_named_face (it->f, face_name, 'A'); | ||
| 3534 | if (face_id < 0) | ||
| 3535 | return 0; | ||
| 3536 | } | ||
| 3537 | |||
| 3538 | push_it (it); | ||
| 3539 | |||
| 3540 | it->area = TEXT_AREA; | ||
| 3541 | it->what = IT_IMAGE; | ||
| 3542 | it->image_id = -1; /* no image */ | ||
| 3543 | it->position = start_pos; | ||
| 3544 | it->object = NILP (object) ? it->w->buffer : object; | ||
| 3545 | it->method = next_element_from_image; | ||
| 3546 | it->face_id = face_id; | ||
| 3547 | |||
| 3548 | /* Say that we haven't consumed the characters with | ||
| 3549 | `display' property yet. The call to pop_it in | ||
| 3550 | set_iterator_to_next will clean this up. */ | ||
| 3551 | *position = start_pos; | ||
| 3552 | |||
| 3553 | if (EQ (XCAR (prop), Qleft_fringe)) | ||
| 3554 | { | ||
| 3555 | it->left_user_fringe_bitmap = XINT (value); | ||
| 3556 | it->left_user_fringe_face_id = face_id; | ||
| 3557 | } | ||
| 3558 | else | ||
| 3559 | { | ||
| 3560 | it->right_user_fringe_bitmap = XINT (value); | ||
| 3561 | it->right_user_fringe_face_id = face_id; | ||
| 3562 | } | ||
| 3563 | #endif /* HAVE_WINDOW_SYSTEM */ | ||
| 3564 | return 1; | ||
| 3565 | } | ||
| 3566 | |||
| 3540 | location = Qunbound; | 3567 | location = Qunbound; |
| 3541 | if (CONSP (prop) && CONSP (XCAR (prop))) | 3568 | if (CONSP (prop) && CONSP (XCAR (prop))) |
| 3542 | { | 3569 | { |
| @@ -17673,17 +17700,31 @@ produce_image_glyph (it) | |||
| 17673 | xassert (it->what == IT_IMAGE); | 17700 | xassert (it->what == IT_IMAGE); |
| 17674 | 17701 | ||
| 17675 | face = FACE_FROM_ID (it->f, it->face_id); | 17702 | face = FACE_FROM_ID (it->f, it->face_id); |
| 17703 | xassert (face); | ||
| 17704 | /* Make sure X resources of the face is loaded. */ | ||
| 17705 | PREPARE_FACE_FOR_DISPLAY (it->f, face); | ||
| 17706 | |||
| 17707 | if (it->image_id < 0) | ||
| 17708 | { | ||
| 17709 | /* Fringe bitmap. */ | ||
| 17710 | it->nglyphs = 0; | ||
| 17711 | return; | ||
| 17712 | } | ||
| 17713 | |||
| 17676 | img = IMAGE_FROM_ID (it->f, it->image_id); | 17714 | img = IMAGE_FROM_ID (it->f, it->image_id); |
| 17677 | xassert (img); | 17715 | xassert (img); |
| 17678 | 17716 | /* Make sure X resources of the image is loaded. */ | |
| 17679 | /* Make sure X resources of the face and image are loaded. */ | ||
| 17680 | PREPARE_FACE_FOR_DISPLAY (it->f, face); | ||
| 17681 | prepare_image_for_display (it->f, img); | 17717 | prepare_image_for_display (it->f, img); |
| 17682 | 17718 | ||
| 17683 | it->ascent = it->phys_ascent = glyph_ascent = image_ascent (img, face); | 17719 | it->ascent = it->phys_ascent = glyph_ascent = image_ascent (img, face); |
| 17684 | it->descent = it->phys_descent = img->height + 2 * img->vmargin - it->ascent; | 17720 | it->descent = it->phys_descent = img->height + 2 * img->vmargin - it->ascent; |
| 17685 | it->pixel_width = img->width + 2 * img->hmargin; | 17721 | it->pixel_width = img->width + 2 * img->hmargin; |
| 17686 | 17722 | ||
| 17723 | /* It's quite possible for images to have an ascent greater than | ||
| 17724 | their height, so don't get confused in that case. */ | ||
| 17725 | if (it->descent < 0) | ||
| 17726 | it->descent = 0; | ||
| 17727 | |||
| 17687 | /* If this glyph is alone on the last line, adjust it.ascent to minimum row ascent. */ | 17728 | /* If this glyph is alone on the last line, adjust it.ascent to minimum row ascent. */ |
| 17688 | face_ascent = face->font ? FONT_BASE (face->font) : FRAME_BASELINE_OFFSET (it->f); | 17729 | face_ascent = face->font ? FONT_BASE (face->font) : FRAME_BASELINE_OFFSET (it->f); |
| 17689 | if (face_ascent > it->ascent) | 17730 | if (face_ascent > it->ascent) |
diff --git a/src/xfns.c b/src/xfns.c index a649ddd1068..5b3f8ffe552 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Functions for the X window system. | 1 | /* Functions for the X window system. |
| 2 | Copyright (C) 1989, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 01, 02, 03 | 2 | Copyright (C) 1989, 92, 93, 94, 95, 96, 97, 98, 99, 2000,01,02,03,04 |
| 3 | Free Software Foundation. | 3 | Free Software Foundation. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| @@ -5323,7 +5323,6 @@ lookup_image (f, spec) | |||
| 5323 | } | 5323 | } |
| 5324 | 5324 | ||
| 5325 | UNBLOCK_INPUT; | 5325 | UNBLOCK_INPUT; |
| 5326 | xassert (!interrupt_input_blocked); | ||
| 5327 | } | 5326 | } |
| 5328 | 5327 | ||
| 5329 | /* We're using IMG, so set its timestamp to `now'. */ | 5328 | /* We're using IMG, so set its timestamp to `now'. */ |