summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2006-05-02 05:51:52 +0000
committerMiles Bader <miles@gnu.org>2006-05-02 05:51:52 +0000
commitfe682fb2f05fcbd9fcd2d12c2110719adcfcb58a (patch)
tree2a89d2d9ea2689cfe80a7618885cdd9f449761dd /src
parent7e635d0ed3c42e6e779821f5c0c1c62289f4c1ee (diff)
parent6cf93749317c2e18f850cd0f47f905895e850bfc (diff)
downloademacs-fe682fb2f05fcbd9fcd2d12c2110719adcfcb58a.tar.gz
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-58
Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 239-258) - Update from CVS - (Ffield_beginning, find_field): Undo change of 2006-04-23. - Rcirc patch from Ryan Yeske - Merge from gnus--rel--5.10 - Clean up lisp/gnus/ChangeLog a bit * gnus--rel--5.10 (patch 91-98) - Merge from emacs--devo--0 - Update from CVS
Diffstat (limited to 'src')
-rw-r--r--src/.gdbinit11
-rw-r--r--src/ChangeLog187
-rw-r--r--src/dispextern.h9
-rw-r--r--src/dispnew.c2
-rw-r--r--src/editfns.c2
-rw-r--r--src/frame.c8
-rw-r--r--src/image.c136
-rw-r--r--src/keymap.c9
-rw-r--r--src/mac.c50
-rw-r--r--src/macfns.c104
-rw-r--r--src/macgui.h38
-rw-r--r--src/macmenu.c58
-rw-r--r--src/macterm.c241
-rw-r--r--src/macterm.h8
-rw-r--r--src/process.h6
-rw-r--r--src/puresize.h2
-rw-r--r--src/s/ms-w32.h6
-rw-r--r--src/syntax.c7
-rw-r--r--src/unexmacosx.c3
-rw-r--r--src/w32fns.c2
-rw-r--r--src/w32term.c6
-rw-r--r--src/window.c2
-rw-r--r--src/xdisp.c61
-rw-r--r--src/xmenu.c1
24 files changed, 757 insertions, 202 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index af2114ebd18..881a11dc8c0 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -88,15 +88,13 @@ end
# Print out s-expressions from tool bar
define pp1
set $tmp = $arg0
- echo $arg0
- printf " = "
set $output_debug = print_output_debug_flag
set print_output_debug_flag = 0
set safe_debug_print ($tmp)
set print_output_debug_flag = $output_debug
end
document pp1
-Print the argument as an emacs s-expression
+Print the argument as an emacs s-expression.
Works only when an inferior emacs is executing.
For use on tool bar when debugging in Emacs
where the variable name would not otherwise
@@ -119,8 +117,6 @@ end
# Print value of lisp variable
define pv1
set $tmp = "$arg0"
- echo $arg0
- printf " = "
set $output_debug = print_output_debug_flag
set print_output_debug_flag = 0
set safe_debug_print (find_symbol_value (intern ($tmp)))
@@ -129,9 +125,8 @@ end
document pv1
Print the value of the lisp variable given as argument.
Works only when an inferior emacs is executing.
-For use on tool bar when debugging in Emacs
-where the variable name would not otherwise
-be recorded in the GUD buffer.
+For use when debugging in Emacs where the variable
+name would not otherwise be recorded in the GUD buffer.
end
# Print out current buffer point and boundaries
diff --git a/src/ChangeLog b/src/ChangeLog
index 5c66a6b5c7d..f68510f2fb4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,11 +1,172 @@
+2006-05-02 Andreas Schwab <schwab@suse.de>
+
+ * xmenu.c (restore_menu_items): Return a value.
+
+2006-05-01 Martin Rudalics <rudalics@gmx.at>
+
+ * syntax.c (Fforward_comment): Detect generic comment at beginning of
+ buffer when moving backwards.
+
+2006-05-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * dispnew.c (update_window): Don't set changed_p when mode/header
+ line is updated.
+
+ * xdisp.c (prepare_menu_bars) [MAC_OS]: Call mac_update_title_bar.
+ (get_glyph_face_and_encoding, get_char_face_and_encoding):
+ Don't distinguish known faces from others.
+
+ * mac.c (mac_coerce_file_name_ptr): Try typeFSRef if coercion
+ through typeFileURL failed.
+
+ * macfns.c (mac_update_title_bar): New function.
+ [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): New function.
+ (show_hourglass, hide_hourglass) [USE_CG_DRAWING]:
+ Call mac_prepare_for_quickdraw.
+
+ * macgui.h (USE_ATSUI): Set default to 1 if MAC_OSX is defined.
+ (USE_CG_DRAWING): Don't define if compiled on Mac OS X 10.1.
+ (enum pcm_status): New enum.
+ (XCHARSTRUCTROW_CHAR_VALID_P, XCHARSTRUCTROW_SET_CHAR_VALID)
+ (XCharStructRow): Remove. Now validity is represented by
+ non-negativeness of sum of ascent and descent.
+ (struct MacFontStruct): Change type of member `rows'.
+ (struct _XGC) [USE_CG_DRAWING]: Add member `clip_rects'.
+
+ * macterm.c (mac_draw_line, mac_draw_line_to_pixmap):
+ Adjust endpoints of strictly horizontal/vertical lines.
+ (mac_set_clip_rectangles) [USE_CG_DRAWING]: Set clip_rects.
+ (pcm_init, pcm_get_status): New functions.
+ (x_per_char_metric, XLoadQueryFont): Use them instead of
+ XCharStructRow and related macros.
+ (x_draw_relief_rect): Don't adjust arguments of mac_draw_line.
+ (x_free_frame_resources) [TARGET_API_MAC_CARBON]: Free FRAME_FILE_NAME.
+ (XTread_socket) [TARGET_API_MAC_CARBON]: Handle proxy icon drag
+ and window path pop-up menu on title bar.
+ (mac_use_core_graphics) [USE_CG_DRAWING]: Set default to 1.
+
+ * macterm.h (mac_update_title_bar): Add extern.
+ (struct mac_output) [TARGET_API_MAC_CARBON]: New member `file_name'.
+ (FRAME_FILE_NAME): New macro.
+
+ * unexmacosx.c (unexec): Error if trying unexec from dumped executable.
+
+2006-04-30 Richard Stallman <rms@gnu.org>
+
+ * keymap.c (Fdefine_key): Improve error message
+ when KEY begins with a non-prefix key.
+
+2006-04-30 Martin Rudalics <rudalics@gmx.at>
+
+ * syntax.c (Fforward_comment): Don't forget to break out of the loop
+ when we skipped backward over a generic comment.
+
+2006-04-27 Nick Roberts <nickrob@snap.net.nz>
+
+ * .gdbinit (pp1, pv1): Only print value as expression is now
+ printed out by gud-print.
+ (pv1): Correct doc string.
+
+2006-04-26 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * keymap.c (store_in_keymap): Change `def' arg to not be `register'.
+ Seems to trigger a bug in gcc-amd64 4.0.2 20051125 (Red Hat 4.0.2-8):
+ keymap.c:895: error: address of register variable `def' requested.
+
+2006-04-26 Jason Rumney <jasonr@gnu.org>
+
+ * w32term.c (construct_mouse_wheel): Handle negative coordinates.
+
+ * w32fns.c (w32_wnd_proc) <WM_LBUTTONDOWN, WM_RBUTTONDOWN>:
+ <WM_LBUTTONUP, WM_RBUTTONUP>: Call signal_user_input in the cases
+ where we preempt mouse_button_timer.
+
+2006-04-25 Miles Bader <miles@gnu.org>
+
+ * editfns.c (Ffield_beginning, find_field): Undo change of 2006-04-23.
+
+2006-04-24 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * process.h: Include headers for pid_t.
+
+2006-04-24 Kim F. Storm <storm@cua.dk>
+
+ * xdisp.c (fill_stretch_glyph_string): Set s->nchars = 1 for code which
+ does last_glyph=s->first_glyph+s->nchars-1, e.g. if stretch has relief.
+ (produce_stretch_glyph): Assume that face box height and width is
+ already included in stretch glyph size so caller doesn't have to
+ consider the extra space otherwise added (fixes problem in ses.el).
+
+ * frame.c (x_set_font): Clear f->n_tool_bar_rows and current frame
+ matrices to force recalculation of tool-bar height after font change.
+
+ * xdisp.c (tool_bar_lines_needed): New local `temp_row' for clarity.
+ Clear it when done, so we don't accidentally draw a second copy of
+ the tool-bar after resetting f->n_tool_bar_rows.
+ (redisplay_tool_bar): Update tool-bar-lines frame parameter whenever
+ we recalculate f->n_tool_bar_rows.
+
+2006-04-23 Lars Hansen <larsh@soem.dk>
+
+ * editfns.c (find_field): Fix comment.
+ (Ffield_beginning): Fix bug when POS is at field beginning.
+
+2006-04-22 Eli Zaretskii <eliz@gnu.org>
+
+ * puresize.h (BASE_PURESIZE): Increase to 1205000.
+
+2006-04-21 Kim F. Storm <storm@cua.dk>
+
+ * xdisp.c (redisplay_window): Fix last change. Don't recenter if
+ window start is at BEGV.
+
+ * dispextern.h (struct image): New member `corners'.
+ (TOP_CORNER, LEFT_CORNER, BOT_CORNER, RIGHT_CORNER): New macros.
+
+ * image.c (four_corners_best): New arg CORNERS specifies what pixels
+ to look at in case image has margin.
+ (x_create_bitmap_mask): Pass NULL for CORNERS to four_corners_best.
+ (image_background, image_background_transparent)
+ (x_build_heuristic_mask): Pass img->corners to four_corners_best.
+ (gif_load): Set img->corners according to image's margin spec.
+ Use img->corners values directly where applicable.
+ Save image extension data in img->data.lisp_val.
+ (gif_clear_image): New function to free img->data.lisp_val.
+ (gif_type): Use it instead of generic x_clear_image.
+ (Fimage_extension_data): New defun.
+ (syms_of_image): Defsubr it.
+
+2006-04-21 John Sullivan <john@wjsullivan.net> (tiny change)
+
+ * window.c (Fdisplay_buffer): Doc fix.
+
+2006-04-21 Eli Zaretskii <eliz@gnu.org>
+
+ * s/ms-w32.h (SYSTEM_PURESIZE_EXTRA): Increase to 25000.
+
+2006-04-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * image.c [MAC_OS] (xpm_load_image): Fill in background field
+ while we have ximg handy.
+
+ * macmenu.c (restore_menu_items, save_menu_items): New functions
+ from xmenu.c.
+ (set_frame_menubar, digest_single_submenu): Apply 2006-04-18
+ changes for xmenu.c.
+
+ * macterm.c (x_per_char_metric): Return NULL if glyph width is 0.
+ (add_mac_font_name): New function.
+ (init_font_name_table): Use it. Adopt the first found font from
+ those having the same family name.
+
2006-04-21 Nick Roberts <nickrob@snap.net.nz>
* xdisp.c (note_mouse_highlight): Use build_string.
2006-04-20 Lars Hansen <larsh@soem.dk>
- * textprop.c (Fremove_list_of_text_properties): Ensure
- modify_region is called only when buffer is modified and that
+ * textprop.c (Fremove_list_of_text_properties):
+ Ensure modify_region is called only when buffer is modified and that
signal_after_change is allways called in that case.
* print.c (PRINTFINISH): Call signal_after_change.
@@ -23,8 +184,8 @@
* xmenu.c (restore_menu_items, save_menu_items): New fns.
(set_frame_menubar): Use save_menu_items. Save updated vector in
- the frame before unwinding it. Don't use unuse_menu_items. Don't
- use discard_menu_items.
+ the frame before unwinding it. Don't use unuse_menu_items.
+ Don't use discard_menu_items.
(digest_single_submenu): Abort if an item is not in a pane.
(init_menu_items): Put the error check at the top.
@@ -51,8 +212,8 @@
* macterm.c (XCreateGC, x_per_char_metric, xlfdpat_create)
(init_font_name_table, init_font_name_table, mac_do_list_fonts)
- (XLoadQueryFont, mac_store_apple_event): Don't check
- return value of xmalloc.
+ (XLoadQueryFont, mac_store_apple_event): Don't check return value
+ of xmalloc.
2006-04-17 Kim F. Storm <storm@cua.dk>
@@ -96,8 +257,7 @@
2006-04-13 Kenichi Handa <handa@m17n.org>
* coding.c (setup_coding_system): Fix previous change.
- (encode_coding): If eol_type is not yet decided, use
- system_eol_type.
+ (encode_coding): If eol_type is not yet decided, use system_eol_type.
(shrink_encoding_region): If eol_type is not yet decided and
system_eol_type is not LF, don't shrink.
@@ -197,8 +357,8 @@
within ||. Add explicit braces to avoid ambiguous `else'.
(dump_glyph_row): Remove label for `inverse_p' from legend.
- * xfaces.c (Finternal_merge_in_global_face, try_font_list): Add
- explicit braces to avoid ambiguous `else'.
+ * xfaces.c (Finternal_merge_in_global_face, try_font_list):
+ Add explicit braces to avoid ambiguous `else'.
2006-04-11 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org> (tiny change)
@@ -907,11 +1067,6 @@
(mac_set_clip_rectangles): When resetting clip region, make it
empty instead of disposing of it.
-2006-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
-
- * keymap.c (store_in_keymap): Change `def' arg to not be `register'.
- Seems to trigger a bug in gcc-amd64 4.0.2 20051125 (Red Hat 4.0.2-8).
-
2006-02-20 Kim F. Storm <storm@cua.dk>
* Makefile.in: Add fringe.elc to WINDOW_SUPPORT.
@@ -1586,7 +1741,7 @@
* image.c [MAC_OS] (find_image_fsspec): Likewise.
-2005-12-23 Martin Rudalics <rudalics@gmx.at> (tiny change)
+2005-12-23 Martin Rudalics <rudalics@gmx.at>
* insdel.c (insert, insert_and_inherit, insert_before_markers)
(insert_before_markers_and_inherit): Make sure FROM is correct
diff --git a/src/dispextern.h b/src/dispextern.h
index f6b0fbbbf15..b1e71315086 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2417,6 +2417,15 @@ struct image
#define DEFAULT_IMAGE_WIDTH 30
#define DEFAULT_IMAGE_HEIGHT 30
+ /* Top/left and bottom/right corner pixel of actual image data.
+ Used by four_corners_best to consider the real image data,
+ rather than looking at the optional image margin. */
+ int corners[4];
+#define TOP_CORNER 0
+#define LEFT_CORNER 1
+#define BOT_CORNER 2
+#define RIGHT_CORNER 3
+
/* Percent of image height used as ascent. A value of
CENTERED_IMAGE_ASCENT means draw the image centered on the
line. */
diff --git a/src/dispnew.c b/src/dispnew.c
index 2884a687e5f..e8833376701 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -4142,7 +4142,6 @@ update_window (w, force_p)
update_window_line (w, MATRIX_ROW_VPOS (mode_line_row,
desired_matrix),
&mouse_face_overwritten_p);
- changed_p = 1;
}
/* Find first enabled row. Optimizations in redisplay_internal
@@ -4212,7 +4211,6 @@ update_window (w, force_p)
{
header_line_row->y = 0;
update_window_line (w, 0, &mouse_face_overwritten_p);
- changed_p = 1;
}
/* Fix the appearance of overlapping/overlapped rows. */
diff --git a/src/editfns.c b/src/editfns.c
index b0e79057988..4f8b349b749 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -489,7 +489,7 @@ get_pos_property (position, prop, object)
}
/* Find the field surrounding POS in *BEG and *END. If POS is nil,
- the value of point is used instead. If BEG or END null,
+ the value of point is used instead. If BEG or END is null,
means don't store the beginning or end of the field.
BEG_LIMIT and END_LIMIT serve to limit the ranged of the returned
diff --git a/src/frame.c b/src/frame.c
index 914bc5abf65..3efd04bf110 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1,5 +1,5 @@
/* Generic frame functions.
- Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003,
+ Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2006,
2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -3093,9 +3093,15 @@ x_set_font (f, arg, oldval)
return;
}
store_frame_param (f, Qfont, result);
+
if (!NILP (Fequal (result, oldval)))
return;
+ /* Recalculate toolbar height. */
+ f->n_tool_bar_rows = 0;
+ /* Ensure we redraw it. */
+ clear_current_matrices (f);
+
recompute_basic_faces (f);
}
else
diff --git a/src/image.c b/src/image.c
index 10c402be119..688ff200055 100644
--- a/src/image.c
+++ b/src/image.c
@@ -603,7 +603,9 @@ x_destroy_all_bitmaps (dpyinfo)
/* Useful functions defined in the section
`Image type independent image structures' below. */
-static unsigned long four_corners_best P_ ((XImagePtr ximg, unsigned long width,
+static unsigned long four_corners_best P_ ((XImagePtr ximg,
+ int *corners,
+ unsigned long width,
unsigned long height));
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)
return -1;
}
- bg = four_corners_best (ximg, width, height);
+ bg = four_corners_best (ximg, NULL, width, height);
for (y = 0; y < ximg->height; ++y)
{
@@ -732,7 +734,7 @@ Lisp_Object Qxbm;
/* Keywords. */
extern Lisp_Object QCwidth, QCheight, QCforeground, QCbackground, QCfile;
-extern Lisp_Object QCdata, QCtype;
+extern Lisp_Object QCdata, QCtype, Qcount;
extern Lisp_Object Qcenter;
Lisp_Object QCascent, QCmargin, QCrelief;
Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask;
@@ -1141,6 +1143,27 @@ or omitted means use the selected frame. */)
return mask;
}
+DEFUN ("image-extension-data", Fimage_extension_data, Simage_extension_data, 1, 2, 0,
+ doc: /* Return extension data for image SPEC.
+FRAME is the frame on which the image will be displayed. FRAME nil
+or omitted means use the selected frame. */)
+ (spec, frame)
+ Lisp_Object spec, frame;
+{
+ Lisp_Object ext;
+
+ ext = Qnil;
+ if (valid_image_p (spec))
+ {
+ struct frame *f = check_x_frame (frame);
+ int id = lookup_image (f, spec);
+ struct image *img = IMAGE_FROM_ID (f, id);
+ ext = img->data.lisp_val;
+ }
+
+ return ext;
+}
+
/***********************************************************************
Image type independent image structures
@@ -1171,6 +1194,7 @@ make_image (spec, hash)
img->data.lisp_val = Qnil;
img->ascent = DEFAULT_IMAGE_ASCENT;
img->hash = hash;
+ img->corners[BOT_CORNER] = -1; /* Full image */
return img;
}
@@ -1322,30 +1346,41 @@ image_ascent (img, face, slice)
On W32, XIMG is assumed to a device context with the bitmap selected. */
static RGB_PIXEL_COLOR
-four_corners_best (ximg, width, height)
+four_corners_best (ximg, corners, width, height)
XImagePtr_or_DC ximg;
+ int *corners;
unsigned long width, height;
{
- RGB_PIXEL_COLOR corners[4], best;
+ RGB_PIXEL_COLOR corner_pixels[4], best;
int i, best_count;
- /* Get the colors at the corners of ximg. */
- corners[0] = GET_PIXEL (ximg, 0, 0);
- corners[1] = GET_PIXEL (ximg, width - 1, 0);
- corners[2] = GET_PIXEL (ximg, width - 1, height - 1);
- corners[3] = GET_PIXEL (ximg, 0, height - 1);
-
+ if (corners && corners[BOT_CORNER] >= 0)
+ {
+ /* Get the colors at the corner_pixels of ximg. */
+ corner_pixels[0] = GET_PIXEL (ximg, corners[LEFT_CORNER], corners[TOP_CORNER]);
+ corner_pixels[1] = GET_PIXEL (ximg, corners[RIGHT_CORNER] - 1, corners[TOP_CORNER]);
+ corner_pixels[2] = GET_PIXEL (ximg, corners[RIGHT_CORNER] - 1, corners[BOT_CORNER] - 1);
+ corner_pixels[3] = GET_PIXEL (ximg, corners[LEFT_CORNER], corners[BOT_CORNER] - 1);
+ }
+ else
+ {
+ /* Get the colors at the corner_pixels of ximg. */
+ corner_pixels[0] = GET_PIXEL (ximg, 0, 0);
+ corner_pixels[1] = GET_PIXEL (ximg, width - 1, 0);
+ corner_pixels[2] = GET_PIXEL (ximg, width - 1, height - 1);
+ corner_pixels[3] = GET_PIXEL (ximg, 0, height - 1);
+ }
/* Choose the most frequently found color as background. */
for (i = best_count = 0; i < 4; ++i)
{
int j, n;
for (j = n = 0; j < 4; ++j)
- if (corners[i] == corners[j])
+ if (corner_pixels[i] == corner_pixels[j])
++n;
if (n > best_count)
- best = corners[i], best_count = n;
+ best = corner_pixels[i], best_count = n;
}
return best;
@@ -1404,7 +1439,7 @@ image_background (img, f, ximg)
#endif /* !HAVE_NTGUI */
}
- img->background = four_corners_best (ximg, img->width, img->height);
+ img->background = four_corners_best (ximg, img->corners, img->width, img->height);
if (free_ximg)
Destroy_Image (ximg, prev);
@@ -1449,7 +1484,7 @@ image_background_transparent (img, f, mask)
}
img->background_transparent
- = (four_corners_best (mask, img->width, img->height) == PIX_MASK_RETAIN);
+ = (four_corners_best (mask, img->corners, img->width, img->height) == PIX_MASK_RETAIN);
if (free_mask)
Destroy_Image (mask, prev);
@@ -4460,6 +4495,10 @@ xpm_load_image (f, img, contents, end)
img->width = width;
img->height = height;
+ /* Maybe fill in the background field while we have ximg handy. */
+ if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
+ IMAGE_BACKGROUND (img, f, ximg);
+
x_put_x_image (f, ximg, img->pixmap, width, height);
x_destroy_x_image (ximg);
if (have_mask)
@@ -5354,7 +5393,7 @@ x_build_heuristic_mask (f, img, how)
}
if (use_img_background)
- bg = four_corners_best (ximg, img->width, img->height);
+ bg = four_corners_best (ximg, img->corners, img->width, img->height);
/* Set all bits in mask_img to 1 whose color in ximg is different
from the background color bg. */
@@ -7447,6 +7486,7 @@ tiff_load (f, img)
static int gif_image_p P_ ((Lisp_Object object));
static int gif_load P_ ((struct frame *f, struct image *img));
+static void gif_clear_image P_ ((struct frame *f, struct image *img));
/* The symbol `gif' identifying images of this type. */
@@ -7495,10 +7535,22 @@ static struct image_type gif_type =
&Qgif,
gif_image_p,
gif_load,
- x_clear_image,
+ gif_clear_image,
NULL
};
+/* Free X resources of GIF image IMG which is used on frame F. */
+
+static void
+gif_clear_image (f, img)
+ struct frame *f;
+ struct image *img;
+{
+ /* IMG->data.ptr_val may contain extension data. */
+ img->data.lisp_val = Qnil;
+ x_clear_image (f, img);
+}
+
/* Return non-zero if OBJECT is a valid GIF image specification. */
static int
@@ -7619,7 +7671,7 @@ gif_load (f, img)
GifFileType *gif;
struct gcpro gcpro1;
Lisp_Object image;
- int ino, image_left, image_top, image_width, image_height;
+ int ino, image_height, image_width;
gif_memory_source memsrc;
unsigned char *raster;
@@ -7696,17 +7748,19 @@ gif_load (f, img)
return 0;
}
- image_top = gif->SavedImages[ino].ImageDesc.Top;
- image_left = gif->SavedImages[ino].ImageDesc.Left;
- image_width = gif->SavedImages[ino].ImageDesc.Width;
+ img->corners[TOP_CORNER] = gif->SavedImages[ino].ImageDesc.Top;
+ img->corners[LEFT_CORNER] = gif->SavedImages[ino].ImageDesc.Left;
image_height = gif->SavedImages[ino].ImageDesc.Height;
+ img->corners[BOT_CORNER] = img->corners[TOP_CORNER] + image_height;
+ image_width = gif->SavedImages[ino].ImageDesc.Width;
+ img->corners[RIGHT_CORNER] = img->corners[LEFT_CORNER] + image_width;
width = img->width = max (gif->SWidth,
max (gif->Image.Left + gif->Image.Width,
- image_left + image_width));
+ img->corners[RIGHT_CORNER]));
height = img->height = max (gif->SHeight,
max (gif->Image.Top + gif->Image.Height,
- image_top + image_height));
+ img->corners[BOT_CORNER]));
if (!check_image_size (f, width, height))
{
@@ -7749,19 +7803,19 @@ gif_load (f, img)
requires more than can be done here (see the gif89 spec,
disposal methods). Let's simply assume that the part
not covered by a sub-image is in the frame's background color. */
- for (y = 0; y < image_top; ++y)
+ for (y = 0; y < img->corners[TOP_CORNER]; ++y)
for (x = 0; x < width; ++x)
XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f));
- for (y = image_top + image_height; y < height; ++y)
+ for (y = img->corners[BOT_CORNER]; y < height; ++y)
for (x = 0; x < width; ++x)
XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f));
- for (y = image_top; y < image_top + image_height; ++y)
+ for (y = img->corners[TOP_CORNER]; y < img->corners[BOT_CORNER]; ++y)
{
- for (x = 0; x < image_left; ++x)
+ for (x = 0; x < img->corners[LEFT_CORNER]; ++x)
XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f));
- for (x = image_left + image_width; x < width; ++x)
+ for (x = img->corners[RIGHT_CORNER]; x < width; ++x)
XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f));
}
@@ -7791,8 +7845,8 @@ gif_load (f, img)
for (x = 0; x < image_width; x++)
{
int i = raster[(y * image_width) + x];
- XPutPixel (ximg, x + image_left, row + image_top,
- pixel_colors[i]);
+ XPutPixel (ximg, x + img->corners[LEFT_CORNER],
+ row + img->corners[TOP_CORNER], pixel_colors[i]);
}
row += interlace_increment[pass];
@@ -7804,10 +7858,29 @@ gif_load (f, img)
for (x = 0; x < image_width; ++x)
{
int i = raster[y * image_width + x];
- XPutPixel (ximg, x + image_left, y + image_top, pixel_colors[i]);
+ XPutPixel (ximg, x + img->corners[LEFT_CORNER],
+ y + img->corners[TOP_CORNER], pixel_colors[i]);
}
}
+ /* Save GIF image extension data for `image-extension-data'.
+ Format is (count IMAGES FUNCTION "BYTES" ...). */
+ img->data.lisp_val = Qnil;
+ if (gif->SavedImages[ino].ExtensionBlockCount > 0)
+ {
+ ExtensionBlock *ext = gif->SavedImages[ino].ExtensionBlocks;
+ for (i = 0; i < gif->SavedImages[ino].ExtensionBlockCount; i++, ext++)
+ /* Append (... FUNCTION "BYTES") */
+ img->data.lisp_val = Fcons (make_unibyte_string (ext->Bytes, ext->ByteCount),
+ Fcons (make_number (ext->Function),
+ img->data.lisp_val));
+ img->data.lisp_val = Fnreverse (img->data.lisp_val);
+ }
+ if (gif->ImageCount > 1)
+ img->data.lisp_val = Fcons (Qcount,
+ Fcons (make_number (gif->ImageCount),
+ img->data.lisp_val));
+
fn_DGifCloseFile (gif);
/* Maybe fill in the background field while we have ximg handy. */
@@ -8553,6 +8626,7 @@ non-numeric, there is no explicit limit on the size of images. */);
defsubr (&Sclear_image_cache);
defsubr (&Simage_size);
defsubr (&Simage_mask_p);
+ defsubr (&Simage_extension_data);
#if GLYPH_DEBUG
defsubr (&Simagep);
diff --git a/src/keymap.c b/src/keymap.c
index 6930ed08d8c..f5aea3b3902 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -841,7 +841,7 @@ static Lisp_Object
store_in_keymap (keymap, idx, def)
Lisp_Object keymap;
register Lisp_Object idx;
- register Lisp_Object def;
+ Lisp_Object def;
{
/* Flush any reverse-map cache. */
where_is_cache = Qnil;
@@ -1226,8 +1226,11 @@ binding KEY to DEF is added at the front of KEYMAP. */)
if (!CONSP (keymap))
/* We must use Fkey_description rather than just passing key to
error; key might be a vector, not a string. */
- error ("Key sequence %s uses invalid prefix characters",
- SDATA (Fkey_description (key, Qnil)));
+ error ("Key sequence %s starts with non-prefix key %s",
+ SDATA (Fkey_description (key, Qnil)),
+ SDATA (Fkey_description (Fsubstring (key, make_number (0),
+ make_number (idx)),
+ Qnil)));
}
}
diff --git a/src/mac.c b/src/mac.c
index 7172301b6b0..444320322c3 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -448,6 +448,22 @@ mac_coerce_file_name_ptr (type_code, data_ptr, data_size,
}
else
err = memFullErr;
+
+ if (err != noErr)
+ {
+ /* Just to be paranoid ... */
+ FSRef fref;
+ char *buf;
+
+ buf = xmalloc (data_size + 1);
+ memcpy (buf, data_ptr, data_size);
+ buf[data_size] = '\0';
+ err = FSPathMakeRef (buf, &fref, NULL);
+ xfree (buf);
+ if (err == noErr)
+ err = AECoercePtr (typeFSRef, &fref, sizeof (FSRef),
+ to_type, result);
+ }
#else
FSSpec fs;
char *buf;
@@ -510,6 +526,34 @@ mac_coerce_file_name_ptr (type_code, data_ptr, data_size,
CFDataGetLength (data), result);
CFRelease (data);
}
+
+ if (err != noErr)
+ {
+ /* Coercion from typeAlias to typeFileURL fails on Mac OS X
+ 10.2. In such cases, try typeFSRef as a target type. */
+ char file_name[MAXPATHLEN];
+
+ if (type_code == typeFSRef && data_size == sizeof (FSRef))
+ err = FSRefMakePath (data_ptr, file_name, sizeof (file_name));
+ else
+ {
+ AEDesc desc;
+ FSRef fref;
+
+ err = AECoercePtr (type_code, data_ptr, data_size,
+ typeFSRef, &desc);
+ if (err == noErr)
+ {
+ err = AEGetDescData (&desc, &fref, sizeof (FSRef));
+ AEDisposeDesc (&desc);
+ }
+ if (err == noErr)
+ err = FSRefMakePath (&fref, file_name, sizeof (file_name));
+ }
+ if (err == noErr)
+ err = AECreateDesc (TYPE_FILE_NAME, file_name,
+ strlen (file_name), result);
+ }
#else
char file_name[MAXPATHLEN];
@@ -529,11 +573,11 @@ mac_coerce_file_name_ptr (type_code, data_ptr, data_size,
#else
fs = *(FSSpec *)(*(desc.dataHandle));
#endif
- if (err == noErr)
- err = fsspec_to_posix_pathname (&fs, file_name,
- sizeof (file_name) - 1);
AEDisposeDesc (&desc);
}
+ if (err == noErr)
+ err = fsspec_to_posix_pathname (&fs, file_name,
+ sizeof (file_name) - 1);
}
if (err == noErr)
err = AECreateDesc (TYPE_FILE_NAME, file_name,
diff --git a/src/macfns.c b/src/macfns.c
index f4cfd61acb3..74b5288e781 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -1919,6 +1919,100 @@ mac_set_scroll_bar_width (f, arg, oldval)
x_set_scroll_bar_width (f, arg, oldval);
}
+#if TARGET_API_MAC_CARBON
+static void
+mac_update_proxy_icon (f)
+ struct frame *f;
+{
+ Lisp_Object file_name =
+ XBUFFER (XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer)->filename;
+ Window w = FRAME_MAC_WINDOW (f);
+
+ if (FRAME_FILE_NAME (f) == NULL && !STRINGP (file_name))
+ return;
+ if (FRAME_FILE_NAME (f) && STRINGP (file_name)
+ && strcmp (FRAME_FILE_NAME (f), SDATA (file_name)) == 0)
+ return;
+
+ if (FRAME_FILE_NAME (f))
+ {
+ xfree (FRAME_FILE_NAME (f));
+ FRAME_FILE_NAME (f) = NULL;
+ }
+
+ BLOCK_INPUT;
+
+ if (STRINGP (file_name))
+ {
+ OSStatus err;
+ AEDesc desc;
+ Lisp_Object encoded_file_name = ENCODE_FILE (file_name);
+
+#ifdef MAC_OS8
+ SetPortWindowPort (w);
+#endif
+ err = AECoercePtr (TYPE_FILE_NAME, SDATA (encoded_file_name),
+ SBYTES (encoded_file_name), typeAlias, &desc);
+ if (err == noErr)
+ {
+ Size size = AEGetDescDataSize (&desc);
+ AliasHandle alias = (AliasHandle) NewHandle (size);
+
+ if (alias == NULL)
+ err = memFullErr;
+ else
+ {
+ HLock ((Handle) alias);
+ err = AEGetDescData (&desc, *alias, size);
+ HUnlock ((Handle) alias);
+ if (err == noErr)
+ err = SetWindowProxyAlias (w, alias);
+ DisposeHandle ((Handle) alias);
+ }
+ AEDisposeDesc (&desc);
+ }
+ if (err == noErr)
+ {
+ FRAME_FILE_NAME (f) = xmalloc (SBYTES (file_name) + 1);
+ strcpy (FRAME_FILE_NAME (f), SDATA (file_name));
+ }
+ }
+
+ if (FRAME_FILE_NAME (f) == NULL)
+ RemoveWindowProxy (w);
+
+ UNBLOCK_INPUT;
+}
+#endif
+
+void
+mac_update_title_bar (f, save_match_data)
+ struct frame *f;
+ int save_match_data;
+{
+#if TARGET_API_MAC_CARBON
+ struct window *w;
+ int modified_p;
+
+ if (!FRAME_MAC_P (f))
+ return;
+
+ w = XWINDOW (FRAME_SELECTED_WINDOW (f));
+ modified_p = (BUF_SAVE_MODIFF (XBUFFER (w->buffer))
+ < BUF_MODIFF (XBUFFER (w->buffer)));
+ if (windows_or_buffers_changed
+ /* Minibuffer modification status shown in the close button is
+ confusing. */
+ || (!MINI_WINDOW_P (w)
+ && (modified_p != !NILP (w->last_had_star))))
+ SetWindowModified (FRAME_MAC_WINDOW (f),
+ !MINI_WINDOW_P (w) && modified_p);
+
+ if (windows_or_buffers_changed)
+ mac_update_proxy_icon (f);
+#endif
+}
+
/* Subroutines of creating a frame. */
@@ -3470,6 +3564,9 @@ show_hourglass (timer)
if (FRAME_LIVE_P (f) && FRAME_MAC_P (f)
&& FRAME_MAC_WINDOW (f) != tip_window)
{
+#if USE_CG_DRAWING
+ mac_prepare_for_quickdraw (f);
+#endif
if (!f->output_data.mac->hourglass_control)
{
Window w = FRAME_MAC_WINDOW (f);
@@ -3514,7 +3611,12 @@ hide_hourglass ()
if (FRAME_MAC_P (f)
/* Watch out for newly created frames. */
&& f->output_data.mac->hourglass_control)
- HideControl (f->output_data.mac->hourglass_control);
+ {
+#if USE_CG_DRAWING
+ mac_prepare_for_quickdraw (f);
+#endif
+ HideControl (f->output_data.mac->hourglass_control);
+ }
}
hourglass_shown_p = 0;
diff --git a/src/macgui.h b/src/macgui.h
index 7eb6c9942ab..579ae2b7663 100644
--- a/src/macgui.h
+++ b/src/macgui.h
@@ -79,14 +79,26 @@ typedef unsigned long Time;
#include <Gestalt.h>
#endif /* not HAVE_CARBON */
+/* Whether to use ATSUI (Apple Type Services for Unicode Imaging) for
+ text drawing. */
+#ifndef USE_ATSUI
+#ifdef MAC_OSX
+#define USE_ATSUI 1
+#endif
+#endif
+
+/* Whether to use low-level Quartz 2D (aka Core Graphics) text drawing
+ in preference to ATSUI for ASCII and Latin-1 characters. */
#ifndef USE_CG_TEXT_DRAWING
#if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
#define USE_CG_TEXT_DRAWING 1
#endif
#endif
+/* Whether to use Quartz 2D routines for drawing operations other than
+ texts. */
#ifndef USE_CG_DRAWING
-#if USE_ATSUI && defined (MAC_OSX)
+#if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
#define USE_CG_DRAWING 1
#endif
#endif
@@ -105,6 +117,8 @@ typedef GWorldPtr Pixmap;
/* Emulate XCharStruct. */
+/* If the sum of ascent and descent is negative, that means some
+ special status specified by enum pcm_status. */
typedef struct _XCharStruct
{
short lbearing; /* origin to left edge of raster */
@@ -117,6 +131,12 @@ typedef struct _XCharStruct
#endif
} XCharStruct;
+enum pcm_status
+ {
+ PCM_VALID = 0, /* pcm data is valid */
+ PCM_INVALID = -1, /* pcm data is invalid */
+ };
+
#define STORE_XCHARSTRUCT(xcs, w, bds) \
((xcs).width = (w), \
(xcs).lbearing = (bds).left, \
@@ -124,18 +144,6 @@ typedef struct _XCharStruct
(xcs).ascent = -(bds).top, \
(xcs).descent = (bds).bottom)
-typedef struct
-{
- char valid_bits[0x100 / 8];
- XCharStruct per_char[0x100];
-} XCharStructRow;
-
-#define XCHARSTRUCTROW_CHAR_VALID_P(row, byte2) \
- ((row)->valid_bits[(byte2) / 8] & (1 << (byte2) % 8))
-
-#define XCHARSTRUCTROW_SET_CHAR_VALID(row, byte2) \
- ((row)->valid_bits[(byte2) / 8] |= (1 << (byte2) % 8))
-
struct MacFontStruct {
char *full_name;
@@ -175,7 +183,7 @@ struct MacFontStruct {
XCharStruct max_bounds; /* maximum bounds over all existing char */
union {
XCharStruct *per_char; /* first_char to last_char information */
- XCharStructRow **rows; /* first row to last row information */
+ XCharStruct **rows; /* first row to last row information */
} bounds;
int ascent; /* logical extent above baseline for spacing */
int descent; /* logical decent below baseline for spacing */
@@ -229,7 +237,7 @@ typedef struct _XGC
/* QuickDraw clipping region. Ignored if n_clip_rects == 0. */
RgnHandle clip_region;
-#if defined (MAC_OSX) && USE_ATSUI
+#if defined (MAC_OSX) && (USE_ATSUI || USE_CG_DRAWING)
/* Clipping rectangles used in Quartz 2D drawing. The y-coordinate
is in QuickDraw's. */
CGRect clip_rects[MAX_CLIP_RECTS];
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 ()
}
}
+/* This undoes save_menu_items, and it is called by the specpdl unwind
+ mechanism. */
+
+static Lisp_Object
+restore_menu_items (saved)
+ Lisp_Object saved;
+{
+ menu_items = XCAR (saved);
+ menu_items_allocated = (VECTORP (menu_items) ? ASIZE (menu_items) : 0);
+ saved = XCDR (saved);
+ menu_items_used = XINT (XCAR (saved));
+ saved = XCDR (saved);
+ menu_items_n_panes = XINT (XCAR (saved));
+ saved = XCDR (saved);
+ menu_items_submenu_depth = XINT (XCAR (saved));
+}
+
+/* Push the whole state of menu_items processing onto the specpdl.
+ It will be restored when the specpdl is unwound. */
+
+static void
+save_menu_items ()
+{
+ Lisp_Object saved = list4 (menu_items,
+ make_number (menu_items_used),
+ make_number (menu_items_n_panes),
+ make_number (menu_items_submenu_depth));
+ record_unwind_protect (restore_menu_items, saved);
+ menu_items = Qnil;
+}
+
/* Make the menu_items vector twice as large. */
static void
@@ -313,6 +344,7 @@ grow_menu_items ()
old = menu_items;
menu_items_allocated *= 2;
+
menu_items = Fmake_vector (make_number (menu_items_allocated), Qnil);
bcopy (XVECTOR (old)->contents, XVECTOR (menu_items)->contents,
old_size * sizeof (Lisp_Object));
@@ -1185,6 +1217,7 @@ digest_single_submenu (start, end, top_level_items)
int i;
int submenu_depth = 0;
widget_value **submenu_stack;
+ int panes_seen = 0;
submenu_stack
= (widget_value **) alloca (menu_items_used * sizeof (widget_value *));
@@ -1231,6 +1264,8 @@ digest_single_submenu (start, end, top_level_items)
Lisp_Object pane_name, prefix;
char *pane_string;
+ panes_seen++;
+
pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME];
prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX];
@@ -1278,6 +1313,10 @@ digest_single_submenu (start, end, top_level_items)
Lisp_Object item_name, enable, descrip, def, type, selected;
Lisp_Object help;
+ /* All items should be contained in panes. */
+ if (panes_seen == 0)
+ abort ();
+
item_name = AREF (menu_items, i + MENU_ITEMS_ITEM_NAME);
enable = AREF (menu_items, i + MENU_ITEMS_ITEM_ENABLE);
descrip = AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY);
@@ -1529,6 +1568,8 @@ set_frame_menubar (f, first_time, deep_p)
/* Fill in menu_items with the current menu bar contents.
This can evaluate Lisp code. */
+ save_menu_items ();
+
menu_items = f->menu_bar_vector;
menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0;
submenu_start = (int *) alloca (XVECTOR (items)->size * sizeof (int *));
@@ -1588,23 +1629,33 @@ set_frame_menubar (f, first_time, deep_p)
}
set_buffer_internal_1 (prev);
- unbind_to (specpdl_count, Qnil);
/* If there has been no change in the Lisp-level contents
of the menu bar, skip redisplaying it. Just exit. */
+ /* Compare the new menu items with the ones computed last time. */
for (i = 0; i < previous_menu_items_used; i++)
if (menu_items_used == i
|| (!EQ (previous_items[i], XVECTOR (menu_items)->contents[i])))
break;
if (i == menu_items_used && i == previous_menu_items_used && i != 0)
{
+ /* The menu items have not changed. Don't bother updating
+ the menus in any form, since it would be a no-op. */
free_menubar_widget_value_tree (first_wv);
discard_menu_items ();
-
+ unbind_to (specpdl_count, Qnil);
return;
}
+ /* The menu items are different, so store them in the frame. */
+ f->menu_bar_vector = menu_items;
+ f->menu_bar_items_used = menu_items_used;
+
+ /* This calls restore_menu_items to restore menu_items, etc.,
+ as they were outside. */
+ unbind_to (specpdl_count, Qnil);
+
/* Now GC cannot happen during the lifetime of the widget_value,
so it's safe to store data from a Lisp_String. */
wv = first_wv->contents;
@@ -1619,9 +1670,6 @@ set_frame_menubar (f, first_time, deep_p)
wv = wv->next;
}
- f->menu_bar_vector = menu_items;
- f->menu_bar_items_used = menu_items_used;
- discard_menu_items ();
}
else
{
diff --git a/src/macterm.c b/src/macterm.c
index b7a7fadeab2..8ddd8febd69 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -391,16 +391,37 @@ mac_draw_line (f, gc, x1, y1, x2, y2)
{
#if USE_CG_DRAWING
CGContextRef context;
+ float gx1 = x1, gy1 = y1, gx2 = x2, gy2 = y2;
+
+ if (y1 != y2)
+ gx1 += 0.5f, gx2 += 0.5f;
+ if (x1 != x2)
+ gy1 += 0.5f, gy2 += 0.5f;
context = mac_begin_cg_clip (f, gc);
CG_SET_STROKE_COLOR (context, gc->xgcv.foreground);
CGContextBeginPath (context);
- CGContextMoveToPoint (context, x1 + 0.5f, y1 + 0.5f);
- CGContextAddLineToPoint (context, x2 + 0.5f, y2 + 0.5f);
+ CGContextMoveToPoint (context, gx1, gy1);
+ CGContextAddLineToPoint (context, gx2, gy2);
CGContextClosePath (context);
CGContextStrokePath (context);
mac_end_cg_clip (f);
#else
+ if (x1 == x2)
+ {
+ if (y1 > y2)
+ y1--;
+ else if (y2 > y1)
+ y2--;
+ }
+ else if (y1 == y2)
+ {
+ if (x1 > x2)
+ x1--;
+ else
+ x2--;
+ }
+
SetPortWindowPort (FRAME_MAC_WINDOW (f));
RGBForeColor (GC_FORE_COLOR (gc));
@@ -422,6 +443,21 @@ mac_draw_line_to_pixmap (display, p, gc, x1, y1, x2, y2)
CGrafPtr old_port;
GDHandle old_gdh;
+ if (x1 == x2)
+ {
+ if (y1 > y2)
+ y1--;
+ else if (y2 > y1)
+ y2--;
+ }
+ else if (y1 == y2)
+ {
+ if (x1 > x2)
+ x1--;
+ else
+ x2--;
+ }
+
GetGWorld (&old_port, &old_gdh);
SetGWorld (p, NULL);
@@ -1627,7 +1663,7 @@ mac_set_clip_rectangles (display, gc, rectangles, n)
DisposeRgn (region);
}
}
-#if defined (MAC_OSX) && USE_ATSUI
+#if defined (MAC_OSX) && (USE_ATSUI || USE_CG_DRAWING)
for (i = 0; i < n; i++)
{
Rect *rect = rectangles + i;
@@ -2139,6 +2175,29 @@ static int mac_encode_char P_ ((int, XChar2b *, struct font_info *,
struct charset *, int *));
+static void
+pcm_init (pcm, count)
+ XCharStruct *pcm;
+ int count;
+{
+ bzero (pcm, sizeof (XCharStruct) * count);
+ while (--count >= 0)
+ {
+ pcm->descent = PCM_INVALID;
+ pcm++;
+ }
+}
+
+static enum pcm_status
+pcm_get_status (pcm)
+ XCharStruct *pcm;
+{
+ int height = pcm->ascent + pcm->descent;
+
+ /* Negative height means some special status. */
+ return height >= 0 ? PCM_VALID : height;
+}
+
/* Get metrics of character CHAR2B in FONT. Value is null if CHAR2B
is not contained in the font. */
@@ -2155,22 +2214,21 @@ x_per_char_metric (font, char2b)
#if USE_ATSUI
if (font->mac_style)
{
- XCharStructRow **row = font->bounds.rows + char2b->byte1;
+ XCharStruct **row = font->bounds.rows + char2b->byte1;
if (*row == NULL)
{
- *row = xmalloc (sizeof (XCharStructRow));
- bzero (*row, sizeof (XCharStructRow));
+ *row = xmalloc (sizeof (XCharStruct) * 0x100);
+ pcm_init (*row, 0x100);
}
- pcm = (*row)->per_char + char2b->byte2;
- if (!XCHARSTRUCTROW_CHAR_VALID_P (*row, char2b->byte2))
+ pcm = *row + char2b->byte2;
+ if (pcm_get_status (pcm) != PCM_VALID)
{
BLOCK_INPUT;
mac_query_char_extents (font->mac_style,
(char2b->byte1 << 8) + char2b->byte2,
NULL, NULL, pcm, NULL);
UNBLOCK_INPUT;
- XCHARSTRUCTROW_SET_CHAR_VALID (*row, char2b->byte2);
}
}
else
@@ -2233,7 +2291,11 @@ x_per_char_metric (font, char2b)
#endif
return ((pcm == NULL
- || (pcm->width == 0 && (pcm->rbearing - pcm->lbearing) == 0))
+ || (pcm->width == 0
+#if 0 /* Show hollow boxes for zero-width glyphs such as combining diacritics. */
+ && (pcm->rbearing - pcm->lbearing) == 0
+#endif
+ ))
? NULL : pcm);
}
@@ -3120,13 +3182,13 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
for (i = 0; i < width; ++i)
mac_draw_line (f, gc,
left_x + i * left_p, top_y + i,
- right_x - i * right_p, top_y + i);
+ right_x + 1 - i * right_p, top_y + i);
/* Left. */
if (left_p)
for (i = 0; i < width; ++i)
mac_draw_line (f, gc,
- left_x + i, top_y + i, left_x + i, bottom_y - i);
+ left_x + i, top_y + i, left_x + i, bottom_y - i + 1);
mac_reset_clip_rectangles (dpy, gc);
if (raised_p)
@@ -3140,13 +3202,13 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
for (i = 0; i < width; ++i)
mac_draw_line (f, gc,
left_x + i * left_p, bottom_y - i,
- right_x - i * right_p, bottom_y - i);
+ right_x + 1 - i * right_p, bottom_y - i);
/* Right. */
if (right_p)
for (i = 0; i < width; ++i)
mac_draw_line (f, gc,
- right_x - i, top_y + i + 1, right_x - i, bottom_y - i - 1);
+ right_x - i, top_y + i + 1, right_x - i, bottom_y - i);
mac_reset_clip_rectangles (dpy, gc);
}
@@ -6315,6 +6377,11 @@ x_free_frame_resources (f)
if (FRAME_SIZE_HINTS (f))
xfree (FRAME_SIZE_HINTS (f));
+#if TARGET_API_MAC_CARBON
+ if (FRAME_FILE_NAME (f))
+ xfree (FRAME_FILE_NAME (f));
+#endif
+
xfree (f->output_data.mac);
f->output_data.mac = NULL;
@@ -7061,6 +7128,25 @@ add_font_name_table_entry (char *font_name)
font_name_table[font_name_count++] = font_name;
}
+static void
+add_mac_font_name (name, size, style, charset)
+ char *name;
+ int size;
+ Style style;
+ char *charset;
+{
+ if (size > 0)
+ add_font_name_table_entry (mac_to_x_fontname (name, size, style, charset));
+ else
+ {
+ add_font_name_table_entry (mac_to_x_fontname (name, 0, style, charset));
+ add_font_name_table_entry (mac_to_x_fontname (name, 0, italic, charset));
+ add_font_name_table_entry (mac_to_x_fontname (name, 0, bold, charset));
+ add_font_name_table_entry (mac_to_x_fontname (name, 0, italic | bold,
+ charset));
+ }
+}
+
/* Sets up the table font_name_table to contain the list of all fonts
in the system the first time the table is used so that the Resource
Manager need not be accessed every time this information is
@@ -7086,16 +7172,21 @@ init_font_name_table ()
text_encoding_info_alist)))
{
OSErr err;
+ struct Lisp_Hash_Table *h;
+ unsigned hash_code;
ItemCount nfonts, i;
ATSUFontID *font_ids = NULL;
- Ptr name, prev_name = NULL;
+ Ptr name;
ByteCount name_len;
+ Lisp_Object family;
atsu_font_id_hash =
make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE),
make_float (DEFAULT_REHASH_SIZE),
make_float (DEFAULT_REHASH_THRESHOLD),
Qnil, Qnil, Qnil);;
+ h = XHASH_TABLE (atsu_font_id_hash);
+
err = ATSUFontCount (&nfonts);
if (err == noErr)
{
@@ -7117,32 +7208,19 @@ init_font_name_table ()
kFontNoLanguage, name_len, name,
NULL, NULL);
if (err == noErr)
- decode_mac_font_name (name, name_len + 1, Qnil);
- if (err == noErr
- && *name != '.'
- && (prev_name == NULL
- || strcmp (name, prev_name) != 0))
{
- static char *cs = "iso10646-1";
-
- add_font_name_table_entry (mac_to_x_fontname (name, 0,
- normal, cs));
- add_font_name_table_entry (mac_to_x_fontname (name, 0,
- italic, cs));
- add_font_name_table_entry (mac_to_x_fontname (name, 0,
- bold, cs));
- add_font_name_table_entry (mac_to_x_fontname (name, 0,
- italic | bold, cs));
- Fputhash (make_unibyte_string (name, name_len),
- long_to_cons (font_ids[i]), atsu_font_id_hash);
- xfree (prev_name);
- prev_name = name;
+ decode_mac_font_name (name, name_len + 1, Qnil);
+ family = make_unibyte_string (name, name_len);
+ if (*name != '.'
+ && hash_lookup (h, family, &hash_code) < 0)
+ {
+ add_mac_font_name (name, 0, normal, "iso10646-1");
+ hash_put (h, family, long_to_cons (font_ids[i]),
+ hash_code);
+ }
}
- else
- xfree (name);
+ xfree (name);
}
- if (prev_name)
- xfree (prev_name);
if (font_ids)
xfree (font_ids);
}
@@ -7170,16 +7248,16 @@ init_font_name_table ()
FMFontSize size;
TextEncoding encoding;
TextEncodingBase sc;
- Lisp_Object text_encoding_info;
+ Lisp_Object text_encoding_info, family;
if (FMGetFontFamilyName (ff, name) != noErr)
- break;
+ continue;
p2cstr (name);
if (*name == '.')
continue;
if (FMGetFontFamilyTextEncoding (ff, &encoding) != noErr)
- break;
+ continue;
sc = GetTextEncodingBase (encoding);
text_encoding_info = assq_no_quit (make_number (sc),
text_encoding_info_alist);
@@ -7188,13 +7266,15 @@ init_font_name_table ()
text_encoding_info_alist);
decode_mac_font_name (name, sizeof (name),
XCAR (XCDR (text_encoding_info)));
- fm_font_family_alist = Fcons (Fcons (build_string (name),
- make_number (ff)),
+ family = build_string (name);
+ if (!NILP (Fassoc (family, fm_font_family_alist)))
+ continue;
+ fm_font_family_alist = Fcons (Fcons (family, make_number (ff)),
fm_font_family_alist);
/* Point the instance iterator at the current font family. */
if (FMResetFontFamilyInstanceIterator (ff, &ffii) != noErr)
- break;
+ continue;
while (FMGetNextFontFamilyInstance (&ffii, &font, &style, &size)
== noErr)
@@ -7203,27 +7283,7 @@ init_font_name_table ()
if (size > 0 || style == normal)
for (; !NILP (rest); rest = XCDR (rest))
- {
- char *cs = SDATA (XCAR (rest));
-
- if (size == 0)
- {
- add_font_name_table_entry (mac_to_x_fontname (name, size,
- style, cs));
- add_font_name_table_entry (mac_to_x_fontname (name, size,
- italic, cs));
- add_font_name_table_entry (mac_to_x_fontname (name, size,
- bold, cs));
- add_font_name_table_entry (mac_to_x_fontname (name, size,
- italic | bold,
- cs));
- }
- else
- {
- add_font_name_table_entry (mac_to_x_fontname (name, size,
- style, cs));
- }
- }
+ add_mac_font_name (name, size, style, SDATA (XCAR (rest)));
}
}
@@ -7243,7 +7303,7 @@ init_font_name_table ()
Str255 name;
struct FontAssoc *fat;
struct AsscEntry *assc_entry;
- Lisp_Object text_encoding_info_alist, text_encoding_info;
+ Lisp_Object text_encoding_info_alist, text_encoding_info, family;
struct gcpro gcpro1;
GetPort (&port); /* save the current font number used */
@@ -7262,7 +7322,7 @@ init_font_name_table ()
GetResInfo (font_handle, &id, &type, name);
GetFNum (name, &fontnum);
p2cstr (name);
- if (fontnum == 0)
+ if (fontnum == 0 || *name == '.')
continue;
TextFont (fontnum);
@@ -7274,8 +7334,10 @@ init_font_name_table ()
text_encoding_info_alist);
decode_mac_font_name (name, sizeof (name),
XCAR (XCDR (text_encoding_info)));
- fm_font_family_alist = Fcons (Fcons (build_string (name),
- make_number (fontnum)),
+ family = build_string (name);
+ if (!NILP (Fassoc (family, fm_font_family_alist)))
+ continue;
+ fm_font_family_alist = Fcons (Fcons (family, make_number (fontnum)),
fm_font_family_alist);
do
{
@@ -7296,14 +7358,9 @@ init_font_name_table ()
Lisp_Object rest = XCDR (XCDR (text_encoding_info));
for (; !NILP (rest); rest = XCDR (rest))
- {
- char *cs = SDATA (XCAR (rest));
-
- add_font_name_table_entry (mac_to_x_fontname (name,
- assc_entry->fontSize,
- assc_entry->fontStyle,
- cs));
- }
+ add_mac_font_name (name, assc_entry->fontSize,
+ assc_entry->fontStyle,
+ SDATA (XCAR (rest)));
}
}
@@ -7771,10 +7828,10 @@ XLoadQueryFont (Display *dpy, char *fontname)
font->min_char_or_byte2 = 0;
font->max_char_or_byte2 = 0xff;
- font->bounds.rows = xmalloc (sizeof (XCharStructRow *) * 0x100);
- bzero (font->bounds.rows, sizeof (XCharStructRow *) * 0x100);
- font->bounds.rows[0] = xmalloc (sizeof (XCharStructRow));
- bzero (font->bounds.rows[0], sizeof (XCharStructRow));
+ font->bounds.rows = xmalloc (sizeof (XCharStruct *) * 0x100);
+ bzero (font->bounds.rows, sizeof (XCharStruct *) * 0x100);
+ font->bounds.rows[0] = xmalloc (sizeof (XCharStruct) * 0x100);
+ pcm_init (font->bounds.rows[0], 0x100);
#if USE_CG_TEXT_DRAWING
{
@@ -7800,7 +7857,7 @@ XLoadQueryFont (Display *dpy, char *fontname)
bzero (font->cg_glyphs, sizeof (CGGlyph) * 0x100);
}
#endif
- space_bounds = font->bounds.rows[0]->per_char + 0x20;
+ space_bounds = font->bounds.rows[0] + 0x20;
err = mac_query_char_extents (font->mac_style, 0x20,
&font->ascent, &font->descent,
space_bounds,
@@ -7816,9 +7873,8 @@ XLoadQueryFont (Display *dpy, char *fontname)
mac_unload_font (&one_mac_display_info, font);
return NULL;
}
- XCHARSTRUCTROW_SET_CHAR_VALID (font->bounds.rows[0], 0x20);
- pcm = font->bounds.rows[0]->per_char;
+ pcm = font->bounds.rows[0];
for (c = 0x21; c <= 0xff; c++)
{
if (c == 0xad)
@@ -7838,7 +7894,6 @@ XLoadQueryFont (Display *dpy, char *fontname)
NULL
#endif
);
- XCHARSTRUCTROW_SET_CHAR_VALID (font->bounds.rows[0], c);
#if USE_CG_TEXT_DRAWING
if (font->cg_glyphs && font->cg_glyphs[c] == 0)
@@ -10024,8 +10079,20 @@ XTread_socket (sd, expected, hold_quit)
}
break;
+#if TARGET_API_MAC_CARBON
+ case inProxyIcon:
+ if (TrackWindowProxyDrag (window_ptr, er.where)
+ != errUserWantsToDragWindow)
+ break;
+ /* fall through */
+#endif
case inDrag:
#if TARGET_API_MAC_CARBON
+ if (IsWindowPathSelectClick (window_ptr, &er))
+ {
+ WindowPathSelect (window_ptr, NULL, NULL);
+ break;
+ }
DragWindow (window_ptr, er.where, NULL);
#else /* not TARGET_API_MAC_CARBON */
DragWindow (window_ptr, er.where, &qd.screenBits.bounds);
@@ -11076,7 +11143,11 @@ button will be mouse-3. */);
doc: /* *If non-nil, allow anti-aliasing.
The text will be rendered using Core Graphics text rendering which
may anti-alias the text. */);
+#if USE_CG_DRAWING
+ mac_use_core_graphics = 1;
+#else
mac_use_core_graphics = 0;
+#endif
/* Register an entry for `mac-roman' so that it can be used when
creating the terminal frame on Mac OS 9 before loading
diff --git a/src/macterm.h b/src/macterm.h
index e35f04a6ba6..f23554f01c6 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -335,6 +335,11 @@ struct mac_output {
/* Hints for the size and the position of a window. */
XSizeHints *size_hints;
+#if TARGET_API_MAC_CARBON
+ /* File name for the proxy icon of this frame. Might be NULL. */
+ char *file_name;
+#endif
+
#if USE_CG_DRAWING
/* Quartz 2D graphics context. */
CGContextRef cg_context;
@@ -360,6 +365,8 @@ typedef struct mac_output mac_output;
#define FRAME_SIZE_HINTS(f) ((f)->output_data.mac->size_hints)
+#define FRAME_FILE_NAME(f) ((f)->output_data.mac->file_name)
+
/* This gives the mac_display_info structure for the display F is on. */
#define FRAME_MAC_DISPLAY_INFO(f) (&one_mac_display_info)
#define FRAME_X_DISPLAY_INFO(f) (&one_mac_display_info)
@@ -606,6 +613,7 @@ extern int x_char_width P_ ((struct frame *));
extern int x_char_height P_ ((struct frame *));
extern void x_sync P_ ((struct frame *));
extern void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
+extern void mac_update_title_bar P_ ((struct frame *, int));
/* Defined in macmenu.c */
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
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
/* This structure records information about a subprocess
or network connection.
diff --git a/src/puresize.h b/src/puresize.h
index fa73736bc43..1288feff151 100644
--- a/src/puresize.h
+++ b/src/puresize.h
@@ -43,7 +43,7 @@ Boston, MA 02110-1301, USA. */
#endif
#ifndef BASE_PURESIZE
-#define BASE_PURESIZE (1200000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
+#define BASE_PURESIZE (1205000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
#endif
/* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */
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);
#include <string.h>
/* We need a little extra space, see ../../lisp/loadup.el.
- The number below comes from 22038 bytes worth (as of 2006-04)
- of w32-specific files loaded by loadup.el, plus 2K spare. */
-#define SYSTEM_PURESIZE_EXTRA 24000
+ The number below comes from 23923 bytes worth (as of 2006-04)
+ of w32-specific files loaded by loadup.el, plus 1K spare. */
+#define SYSTEM_PURESIZE_EXTRA 25000
/* For unexec to work on Alpha systems, we need to put Emacs'
initialized data into a separate section from the CRT initialized
diff --git a/src/syntax.c b/src/syntax.c
index f8d50d1e5b4..3f6058e3b1a 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -2344,8 +2344,6 @@ between them, return t; otherwise return nil. */)
while (1)
{
DEC_BOTH (from, from_byte);
- if (from == stop)
- break;
UPDATE_SYNTAX_TABLE_BACKWARD (from);
c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
if (SYNTAX (c) == Scomment_fence
@@ -2354,6 +2352,8 @@ between them, return t; otherwise return nil. */)
found = 1;
break;
}
+ else if (from == stop)
+ break;
}
if (found == 0)
{
@@ -2361,6 +2361,9 @@ between them, return t; otherwise return nil. */)
from_byte = ini_byte;
goto leave;
}
+ else
+ /* We have skipped one comment. */
+ break;
}
else if (code == Sendcomment)
{
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 4ca0be829a2..f65fd9cbc22 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -1021,6 +1021,9 @@ void
unexec (char *outfile, char *infile, void *start_data, void *start_bss,
void *entry_address)
{
+ if (in_dumped_exec)
+ unexec_error ("Unexec from a dumped executable is not supported.");
+
infd = open (infile, O_RDONLY, 0);
if (infd < 0)
{
diff --git a/src/w32fns.c b/src/w32fns.c
index 95ba34fc1e4..4da5271c870 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -3191,6 +3191,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
}
wmsg.dwModifiers = w32_get_modifiers ();
my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
+ signal_user_input ();
/* Clear message buffer. */
saved_mouse_button_msg.msg.hwnd = 0;
@@ -3248,6 +3249,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
}
wmsg.dwModifiers = w32_get_modifiers ();
my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
+ signal_user_input ();
/* Always clear message buffer and cancel timer. */
saved_mouse_button_msg.msg.hwnd = 0;
diff --git a/src/w32term.c b/src/w32term.c
index 5681b6ee62f..305527946fb 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -3282,8 +3282,10 @@ construct_mouse_wheel (result, msg, f)
result->modifiers = (msg->dwModifiers
| ((delta < 0 ) ? down_modifier : up_modifier));
- p.x = LOWORD (msg->msg.lParam);
- p.y = HIWORD (msg->msg.lParam);
+ /* With multiple monitors, we can legitimately get negative
+ coordinates, so cast to short to interpret them correctly. */
+ p.x = (short) LOWORD (msg->msg.lParam);
+ p.y = (short) HIWORD (msg->msg.lParam);
ScreenToClient (msg->msg.hwnd, &p);
XSETINT (result->x, p.x);
XSETINT (result->y, p.y);
diff --git a/src/window.c b/src/window.c
index 1bd8c3924a1..1abeec92367 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3437,7 +3437,7 @@ displaying BUFFER, then simply raise that frame.
The variables `special-display-buffer-names',
`special-display-regexps', `same-window-buffer-names', and
`same-window-regexps' customize how certain buffer names are handled.
-The latter two take effect only if NOT-THIS-WINDOW is t.
+The latter two take effect only if NOT-THIS-WINDOW is nil.
If optional argument FRAME is `visible', search all visible frames.
If FRAME is 0, search all visible and iconified frames.
diff --git a/src/xdisp.c b/src/xdisp.c
index 1689ec88be5..63a1338b2cb 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -9060,6 +9060,9 @@ prepare_menu_bars ()
update_menu_bar (f, 0);
#ifdef HAVE_WINDOW_SYSTEM
update_tool_bar (f, 0);
+#ifdef MAC_OS
+ mac_update_title_bar (f, 0);
+#endif
#endif
UNGCPRO;
}
@@ -9072,6 +9075,9 @@ prepare_menu_bars ()
update_menu_bar (sf, 1);
#ifdef HAVE_WINDOW_SYSTEM
update_tool_bar (sf, 1);
+#ifdef MAC_OS
+ mac_update_title_bar (sf, 1);
+#endif
#endif
}
@@ -9668,20 +9674,22 @@ tool_bar_lines_needed (f, n_rows)
{
struct window *w = XWINDOW (f->tool_bar_window);
struct it it;
+ struct glyph_row *temp_row = w->desired_matrix->rows;
/* Initialize an iterator for iteration over
F->desired_tool_bar_string in the tool-bar window of frame F. */
- init_iterator (&it, w, -1, -1, w->desired_matrix->rows, TOOL_BAR_FACE_ID);
+ init_iterator (&it, w, -1, -1, temp_row, TOOL_BAR_FACE_ID);
it.first_visible_x = 0;
it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f);
reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1);
while (!ITERATOR_AT_END_P (&it))
{
- it.glyph_row = w->desired_matrix->rows;
- clear_glyph_row (it.glyph_row);
+ clear_glyph_row (temp_row);
+ it.glyph_row = temp_row;
display_tool_bar_line (&it, -1);
}
+ clear_glyph_row (temp_row);
/* f->n_tool_bar_rows == 0 means "unknown"; -1 means no tool-bar. */
if (n_rows)
@@ -9761,7 +9769,29 @@ redisplay_tool_bar (f)
reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1);
if (f->n_tool_bar_rows == 0)
- (void)tool_bar_lines_needed (f, &f->n_tool_bar_rows);
+ {
+ int nlines;
+
+ if ((nlines = tool_bar_lines_needed (f, &f->n_tool_bar_rows),
+ nlines != WINDOW_TOTAL_LINES (w)))
+ {
+ extern Lisp_Object Qtool_bar_lines;
+ Lisp_Object frame;
+ int old_height = WINDOW_TOTAL_LINES (w);
+
+ XSETFRAME (frame, f);
+ clear_glyph_matrix (w->desired_matrix);
+ Fmodify_frame_parameters (frame,
+ Fcons (Fcons (Qtool_bar_lines,
+ make_number (nlines)),
+ Qnil));
+ if (WINDOW_TOTAL_LINES (w) != old_height)
+ {
+ fonts_changed_p = 1;
+ return 1;
+ }
+ }
+ }
/* Display as many lines as needed to display all tool-bar items. */
@@ -12957,7 +12987,8 @@ redisplay_window (window, just_this_one_p)
/* If first window line is a continuation line, and window start
is inside the modified region, but the first change is before
current window start, we must select a new window start.*/
- if (NILP (w->start_at_line_beg))
+ if (NILP (w->start_at_line_beg)
+ && CHARPOS (startp) > BEGV)
{
/* Make sure beg_unchanged and end_unchanged are up to date.
Do it only if buffer has really changed. This may or may
@@ -18593,8 +18624,7 @@ get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p)
sure to use a face suitable for unibyte. */
STORE_XCHAR2B (char2b, 0, glyph->u.ch);
}
- else if (glyph->u.ch < 128
- && glyph->face_id < BASIC_FACE_ID_SENTINEL)
+ else if (glyph->u.ch < 128)
{
/* Case of ASCII in a face known to fit ASCII. */
STORE_XCHAR2B (char2b, 0, glyph->u.ch);
@@ -18814,6 +18844,7 @@ fill_stretch_glyph_string (s, row, area, start, end)
s->font = s->face->font;
s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id);
s->width = glyph->pixel_width;
+ s->nchars = 1;
voffset = glyph->voffset;
for (++glyph;
@@ -19011,7 +19042,7 @@ get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p, display_p)
face_id = FACE_FOR_CHAR (f, face, c, -1, Qnil);
face = FACE_FROM_ID (f, face_id);
}
- else if (c < 128 && face_id < BASIC_FACE_ID_SENTINEL)
+ else if (c < 128)
{
/* Case of ASCII in a face known to fit ASCII. */
STORE_XCHAR2B (char2b, 0, c);
@@ -19968,20 +19999,6 @@ produce_stretch_glyph (it)
it->descent = it->phys_descent = height - it->ascent;
it->nglyphs = width > 0 && height > 0 ? 1 : 0;
- if (width > 0 && height > 0 && face->box != FACE_NO_BOX)
- {
- if (face->box_line_width > 0)
- {
- it->ascent += face->box_line_width;
- it->descent += face->box_line_width;
- }
-
- if (it->start_of_box_run_p)
- it->pixel_width += abs (face->box_line_width);
- if (it->end_of_box_run_p)
- it->pixel_width += abs (face->box_line_width);
- }
-
take_vertical_position_into_account (it);
}
diff --git a/src/xmenu.c b/src/xmenu.c
index 8558e113863..2abf0a48319 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -327,6 +327,7 @@ restore_menu_items (saved)
menu_items_n_panes = XINT (XCAR (saved));
saved = XCDR (saved);
menu_items_submenu_depth = XINT (XCAR (saved));
+ return Qnil;
}
/* Push the whole state of menu_items processing onto the specpdl.