summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog74
-rw-r--r--src/alloc.c2
-rw-r--r--src/dispextern.h8
-rw-r--r--src/frame.c14
-rw-r--r--src/fringe.c281
-rw-r--r--src/image.c4
-rw-r--r--src/keyboard.c49
-rw-r--r--src/keymap.c10
-rw-r--r--src/lread.c22
-rw-r--r--src/nsterm.m15
-rw-r--r--src/w32fns.c10
-rw-r--r--src/w32term.c17
-rw-r--r--src/xdisp.c1
-rw-r--r--src/xfaces.c1
-rw-r--r--src/xfns.c6
-rw-r--r--src/xmenu.c8
-rw-r--r--src/xterm.c17
17 files changed, 377 insertions, 162 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a6fb6852c6c..2d6c12a62b7 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -802,7 +802,55 @@
Improve documentation. Return font regardless of use_system_font.
(syms_of_xsettings): Improve documentation for font-use-system-font.
-2009-06-17 Naohiro Aota <naota@elisp.net> (tiny change)
+2010-07-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * xfaces.c (realize_face): Garbage the frame if a face is removed
+ (Bug#6593).
+
+2010-07-05 Andreas Schwab <schwab@linux-m68k.org>
+
+ * keyboard.c: Remove duplicate <setjmp.h>.
+ (read_key_sequence): Remove volatile qualifiers.
+
+2010-07-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * dispextern.h (FRINGE_HEIGHT_BITS): New define.
+ (struct glyph_row): New members left_fringe_offset and
+ right_fringe_offset.
+
+ * xterm.c (x_draw_fringe_bitmap): Don't clip bottom aligned bitmap
+ specially.
+ * w32term.c (w32_draw_fringe_bitmap): Likewise.
+ * nsterm.m (ns_draw_fringe_bitmap): Likewise.
+
+ * fringe.c (draw_fringe_bitmap_1): Don't clip bitmap here.
+ Take account of bitmap offset.
+ (draw_window_fringes): Take account of window vscroll.
+ (update_window_fringes): Likewise. Extend top-aligned top indicator
+ or bottom-aligned bottom indicator to adjacent rows if it doesn't fit
+ in one row. Don't set redraw_fringe_bitmaps_p outside row comparison.
+ Set left_fringe_offset and right_fringe_offset (Bug#5634, Bug#6325).
+
+2010-07-04 Juanma Barranquero <lekktu@gmail.com>
+
+ * w32fns.c (Qtooltip): Declare.
+ Suggested by Andy Moreton <andrewjmoreton@gmail.com>.
+
+2010-07-03 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xmenu.c (x_activate_menubar): Send Press/Release for Gtk+ to avoid
+ grab on just Press (Bug#6499).
+
+2010-07-02 Chong Yidong <cyd@stupidchicken.com>
+
+ * frame.c (Qtooltip): New var.
+ (delete_frame): Use it. Fix faulty if statement. Don't update
+ mode line for tooltip frames. Suggested by Martin Rudalics.
+
+ * xfns.c (x_create_tip_frame):
+ * w32fns.c (x_create_tip_frame): Use it.
+
+2010-06-17 Naohiro Aota <naota@elisp.net> (tiny change)
* xftfont.c (xftfont_open): Check font width one by one also when
spacing is dual.
@@ -981,6 +1029,30 @@
* m/ibms390x.h: Rather than duplicating ibms390.h, just include it.
+2010-06-26 Andreas Schwab <schwab@linux-m68k.org>
+
+ * alloc.c (Fmake_byte_code): Don't access undefined argument
+ (Bug#6517).
+
+2010-06-25 Chong Yidong <cyd@stupidchicken.com>
+
+ * xdisp.c (next_element_from_image): Ensure that after-strings are
+ read the next time we hit handle_stop (Bug#1336).
+
+2010-06-23 Andreas Schwab <schwab@linux-m68k.org>
+
+ * lread.c (read1): Signal error if #s is not followed by paren.
+
+2010-06-19 Chong Yidong <cyd@stupidchicken.com>
+
+ * image.c (free_image): Mark frame as garbaged (Bug#6426).
+
+ * keymap.c (Fdefine_key): Doc fix (Bug#6460).
+
+2010-06-15 Glenn Morris <rgm@gnu.org>
+
+ * editfns.c (Fbyte_to_string): Pacify compiler.
+
2010-06-09 Stefan Monnier <monnier@iro.umontreal.ca>
* dbusbind.c (xd_append_arg): Don't "make-unibyte" the string.
diff --git a/src/alloc.c b/src/alloc.c
index 2a15fd0d63d..36b197e5eac 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3030,7 +3030,7 @@ usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INT
else
val = Fmake_vector (len, Qnil);
- if (STRINGP (args[1]) && STRING_MULTIBYTE (args[1]))
+ if (nargs > 1 && STRINGP (args[1]) && STRING_MULTIBYTE (args[1]))
/* BYTECODE-STRING must have been produced by Emacs 20.2 or the
earlier because they produced a raw 8-bit string for byte-code
and now such a byte-code string is loaded as multibyte while
diff --git a/src/dispextern.h b/src/dispextern.h
index 9bafb49dd91..5ca7e813a1e 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -105,6 +105,8 @@ enum window_part
/* Number of bits allocated to store fringe bitmap numbers. */
#define FRINGE_ID_BITS 16
+/* Number of bits allocated to store fringe bitmap height. */
+#define FRINGE_HEIGHT_BITS 8
/***********************************************************************
@@ -800,6 +802,12 @@ struct glyph_row
/* Face of the right fringe glyph. */
unsigned right_fringe_face_id : FACE_ID_BITS;
+ /* Vertical offset of the left fringe bitmap. */
+ signed left_fringe_offset : FRINGE_HEIGHT_BITS;
+
+ /* Vertical offset of the right fringe bitmap. */
+ signed right_fringe_offset : FRINGE_HEIGHT_BITS;
+
/* 1 means that we must draw the bitmaps of this row. */
unsigned redraw_fringe_bitmaps_p : 1;
diff --git a/src/frame.c b/src/frame.c
index 37d1579dd4d..5b0cfd13892 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -100,6 +100,7 @@ Lisp_Object Qgeometry; /* Not used */
Lisp_Object Qheight, Qwidth;
Lisp_Object Qleft, Qright;
Lisp_Object Qicon_left, Qicon_top, Qicon_type, Qicon_name;
+Lisp_Object Qtooltip;
Lisp_Object Qinternal_border_width;
Lisp_Object Qmouse_color;
Lisp_Object Qminibuffer;
@@ -1298,7 +1299,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
struct frame *sf = SELECTED_FRAME ();
struct kboard *kb;
- int minibuffer_selected;
+ int minibuffer_selected, tooltip_frame;
if (EQ (frame, Qnil))
{
@@ -1350,13 +1351,15 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
}
}
+ tooltip_frame = !NILP (Fframe_parameter (frame, intern ("tooltip")));
+
/* Run `delete-frame-functions' unless FORCE is `noelisp' or
frame is a tooltip. FORCE is set to `noelisp' when handling
a disconnect from the terminal, so we don't dare call Lisp
code. */
- if (NILP (Vrun_hooks) || !NILP (Fframe_parameter (frame, intern ("tooltip"))))
+ if (NILP (Vrun_hooks) || tooltip_frame)
;
- if (EQ (force, Qnoelisp))
+ else if (EQ (force, Qnoelisp))
pending_funcalls
= Fcons (list3 (Qrun_hook_with_args, Qdelete_frame_functions, frame),
pending_funcalls);
@@ -1602,7 +1605,8 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
}
/* Cause frame titles to update--necessary if we now have just one frame. */
- update_mode_lines = 1;
+ if (!tooltip_frame)
+ update_mode_lines = 1;
return Qnil;
}
@@ -4320,6 +4324,8 @@ syms_of_frame (void)
staticpro (&Qicon_left);
Qicon_top = intern_c_string ("icon-top");
staticpro (&Qicon_top);
+ Qtooltip = intern_c_string ("tooltip");
+ staticpro (&Qtooltip);
Qleft = intern_c_string ("left");
staticpro (&Qleft);
Qright = intern_c_string ("right");
diff --git a/src/fringe.c b/src/fringe.c
index 50d5a5c9747..399779009dc 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -555,23 +555,26 @@ draw_fringe_bitmap_1 (struct window *w, struct glyph_row *row, int left_p, int o
struct fringe_bitmap *fb;
int period;
int face_id = DEFAULT_FACE_ID;
+ int offset, header_line_height;
- p.cursor_p = 0;
p.overlay_p = (overlay & 1) == 1;
p.cursor_p = (overlay & 2) == 2;
if (which != NO_FRINGE_BITMAP)
{
+ offset = 0;
}
else if (left_p)
{
which = row->left_fringe_bitmap;
face_id = row->left_fringe_face_id;
+ offset = row->left_fringe_offset;
}
else
{
which = row->right_fringe_bitmap;
face_id = row->right_fringe_face_id;
+ offset = row->right_fringe_offset;
}
if (face_id == DEFAULT_FACE_ID)
@@ -591,7 +594,7 @@ draw_fringe_bitmap_1 (struct window *w, struct glyph_row *row, int left_p, int o
period = fb->period;
/* Convert row to frame coordinates. */
- p.y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
+ p.y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y) + offset;
p.which = which;
p.bits = fb->bits;
@@ -600,9 +603,19 @@ draw_fringe_bitmap_1 (struct window *w, struct glyph_row *row, int left_p, int o
p.h = fb->height;
p.dh = (period > 0 ? (p.y % period) : 0);
p.h -= p.dh;
- /* Clip bitmap if too high. */
- if (p.h > row->height)
- p.h = row->height;
+
+ /* Adjust y to the offset in the row to start drawing the bitmap. */
+ switch (fb->align)
+ {
+ case ALIGN_BITMAP_CENTER:
+ p.y += (row->height - p.h) / 2;
+ break;
+ case ALIGN_BITMAP_BOTTOM:
+ p.y += (row->visible_height - p.h);
+ break;
+ case ALIGN_BITMAP_TOP:
+ break;
+ }
p.face = FACE_FROM_ID (f, face_id);
@@ -618,6 +631,9 @@ draw_fringe_bitmap_1 (struct window *w, struct glyph_row *row, int left_p, int o
/* Clear left fringe if no bitmap to draw or if bitmap doesn't fill
the fringe. */
p.bx = -1;
+ header_line_height = WINDOW_HEADER_LINE_HEIGHT (w);
+ p.by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, row->y));
+ p.ny = row->visible_height;
if (left_p)
{
int wd = WINDOW_LEFT_FRINGE_WIDTH (w);
@@ -628,7 +644,7 @@ draw_fringe_bitmap_1 (struct window *w, struct glyph_row *row, int left_p, int o
p.wd = wd;
p.x = x - p.wd - (wd - p.wd) / 2;
- if (p.wd < wd || row->height > p.h)
+ if (p.wd < wd || p.y > p.by || p.y + p.h < p.by + p.ny)
{
/* If W has a vertical border to its left, don't draw over it. */
wd -= ((!WINDOW_LEFTMOST_P (w)
@@ -650,35 +666,13 @@ draw_fringe_bitmap_1 (struct window *w, struct glyph_row *row, int left_p, int o
p.x = x + (wd - p.wd) / 2;
/* Clear right fringe if no bitmap to draw of if bitmap doesn't fill
the fringe. */
- if (p.wd < wd || row->height > p.h)
+ if (p.wd < wd || p.y > p.by || p.y + p.h < p.by + p.ny)
{
p.bx = x;
p.nx = wd;
}
}
- if (p.bx >= 0)
- {
- int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w);
-
- p.by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, row->y));
- p.ny = row->visible_height;
- }
-
- /* Adjust y to the offset in the row to start drawing the bitmap. */
- switch (fb->align)
- {
- case ALIGN_BITMAP_CENTER:
- p.y += (row->height - p.h) / 2;
- break;
- case ALIGN_BITMAP_BOTTOM:
- p.h = fb->height;
- p.y += (row->visible_height - p.h);
- break;
- case ALIGN_BITMAP_TOP:
- break;
- }
-
FRAME_RIF (f)->draw_fringe_bitmap (w, row, &p);
}
@@ -892,7 +886,7 @@ draw_window_fringes (struct window *w, int no_fringe)
struct glyph_row *row;
int yb = window_text_bottom_y (w);
int nrows = w->current_matrix->nrows;
- int y = 0, rn;
+ int y, rn;
int updated = 0;
if (w->pseudo_window_p)
@@ -904,7 +898,7 @@ draw_window_fringes (struct window *w, int no_fringe)
|| WINDOW_RIGHT_FRINGE_WIDTH (w) == 0))
updated++;
- for (y = 0, rn = 0, row = w->current_matrix->rows;
+ for (y = w->vscroll, rn = 0, row = w->current_matrix->rows;
y < yb && rn < nrows;
y += row->height, ++row, ++rn)
{
@@ -938,6 +932,9 @@ update_window_fringes (struct window *w, int keep_current_p)
Lisp_Object ind = Qnil;
#define MAX_BITMAP_CACHE (8*4)
int bitmap_cache[MAX_BITMAP_CACHE];
+ int top_ind_rn, bot_ind_rn;
+ int top_ind_min_y, bot_ind_max_y;
+ int top_row_ends_at_zv_p, bot_row_ends_at_zv_p;
if (w->pseudo_window_p)
return 0;
@@ -966,11 +963,10 @@ update_window_fringes (struct window *w, int keep_current_p)
boundary_top = boundary_bot = Qleft;
}
+ top_ind_rn = bot_ind_rn = -1;
if (!NILP (ind))
{
- int done_top = 0, done_bot = 0;
-
- for (y = 0, rn = 0;
+ for (y = w->vscroll, rn = 0;
y < yb && rn < nrows;
y += row->height, ++rn)
{
@@ -991,31 +987,25 @@ update_window_fringes (struct window *w, int keep_current_p)
if (!row->mode_line_p)
{
- if (!done_top)
+ if (top_ind_rn < 0 && row->visible_height > 0)
{
if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer))
&& !MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row))
row->indicate_bob_p = !NILP (boundary_top);
else
row->indicate_top_line_p = !NILP (arrow_top);
- done_top = 1;
+ top_ind_rn = rn;
}
- if (!done_bot)
+ if (bot_ind_rn < 0)
{
if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer))
&& !MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row))
- row->indicate_eob_p = !NILP (boundary_bot), done_bot = 1;
+ row->indicate_eob_p = !NILP (boundary_bot), bot_ind_rn = rn;
else if (y + row->height >= yb)
- row->indicate_bottom_line_p = !NILP (arrow_bot), done_bot = 1;
+ row->indicate_bottom_line_p = !NILP (arrow_bot), bot_ind_rn = rn;
}
}
-
- if (indicate_bob_p != row->indicate_bob_p
- || indicate_top_line_p != row->indicate_top_line_p
- || indicate_eob_p != row->indicate_eob_p
- || indicate_bottom_line_p != row->indicate_bottom_line_p)
- row->redraw_fringe_bitmaps_p = 1;
}
}
@@ -1039,12 +1029,139 @@ update_window_fringes (struct window *w, int keep_current_p)
get_logical_fringe_bitmap (w, which, 1, partial_p)))
- for (y = 0, rn = 0;
+ /* Extend top-aligned top indicator (or bottom-aligned bottom
+ indicator) to adjacent rows if it doesn't fit in one row. */
+ top_ind_min_y = bot_ind_max_y = -1;
+ if (top_ind_rn >= 0)
+ {
+ int bn = NO_FRINGE_BITMAP;
+
+ row = w->desired_matrix->rows + top_ind_rn;
+ if (!row->enabled_p)
+ row = w->current_matrix->rows + top_ind_rn;
+
+ top_row_ends_at_zv_p = row->ends_at_zv_p;
+ if (row->indicate_bob_p)
+ {
+ if (EQ (boundary_top, Qleft))
+ bn = ((row->indicate_eob_p && EQ (boundary_bot, Qleft))
+ ? LEFT_FRINGE (1, Qtop_bottom, row->ends_at_zv_p)
+ : LEFT_FRINGE (2, Qtop, 0));
+ else
+ bn = ((row->indicate_eob_p && EQ (boundary_bot, Qright))
+ ? RIGHT_FRINGE (1, Qtop_bottom, row->ends_at_zv_p)
+ : RIGHT_FRINGE (2, Qtop, 0));
+ }
+ else if (row->indicate_top_line_p)
+ {
+ if (EQ (arrow_top, Qleft))
+ bn = LEFT_FRINGE (6, Qup, 0);
+ else
+ bn = RIGHT_FRINGE (6, Qup, 0);
+ }
+
+ if (bn != NO_FRINGE_BITMAP)
+ {
+ struct fringe_bitmap *fb;
+
+ fb = fringe_bitmaps[bn];
+ if (fb == NULL)
+ fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS
+ ? bn : UNDEF_FRINGE_BITMAP];
+ if (fb->align == ALIGN_BITMAP_TOP && fb->period == 0)
+ {
+ struct glyph_row *row1;
+ int top_ind_max_y;
+
+ top_ind_min_y = WINDOW_HEADER_LINE_HEIGHT (w);
+ top_ind_max_y = top_ind_min_y + fb->height;
+ if (top_ind_max_y > yb)
+ top_ind_max_y = yb;
+
+ for (y = row->y + row->height, rn = top_ind_rn + 1;
+ y < top_ind_max_y && rn < nrows;
+ y += row1->height, rn++)
+ {
+ if (bot_ind_rn >= 0 && rn >= bot_ind_rn)
+ break;
+
+ row1 = w->desired_matrix->rows + rn;
+ if (!row1->enabled_p)
+ row1 = w->current_matrix->rows + rn;
+
+ row1->indicate_bob_p = row->indicate_bob_p;
+ row1->indicate_top_line_p = row->indicate_top_line_p;
+ }
+ }
+ }
+ }
+ if (bot_ind_rn >= 0)
+ {
+ int bn = NO_FRINGE_BITMAP;
+
+ row = w->desired_matrix->rows + bot_ind_rn;
+ if (!row->enabled_p)
+ row = w->current_matrix->rows + bot_ind_rn;
+
+ bot_row_ends_at_zv_p = row->ends_at_zv_p;
+ if (row->indicate_eob_p)
+ {
+ if (EQ (boundary_bot, Qleft))
+ bn = LEFT_FRINGE (3, Qbottom, row->ends_at_zv_p);
+ else
+ bn = RIGHT_FRINGE (3, Qbottom, row->ends_at_zv_p);
+ }
+ else if (row->indicate_bottom_line_p)
+ {
+ if (EQ (arrow_bot, Qleft))
+ bn = LEFT_FRINGE (7, Qdown, 0);
+ else
+ bn = RIGHT_FRINGE (7, Qdown, 0);
+ }
+
+ if (bn != NO_FRINGE_BITMAP)
+ {
+ struct fringe_bitmap *fb;
+
+ fb = fringe_bitmaps[bn];
+ if (fb == NULL)
+ fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS
+ ? bn : UNDEF_FRINGE_BITMAP];
+ if (fb->align == ALIGN_BITMAP_BOTTOM && fb->period == 0)
+ {
+ struct glyph_row *row1;
+ int bot_ind_min_y;
+
+ bot_ind_max_y = row->y + row->visible_height;
+ bot_ind_min_y = bot_ind_max_y - fb->height;
+ if (bot_ind_min_y < WINDOW_HEADER_LINE_HEIGHT (w))
+ bot_ind_min_y = WINDOW_HEADER_LINE_HEIGHT (w);
+
+ for (y = row->y, rn = bot_ind_rn - 1;
+ y >= bot_ind_min_y && rn >= 0;
+ y -= row1->height, rn--)
+ {
+ if (top_ind_rn >= 0 && rn <= top_ind_rn)
+ break;
+
+ row1 = w->desired_matrix->rows + rn;
+ if (!row1->enabled_p)
+ row1 = w->current_matrix->rows + rn;
+
+ row1->indicate_eob_p = row->indicate_eob_p;
+ row1->indicate_bottom_line_p = row->indicate_bottom_line_p;
+ }
+ }
+ }
+ }
+
+ for (y = w->vscroll, rn = 0;
y < yb && rn < nrows;
y += row->height, rn++)
{
int left, right;
unsigned left_face_id, right_face_id;
+ int left_offset, right_offset;
row = w->desired_matrix->rows + rn;
cur = w->current_matrix->rows + rn;
@@ -1052,6 +1169,7 @@ update_window_fringes (struct window *w, int keep_current_p)
row = cur;
left_face_id = right_face_id = DEFAULT_FACE_ID;
+ left_offset = right_offset = 0;
/* Decide which bitmap to draw in the left fringe. */
if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0)
@@ -1065,20 +1183,35 @@ update_window_fringes (struct window *w, int keep_current_p)
|| (row->reversed_p && row->truncated_on_right_p))
left = LEFT_FRINGE(0, Qtruncation, 0);
else if (row->indicate_bob_p && EQ (boundary_top, Qleft))
- left = ((row->indicate_eob_p && EQ (boundary_bot, Qleft))
- ? LEFT_FRINGE (1, Qtop_bottom, row->ends_at_zv_p)
- : LEFT_FRINGE (2, Qtop, 0));
+ {
+ left = ((row->indicate_eob_p && EQ (boundary_bot, Qleft))
+ ? LEFT_FRINGE (1, Qtop_bottom, top_row_ends_at_zv_p)
+ : LEFT_FRINGE (2, Qtop, 0));
+ if (top_ind_min_y >= 0)
+ left_offset = top_ind_min_y - row->y;
+ }
else if (row->indicate_eob_p && EQ (boundary_bot, Qleft))
- left = LEFT_FRINGE (3, Qbottom, row->ends_at_zv_p);
- else if ((!row->reversed_p && MATRIX_ROW_CONTINUATION_LINE_P (row))
- || (row->reversed_p && row->continued_p))
+ {
+ left = LEFT_FRINGE (3, Qbottom, bot_row_ends_at_zv_p);
+ if (bot_ind_max_y >= 0)
+ left_offset = bot_ind_max_y - (row->y + row->visible_height);
+ }
+ else if (MATRIX_ROW_CONTINUATION_LINE_P (row))
left = LEFT_FRINGE (4, Qcontinuation, 0);
else if (row->indicate_empty_line_p && EQ (empty_pos, Qleft))
left = LEFT_FRINGE (5, Qempty_line, 0);
else if (row->indicate_top_line_p && EQ (arrow_top, Qleft))
- left = LEFT_FRINGE (6, Qup, 0);
+ {
+ left = LEFT_FRINGE (6, Qup, 0);
+ if (top_ind_min_y >= 0)
+ left_offset = top_ind_min_y - row->y;
+ }
else if (row->indicate_bottom_line_p && EQ (arrow_bot, Qleft))
- left = LEFT_FRINGE (7, Qdown, 0);
+ {
+ left = LEFT_FRINGE (7, Qdown, 0);
+ if (bot_ind_max_y >= 0)
+ left_offset = bot_ind_max_y - (row->y + row->visible_height);
+ }
else
left = NO_FRINGE_BITMAP;
@@ -1094,18 +1227,33 @@ update_window_fringes (struct window *w, int keep_current_p)
|| (row->reversed_p && row->truncated_on_left_p))
right = RIGHT_FRINGE (0, Qtruncation, 0);
else if (row->indicate_bob_p && EQ (boundary_top, Qright))
- right = ((row->indicate_eob_p && EQ (boundary_bot, Qright))
- ? RIGHT_FRINGE (1, Qtop_bottom, row->ends_at_zv_p)
- : RIGHT_FRINGE (2, Qtop, 0));
+ {
+ right = ((row->indicate_eob_p && EQ (boundary_bot, Qright))
+ ? RIGHT_FRINGE (1, Qtop_bottom, top_row_ends_at_zv_p)
+ : RIGHT_FRINGE (2, Qtop, 0));
+ if (top_ind_min_y >= 0)
+ right_offset = top_ind_min_y - row->y;
+ }
else if (row->indicate_eob_p && EQ (boundary_bot, Qright))
- right = RIGHT_FRINGE (3, Qbottom, row->ends_at_zv_p);
- else if ((!row->reversed_p && row->continued_p)
- || (row->reversed_p && MATRIX_ROW_CONTINUATION_LINE_P (row)))
+ {
+ right = RIGHT_FRINGE (3, Qbottom, bot_row_ends_at_zv_p);
+ if (bot_ind_max_y >= 0)
+ right_offset = bot_ind_max_y - (row->y + row->visible_height);
+ }
+ else if (row->continued_p)
right = RIGHT_FRINGE (4, Qcontinuation, 0);
else if (row->indicate_top_line_p && EQ (arrow_top, Qright))
- right = RIGHT_FRINGE (6, Qup, 0);
+ {
+ right = RIGHT_FRINGE (6, Qup, 0);
+ if (top_ind_min_y >= 0)
+ right_offset = top_ind_min_y - row->y;
+ }
else if (row->indicate_bottom_line_p && EQ (arrow_bot, Qright))
- right = RIGHT_FRINGE (7, Qdown, 0);
+ {
+ right = RIGHT_FRINGE (7, Qdown, 0);
+ if (bot_ind_max_y >= 0)
+ right_offset = bot_ind_max_y - (row->y + row->visible_height);
+ }
else if (row->indicate_empty_line_p && EQ (empty_pos, Qright))
right = RIGHT_FRINGE (5, Qempty_line, 0);
else
@@ -1118,6 +1266,8 @@ update_window_fringes (struct window *w, int keep_current_p)
|| right != cur->right_fringe_bitmap
|| left_face_id != cur->left_fringe_face_id
|| right_face_id != cur->right_fringe_face_id
+ || left_offset != cur->left_fringe_offset
+ || right_offset != cur->right_fringe_offset
|| cur->redraw_fringe_bitmaps_p)
{
redraw_p = row->redraw_fringe_bitmaps_p = 1;
@@ -1128,6 +1278,8 @@ update_window_fringes (struct window *w, int keep_current_p)
cur->right_fringe_bitmap = right;
cur->left_fringe_face_id = left_face_id;
cur->right_fringe_face_id = right_face_id;
+ cur->left_fringe_offset = left_offset;
+ cur->right_fringe_offset = right_offset;
}
}
@@ -1144,9 +1296,8 @@ update_window_fringes (struct window *w, int keep_current_p)
row->right_fringe_bitmap = right;
row->left_fringe_face_id = left_face_id;
row->right_fringe_face_id = right_face_id;
-
- if (rn > 0 && row->redraw_fringe_bitmaps_p)
- row[-1].redraw_fringe_bitmaps_p = cur[-1].redraw_fringe_bitmaps_p = 1;
+ row->left_fringe_offset = left_offset;
+ row->right_fringe_offset = right_offset;
}
return redraw_p && !keep_current_p;
diff --git a/src/image.c b/src/image.c
index 064278eebbc..6e75921414b 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1053,6 +1053,10 @@ free_image (struct frame *f, struct image *img)
/* Free resources, then free IMG. */
img->type->free (f, img);
xfree (img);
+
+ /* As display glyphs may still be referring to the image ID, we
+ must garbage the frame (Bug#6426). */
+ SET_FRAME_GARBAGED (f);
}
}
diff --git a/src/keyboard.c b/src/keyboard.c
index 6ea0b90b9b4..cddf04788a6 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -42,7 +42,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "puresize.h"
#include "systime.h"
#include "atimer.h"
-#include <setjmp.h>
#include <errno.h>
#ifdef HAVE_GTK_AND_PTHREAD
@@ -9000,48 +8999,48 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
int dont_downcase_last, int can_return_switch_frame,
int fix_current_buffer)
{
- volatile Lisp_Object from_string;
- volatile int count = SPECPDL_INDEX ();
+ Lisp_Object from_string;
+ int count = SPECPDL_INDEX ();
/* How many keys there are in the current key sequence. */
- volatile int t;
+ int t;
/* The length of the echo buffer when we started reading, and
the length of this_command_keys when we started reading. */
- volatile int echo_start;
- volatile int keys_start;
+ int echo_start;
+ int keys_start;
/* The number of keymaps we're scanning right now, and the number of
keymaps we have allocated space for. */
- volatile int nmaps;
- volatile int nmaps_allocated = 0;
+ int nmaps;
+ int nmaps_allocated = 0;
/* defs[0..nmaps-1] are the definitions of KEYBUF[0..t-1] in
the current keymaps. */
- Lisp_Object *volatile defs = NULL;
+ Lisp_Object *defs = NULL;
/* submaps[0..nmaps-1] are the prefix definitions of KEYBUF[0..t-1]
in the current keymaps, or nil where it is not a prefix. */
- Lisp_Object *volatile submaps = NULL;
+ Lisp_Object *submaps = NULL;
/* The local map to start out with at start of key sequence. */
- volatile Lisp_Object orig_local_map;
+ Lisp_Object orig_local_map;
/* The map from the `keymap' property to start out with at start of
key sequence. */
- volatile Lisp_Object orig_keymap;
+ Lisp_Object orig_keymap;
/* 1 if we have already considered switching to the local-map property
of the place where a mouse click occurred. */
- volatile int localized_local_map = 0;
+ int localized_local_map = 0;
/* The index in submaps[] of the first keymap that has a binding for
this key sequence. In other words, the lowest i such that
submaps[i] is non-nil. */
- volatile int first_binding;
+ int first_binding;
/* Index of the first key that has no binding.
It is useless to try fkey.start larger than that. */
- volatile int first_unbound;
+ int first_unbound;
/* If t < mock_input, then KEYBUF[t] should be read as the next
input key.
@@ -9056,7 +9055,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
restart_sequence; the loop will read keys from keybuf up until
mock_input, thus rebuilding the state; and then it will resume
reading characters from the keyboard. */
- volatile int mock_input = 0;
+ int mock_input = 0;
/* If the sequence is unbound in submaps[], then
keybuf[fkey.start..fkey.end-1] is a prefix in Vfunction_key_map,
@@ -9066,28 +9065,28 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
should hold off until t reaches them. We do this when we've just
recognized a function key, to avoid searching for the function
key's again in Vfunction_key_map. */
- volatile keyremap fkey;
+ keyremap fkey;
/* Likewise, for key_translation_map and input-decode-map. */
- volatile keyremap keytran, indec;
+ keyremap keytran, indec;
/* Non-zero if we are trying to map a key by changing an upper-case
letter to lower case, or a shifted function key to an unshifted
one. */
- volatile int shift_translated = 0;
+ int shift_translated = 0;
/* If we receive a `switch-frame' or `select-window' event in the middle of
a key sequence, we put it off for later.
While we're reading, we keep the event here. */
- volatile Lisp_Object delayed_switch_frame;
+ Lisp_Object delayed_switch_frame;
/* See the comment below... */
#if defined (GOBBLE_FIRST_EVENT)
Lisp_Object first_event;
#endif
- volatile Lisp_Object original_uppercase;
- volatile int original_uppercase_position = -1;
+ Lisp_Object original_uppercase;
+ int original_uppercase_position = -1;
/* Gets around Microsoft compiler limitations. */
int dummyflag = 0;
@@ -9095,7 +9094,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
struct buffer *starting_buffer;
/* List of events for which a fake prefix key has been generated. */
- volatile Lisp_Object fake_prefixed_keys = Qnil;
+ Lisp_Object fake_prefixed_keys = Qnil;
#if defined (GOBBLE_FIRST_EVENT)
int junk;
@@ -9252,13 +9251,13 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
(say, a mouse click on the mode line which is being treated
as [mode-line (mouse-...)], then we backtrack to this point
of keybuf. */
- volatile int last_real_key_start;
+ int last_real_key_start;
/* These variables are analogous to echo_start and keys_start;
while those allow us to restart the entire key sequence,
echo_local_start and keys_local_start allow us to throw away
just one key. */
- volatile int echo_local_start, keys_local_start, local_first_binding;
+ int echo_local_start, keys_local_start, local_first_binding;
eassert (indec.end == t || (indec.end > t && indec.end <= mock_input));
eassert (indec.start <= indec.end);
diff --git a/src/keymap.c b/src/keymap.c
index 1245caf3b9b..40005a51008 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1126,11 +1126,13 @@ DEFUN ("define-key", Fdefine_key, Sdefine_key, 3, 3, 0,
doc: /* In KEYMAP, define key sequence KEY as DEF.
KEYMAP is a keymap.
-KEY is a string or a vector of symbols and characters meaning a
+KEY is a string or a vector of symbols and characters, representing a
sequence of keystrokes and events. Non-ASCII characters with codes
-above 127 (such as ISO Latin-1) can be included if you use a vector.
-Using [t] for KEY creates a default definition, which applies to any
-event type that has no other definition in this keymap.
+above 127 (such as ISO Latin-1) can be represented by vectors.
+Two types of vector have special meanings:
+ [remap COMMAND] remaps any key binding for COMMAND.
+ [t] creates a default definition, which applies to any event with no
+ other definition in KEYMAP.
DEF is anything that can be a key's definition:
nil (means key is undefined in this keymap),
diff --git a/src/lread.c b/src/lread.c
index 42925f8ac09..c8c464875bf 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2316,28 +2316,28 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
/* This is repetitive but fast and simple. */
params[param_count] = QCsize;
params[param_count+1] = Fplist_get (tmp, Qsize);
- if (!NILP (params[param_count+1]))
- param_count+=2;
+ if (!NILP (params[param_count + 1]))
+ param_count += 2;
params[param_count] = QCtest;
params[param_count+1] = Fplist_get (tmp, Qtest);
- if (!NILP (params[param_count+1]))
- param_count+=2;
+ if (!NILP (params[param_count + 1]))
+ param_count += 2;
params[param_count] = QCweakness;
params[param_count+1] = Fplist_get (tmp, Qweakness);
- if (!NILP (params[param_count+1]))
- param_count+=2;
+ if (!NILP (params[param_count + 1]))
+ param_count += 2;
params[param_count] = QCrehash_size;
params[param_count+1] = Fplist_get (tmp, Qrehash_size);
- if (!NILP (params[param_count+1]))
- param_count+=2;
+ if (!NILP (params[param_count + 1]))
+ param_count += 2;
params[param_count] = QCrehash_threshold;
params[param_count+1] = Fplist_get (tmp, Qrehash_threshold);
- if (!NILP (params[param_count+1]))
- param_count+=2;
+ if (!NILP (params[param_count + 1]))
+ param_count += 2;
/* This is the hashtable data. */
data = Fplist_get (tmp, Qdata);
@@ -2358,6 +2358,8 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
return ht;
}
+ UNREAD (c);
+ invalid_syntax ("#", 1);
}
if (c == '^')
{
diff --git a/src/nsterm.m b/src/nsterm.m
index 62f1c0bcd57..58245f4aebf 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -2177,20 +2177,7 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
/* Must clip because of partially visible lines. */
rowY = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
- if (p->y < rowY)
- {
- /* Adjust position of "bottom aligned" bitmap on partially
- visible last row. */
- int oldY = row->y;
- int oldVH = row->visible_height;
- row->visible_height = p->h;
- row->y -= rowY - p->y;
- ns_clip_to_row (w, row, -1, NO);
- row->y = oldY;
- row->visible_height = oldVH;
- }
- else
- ns_clip_to_row (w, row, -1, YES);
+ ns_clip_to_row (w, row, -1, YES);
if (p->bx >= 0 && !p->overlay_p)
{
diff --git a/src/w32fns.c b/src/w32fns.c
index 916aea28eea..c1791f2bf3e 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -288,10 +288,15 @@ unsigned int msh_mousewheel = 0;
#define MENU_FREE_DELAY 1000
static unsigned menu_free_timer = 0;
+/* In dispnew.c */
+
+extern Lisp_Object Vwindow_system_version;
+
/* The below are defined in frame.c. */
extern Lisp_Object Vmenu_bar_mode, Vtool_bar_mode;
extern Lisp_Object Vwindow_system_version;
+extern Lisp_Object Qtooltip;
#ifdef GLYPH_DEBUG
int image_cache_refcount, dpyinfo_refcount;
@@ -5476,9 +5481,8 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
change_frame_size (f, height, width, 1, 0, 0);
/* Add `tooltip' frame parameter's default value. */
- if (NILP (Fframe_parameter (frame, intern ("tooltip"))))
- Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt),
- Qnil));
+ if (NILP (Fframe_parameter (frame, Qtooltip)))
+ Fmodify_frame_parameters (frame, Fcons (Fcons (Qtooltip, Qt), Qnil));
/* Set up faces after all frame parameters are known. This call
also merges in face attributes specified for new frames.
diff --git a/src/w32term.c b/src/w32term.c
index 7ace4b01f95..9db533eb5e9 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -737,7 +737,6 @@ w32_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
struct frame *f = XFRAME (WINDOW_FRAME (w));
HDC hdc;
struct face *face = p->face;
- int rowY;
hdc = get_frame_dc (f);
@@ -796,21 +795,7 @@ w32_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
}
/* Must clip because of partially visible lines. */
- rowY = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
- if (p->y < rowY)
- {
- /* Adjust position of "bottom aligned" bitmap on partially
- visible last row. */
- int oldY = row->y;
- int oldVH = row->visible_height;
- row->visible_height = p->h;
- row->y -= rowY - p->y;
- w32_clip_to_row (w, row, -1, hdc);
- row->y = oldY;
- row->visible_height = oldVH;
- }
- else
- w32_clip_to_row (w, row, -1, hdc);
+ w32_clip_to_row (w, row, -1, hdc);
if (p->which && p->which < max_fringe_bmp)
{
diff --git a/src/xdisp.c b/src/xdisp.c
index d145e7bd9f6..b6bd231bb67 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -6625,6 +6625,7 @@ static int
next_element_from_image (struct it *it)
{
it->what = IT_IMAGE;
+ it->ignore_overlay_strings_at_pos_p = 0;
return 1;
}
diff --git a/src/xfaces.c b/src/xfaces.c
index 520546c42b1..6848e7f95dc 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -5605,6 +5605,7 @@ realize_face (struct face_cache *cache, Lisp_Object *attrs, int former_face_id)
struct face *former_face = cache->faces_by_id[former_face_id];
uncache_face (cache, former_face);
free_realized_face (cache->f, former_face);
+ SET_FRAME_GARBAGED (cache->f);
}
if (FRAME_WINDOW_P (cache->f))
diff --git a/src/xfns.c b/src/xfns.c
index 1dfaa381b3e..988725ead00 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -205,6 +205,7 @@ extern Lisp_Object Vsystem_name;
/* The below are defined in frame.c. */
extern Lisp_Object Vmenu_bar_mode, Vtool_bar_mode;
+extern Lisp_Object Qtooltip;
#if GLYPH_DEBUG
int image_cache_refcount, dpyinfo_refcount;
@@ -4847,9 +4848,8 @@ x_create_tip_frame (struct x_display_info *dpyinfo, Lisp_Object parms, Lisp_Obje
change_frame_size (f, height, width, 1, 0, 0);
/* Add `tooltip' frame parameter's default value. */
- if (NILP (Fframe_parameter (frame, intern ("tooltip"))))
- Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt),
- Qnil));
+ if (NILP (Fframe_parameter (frame, Qtooltip)))
+ Fmodify_frame_parameters (frame, Fcons (Fcons (Qtooltip, Qt), Qnil));
/* FIXME - can this be done in a similar way to normal frames?
http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00641.html */
diff --git a/src/xmenu.c b/src/xmenu.c
index 8d79aed3744..93a40792aec 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -676,6 +676,14 @@ x_activate_menubar (FRAME_PTR f)
set_frame_menubar (f, 0, 1);
BLOCK_INPUT;
#ifdef USE_GTK
+ /* If we click outside any menu item, the menu bar still grabs.
+ So we send Press and the Release. If outside, grab is released.
+ If on a menu item, it is popped up normally.
+ PutBack is like a stack, so we put back in reverse order. */
+ f->output_data.x->saved_menu_event->type = ButtonRelease;
+ XPutBackEvent (f->output_data.x->display_info->display,
+ f->output_data.x->saved_menu_event);
+ f->output_data.x->saved_menu_event->type = ButtonPress;
XPutBackEvent (f->output_data.x->display_info->display,
f->output_data.x->saved_menu_event);
popup_activated_flag = 1;
diff --git a/src/xterm.c b/src/xterm.c
index d1bf9eaa5ea..3ec0636fc60 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -753,24 +753,9 @@ x_draw_fringe_bitmap (struct window *w, struct glyph_row *row, struct draw_fring
Window window = FRAME_X_WINDOW (f);
GC gc = f->output_data.x->normal_gc;
struct face *face = p->face;
- int rowY;
/* Must clip because of partially visible lines. */
- rowY = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
- if (p->y < rowY)
- {
- /* Adjust position of "bottom aligned" bitmap on partially
- visible last row. */
- int oldY = row->y;
- int oldVH = row->visible_height;
- row->visible_height = p->h;
- row->y -= rowY - p->y;
- x_clip_to_row (w, row, -1, gc);
- row->y = oldY;
- row->visible_height = oldVH;
- }
- else
- x_clip_to_row (w, row, -1, gc);
+ x_clip_to_row (w, row, -1, gc);
if (!p->overlay_p)
{