diff options
| author | Karoly Lorentey | 2006-04-28 14:48:18 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2006-04-28 14:48:18 +0000 |
| commit | b33c71f58623306001d4d4fe4f7354d8c360edaa (patch) | |
| tree | 3bcc8154133fcb19081850754bb725f38f86b56f /src | |
| parent | 717a00ef34c0f55bfbad80584f00d86c090d547f (diff) | |
| parent | a48b489eb94a238c1eca6a0c4bdf7d5b80503240 (diff) | |
| download | emacs-b33c71f58623306001d4d4fe4f7354d8c360edaa.tar.gz emacs-b33c71f58623306001d4d4fe4f7354d8c360edaa.zip | |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-234
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-235
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-236
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-237
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-238
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-239
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-240
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-241
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-242
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-243
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-244
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-245
(Ffield_beginning, find_field): Undo change of 2006-04-23.
* emacs@sv.gnu.org/emacs--devo--0--patch-246
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-247
Rcirc patch from Ryan Yeske
* emacs@sv.gnu.org/emacs--devo--0--patch-248
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-249
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-250
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-251
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-87
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-88
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-89
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-90
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-91
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-92
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-93
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-94
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-95
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-553
Diffstat (limited to 'src')
| -rw-r--r-- | src/.gdbinit | 11 | ||||
| -rw-r--r-- | src/ChangeLog | 139 | ||||
| -rw-r--r-- | src/dispextern.h | 9 | ||||
| -rw-r--r-- | src/editfns.c | 2 | ||||
| -rw-r--r-- | src/frame.c | 5 | ||||
| -rw-r--r-- | src/image.c | 136 | ||||
| -rw-r--r-- | src/keymap.c | 2 | ||||
| -rw-r--r-- | src/macmenu.c | 58 | ||||
| -rw-r--r-- | src/macterm.c | 122 | ||||
| -rw-r--r-- | src/print.c | 1 | ||||
| -rw-r--r-- | src/process.h | 6 | ||||
| -rw-r--r-- | src/s/ms-w32.h | 6 | ||||
| -rw-r--r-- | src/textprop.c | 32 | ||||
| -rw-r--r-- | src/w32fns.c | 2 | ||||
| -rw-r--r-- | src/w32term.c | 6 | ||||
| -rw-r--r-- | src/window.c | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 81 |
17 files changed, 464 insertions, 156 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index d40286f8679..ea9bf3f6092 100644 --- a/src/.gdbinit +++ b/src/.gdbinit | |||
| @@ -88,15 +88,13 @@ end | |||
| 88 | # Print out s-expressions from tool bar | 88 | # Print out s-expressions from tool bar |
| 89 | define pp1 | 89 | define pp1 |
| 90 | set $tmp = $arg0 | 90 | set $tmp = $arg0 |
| 91 | echo $arg0 | ||
| 92 | printf " = " | ||
| 93 | set $output_debug = print_output_debug_flag | 91 | set $output_debug = print_output_debug_flag |
| 94 | set print_output_debug_flag = 0 | 92 | set print_output_debug_flag = 0 |
| 95 | set safe_debug_print ($tmp) | 93 | set safe_debug_print ($tmp) |
| 96 | set print_output_debug_flag = $output_debug | 94 | set print_output_debug_flag = $output_debug |
| 97 | end | 95 | end |
| 98 | document pp1 | 96 | document pp1 |
| 99 | Print the argument as an emacs s-expression | 97 | Print the argument as an emacs s-expression. |
| 100 | Works only when an inferior emacs is executing. | 98 | Works only when an inferior emacs is executing. |
| 101 | For use on tool bar when debugging in Emacs | 99 | For use on tool bar when debugging in Emacs |
| 102 | where the variable name would not otherwise | 100 | where the variable name would not otherwise |
| @@ -119,8 +117,6 @@ end | |||
| 119 | # Print value of lisp variable | 117 | # Print value of lisp variable |
| 120 | define pv1 | 118 | define pv1 |
| 121 | set $tmp = "$arg0" | 119 | set $tmp = "$arg0" |
| 122 | echo $arg0 | ||
| 123 | printf " = " | ||
| 124 | set $output_debug = print_output_debug_flag | 120 | set $output_debug = print_output_debug_flag |
| 125 | set print_output_debug_flag = 0 | 121 | set print_output_debug_flag = 0 |
| 126 | set safe_debug_print (find_symbol_value (intern ($tmp))) | 122 | set safe_debug_print (find_symbol_value (intern ($tmp))) |
| @@ -129,9 +125,8 @@ end | |||
| 129 | document pv1 | 125 | document pv1 |
| 130 | Print the value of the lisp variable given as argument. | 126 | Print the value of the lisp variable given as argument. |
| 131 | Works only when an inferior emacs is executing. | 127 | Works only when an inferior emacs is executing. |
| 132 | For use on tool bar when debugging in Emacs | 128 | For use when debugging in Emacs where the variable |
| 133 | where the variable name would not otherwise | 129 | name would not otherwise be recorded in the GUD buffer. |
| 134 | be recorded in the GUD buffer. | ||
| 135 | end | 130 | end |
| 136 | 131 | ||
| 137 | # Print out current buffer point and boundaries | 132 | # Print out current buffer point and boundaries |
diff --git a/src/ChangeLog b/src/ChangeLog index f0f504e6e64..a4d458bee0f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,9 +1,128 @@ | |||
| 1 | 2006-04-27 Nick Roberts <nickrob@snap.net.nz> | ||
| 2 | |||
| 3 | * .gdbinit (pp1, pv1): Only print value as expression is now | ||
| 4 | printed out by gud-print. | ||
| 5 | (pv1): Correct doc string. | ||
| 6 | |||
| 7 | 2006-04-26 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 8 | |||
| 9 | * keymap.c (store_in_keymap): Change `def' arg to not be `register'. | ||
| 10 | Seems to trigger a bug in gcc-amd64 4.0.2 20051125 (Red Hat 4.0.2-8): | ||
| 11 | keymap.c:895: error: address of register variable `def' requested. | ||
| 12 | |||
| 13 | 2006-04-26 Jason Rumney <jasonr@gnu.org> | ||
| 14 | |||
| 15 | * w32term.c (construct_mouse_wheel): Handle negative coordinates. | ||
| 16 | |||
| 17 | * w32fns.c (w32_wnd_proc) <WM_LBUTTONDOWN, WM_RBUTTONDOWN>: | ||
| 18 | <WM_LBUTTONUP, WM_RBUTTONUP>: Call signal_user_input in the cases | ||
| 19 | where we preempt mouse_button_timer. | ||
| 20 | |||
| 21 | 2006-04-25 Miles Bader <miles@gnu.org> | ||
| 22 | |||
| 23 | * editfns.c (Ffield_beginning, find_field): Undo change of 2006-04-23. | ||
| 24 | |||
| 25 | 2006-04-24 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 26 | |||
| 27 | * process.h: Include headers for pid_t. | ||
| 28 | |||
| 29 | 2006-04-24 Kim F. Storm <storm@cua.dk> | ||
| 30 | |||
| 31 | * xdisp.c (fill_stretch_glyph_string): Set s->nchars = 1 for code which | ||
| 32 | does last_glyph=s->first_glyph+s->nchars-1, e.g. if stretch has relief. | ||
| 33 | (produce_stretch_glyph): Assume that face box height and width is | ||
| 34 | already included in in stretch glyph size so caller doesn't have to | ||
| 35 | consider the extra space otherwise added (fixes problem in ses.el). | ||
| 36 | |||
| 37 | * frame.c (x_set_font): Clear f->n_tool_bar_rows and current frame | ||
| 38 | matrices to force recalculation of tool-bar height after font change. | ||
| 39 | |||
| 40 | * xdisp.c (tool_bar_lines_needed): New local `temp_row' for clarity. | ||
| 41 | Clear it when done, so we don't accidentally draw a second copy of | ||
| 42 | the tool-bar after resetting f->n_tool_bar_rows. | ||
| 43 | (redisplay_tool_bar): Update tool-bar-lines frame parameter whenever | ||
| 44 | we recalculate f->n_tool_bar_rows. | ||
| 45 | |||
| 46 | 2006-04-23 Lars Hansen <larsh@soem.dk> | ||
| 47 | |||
| 48 | * editfns.c (find_field): Fix comment. | ||
| 49 | (Ffield_beginning): Fix bug when POS is at field beginning. | ||
| 50 | |||
| 51 | 2006-04-22 Eli Zaretskii <eliz@gnu.org> | ||
| 52 | |||
| 53 | * puresize.h (BASE_PURESIZE): Increase to 1205000. | ||
| 54 | |||
| 55 | 2006-04-21 Kim F. Storm <storm@cua.dk> | ||
| 56 | |||
| 57 | * xdisp.c (redisplay_window): Fix last change. Don't recenter if | ||
| 58 | window start is at BEGV. | ||
| 59 | |||
| 60 | * dispextern.h (struct image): New member `corners'. | ||
| 61 | (TOP_CORNER, LEFT_CORNER, BOT_CORNER, RIGHT_CORNER): New macros. | ||
| 62 | |||
| 63 | * image.c (four_corners_best): New arg CORNERS specifies what pixels | ||
| 64 | to look at in case image has margin. | ||
| 65 | (x_create_bitmap_mask): Pass NULL for CORNERS to four_corners_best. | ||
| 66 | (image_background, image_background_transparent) | ||
| 67 | (x_build_heuristic_mask): Pass img->corners to four_corners_best. | ||
| 68 | (gif_load): Set img->corners according to image's margin spec. | ||
| 69 | Use img->corners values directly where applicable. | ||
| 70 | Save image extension data in img->data.lisp_val. | ||
| 71 | (gif_clear_image): New function to free img->data.lisp_val. | ||
| 72 | (gif_type): Use it instead of generic x_clear_image. | ||
| 73 | (Fimage_extension_data): New defun. | ||
| 74 | (syms_of_image): Defsubr it. | ||
| 75 | |||
| 76 | 2006-04-21 John Sullivan <john@wjsullivan.net> (tiny change) | ||
| 77 | |||
| 78 | * window.c (Fdisplay_buffer): Doc fix. | ||
| 79 | |||
| 80 | 2006-04-21 Eli Zaretskii <eliz@gnu.org> | ||
| 81 | |||
| 82 | * s/ms-w32.h (SYSTEM_PURESIZE_EXTRA): Increase to 25000. | ||
| 83 | |||
| 84 | 2006-04-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 85 | |||
| 86 | * image.c [MAC_OS] (xpm_load_image): Fill in background field | ||
| 87 | while we have ximg handy. | ||
| 88 | |||
| 89 | * macmenu.c (restore_menu_items, save_menu_items): New functions | ||
| 90 | from xmenu.c. | ||
| 91 | (set_frame_menubar, digest_single_submenu): Apply 2006-04-18 | ||
| 92 | changes for xmenu.c. | ||
| 93 | |||
| 94 | * macterm.c (x_per_char_metric): Return NULL if glyph width is 0. | ||
| 95 | (add_mac_font_name): New function. | ||
| 96 | (init_font_name_table): Use it. Adopt the first found font from | ||
| 97 | those having the same family name. | ||
| 98 | |||
| 99 | 2006-04-21 Nick Roberts <nickrob@snap.net.nz> | ||
| 100 | |||
| 101 | * xdisp.c (note_mouse_highlight): Use build_string. | ||
| 102 | |||
| 103 | 2006-04-20 Lars Hansen <larsh@soem.dk> | ||
| 104 | |||
| 105 | * textprop.c (Fremove_list_of_text_properties): | ||
| 106 | Ensure modify_region is called only when buffer is modified and that | ||
| 107 | signal_after_change is allways called in that case. | ||
| 108 | |||
| 109 | * print.c (PRINTFINISH): Call signal_after_change. | ||
| 110 | |||
| 111 | 2006-04-20 Kim F. Storm <storm@cua.dk> | ||
| 112 | |||
| 113 | * xdisp.c (redisplay_window): Fix last change. | ||
| 114 | |||
| 115 | * xdisp.c (redisplay_window): If current window start is not at the | ||
| 116 | beginning of a line, select a new window start if buffer is modified | ||
| 117 | and window start is in the modified region, but the first change is | ||
| 118 | before window start. | ||
| 119 | |||
| 1 | 2006-04-18 Richard Stallman <rms@gnu.org> | 120 | 2006-04-18 Richard Stallman <rms@gnu.org> |
| 2 | 121 | ||
| 3 | * xmenu.c (restore_menu_items, save_menu_items): New fns. | 122 | * xmenu.c (restore_menu_items, save_menu_items): New fns. |
| 4 | (set_frame_menubar): Use save_menu_items. Save updated vector in | 123 | (set_frame_menubar): Use save_menu_items. Save updated vector in |
| 5 | the frame before unwinding it. Don't use unuse_menu_items. Don't | 124 | the frame before unwinding it. Don't use unuse_menu_items. |
| 6 | use discard_menu_items. | 125 | Don't use discard_menu_items. |
| 7 | (digest_single_submenu): Abort if an item is not in a pane. | 126 | (digest_single_submenu): Abort if an item is not in a pane. |
| 8 | (init_menu_items): Put the error check at the top. | 127 | (init_menu_items): Put the error check at the top. |
| 9 | 128 | ||
| @@ -30,8 +149,8 @@ | |||
| 30 | 149 | ||
| 31 | * macterm.c (XCreateGC, x_per_char_metric, xlfdpat_create) | 150 | * macterm.c (XCreateGC, x_per_char_metric, xlfdpat_create) |
| 32 | (init_font_name_table, init_font_name_table, mac_do_list_fonts) | 151 | (init_font_name_table, init_font_name_table, mac_do_list_fonts) |
| 33 | (XLoadQueryFont, mac_store_apple_event): Don't check | 152 | (XLoadQueryFont, mac_store_apple_event): Don't check return value |
| 34 | return value of xmalloc. | 153 | of xmalloc. |
| 35 | 154 | ||
| 36 | 2006-04-17 Kim F. Storm <storm@cua.dk> | 155 | 2006-04-17 Kim F. Storm <storm@cua.dk> |
| 37 | 156 | ||
| @@ -75,8 +194,7 @@ | |||
| 75 | 2006-04-13 Kenichi Handa <handa@m17n.org> | 194 | 2006-04-13 Kenichi Handa <handa@m17n.org> |
| 76 | 195 | ||
| 77 | * coding.c (setup_coding_system): Fix previous change. | 196 | * coding.c (setup_coding_system): Fix previous change. |
| 78 | (encode_coding): If eol_type is not yet decided, use | 197 | (encode_coding): If eol_type is not yet decided, use system_eol_type. |
| 79 | system_eol_type. | ||
| 80 | (shrink_encoding_region): If eol_type is not yet decided and | 198 | (shrink_encoding_region): If eol_type is not yet decided and |
| 81 | system_eol_type is not LF, don't shrink. | 199 | system_eol_type is not LF, don't shrink. |
| 82 | 200 | ||
| @@ -176,8 +294,8 @@ | |||
| 176 | within ||. Add explicit braces to avoid ambiguous `else'. | 294 | within ||. Add explicit braces to avoid ambiguous `else'. |
| 177 | (dump_glyph_row): Remove label for `inverse_p' from legend. | 295 | (dump_glyph_row): Remove label for `inverse_p' from legend. |
| 178 | 296 | ||
| 179 | * xfaces.c (Finternal_merge_in_global_face, try_font_list): Add | 297 | * xfaces.c (Finternal_merge_in_global_face, try_font_list): |
| 180 | explicit braces to avoid ambiguous `else'. | 298 | Add explicit braces to avoid ambiguous `else'. |
| 181 | 299 | ||
| 182 | 2006-04-11 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org> (tiny change) | 300 | 2006-04-11 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org> (tiny change) |
| 183 | 301 | ||
| @@ -886,11 +1004,6 @@ | |||
| 886 | (mac_set_clip_rectangles): When resetting clip region, make it | 1004 | (mac_set_clip_rectangles): When resetting clip region, make it |
| 887 | empty instead of disposing of it. | 1005 | empty instead of disposing of it. |
| 888 | 1006 | ||
| 889 | 2006-02-20 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 890 | |||
| 891 | * keymap.c (store_in_keymap): Change `def' arg to not be `register'. | ||
| 892 | Seems to trigger a bug in gcc-amd64 4.0.2 20051125 (Red Hat 4.0.2-8). | ||
| 893 | |||
| 894 | 2006-02-20 Kim F. Storm <storm@cua.dk> | 1007 | 2006-02-20 Kim F. Storm <storm@cua.dk> |
| 895 | 1008 | ||
| 896 | * Makefile.in: Add fringe.elc to WINDOW_SUPPORT. | 1009 | * Makefile.in: Add fringe.elc to WINDOW_SUPPORT. |
diff --git a/src/dispextern.h b/src/dispextern.h index 137b1d4dee2..c836bc751d0 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -2412,6 +2412,15 @@ struct image | |||
| 2412 | #define DEFAULT_IMAGE_WIDTH 30 | 2412 | #define DEFAULT_IMAGE_WIDTH 30 |
| 2413 | #define DEFAULT_IMAGE_HEIGHT 30 | 2413 | #define DEFAULT_IMAGE_HEIGHT 30 |
| 2414 | 2414 | ||
| 2415 | /* Top/left and bottom/right corner pixel of actual image data. | ||
| 2416 | Used by four_corners_best to consider the real image data, | ||
| 2417 | rather than looking at the optional image margin. */ | ||
| 2418 | int corners[4]; | ||
| 2419 | #define TOP_CORNER 0 | ||
| 2420 | #define LEFT_CORNER 1 | ||
| 2421 | #define BOT_CORNER 2 | ||
| 2422 | #define RIGHT_CORNER 3 | ||
| 2423 | |||
| 2415 | /* Percent of image height used as ascent. A value of | 2424 | /* Percent of image height used as ascent. A value of |
| 2416 | CENTERED_IMAGE_ASCENT means draw the image centered on the | 2425 | CENTERED_IMAGE_ASCENT means draw the image centered on the |
| 2417 | line. */ | 2426 | line. */ |
diff --git a/src/editfns.c b/src/editfns.c index 450a7684584..b74fd2a41c2 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -491,7 +491,7 @@ get_pos_property (position, prop, object) | |||
| 491 | } | 491 | } |
| 492 | 492 | ||
| 493 | /* Find the field surrounding POS in *BEG and *END. If POS is nil, | 493 | /* Find the field surrounding POS in *BEG and *END. If POS is nil, |
| 494 | the value of point is used instead. If BEG or END null, | 494 | the value of point is used instead. If BEG or END is null, |
| 495 | means don't store the beginning or end of the field. | 495 | means don't store the beginning or end of the field. |
| 496 | 496 | ||
| 497 | BEG_LIMIT and END_LIMIT serve to limit the ranged of the returned | 497 | BEG_LIMIT and END_LIMIT serve to limit the ranged of the returned |
diff --git a/src/frame.c b/src/frame.c index 988b1436936..04a663f9388 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -3399,6 +3399,11 @@ x_set_font (f, arg, oldval) | |||
| 3399 | else if (!NILP (Fequal (result, oldval))) | 3399 | else if (!NILP (Fequal (result, oldval))) |
| 3400 | return; | 3400 | return; |
| 3401 | 3401 | ||
| 3402 | /* Recalculate toolbar height. */ | ||
| 3403 | f->n_tool_bar_rows = 0; | ||
| 3404 | /* Ensure we redraw it. */ | ||
| 3405 | clear_current_matrices (f); | ||
| 3406 | |||
| 3402 | store_frame_param (f, Qfont, result); | 3407 | store_frame_param (f, Qfont, result); |
| 3403 | recompute_basic_faces (f); | 3408 | recompute_basic_faces (f); |
| 3404 | } | 3409 | } |
diff --git a/src/image.c b/src/image.c index a6b3c8f19c5..eae25fdb02e 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -603,7 +603,9 @@ x_destroy_all_bitmaps (dpyinfo) | |||
| 603 | /* Useful functions defined in the section | 603 | /* Useful functions defined in the section |
| 604 | `Image type independent image structures' below. */ | 604 | `Image type independent image structures' below. */ |
| 605 | 605 | ||
| 606 | static unsigned long four_corners_best P_ ((XImagePtr ximg, unsigned long width, | 606 | static unsigned long four_corners_best P_ ((XImagePtr ximg, |
| 607 | int *corners, | ||
| 608 | unsigned long width, | ||
| 607 | unsigned long height)); | 609 | unsigned long height)); |
| 608 | 610 | ||
| 609 | static int x_create_x_image_and_pixmap P_ ((struct frame *f, int width, int height, | 611 | static int x_create_x_image_and_pixmap P_ ((struct frame *f, int width, int height, |
| @@ -657,7 +659,7 @@ x_create_bitmap_mask (f, id) | |||
| 657 | return -1; | 659 | return -1; |
| 658 | } | 660 | } |
| 659 | 661 | ||
| 660 | bg = four_corners_best (ximg, width, height); | 662 | bg = four_corners_best (ximg, NULL, width, height); |
| 661 | 663 | ||
| 662 | for (y = 0; y < ximg->height; ++y) | 664 | for (y = 0; y < ximg->height; ++y) |
| 663 | { | 665 | { |
| @@ -732,7 +734,7 @@ Lisp_Object Qxbm; | |||
| 732 | /* Keywords. */ | 734 | /* Keywords. */ |
| 733 | 735 | ||
| 734 | extern Lisp_Object QCwidth, QCheight, QCforeground, QCbackground, QCfile; | 736 | extern Lisp_Object QCwidth, QCheight, QCforeground, QCbackground, QCfile; |
| 735 | extern Lisp_Object QCdata, QCtype; | 737 | extern Lisp_Object QCdata, QCtype, Qcount; |
| 736 | extern Lisp_Object Qcenter; | 738 | extern Lisp_Object Qcenter; |
| 737 | Lisp_Object QCascent, QCmargin, QCrelief; | 739 | Lisp_Object QCascent, QCmargin, QCrelief; |
| 738 | Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask; | 740 | Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask; |
| @@ -1141,6 +1143,27 @@ or omitted means use the selected frame. */) | |||
| 1141 | return mask; | 1143 | return mask; |
| 1142 | } | 1144 | } |
| 1143 | 1145 | ||
| 1146 | DEFUN ("image-extension-data", Fimage_extension_data, Simage_extension_data, 1, 2, 0, | ||
| 1147 | doc: /* Return extension data for image SPEC. | ||
| 1148 | FRAME is the frame on which the image will be displayed. FRAME nil | ||
| 1149 | or omitted means use the selected frame. */) | ||
| 1150 | (spec, frame) | ||
| 1151 | Lisp_Object spec, frame; | ||
| 1152 | { | ||
| 1153 | Lisp_Object ext; | ||
| 1154 | |||
| 1155 | ext = Qnil; | ||
| 1156 | if (valid_image_p (spec)) | ||
| 1157 | { | ||
| 1158 | struct frame *f = check_x_frame (frame); | ||
| 1159 | int id = lookup_image (f, spec); | ||
| 1160 | struct image *img = IMAGE_FROM_ID (f, id); | ||
| 1161 | ext = img->data.lisp_val; | ||
| 1162 | } | ||
| 1163 | |||
| 1164 | return ext; | ||
| 1165 | } | ||
| 1166 | |||
| 1144 | 1167 | ||
| 1145 | /*********************************************************************** | 1168 | /*********************************************************************** |
| 1146 | Image type independent image structures | 1169 | Image type independent image structures |
| @@ -1171,6 +1194,7 @@ make_image (spec, hash) | |||
| 1171 | img->data.lisp_val = Qnil; | 1194 | img->data.lisp_val = Qnil; |
| 1172 | img->ascent = DEFAULT_IMAGE_ASCENT; | 1195 | img->ascent = DEFAULT_IMAGE_ASCENT; |
| 1173 | img->hash = hash; | 1196 | img->hash = hash; |
| 1197 | img->corners[BOT_CORNER] = -1; /* Full image */ | ||
| 1174 | return img; | 1198 | return img; |
| 1175 | } | 1199 | } |
| 1176 | 1200 | ||
| @@ -1322,30 +1346,41 @@ image_ascent (img, face, slice) | |||
| 1322 | On W32, XIMG is assumed to a device context with the bitmap selected. */ | 1346 | On W32, XIMG is assumed to a device context with the bitmap selected. */ |
| 1323 | 1347 | ||
| 1324 | static RGB_PIXEL_COLOR | 1348 | static RGB_PIXEL_COLOR |
| 1325 | four_corners_best (ximg, width, height) | 1349 | four_corners_best (ximg, corners, width, height) |
| 1326 | XImagePtr_or_DC ximg; | 1350 | XImagePtr_or_DC ximg; |
| 1351 | int *corners; | ||
| 1327 | unsigned long width, height; | 1352 | unsigned long width, height; |
| 1328 | { | 1353 | { |
| 1329 | RGB_PIXEL_COLOR corners[4], best; | 1354 | RGB_PIXEL_COLOR corner_pixels[4], best; |
| 1330 | int i, best_count; | 1355 | int i, best_count; |
| 1331 | 1356 | ||
| 1332 | /* Get the colors at the corners of ximg. */ | 1357 | if (corners && corners[BOT_CORNER] >= 0) |
| 1333 | corners[0] = GET_PIXEL (ximg, 0, 0); | 1358 | { |
| 1334 | corners[1] = GET_PIXEL (ximg, width - 1, 0); | 1359 | /* Get the colors at the corner_pixels of ximg. */ |
| 1335 | corners[2] = GET_PIXEL (ximg, width - 1, height - 1); | 1360 | corner_pixels[0] = GET_PIXEL (ximg, corners[LEFT_CORNER], corners[TOP_CORNER]); |
| 1336 | corners[3] = GET_PIXEL (ximg, 0, height - 1); | 1361 | corner_pixels[1] = GET_PIXEL (ximg, corners[RIGHT_CORNER] - 1, corners[TOP_CORNER]); |
| 1337 | 1362 | corner_pixels[2] = GET_PIXEL (ximg, corners[RIGHT_CORNER] - 1, corners[BOT_CORNER] - 1); | |
| 1363 | corner_pixels[3] = GET_PIXEL (ximg, corners[LEFT_CORNER], corners[BOT_CORNER] - 1); | ||
| 1364 | } | ||
| 1365 | else | ||
| 1366 | { | ||
| 1367 | /* Get the colors at the corner_pixels of ximg. */ | ||
| 1368 | corner_pixels[0] = GET_PIXEL (ximg, 0, 0); | ||
| 1369 | corner_pixels[1] = GET_PIXEL (ximg, width - 1, 0); | ||
| 1370 | corner_pixels[2] = GET_PIXEL (ximg, width - 1, height - 1); | ||
| 1371 | corner_pixels[3] = GET_PIXEL (ximg, 0, height - 1); | ||
| 1372 | } | ||
| 1338 | /* Choose the most frequently found color as background. */ | 1373 | /* Choose the most frequently found color as background. */ |
| 1339 | for (i = best_count = 0; i < 4; ++i) | 1374 | for (i = best_count = 0; i < 4; ++i) |
| 1340 | { | 1375 | { |
| 1341 | int j, n; | 1376 | int j, n; |
| 1342 | 1377 | ||
| 1343 | for (j = n = 0; j < 4; ++j) | 1378 | for (j = n = 0; j < 4; ++j) |
| 1344 | if (corners[i] == corners[j]) | 1379 | if (corner_pixels[i] == corner_pixels[j]) |
| 1345 | ++n; | 1380 | ++n; |
| 1346 | 1381 | ||
| 1347 | if (n > best_count) | 1382 | if (n > best_count) |
| 1348 | best = corners[i], best_count = n; | 1383 | best = corner_pixels[i], best_count = n; |
| 1349 | } | 1384 | } |
| 1350 | 1385 | ||
| 1351 | return best; | 1386 | return best; |
| @@ -1404,7 +1439,7 @@ image_background (img, f, ximg) | |||
| 1404 | #endif /* !HAVE_NTGUI */ | 1439 | #endif /* !HAVE_NTGUI */ |
| 1405 | } | 1440 | } |
| 1406 | 1441 | ||
| 1407 | img->background = four_corners_best (ximg, img->width, img->height); | 1442 | img->background = four_corners_best (ximg, img->corners, img->width, img->height); |
| 1408 | 1443 | ||
| 1409 | if (free_ximg) | 1444 | if (free_ximg) |
| 1410 | Destroy_Image (ximg, prev); | 1445 | Destroy_Image (ximg, prev); |
| @@ -1449,7 +1484,7 @@ image_background_transparent (img, f, mask) | |||
| 1449 | } | 1484 | } |
| 1450 | 1485 | ||
| 1451 | img->background_transparent | 1486 | img->background_transparent |
| 1452 | = (four_corners_best (mask, img->width, img->height) == PIX_MASK_RETAIN); | 1487 | = (four_corners_best (mask, img->corners, img->width, img->height) == PIX_MASK_RETAIN); |
| 1453 | 1488 | ||
| 1454 | if (free_mask) | 1489 | if (free_mask) |
| 1455 | Destroy_Image (mask, prev); | 1490 | Destroy_Image (mask, prev); |
| @@ -4462,6 +4497,10 @@ xpm_load_image (f, img, contents, end) | |||
| 4462 | img->width = width; | 4497 | img->width = width; |
| 4463 | img->height = height; | 4498 | img->height = height; |
| 4464 | 4499 | ||
| 4500 | /* Maybe fill in the background field while we have ximg handy. */ | ||
| 4501 | if (NILP (image_spec_value (img->spec, QCbackground, NULL))) | ||
| 4502 | IMAGE_BACKGROUND (img, f, ximg); | ||
| 4503 | |||
| 4465 | x_put_x_image (f, ximg, img->pixmap, width, height); | 4504 | x_put_x_image (f, ximg, img->pixmap, width, height); |
| 4466 | x_destroy_x_image (ximg); | 4505 | x_destroy_x_image (ximg); |
| 4467 | if (have_mask) | 4506 | if (have_mask) |
| @@ -5356,7 +5395,7 @@ x_build_heuristic_mask (f, img, how) | |||
| 5356 | } | 5395 | } |
| 5357 | 5396 | ||
| 5358 | if (use_img_background) | 5397 | if (use_img_background) |
| 5359 | bg = four_corners_best (ximg, img->width, img->height); | 5398 | bg = four_corners_best (ximg, img->corners, img->width, img->height); |
| 5360 | 5399 | ||
| 5361 | /* Set all bits in mask_img to 1 whose color in ximg is different | 5400 | /* Set all bits in mask_img to 1 whose color in ximg is different |
| 5362 | from the background color bg. */ | 5401 | from the background color bg. */ |
| @@ -7449,6 +7488,7 @@ tiff_load (f, img) | |||
| 7449 | 7488 | ||
| 7450 | static int gif_image_p P_ ((Lisp_Object object)); | 7489 | static int gif_image_p P_ ((Lisp_Object object)); |
| 7451 | static int gif_load P_ ((struct frame *f, struct image *img)); | 7490 | static int gif_load P_ ((struct frame *f, struct image *img)); |
| 7491 | static void gif_clear_image P_ ((struct frame *f, struct image *img)); | ||
| 7452 | 7492 | ||
| 7453 | /* The symbol `gif' identifying images of this type. */ | 7493 | /* The symbol `gif' identifying images of this type. */ |
| 7454 | 7494 | ||
| @@ -7497,10 +7537,22 @@ static struct image_type gif_type = | |||
| 7497 | &Qgif, | 7537 | &Qgif, |
| 7498 | gif_image_p, | 7538 | gif_image_p, |
| 7499 | gif_load, | 7539 | gif_load, |
| 7500 | x_clear_image, | 7540 | gif_clear_image, |
| 7501 | NULL | 7541 | NULL |
| 7502 | }; | 7542 | }; |
| 7503 | 7543 | ||
| 7544 | /* Free X resources of GIF image IMG which is used on frame F. */ | ||
| 7545 | |||
| 7546 | static void | ||
| 7547 | gif_clear_image (f, img) | ||
| 7548 | struct frame *f; | ||
| 7549 | struct image *img; | ||
| 7550 | { | ||
| 7551 | /* IMG->data.ptr_val may contain extension data. */ | ||
| 7552 | img->data.lisp_val = Qnil; | ||
| 7553 | x_clear_image (f, img); | ||
| 7554 | } | ||
| 7555 | |||
| 7504 | /* Return non-zero if OBJECT is a valid GIF image specification. */ | 7556 | /* Return non-zero if OBJECT is a valid GIF image specification. */ |
| 7505 | 7557 | ||
| 7506 | static int | 7558 | static int |
| @@ -7621,7 +7673,7 @@ gif_load (f, img) | |||
| 7621 | GifFileType *gif; | 7673 | GifFileType *gif; |
| 7622 | struct gcpro gcpro1; | 7674 | struct gcpro gcpro1; |
| 7623 | Lisp_Object image; | 7675 | Lisp_Object image; |
| 7624 | int ino, image_left, image_top, image_width, image_height; | 7676 | int ino, image_height, image_width; |
| 7625 | gif_memory_source memsrc; | 7677 | gif_memory_source memsrc; |
| 7626 | unsigned char *raster; | 7678 | unsigned char *raster; |
| 7627 | 7679 | ||
| @@ -7698,17 +7750,19 @@ gif_load (f, img) | |||
| 7698 | return 0; | 7750 | return 0; |
| 7699 | } | 7751 | } |
| 7700 | 7752 | ||
| 7701 | image_top = gif->SavedImages[ino].ImageDesc.Top; | 7753 | img->corners[TOP_CORNER] = gif->SavedImages[ino].ImageDesc.Top; |
| 7702 | image_left = gif->SavedImages[ino].ImageDesc.Left; | 7754 | img->corners[LEFT_CORNER] = gif->SavedImages[ino].ImageDesc.Left; |
| 7703 | image_width = gif->SavedImages[ino].ImageDesc.Width; | ||
| 7704 | image_height = gif->SavedImages[ino].ImageDesc.Height; | 7755 | image_height = gif->SavedImages[ino].ImageDesc.Height; |
| 7756 | img->corners[BOT_CORNER] = img->corners[TOP_CORNER] + image_height; | ||
| 7757 | image_width = gif->SavedImages[ino].ImageDesc.Width; | ||
| 7758 | img->corners[RIGHT_CORNER] = img->corners[LEFT_CORNER] + image_width; | ||
| 7705 | 7759 | ||
| 7706 | width = img->width = max (gif->SWidth, | 7760 | width = img->width = max (gif->SWidth, |
| 7707 | max (gif->Image.Left + gif->Image.Width, | 7761 | max (gif->Image.Left + gif->Image.Width, |
| 7708 | image_left + image_width)); | 7762 | img->corners[RIGHT_CORNER])); |
| 7709 | height = img->height = max (gif->SHeight, | 7763 | height = img->height = max (gif->SHeight, |
| 7710 | max (gif->Image.Top + gif->Image.Height, | 7764 | max (gif->Image.Top + gif->Image.Height, |
| 7711 | image_top + image_height)); | 7765 | img->corners[BOT_CORNER])); |
| 7712 | 7766 | ||
| 7713 | if (!check_image_size (f, width, height)) | 7767 | if (!check_image_size (f, width, height)) |
| 7714 | { | 7768 | { |
| @@ -7751,19 +7805,19 @@ gif_load (f, img) | |||
| 7751 | requires more than can be done here (see the gif89 spec, | 7805 | requires more than can be done here (see the gif89 spec, |
| 7752 | disposal methods). Let's simply assume that the part | 7806 | disposal methods). Let's simply assume that the part |
| 7753 | not covered by a sub-image is in the frame's background color. */ | 7807 | not covered by a sub-image is in the frame's background color. */ |
| 7754 | for (y = 0; y < image_top; ++y) | 7808 | for (y = 0; y < img->corners[TOP_CORNER]; ++y) |
| 7755 | for (x = 0; x < width; ++x) | 7809 | for (x = 0; x < width; ++x) |
| 7756 | XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f)); | 7810 | XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f)); |
| 7757 | 7811 | ||
| 7758 | for (y = image_top + image_height; y < height; ++y) | 7812 | for (y = img->corners[BOT_CORNER]; y < height; ++y) |
| 7759 | for (x = 0; x < width; ++x) | 7813 | for (x = 0; x < width; ++x) |
| 7760 | XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f)); | 7814 | XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f)); |
| 7761 | 7815 | ||
| 7762 | for (y = image_top; y < image_top + image_height; ++y) | 7816 | for (y = img->corners[TOP_CORNER]; y < img->corners[BOT_CORNER]; ++y) |
| 7763 | { | 7817 | { |
| 7764 | for (x = 0; x < image_left; ++x) | 7818 | for (x = 0; x < img->corners[LEFT_CORNER]; ++x) |
| 7765 | XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f)); | 7819 | XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f)); |
| 7766 | for (x = image_left + image_width; x < width; ++x) | 7820 | for (x = img->corners[RIGHT_CORNER]; x < width; ++x) |
| 7767 | XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f)); | 7821 | XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f)); |
| 7768 | } | 7822 | } |
| 7769 | 7823 | ||
| @@ -7793,8 +7847,8 @@ gif_load (f, img) | |||
| 7793 | for (x = 0; x < image_width; x++) | 7847 | for (x = 0; x < image_width; x++) |
| 7794 | { | 7848 | { |
| 7795 | int i = raster[(y * image_width) + x]; | 7849 | int i = raster[(y * image_width) + x]; |
| 7796 | XPutPixel (ximg, x + image_left, row + image_top, | 7850 | XPutPixel (ximg, x + img->corners[LEFT_CORNER], |
| 7797 | pixel_colors[i]); | 7851 | row + img->corners[TOP_CORNER], pixel_colors[i]); |
| 7798 | } | 7852 | } |
| 7799 | 7853 | ||
| 7800 | row += interlace_increment[pass]; | 7854 | row += interlace_increment[pass]; |
| @@ -7806,10 +7860,29 @@ gif_load (f, img) | |||
| 7806 | for (x = 0; x < image_width; ++x) | 7860 | for (x = 0; x < image_width; ++x) |
| 7807 | { | 7861 | { |
| 7808 | int i = raster[y * image_width + x]; | 7862 | int i = raster[y * image_width + x]; |
| 7809 | XPutPixel (ximg, x + image_left, y + image_top, pixel_colors[i]); | 7863 | XPutPixel (ximg, x + img->corners[LEFT_CORNER], |
| 7864 | y + img->corners[TOP_CORNER], pixel_colors[i]); | ||
| 7810 | } | 7865 | } |
| 7811 | } | 7866 | } |
| 7812 | 7867 | ||
| 7868 | /* Save GIF image extension data for `image-extension-data'. | ||
| 7869 | Format is (count IMAGES FUNCTION "BYTES" ...). */ | ||
| 7870 | img->data.lisp_val = Qnil; | ||
| 7871 | if (gif->SavedImages[ino].ExtensionBlockCount > 0) | ||
| 7872 | { | ||
| 7873 | ExtensionBlock *ext = gif->SavedImages[ino].ExtensionBlocks; | ||
| 7874 | for (i = 0; i < gif->SavedImages[ino].ExtensionBlockCount; i++, ext++) | ||
| 7875 | /* Append (... FUNCTION "BYTES") */ | ||
| 7876 | img->data.lisp_val = Fcons (make_unibyte_string (ext->Bytes, ext->ByteCount), | ||
| 7877 | Fcons (make_number (ext->Function), | ||
| 7878 | img->data.lisp_val)); | ||
| 7879 | img->data.lisp_val = Fnreverse (img->data.lisp_val); | ||
| 7880 | } | ||
| 7881 | if (gif->ImageCount > 1) | ||
| 7882 | img->data.lisp_val = Fcons (Qcount, | ||
| 7883 | Fcons (make_number (gif->ImageCount), | ||
| 7884 | img->data.lisp_val)); | ||
| 7885 | |||
| 7813 | fn_DGifCloseFile (gif); | 7886 | fn_DGifCloseFile (gif); |
| 7814 | 7887 | ||
| 7815 | /* Maybe fill in the background field while we have ximg handy. */ | 7888 | /* Maybe fill in the background field while we have ximg handy. */ |
| @@ -8555,6 +8628,7 @@ non-numeric, there is no explicit limit on the size of images. */); | |||
| 8555 | defsubr (&Sclear_image_cache); | 8628 | defsubr (&Sclear_image_cache); |
| 8556 | defsubr (&Simage_size); | 8629 | defsubr (&Simage_size); |
| 8557 | defsubr (&Simage_mask_p); | 8630 | defsubr (&Simage_mask_p); |
| 8631 | defsubr (&Simage_extension_data); | ||
| 8558 | 8632 | ||
| 8559 | #if GLYPH_DEBUG | 8633 | #if GLYPH_DEBUG |
| 8560 | defsubr (&Simagep); | 8634 | defsubr (&Simagep); |
diff --git a/src/keymap.c b/src/keymap.c index 5962dfc2efd..7ff3f471b0f 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -859,7 +859,7 @@ static Lisp_Object | |||
| 859 | store_in_keymap (keymap, idx, def) | 859 | store_in_keymap (keymap, idx, def) |
| 860 | Lisp_Object keymap; | 860 | Lisp_Object keymap; |
| 861 | register Lisp_Object idx; | 861 | register Lisp_Object idx; |
| 862 | register Lisp_Object def; | 862 | Lisp_Object def; |
| 863 | { | 863 | { |
| 864 | /* Flush any reverse-map cache. */ | 864 | /* Flush any reverse-map cache. */ |
| 865 | where_is_cache = Qnil; | 865 | where_is_cache = Qnil; |
diff --git a/src/macmenu.c b/src/macmenu.c index 29233ec0d64..be565f89259 100644 --- a/src/macmenu.c +++ b/src/macmenu.c | |||
| @@ -303,6 +303,37 @@ discard_menu_items () | |||
| 303 | } | 303 | } |
| 304 | } | 304 | } |
| 305 | 305 | ||
| 306 | /* This undoes save_menu_items, and it is called by the specpdl unwind | ||
| 307 | mechanism. */ | ||
| 308 | |||
| 309 | static Lisp_Object | ||
| 310 | restore_menu_items (saved) | ||
| 311 | Lisp_Object saved; | ||
| 312 | { | ||
| 313 | menu_items = XCAR (saved); | ||
| 314 | menu_items_allocated = (VECTORP (menu_items) ? ASIZE (menu_items) : 0); | ||
| 315 | saved = XCDR (saved); | ||
| 316 | menu_items_used = XINT (XCAR (saved)); | ||
| 317 | saved = XCDR (saved); | ||
| 318 | menu_items_n_panes = XINT (XCAR (saved)); | ||
| 319 | saved = XCDR (saved); | ||
| 320 | menu_items_submenu_depth = XINT (XCAR (saved)); | ||
| 321 | } | ||
| 322 | |||
| 323 | /* Push the whole state of menu_items processing onto the specpdl. | ||
| 324 | It will be restored when the specpdl is unwound. */ | ||
| 325 | |||
| 326 | static void | ||
| 327 | save_menu_items () | ||
| 328 | { | ||
| 329 | Lisp_Object saved = list4 (menu_items, | ||
| 330 | make_number (menu_items_used), | ||
| 331 | make_number (menu_items_n_panes), | ||
| 332 | make_number (menu_items_submenu_depth)); | ||
| 333 | record_unwind_protect (restore_menu_items, saved); | ||
| 334 | menu_items = Qnil; | ||
| 335 | } | ||
| 336 | |||
| 306 | /* Make the menu_items vector twice as large. */ | 337 | /* Make the menu_items vector twice as large. */ |
| 307 | 338 | ||
| 308 | static void | 339 | static void |
| @@ -313,6 +344,7 @@ grow_menu_items () | |||
| 313 | old = menu_items; | 344 | old = menu_items; |
| 314 | 345 | ||
| 315 | menu_items_allocated *= 2; | 346 | menu_items_allocated *= 2; |
| 347 | |||
| 316 | menu_items = Fmake_vector (make_number (menu_items_allocated), Qnil); | 348 | menu_items = Fmake_vector (make_number (menu_items_allocated), Qnil); |
| 317 | bcopy (XVECTOR (old)->contents, XVECTOR (menu_items)->contents, | 349 | bcopy (XVECTOR (old)->contents, XVECTOR (menu_items)->contents, |
| 318 | old_size * sizeof (Lisp_Object)); | 350 | old_size * sizeof (Lisp_Object)); |
| @@ -1185,6 +1217,7 @@ digest_single_submenu (start, end, top_level_items) | |||
| 1185 | int i; | 1217 | int i; |
| 1186 | int submenu_depth = 0; | 1218 | int submenu_depth = 0; |
| 1187 | widget_value **submenu_stack; | 1219 | widget_value **submenu_stack; |
| 1220 | int panes_seen = 0; | ||
| 1188 | 1221 | ||
| 1189 | submenu_stack | 1222 | submenu_stack |
| 1190 | = (widget_value **) alloca (menu_items_used * sizeof (widget_value *)); | 1223 | = (widget_value **) alloca (menu_items_used * sizeof (widget_value *)); |
| @@ -1231,6 +1264,8 @@ digest_single_submenu (start, end, top_level_items) | |||
| 1231 | Lisp_Object pane_name, prefix; | 1264 | Lisp_Object pane_name, prefix; |
| 1232 | char *pane_string; | 1265 | char *pane_string; |
| 1233 | 1266 | ||
| 1267 | panes_seen++; | ||
| 1268 | |||
| 1234 | pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; | 1269 | pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; |
| 1235 | prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; | 1270 | prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; |
| 1236 | 1271 | ||
| @@ -1278,6 +1313,10 @@ digest_single_submenu (start, end, top_level_items) | |||
| 1278 | Lisp_Object item_name, enable, descrip, def, type, selected; | 1313 | Lisp_Object item_name, enable, descrip, def, type, selected; |
| 1279 | Lisp_Object help; | 1314 | Lisp_Object help; |
| 1280 | 1315 | ||
| 1316 | /* All items should be contained in panes. */ | ||
| 1317 | if (panes_seen == 0) | ||
| 1318 | abort (); | ||
| 1319 | |||
| 1281 | item_name = AREF (menu_items, i + MENU_ITEMS_ITEM_NAME); | 1320 | item_name = AREF (menu_items, i + MENU_ITEMS_ITEM_NAME); |
| 1282 | enable = AREF (menu_items, i + MENU_ITEMS_ITEM_ENABLE); | 1321 | enable = AREF (menu_items, i + MENU_ITEMS_ITEM_ENABLE); |
| 1283 | descrip = AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY); | 1322 | descrip = AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY); |
| @@ -1529,6 +1568,8 @@ set_frame_menubar (f, first_time, deep_p) | |||
| 1529 | 1568 | ||
| 1530 | /* Fill in menu_items with the current menu bar contents. | 1569 | /* Fill in menu_items with the current menu bar contents. |
| 1531 | This can evaluate Lisp code. */ | 1570 | This can evaluate Lisp code. */ |
| 1571 | save_menu_items (); | ||
| 1572 | |||
| 1532 | menu_items = f->menu_bar_vector; | 1573 | menu_items = f->menu_bar_vector; |
| 1533 | menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0; | 1574 | menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0; |
| 1534 | submenu_start = (int *) alloca (XVECTOR (items)->size * sizeof (int *)); | 1575 | submenu_start = (int *) alloca (XVECTOR (items)->size * sizeof (int *)); |
| @@ -1588,23 +1629,33 @@ set_frame_menubar (f, first_time, deep_p) | |||
| 1588 | } | 1629 | } |
| 1589 | 1630 | ||
| 1590 | set_buffer_internal_1 (prev); | 1631 | set_buffer_internal_1 (prev); |
| 1591 | unbind_to (specpdl_count, Qnil); | ||
| 1592 | 1632 | ||
| 1593 | /* If there has been no change in the Lisp-level contents | 1633 | /* If there has been no change in the Lisp-level contents |
| 1594 | of the menu bar, skip redisplaying it. Just exit. */ | 1634 | of the menu bar, skip redisplaying it. Just exit. */ |
| 1595 | 1635 | ||
| 1636 | /* Compare the new menu items with the ones computed last time. */ | ||
| 1596 | for (i = 0; i < previous_menu_items_used; i++) | 1637 | for (i = 0; i < previous_menu_items_used; i++) |
| 1597 | if (menu_items_used == i | 1638 | if (menu_items_used == i |
| 1598 | || (!EQ (previous_items[i], XVECTOR (menu_items)->contents[i]))) | 1639 | || (!EQ (previous_items[i], XVECTOR (menu_items)->contents[i]))) |
| 1599 | break; | 1640 | break; |
| 1600 | if (i == menu_items_used && i == previous_menu_items_used && i != 0) | 1641 | if (i == menu_items_used && i == previous_menu_items_used && i != 0) |
| 1601 | { | 1642 | { |
| 1643 | /* The menu items have not changed. Don't bother updating | ||
| 1644 | the menus in any form, since it would be a no-op. */ | ||
| 1602 | free_menubar_widget_value_tree (first_wv); | 1645 | free_menubar_widget_value_tree (first_wv); |
| 1603 | discard_menu_items (); | 1646 | discard_menu_items (); |
| 1604 | 1647 | unbind_to (specpdl_count, Qnil); | |
| 1605 | return; | 1648 | return; |
| 1606 | } | 1649 | } |
| 1607 | 1650 | ||
| 1651 | /* The menu items are different, so store them in the frame. */ | ||
| 1652 | f->menu_bar_vector = menu_items; | ||
| 1653 | f->menu_bar_items_used = menu_items_used; | ||
| 1654 | |||
| 1655 | /* This calls restore_menu_items to restore menu_items, etc., | ||
| 1656 | as they were outside. */ | ||
| 1657 | unbind_to (specpdl_count, Qnil); | ||
| 1658 | |||
| 1608 | /* Now GC cannot happen during the lifetime of the widget_value, | 1659 | /* Now GC cannot happen during the lifetime of the widget_value, |
| 1609 | so it's safe to store data from a Lisp_String. */ | 1660 | so it's safe to store data from a Lisp_String. */ |
| 1610 | wv = first_wv->contents; | 1661 | wv = first_wv->contents; |
| @@ -1619,9 +1670,6 @@ set_frame_menubar (f, first_time, deep_p) | |||
| 1619 | wv = wv->next; | 1670 | wv = wv->next; |
| 1620 | } | 1671 | } |
| 1621 | 1672 | ||
| 1622 | f->menu_bar_vector = menu_items; | ||
| 1623 | f->menu_bar_items_used = menu_items_used; | ||
| 1624 | discard_menu_items (); | ||
| 1625 | } | 1673 | } |
| 1626 | else | 1674 | else |
| 1627 | { | 1675 | { |
diff --git a/src/macterm.c b/src/macterm.c index 5696f13e5a0..6c47e2f932f 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -2230,7 +2230,11 @@ x_per_char_metric (font, char2b) | |||
| 2230 | #endif | 2230 | #endif |
| 2231 | 2231 | ||
| 2232 | return ((pcm == NULL | 2232 | return ((pcm == NULL |
| 2233 | || (pcm->width == 0 && (pcm->rbearing - pcm->lbearing) == 0)) | 2233 | || (pcm->width == 0 |
| 2234 | #if 0 /* Show hollow boxes for zero-width glyphs such as combining diacritics. */ | ||
| 2235 | && (pcm->rbearing - pcm->lbearing) == 0 | ||
| 2236 | #endif | ||
| 2237 | )) | ||
| 2234 | ? NULL : pcm); | 2238 | ? NULL : pcm); |
| 2235 | } | 2239 | } |
| 2236 | 2240 | ||
| @@ -7042,6 +7046,25 @@ add_font_name_table_entry (char *font_name) | |||
| 7042 | font_name_table[font_name_count++] = font_name; | 7046 | font_name_table[font_name_count++] = font_name; |
| 7043 | } | 7047 | } |
| 7044 | 7048 | ||
| 7049 | static void | ||
| 7050 | add_mac_font_name (name, size, style, charset) | ||
| 7051 | char *name; | ||
| 7052 | int size; | ||
| 7053 | Style style; | ||
| 7054 | char *charset; | ||
| 7055 | { | ||
| 7056 | if (size > 0) | ||
| 7057 | add_font_name_table_entry (mac_to_x_fontname (name, size, style, charset)); | ||
| 7058 | else | ||
| 7059 | { | ||
| 7060 | add_font_name_table_entry (mac_to_x_fontname (name, 0, style, charset)); | ||
| 7061 | add_font_name_table_entry (mac_to_x_fontname (name, 0, italic, charset)); | ||
| 7062 | add_font_name_table_entry (mac_to_x_fontname (name, 0, bold, charset)); | ||
| 7063 | add_font_name_table_entry (mac_to_x_fontname (name, 0, italic | bold, | ||
| 7064 | charset)); | ||
| 7065 | } | ||
| 7066 | } | ||
| 7067 | |||
| 7045 | /* Sets up the table font_name_table to contain the list of all fonts | 7068 | /* Sets up the table font_name_table to contain the list of all fonts |
| 7046 | in the system the first time the table is used so that the Resource | 7069 | in the system the first time the table is used so that the Resource |
| 7047 | Manager need not be accessed every time this information is | 7070 | Manager need not be accessed every time this information is |
| @@ -7067,16 +7090,21 @@ init_font_name_table () | |||
| 7067 | text_encoding_info_alist))) | 7090 | text_encoding_info_alist))) |
| 7068 | { | 7091 | { |
| 7069 | OSErr err; | 7092 | OSErr err; |
| 7093 | struct Lisp_Hash_Table *h; | ||
| 7094 | unsigned hash_code; | ||
| 7070 | ItemCount nfonts, i; | 7095 | ItemCount nfonts, i; |
| 7071 | ATSUFontID *font_ids = NULL; | 7096 | ATSUFontID *font_ids = NULL; |
| 7072 | Ptr name, prev_name = NULL; | 7097 | Ptr name; |
| 7073 | ByteCount name_len; | 7098 | ByteCount name_len; |
| 7099 | Lisp_Object family; | ||
| 7074 | 7100 | ||
| 7075 | atsu_font_id_hash = | 7101 | atsu_font_id_hash = |
| 7076 | make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE), | 7102 | make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE), |
| 7077 | make_float (DEFAULT_REHASH_SIZE), | 7103 | make_float (DEFAULT_REHASH_SIZE), |
| 7078 | make_float (DEFAULT_REHASH_THRESHOLD), | 7104 | make_float (DEFAULT_REHASH_THRESHOLD), |
| 7079 | Qnil, Qnil, Qnil);; | 7105 | Qnil, Qnil, Qnil);; |
| 7106 | h = XHASH_TABLE (atsu_font_id_hash); | ||
| 7107 | |||
| 7080 | err = ATSUFontCount (&nfonts); | 7108 | err = ATSUFontCount (&nfonts); |
| 7081 | if (err == noErr) | 7109 | if (err == noErr) |
| 7082 | { | 7110 | { |
| @@ -7098,32 +7126,19 @@ init_font_name_table () | |||
| 7098 | kFontNoLanguage, name_len, name, | 7126 | kFontNoLanguage, name_len, name, |
| 7099 | NULL, NULL); | 7127 | NULL, NULL); |
| 7100 | if (err == noErr) | 7128 | if (err == noErr) |
| 7101 | decode_mac_font_name (name, name_len + 1, Qnil); | ||
| 7102 | if (err == noErr | ||
| 7103 | && *name != '.' | ||
| 7104 | && (prev_name == NULL | ||
| 7105 | || strcmp (name, prev_name) != 0)) | ||
| 7106 | { | 7129 | { |
| 7107 | static char *cs = "iso10646-1"; | 7130 | decode_mac_font_name (name, name_len + 1, Qnil); |
| 7108 | 7131 | family = make_unibyte_string (name, name_len); | |
| 7109 | add_font_name_table_entry (mac_to_x_fontname (name, 0, | 7132 | if (*name != '.' |
| 7110 | normal, cs)); | 7133 | && hash_lookup (h, family, &hash_code) < 0) |
| 7111 | add_font_name_table_entry (mac_to_x_fontname (name, 0, | 7134 | { |
| 7112 | italic, cs)); | 7135 | add_mac_font_name (name, 0, normal, "iso10646-1"); |
| 7113 | add_font_name_table_entry (mac_to_x_fontname (name, 0, | 7136 | hash_put (h, family, long_to_cons (font_ids[i]), |
| 7114 | bold, cs)); | 7137 | hash_code); |
| 7115 | add_font_name_table_entry (mac_to_x_fontname (name, 0, | 7138 | } |
| 7116 | italic | bold, cs)); | ||
| 7117 | Fputhash (make_unibyte_string (name, name_len), | ||
| 7118 | long_to_cons (font_ids[i]), atsu_font_id_hash); | ||
| 7119 | xfree (prev_name); | ||
| 7120 | prev_name = name; | ||
| 7121 | } | 7139 | } |
| 7122 | else | 7140 | xfree (name); |
| 7123 | xfree (name); | ||
| 7124 | } | 7141 | } |
| 7125 | if (prev_name) | ||
| 7126 | xfree (prev_name); | ||
| 7127 | if (font_ids) | 7142 | if (font_ids) |
| 7128 | xfree (font_ids); | 7143 | xfree (font_ids); |
| 7129 | } | 7144 | } |
| @@ -7151,16 +7166,16 @@ init_font_name_table () | |||
| 7151 | FMFontSize size; | 7166 | FMFontSize size; |
| 7152 | TextEncoding encoding; | 7167 | TextEncoding encoding; |
| 7153 | TextEncodingBase sc; | 7168 | TextEncodingBase sc; |
| 7154 | Lisp_Object text_encoding_info; | 7169 | Lisp_Object text_encoding_info, family; |
| 7155 | 7170 | ||
| 7156 | if (FMGetFontFamilyName (ff, name) != noErr) | 7171 | if (FMGetFontFamilyName (ff, name) != noErr) |
| 7157 | break; | 7172 | continue; |
| 7158 | p2cstr (name); | 7173 | p2cstr (name); |
| 7159 | if (*name == '.') | 7174 | if (*name == '.') |
| 7160 | continue; | 7175 | continue; |
| 7161 | 7176 | ||
| 7162 | if (FMGetFontFamilyTextEncoding (ff, &encoding) != noErr) | 7177 | if (FMGetFontFamilyTextEncoding (ff, &encoding) != noErr) |
| 7163 | break; | 7178 | continue; |
| 7164 | sc = GetTextEncodingBase (encoding); | 7179 | sc = GetTextEncodingBase (encoding); |
| 7165 | text_encoding_info = assq_no_quit (make_number (sc), | 7180 | text_encoding_info = assq_no_quit (make_number (sc), |
| 7166 | text_encoding_info_alist); | 7181 | text_encoding_info_alist); |
| @@ -7169,13 +7184,15 @@ init_font_name_table () | |||
| 7169 | text_encoding_info_alist); | 7184 | text_encoding_info_alist); |
| 7170 | decode_mac_font_name (name, sizeof (name), | 7185 | decode_mac_font_name (name, sizeof (name), |
| 7171 | XCAR (XCDR (text_encoding_info))); | 7186 | XCAR (XCDR (text_encoding_info))); |
| 7172 | fm_font_family_alist = Fcons (Fcons (build_string (name), | 7187 | family = build_string (name); |
| 7173 | make_number (ff)), | 7188 | if (!NILP (Fassoc (family, fm_font_family_alist))) |
| 7189 | continue; | ||
| 7190 | fm_font_family_alist = Fcons (Fcons (family, make_number (ff)), | ||
| 7174 | fm_font_family_alist); | 7191 | fm_font_family_alist); |
| 7175 | 7192 | ||
| 7176 | /* Point the instance iterator at the current font family. */ | 7193 | /* Point the instance iterator at the current font family. */ |
| 7177 | if (FMResetFontFamilyInstanceIterator (ff, &ffii) != noErr) | 7194 | if (FMResetFontFamilyInstanceIterator (ff, &ffii) != noErr) |
| 7178 | break; | 7195 | continue; |
| 7179 | 7196 | ||
| 7180 | while (FMGetNextFontFamilyInstance (&ffii, &font, &style, &size) | 7197 | while (FMGetNextFontFamilyInstance (&ffii, &font, &style, &size) |
| 7181 | == noErr) | 7198 | == noErr) |
| @@ -7184,27 +7201,7 @@ init_font_name_table () | |||
| 7184 | 7201 | ||
| 7185 | if (size > 0 || style == normal) | 7202 | if (size > 0 || style == normal) |
| 7186 | for (; !NILP (rest); rest = XCDR (rest)) | 7203 | for (; !NILP (rest); rest = XCDR (rest)) |
| 7187 | { | 7204 | add_mac_font_name (name, size, style, SDATA (XCAR (rest))); |
| 7188 | char *cs = SDATA (XCAR (rest)); | ||
| 7189 | |||
| 7190 | if (size == 0) | ||
| 7191 | { | ||
| 7192 | add_font_name_table_entry (mac_to_x_fontname (name, size, | ||
| 7193 | style, cs)); | ||
| 7194 | add_font_name_table_entry (mac_to_x_fontname (name, size, | ||
| 7195 | italic, cs)); | ||
| 7196 | add_font_name_table_entry (mac_to_x_fontname (name, size, | ||
| 7197 | bold, cs)); | ||
| 7198 | add_font_name_table_entry (mac_to_x_fontname (name, size, | ||
| 7199 | italic | bold, | ||
| 7200 | cs)); | ||
| 7201 | } | ||
| 7202 | else | ||
| 7203 | { | ||
| 7204 | add_font_name_table_entry (mac_to_x_fontname (name, size, | ||
| 7205 | style, cs)); | ||
| 7206 | } | ||
| 7207 | } | ||
| 7208 | } | 7205 | } |
| 7209 | } | 7206 | } |
| 7210 | 7207 | ||
| @@ -7224,7 +7221,7 @@ init_font_name_table () | |||
| 7224 | Str255 name; | 7221 | Str255 name; |
| 7225 | struct FontAssoc *fat; | 7222 | struct FontAssoc *fat; |
| 7226 | struct AsscEntry *assc_entry; | 7223 | struct AsscEntry *assc_entry; |
| 7227 | Lisp_Object text_encoding_info_alist, text_encoding_info; | 7224 | Lisp_Object text_encoding_info_alist, text_encoding_info, family; |
| 7228 | struct gcpro gcpro1; | 7225 | struct gcpro gcpro1; |
| 7229 | 7226 | ||
| 7230 | GetPort (&port); /* save the current font number used */ | 7227 | GetPort (&port); /* save the current font number used */ |
| @@ -7243,7 +7240,7 @@ init_font_name_table () | |||
| 7243 | GetResInfo (font_handle, &id, &type, name); | 7240 | GetResInfo (font_handle, &id, &type, name); |
| 7244 | GetFNum (name, &fontnum); | 7241 | GetFNum (name, &fontnum); |
| 7245 | p2cstr (name); | 7242 | p2cstr (name); |
| 7246 | if (fontnum == 0) | 7243 | if (fontnum == 0 || *name == '.') |
| 7247 | continue; | 7244 | continue; |
| 7248 | 7245 | ||
| 7249 | TextFont (fontnum); | 7246 | TextFont (fontnum); |
| @@ -7255,8 +7252,10 @@ init_font_name_table () | |||
| 7255 | text_encoding_info_alist); | 7252 | text_encoding_info_alist); |
| 7256 | decode_mac_font_name (name, sizeof (name), | 7253 | decode_mac_font_name (name, sizeof (name), |
| 7257 | XCAR (XCDR (text_encoding_info))); | 7254 | XCAR (XCDR (text_encoding_info))); |
| 7258 | fm_font_family_alist = Fcons (Fcons (build_string (name), | 7255 | family = build_string (name); |
| 7259 | make_number (fontnum)), | 7256 | if (!NILP (Fassoc (family, fm_font_family_alist))) |
| 7257 | continue; | ||
| 7258 | fm_font_family_alist = Fcons (Fcons (family, make_number (fontnum)), | ||
| 7260 | fm_font_family_alist); | 7259 | fm_font_family_alist); |
| 7261 | do | 7260 | do |
| 7262 | { | 7261 | { |
| @@ -7277,14 +7276,9 @@ init_font_name_table () | |||
| 7277 | Lisp_Object rest = XCDR (XCDR (text_encoding_info)); | 7276 | Lisp_Object rest = XCDR (XCDR (text_encoding_info)); |
| 7278 | 7277 | ||
| 7279 | for (; !NILP (rest); rest = XCDR (rest)) | 7278 | for (; !NILP (rest); rest = XCDR (rest)) |
| 7280 | { | 7279 | add_mac_font_name (name, assc_entry->fontSize, |
| 7281 | char *cs = SDATA (XCAR (rest)); | 7280 | assc_entry->fontStyle, |
| 7282 | 7281 | SDATA (XCAR (rest))); | |
| 7283 | add_font_name_table_entry (mac_to_x_fontname (name, | ||
| 7284 | assc_entry->fontSize, | ||
| 7285 | assc_entry->fontStyle, | ||
| 7286 | cs)); | ||
| 7287 | } | ||
| 7288 | } | 7282 | } |
| 7289 | } | 7283 | } |
| 7290 | 7284 | ||
diff --git a/src/print.c b/src/print.c index 12960ef214d..0a560dbc2d9 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -275,6 +275,7 @@ int print_output_debug_flag = 1; | |||
| 275 | else \ | 275 | else \ |
| 276 | insert_1_both (print_buffer, print_buffer_pos, \ | 276 | insert_1_both (print_buffer, print_buffer_pos, \ |
| 277 | print_buffer_pos_byte, 0, 1, 0); \ | 277 | print_buffer_pos_byte, 0, 1, 0); \ |
| 278 | signal_after_change (PT - print_buffer_pos, 0, print_buffer_pos);\ | ||
| 278 | } \ | 279 | } \ |
| 279 | if (free_print_buffer) \ | 280 | if (free_print_buffer) \ |
| 280 | { \ | 281 | { \ |
diff --git a/src/process.h b/src/process.h index c4b4281fedf..b585515d6b1 100644 --- a/src/process.h +++ b/src/process.h | |||
| @@ -19,6 +19,12 @@ along with GNU Emacs; see the file COPYING. If not, write to | |||
| 19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 20 | Boston, MA 02110-1301, USA. */ | 20 | Boston, MA 02110-1301, USA. */ |
| 21 | 21 | ||
| 22 | #ifdef HAVE_SYS_TYPES_H | ||
| 23 | #include <sys/types.h> | ||
| 24 | #endif | ||
| 25 | #ifdef HAVE_UNISTD_H | ||
| 26 | #include <unistd.h> | ||
| 27 | #endif | ||
| 22 | 28 | ||
| 23 | /* This structure records information about a subprocess | 29 | /* This structure records information about a subprocess |
| 24 | or network connection. | 30 | or network connection. |
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index 55f62644d04..fa4ca565171 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h | |||
| @@ -466,9 +466,9 @@ extern char *get_emacs_configuration_options (void); | |||
| 466 | #include <string.h> | 466 | #include <string.h> |
| 467 | 467 | ||
| 468 | /* We need a little extra space, see ../../lisp/loadup.el. | 468 | /* We need a little extra space, see ../../lisp/loadup.el. |
| 469 | The number below comes from 22038 bytes worth (as of 2006-04) | 469 | The number below comes from 23923 bytes worth (as of 2006-04) |
| 470 | of w32-specific files loaded by loadup.el, plus 2K spare. */ | 470 | of w32-specific files loaded by loadup.el, plus 1K spare. */ |
| 471 | #define SYSTEM_PURESIZE_EXTRA 24000 | 471 | #define SYSTEM_PURESIZE_EXTRA 25000 |
| 472 | 472 | ||
| 473 | /* For unexec to work on Alpha systems, we need to put Emacs' | 473 | /* For unexec to work on Alpha systems, we need to put Emacs' |
| 474 | initialized data into a separate section from the CRT initialized | 474 | initialized data into a separate section from the CRT initialized |
diff --git a/src/textprop.c b/src/textprop.c index 65823d9fa3f..e2f9c531735 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -1602,10 +1602,12 @@ Return t if any property was actually removed, nil otherwise. */) | |||
| 1602 | } | 1602 | } |
| 1603 | } | 1603 | } |
| 1604 | 1604 | ||
| 1605 | if (BUFFERP (object)) | 1605 | /* We are at the beginning of an interval, with len to scan. |
| 1606 | modify_region (XBUFFER (object), XINT (start), XINT (end)); | 1606 | The flag `modified' records if changes have been made. |
| 1607 | 1607 | When object is a buffer, we must call modify_region before changes are | |
| 1608 | /* We are at the beginning of an interval, with len to scan */ | 1608 | made and signal_after_change when we are done. |
| 1609 | We call modify_region before calling remove_properties iff modified == 0, | ||
| 1610 | and we call signal_after_change before returning iff modified != 0. */ | ||
| 1609 | for (;;) | 1611 | for (;;) |
| 1610 | { | 1612 | { |
| 1611 | if (i == 0) | 1613 | if (i == 0) |
| @@ -1614,10 +1616,20 @@ Return t if any property was actually removed, nil otherwise. */) | |||
| 1614 | if (LENGTH (i) >= len) | 1616 | if (LENGTH (i) >= len) |
| 1615 | { | 1617 | { |
| 1616 | if (! interval_has_some_properties_list (properties, i)) | 1618 | if (! interval_has_some_properties_list (properties, i)) |
| 1617 | return modified ? Qt : Qnil; | 1619 | if (modified) |
| 1620 | { | ||
| 1621 | if (BUFFERP (object)) | ||
| 1622 | signal_after_change (XINT (start), XINT (end) - XINT (start), | ||
| 1623 | XINT (end) - XINT (start)); | ||
| 1624 | return Qt; | ||
| 1625 | } | ||
| 1626 | else | ||
| 1627 | return Qnil; | ||
| 1618 | 1628 | ||
| 1619 | if (LENGTH (i) == len) | 1629 | if (LENGTH (i) == len) |
| 1620 | { | 1630 | { |
| 1631 | if (!modified && BUFFERP (object)) | ||
| 1632 | modify_region (XBUFFER (object), XINT (start), XINT (end)); | ||
| 1621 | remove_properties (Qnil, properties, i, object); | 1633 | remove_properties (Qnil, properties, i, object); |
| 1622 | if (BUFFERP (object)) | 1634 | if (BUFFERP (object)) |
| 1623 | signal_after_change (XINT (start), XINT (end) - XINT (start), | 1635 | signal_after_change (XINT (start), XINT (end) - XINT (start), |
| @@ -1629,6 +1641,8 @@ Return t if any property was actually removed, nil otherwise. */) | |||
| 1629 | unchanged = i; | 1641 | unchanged = i; |
| 1630 | i = split_interval_left (i, len); | 1642 | i = split_interval_left (i, len); |
| 1631 | copy_properties (unchanged, i); | 1643 | copy_properties (unchanged, i); |
| 1644 | if (!modified && BUFFERP (object)) | ||
| 1645 | modify_region (XBUFFER (object), XINT (start), XINT (end)); | ||
| 1632 | remove_properties (Qnil, properties, i, object); | 1646 | remove_properties (Qnil, properties, i, object); |
| 1633 | if (BUFFERP (object)) | 1647 | if (BUFFERP (object)) |
| 1634 | signal_after_change (XINT (start), XINT (end) - XINT (start), | 1648 | signal_after_change (XINT (start), XINT (end) - XINT (start), |
| @@ -1636,8 +1650,14 @@ Return t if any property was actually removed, nil otherwise. */) | |||
| 1636 | return Qt; | 1650 | return Qt; |
| 1637 | } | 1651 | } |
| 1638 | 1652 | ||
| 1653 | if (interval_has_some_properties_list (properties, i)) | ||
| 1654 | { | ||
| 1655 | if (!modified && BUFFERP (object)) | ||
| 1656 | modify_region (XBUFFER (object), XINT (start), XINT (end)); | ||
| 1657 | remove_properties (Qnil, properties, i, object); | ||
| 1658 | modified = 1; | ||
| 1659 | } | ||
| 1639 | len -= LENGTH (i); | 1660 | len -= LENGTH (i); |
| 1640 | modified += remove_properties (Qnil, properties, i, object); | ||
| 1641 | i = next_interval (i); | 1661 | i = next_interval (i); |
| 1642 | } | 1662 | } |
| 1643 | } | 1663 | } |
diff --git a/src/w32fns.c b/src/w32fns.c index 093739d1603..609a88debbd 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -3190,6 +3190,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 3190 | } | 3190 | } |
| 3191 | wmsg.dwModifiers = w32_get_modifiers (); | 3191 | wmsg.dwModifiers = w32_get_modifiers (); |
| 3192 | my_post_msg (&wmsg, hwnd, msg, wParam, lParam); | 3192 | my_post_msg (&wmsg, hwnd, msg, wParam, lParam); |
| 3193 | signal_user_input (); | ||
| 3193 | 3194 | ||
| 3194 | /* Clear message buffer. */ | 3195 | /* Clear message buffer. */ |
| 3195 | saved_mouse_button_msg.msg.hwnd = 0; | 3196 | saved_mouse_button_msg.msg.hwnd = 0; |
| @@ -3247,6 +3248,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 3247 | } | 3248 | } |
| 3248 | wmsg.dwModifiers = w32_get_modifiers (); | 3249 | wmsg.dwModifiers = w32_get_modifiers (); |
| 3249 | my_post_msg (&wmsg, hwnd, msg, wParam, lParam); | 3250 | my_post_msg (&wmsg, hwnd, msg, wParam, lParam); |
| 3251 | signal_user_input (); | ||
| 3250 | 3252 | ||
| 3251 | /* Always clear message buffer and cancel timer. */ | 3253 | /* Always clear message buffer and cancel timer. */ |
| 3252 | saved_mouse_button_msg.msg.hwnd = 0; | 3254 | saved_mouse_button_msg.msg.hwnd = 0; |
diff --git a/src/w32term.c b/src/w32term.c index 465dc780322..05fd303f4d1 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -3131,8 +3131,10 @@ construct_mouse_wheel (result, msg, f) | |||
| 3131 | result->modifiers = (msg->dwModifiers | 3131 | result->modifiers = (msg->dwModifiers |
| 3132 | | ((delta < 0 ) ? down_modifier : up_modifier)); | 3132 | | ((delta < 0 ) ? down_modifier : up_modifier)); |
| 3133 | 3133 | ||
| 3134 | p.x = LOWORD (msg->msg.lParam); | 3134 | /* With multiple monitors, we can legitimately get negative |
| 3135 | p.y = HIWORD (msg->msg.lParam); | 3135 | coordinates, so cast to short to interpret them correctly. */ |
| 3136 | p.x = (short) LOWORD (msg->msg.lParam); | ||
| 3137 | p.y = (short) HIWORD (msg->msg.lParam); | ||
| 3136 | ScreenToClient (msg->msg.hwnd, &p); | 3138 | ScreenToClient (msg->msg.hwnd, &p); |
| 3137 | XSETINT (result->x, p.x); | 3139 | XSETINT (result->x, p.x); |
| 3138 | XSETINT (result->y, p.y); | 3140 | XSETINT (result->y, p.y); |
diff --git a/src/window.c b/src/window.c index 61b85e5ad22..966960edd90 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -3439,7 +3439,7 @@ displaying BUFFER, then simply raise that frame. | |||
| 3439 | The variables `special-display-buffer-names', | 3439 | The variables `special-display-buffer-names', |
| 3440 | `special-display-regexps', `same-window-buffer-names', and | 3440 | `special-display-regexps', `same-window-buffer-names', and |
| 3441 | `same-window-regexps' customize how certain buffer names are handled. | 3441 | `same-window-regexps' customize how certain buffer names are handled. |
| 3442 | The latter two take effect only if NOT-THIS-WINDOW is t. | 3442 | The latter two take effect only if NOT-THIS-WINDOW is nil. |
| 3443 | 3443 | ||
| 3444 | If optional argument FRAME is `visible', search all visible frames. | 3444 | If optional argument FRAME is `visible', search all visible frames. |
| 3445 | If FRAME is 0, search all visible and iconified frames. | 3445 | If FRAME is 0, search all visible and iconified frames. |
diff --git a/src/xdisp.c b/src/xdisp.c index 80b9ff6c8f6..25dd0ffce3d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -9563,20 +9563,22 @@ tool_bar_lines_needed (f, n_rows) | |||
| 9563 | { | 9563 | { |
| 9564 | struct window *w = XWINDOW (f->tool_bar_window); | 9564 | struct window *w = XWINDOW (f->tool_bar_window); |
| 9565 | struct it it; | 9565 | struct it it; |
| 9566 | struct glyph_row *temp_row = w->desired_matrix->rows; | ||
| 9566 | 9567 | ||
| 9567 | /* Initialize an iterator for iteration over | 9568 | /* Initialize an iterator for iteration over |
| 9568 | F->desired_tool_bar_string in the tool-bar window of frame F. */ | 9569 | F->desired_tool_bar_string in the tool-bar window of frame F. */ |
| 9569 | init_iterator (&it, w, -1, -1, w->desired_matrix->rows, TOOL_BAR_FACE_ID); | 9570 | init_iterator (&it, w, -1, -1, temp_row, TOOL_BAR_FACE_ID); |
| 9570 | it.first_visible_x = 0; | 9571 | it.first_visible_x = 0; |
| 9571 | it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f); | 9572 | it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f); |
| 9572 | reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); | 9573 | reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); |
| 9573 | 9574 | ||
| 9574 | while (!ITERATOR_AT_END_P (&it)) | 9575 | while (!ITERATOR_AT_END_P (&it)) |
| 9575 | { | 9576 | { |
| 9576 | it.glyph_row = w->desired_matrix->rows; | 9577 | clear_glyph_row (temp_row); |
| 9577 | clear_glyph_row (it.glyph_row); | 9578 | it.glyph_row = temp_row; |
| 9578 | display_tool_bar_line (&it, -1); | 9579 | display_tool_bar_line (&it, -1); |
| 9579 | } | 9580 | } |
| 9581 | clear_glyph_row (temp_row); | ||
| 9580 | 9582 | ||
| 9581 | /* f->n_tool_bar_rows == 0 means "unknown"; -1 means no tool-bar. */ | 9583 | /* f->n_tool_bar_rows == 0 means "unknown"; -1 means no tool-bar. */ |
| 9582 | if (n_rows) | 9584 | if (n_rows) |
| @@ -9656,7 +9658,29 @@ redisplay_tool_bar (f) | |||
| 9656 | reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); | 9658 | reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); |
| 9657 | 9659 | ||
| 9658 | if (f->n_tool_bar_rows == 0) | 9660 | if (f->n_tool_bar_rows == 0) |
| 9659 | (void)tool_bar_lines_needed (f, &f->n_tool_bar_rows); | 9661 | { |
| 9662 | int nlines; | ||
| 9663 | |||
| 9664 | if ((nlines = tool_bar_lines_needed (f, &f->n_tool_bar_rows), | ||
| 9665 | nlines != WINDOW_TOTAL_LINES (w))) | ||
| 9666 | { | ||
| 9667 | extern Lisp_Object Qtool_bar_lines; | ||
| 9668 | Lisp_Object frame; | ||
| 9669 | int old_height = WINDOW_TOTAL_LINES (w); | ||
| 9670 | |||
| 9671 | XSETFRAME (frame, f); | ||
| 9672 | clear_glyph_matrix (w->desired_matrix); | ||
| 9673 | Fmodify_frame_parameters (frame, | ||
| 9674 | Fcons (Fcons (Qtool_bar_lines, | ||
| 9675 | make_number (nlines)), | ||
| 9676 | Qnil)); | ||
| 9677 | if (WINDOW_TOTAL_LINES (w) != old_height) | ||
| 9678 | { | ||
| 9679 | fonts_changed_p = 1; | ||
| 9680 | return 1; | ||
| 9681 | } | ||
| 9682 | } | ||
| 9683 | } | ||
| 9660 | 9684 | ||
| 9661 | /* Display as many lines as needed to display all tool-bar items. */ | 9685 | /* Display as many lines as needed to display all tool-bar items. */ |
| 9662 | 9686 | ||
| @@ -12697,8 +12721,6 @@ redisplay_window (window, just_this_one_p) | |||
| 12697 | /* IT may overshoot PT if text at PT is invisible. */ | 12721 | /* IT may overshoot PT if text at PT is invisible. */ |
| 12698 | else if (IT_CHARPOS (it) > PT && CHARPOS (startp) <= PT) | 12722 | else if (IT_CHARPOS (it) > PT && CHARPOS (startp) <= PT) |
| 12699 | w->force_start = Qt; | 12723 | w->force_start = Qt; |
| 12700 | |||
| 12701 | |||
| 12702 | } | 12724 | } |
| 12703 | 12725 | ||
| 12704 | /* Handle case where place to start displaying has been specified, | 12726 | /* Handle case where place to start displaying has been specified, |
| @@ -12868,6 +12890,36 @@ redisplay_window (window, just_this_one_p) | |||
| 12868 | || (XFASTINT (w->last_modified) >= MODIFF | 12890 | || (XFASTINT (w->last_modified) >= MODIFF |
| 12869 | && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF))) | 12891 | && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF))) |
| 12870 | { | 12892 | { |
| 12893 | |||
| 12894 | /* If first window line is a continuation line, and window start | ||
| 12895 | is inside the modified region, but the first change is before | ||
| 12896 | current window start, we must select a new window start.*/ | ||
| 12897 | if (NILP (w->start_at_line_beg) | ||
| 12898 | && CHARPOS (startp) > BEGV) | ||
| 12899 | { | ||
| 12900 | /* Make sure beg_unchanged and end_unchanged are up to date. | ||
| 12901 | Do it only if buffer has really changed. This may or may | ||
| 12902 | not have been done by try_window_id (see which) already. */ | ||
| 12903 | if (MODIFF > SAVE_MODIFF | ||
| 12904 | /* This seems to happen sometimes after saving a buffer. */ | ||
| 12905 | || BEG_UNCHANGED + END_UNCHANGED > Z_BYTE) | ||
| 12906 | { | ||
| 12907 | if (GPT - BEG < BEG_UNCHANGED) | ||
| 12908 | BEG_UNCHANGED = GPT - BEG; | ||
| 12909 | if (Z - GPT < END_UNCHANGED) | ||
| 12910 | END_UNCHANGED = Z - GPT; | ||
| 12911 | } | ||
| 12912 | |||
| 12913 | if (CHARPOS (startp) > BEG + BEG_UNCHANGED | ||
| 12914 | && CHARPOS (startp) <= Z - END_UNCHANGED) | ||
| 12915 | { | ||
| 12916 | /* There doesn't seems to be a simple way to find a new | ||
| 12917 | window start that is near the old window start, so | ||
| 12918 | we just recenter. */ | ||
| 12919 | goto recenter; | ||
| 12920 | } | ||
| 12921 | } | ||
| 12922 | |||
| 12871 | #if GLYPH_DEBUG | 12923 | #if GLYPH_DEBUG |
| 12872 | debug_method_add (w, "same window start"); | 12924 | debug_method_add (w, "same window start"); |
| 12873 | #endif | 12925 | #endif |
| @@ -18694,6 +18746,7 @@ fill_stretch_glyph_string (s, row, area, start, end) | |||
| 18694 | s->font = s->face->font; | 18746 | s->font = s->face->font; |
| 18695 | s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id); | 18747 | s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id); |
| 18696 | s->width = glyph->pixel_width; | 18748 | s->width = glyph->pixel_width; |
| 18749 | s->nchars = 1; | ||
| 18697 | voffset = glyph->voffset; | 18750 | voffset = glyph->voffset; |
| 18698 | 18751 | ||
| 18699 | for (++glyph; | 18752 | for (++glyph; |
| @@ -19839,20 +19892,6 @@ produce_stretch_glyph (it) | |||
| 19839 | it->descent = it->phys_descent = height - it->ascent; | 19892 | it->descent = it->phys_descent = height - it->ascent; |
| 19840 | it->nglyphs = width > 0 && height > 0 ? 1 : 0; | 19893 | it->nglyphs = width > 0 && height > 0 ? 1 : 0; |
| 19841 | 19894 | ||
| 19842 | if (width > 0 && height > 0 && face->box != FACE_NO_BOX) | ||
| 19843 | { | ||
| 19844 | if (face->box_line_width > 0) | ||
| 19845 | { | ||
| 19846 | it->ascent += face->box_line_width; | ||
| 19847 | it->descent += face->box_line_width; | ||
| 19848 | } | ||
| 19849 | |||
| 19850 | if (it->start_of_box_run_p) | ||
| 19851 | it->pixel_width += abs (face->box_line_width); | ||
| 19852 | if (it->end_of_box_run_p) | ||
| 19853 | it->pixel_width += abs (face->box_line_width); | ||
| 19854 | } | ||
| 19855 | |||
| 19856 | take_vertical_position_into_account (it); | 19895 | take_vertical_position_into_account (it); |
| 19857 | } | 19896 | } |
| 19858 | 19897 | ||
| @@ -22373,7 +22412,7 @@ note_mouse_highlight (f, x, y) | |||
| 22373 | if (part == ON_VERTICAL_BORDER) | 22412 | if (part == ON_VERTICAL_BORDER) |
| 22374 | { | 22413 | { |
| 22375 | cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor; | 22414 | cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor; |
| 22376 | help_echo_string = make_string ("drag-mouse-1: resize", 20); | 22415 | help_echo_string = build_string ("drag-mouse-1: resize"); |
| 22377 | } | 22416 | } |
| 22378 | else if (part == ON_LEFT_FRINGE || part == ON_RIGHT_FRINGE | 22417 | else if (part == ON_LEFT_FRINGE || part == ON_RIGHT_FRINGE |
| 22379 | || part == ON_SCROLL_BAR) | 22418 | || part == ON_SCROLL_BAR) |