summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog22
-rw-r--r--src/ccl.c2
-rw-r--r--src/data.c2
-rw-r--r--src/fns.c2
-rw-r--r--src/frame.c7
-rw-r--r--src/image.c2
-rw-r--r--src/macterm.c4
-rw-r--r--src/msdos.c4
-rw-r--r--src/sysdep.c2
-rw-r--r--src/term.c65
-rw-r--r--src/termhooks.h1
-rw-r--r--src/window.c2
-rw-r--r--src/xdisp.c10
-rw-r--r--src/xfaces.c2
14 files changed, 86 insertions, 41 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f83f6bafd03..1ffb57b761a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,8 +1,30 @@
+2007-05-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * xdisp.c (redisplay_internal): Bind inhibit-point-motion-hooks to t
+ around current_column call.
+
+2007-05-26 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * xfaces.c (syms_of_xfaces): Delete stray semicolon.
+ * xdisp.c (next_element_from_buffer):
+ * window.c (delete_window):
+ * term.c (term_mouse_highlight):
+ * msdos.c (getdefdir):
+ * macterm.c (mac_create_bitmap_from_bitmap_data)
+ (init_font_name_table):
+ * fns.c (Fsxhash):
+ * data.c (Fmake_local_variable):
+ * ccl.c (ccl_driver): Likewise.
+
2007-05-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* macterm.c [USE_CARBON_EVENTS] (mac_handle_window_event):
Call mac_wakeup_from_rne on window size change.
+2007-05-25 Chong Yidong <cyd@stupidchicken.com>
+
+ * image.c (uncache_image): Fix typo.
+
2007-05-23 Johannes Weiner <hannes@saeurebad.de> (tiny change)
* keyboard.c (make_lispy_movement): Condition on HAVE_GPM too.
diff --git a/src/ccl.c b/src/ccl.c
index ded74fb6296..ee0250f6c2c 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -1261,7 +1261,7 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
case CCL_MOD: reg[rrr] = i % j; break;
case CCL_AND: reg[rrr] = i & j; break;
case CCL_OR: reg[rrr] = i | j; break;
- case CCL_XOR: reg[rrr] = i ^ j;; break;
+ case CCL_XOR: reg[rrr] = i ^ j; break;
case CCL_LSH: reg[rrr] = i << j; break;
case CCL_RSH: reg[rrr] = i >> j; break;
case CCL_LSH8: reg[rrr] = (i << 8) | j; break;
diff --git a/src/data.c b/src/data.c
index 2f682450a16..b31900f9c0c 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1587,7 +1587,7 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */)
XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0;
XBUFFER_LOCAL_VALUE (newval)->check_frame = 0;
XBUFFER_LOCAL_VALUE (newval)->cdr = tem;
- SET_SYMBOL_VALUE (variable, newval);;
+ SET_SYMBOL_VALUE (variable, newval);
}
/* Make sure this buffer has its own value of symbol. */
tem = Fassq (variable, current_buffer->local_var_alist);
diff --git a/src/fns.c b/src/fns.c
index c75c4d68cf3..8adaa0d3ea6 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -5215,7 +5215,7 @@ DEFUN ("sxhash", Fsxhash, Ssxhash, 1, 1, 0,
(obj)
Lisp_Object obj;
{
- unsigned hash = sxhash (obj, 0);;
+ unsigned hash = sxhash (obj, 0);
return make_number (hash);
}
diff --git a/src/frame.c b/src/frame.c
index 5b8f9acaf0c..08379c7623c 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1795,6 +1795,13 @@ before calling this function on it, like this.
Fselect_frame (frame);
mouse_moveto (XINT (x), XINT (y));
}
+#else
+#ifdef HAVE_GPM
+ {
+ Fselect_frame (frame);
+ term_mouse_moveto (XINT (x), XINT (y));
+ }
+#endif
#endif
#endif
diff --git a/src/image.c b/src/image.c
index dbe200195d0..fbd2f4e6a51 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1639,7 +1639,7 @@ uncache_image (f, spec)
Lisp_Object spec;
{
struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
- struct image *img = IMAGE_FROM_ID (f, lookup_image (f, spec));
+ struct image *img;
unsigned hash = sxhash (spec, 0);
int i = hash % IMAGE_CACHE_BUCKETS_SIZE;
diff --git a/src/macterm.c b/src/macterm.c
index 871bf9cd6f9..1faf72485ce 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -736,7 +736,7 @@ mac_create_bitmap_from_bitmap_data (bitmap, bits, w, h)
/* Bitswap XBM bytes to match how Mac does things. */
unsigned char c = *bits++;
*p++ = (unsigned char)((swap_nibble[c & 0xf] << 4)
- | (swap_nibble[(c>>4) & 0xf]));;
+ | (swap_nibble[(c>>4) & 0xf]));
}
}
@@ -7553,7 +7553,7 @@ init_font_name_table ()
make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE),
make_float (DEFAULT_REHASH_SIZE),
make_float (DEFAULT_REHASH_THRESHOLD),
- Qnil, Qnil, Qnil);;
+ Qnil, Qnil, Qnil);
h = XHASH_TABLE (atsu_font_id_hash);
err = ATSUFontCount (&nfonts);
diff --git a/src/msdos.c b/src/msdos.c
index f9ce739fd5b..53c1d088e85 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1584,7 +1584,7 @@ IT_note_mouse_highlight (struct frame *f, int x, int y)
{
extern Lisp_Object Qmouse_face;
Lisp_Object mouse_face, overlay, position, *overlay_vec;
- int noverlays, obegv, ozv;;
+ int noverlays, obegv, ozv;
struct buffer *obuf;
/* If we get an out-of-range value, return now; avoid an error. */
@@ -4071,7 +4071,7 @@ getdefdir (drive, dst)
int drive;
char *dst;
{
- char in_path[4], *p = in_path, e = errno;;
+ char in_path[4], *p = in_path, e = errno;
/* Generate "X:." (when drive is X) or "." (when drive is 0). */
if (drive != 0)
diff --git a/src/sysdep.c b/src/sysdep.c
index 32efd7a056d..5d2d8154d14 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1751,7 +1751,7 @@ init_sys_modes (tty_out)
if (term_gpm)
{
fcntl (gpm_fd, F_SETOWN, getpid ());
- fcntl (gpm_fd, F_SETFL, O_NONBLOCK);
+ fcntl (gpm_fd, F_SETFL, fcntl (gpm_fd, F_GETFL, 0) | O_NONBLOCK);
init_sigio (gpm_fd);
}
#endif /* HAVE_GPM */
diff --git a/src/term.c b/src/term.c
index 1d8e885ade9..f6b9306dc6b 100644
--- a/src/term.c
+++ b/src/term.c
@@ -205,7 +205,7 @@ int gpm_tty;
static int mouse_face_beg_row, mouse_face_beg_col;
static int mouse_face_end_row, mouse_face_end_col;
static int mouse_face_past_end;
-static Lisp_Object mouse_face_window;
+static Lisp_Object Qmouse_face_window;
static int mouse_face_face_id;
/* FRAME and X, Y position of mouse when last checked for
@@ -2344,10 +2344,23 @@ the currently selected frame. */)
***********************************************************************/
#ifdef HAVE_GPM
+void term_mouse_moveto (int x, int y)
+{
+ const char *name;
+ int fd;
+ name = (const char *) ttyname (0);
+ fd = open (name, O_WRONLY);
+ /* TODO: how to set mouse position?
+ SOME_FUNCTION (x, y, fd); */
+ close (fd);
+ last_mouse_x = x;
+ last_mouse_y = y;
+}
+
static void
term_show_mouse_face (enum draw_glyphs_face draw)
{
- struct window *w = XWINDOW (mouse_face_window);
+ struct window *w = XWINDOW (Qmouse_face_window);
int save_x, save_y;
int i, j;
@@ -2426,12 +2439,12 @@ term_show_mouse_face (enum draw_glyphs_face draw)
static void
term_clear_mouse_face ()
{
- if (!NILP (mouse_face_window))
+ if (!NILP (Qmouse_face_window))
term_show_mouse_face (DRAW_NORMAL_TEXT);
mouse_face_beg_row = mouse_face_beg_col = -1;
mouse_face_end_row = mouse_face_end_col = -1;
- mouse_face_window = Qnil;
+ Qmouse_face_window = Qnil;
}
/* Find the glyph matrix position of buffer position POS in window W.
@@ -2532,7 +2545,7 @@ term_mouse_highlight (struct frame *f, int x, int y)
if (!WINDOWP (window))
return;
- if (!EQ (window, mouse_face_window))
+ if (!EQ (window, Qmouse_face_window))
term_clear_mouse_face ();
w = XWINDOW (window);
@@ -2590,7 +2603,7 @@ term_mouse_highlight (struct frame *f, int x, int y)
{
extern Lisp_Object Qmouse_face;
Lisp_Object mouse_face, overlay, position, *overlay_vec;
- int noverlays, obegv, ozv;;
+ int noverlays, obegv, ozv;
struct buffer *obuf;
/* If we get an out-of-range value, return now; avoid an error. */
@@ -2615,7 +2628,7 @@ term_mouse_highlight (struct frame *f, int x, int y)
noverlays = sort_overlays (overlay_vec, noverlays, w);
/* Check mouse-face highlighting. */
- if (!(EQ (window, mouse_face_window)
+ if (!(EQ (window, Qmouse_face_window)
&& y >= mouse_face_beg_row
&& y <= mouse_face_end_row
&& (y > mouse_face_beg_row
@@ -2665,7 +2678,7 @@ term_mouse_highlight (struct frame *f, int x, int y)
= !fast_find_position (w, XFASTINT (after),
&mouse_face_end_col,
&mouse_face_end_row);
- mouse_face_window = window;
+ Qmouse_face_window = window;
mouse_face_face_id
= face_at_buffer_position (w, pos, 0, 0,
@@ -2700,7 +2713,7 @@ term_mouse_highlight (struct frame *f, int x, int y)
= !fast_find_position (w, XFASTINT (after),
&mouse_face_end_col,
&mouse_face_end_row);
- mouse_face_window = window;
+ Qmouse_face_window = window;
mouse_face_face_id
= face_at_buffer_position (w, pos, 0, 0,
@@ -2787,33 +2800,31 @@ term_mouse_movement (FRAME_PTR frame, Gpm_Event *event)
Set *time to the time the mouse was at the returned position.
This should clear mouse_moved until the next motion
- event arrives.
-
- NOT CURRENTLY INVOKED: see mouse_position_hook below. */
+ event arrives. */
static void
term_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window,
enum scroll_bar_part *part, Lisp_Object *x,
Lisp_Object *y, unsigned long *time)
{
- Gpm_Event event;
struct timeval now;
- int i;
-
- BLOCK_INPUT;
+ Lisp_Object frame, window;
+ struct window *w;
*fp = SELECTED_FRAME ();
+ (*fp)->mouse_moved = 0;
*bar_window = Qnil;
*part = 0;
- i = Gpm_GetSnapshot (&event);
+ XSETINT (*x, last_mouse_x);
+ XSETINT (*y, last_mouse_y);
+ XSETFRAME (frame, *fp);
+ window = Fwindow_at (*x, *y, frame);
- XSETINT (*x, event.x);
- XSETINT (*y, event.y);
+ XSETINT (*x, last_mouse_x - WINDOW_LEFT_EDGE_COL (XWINDOW (window)));
+ XSETINT (*y, last_mouse_y - WINDOW_TOP_EDGE_LINE (XWINDOW (window)));
gettimeofday(&now, 0);
*time = (now.tv_sec * 1000) + (now.tv_usec / 1000);
-
- UNBLOCK_INPUT;
}
/* Prepare a mouse-event in *RESULT for placement in the input queue.
@@ -2912,7 +2923,7 @@ handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event, struct in
name = (const char *) ttyname (0);
fd = open (name, O_WRONLY);
ioctl (fd, TIOCLINUX, buf + sizeof (short) - 1);
- close(fd);
+ close (fd);
term_mouse_movement (f, event);
@@ -2927,7 +2938,6 @@ handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event, struct in
else {
f->mouse_moved = 0;
term_mouse_click (&ie, event, f);
- //kbd_buffer_store_event_hold (&ie, hold_quit);
}
done:
@@ -3259,11 +3269,8 @@ init_tty (char *name, char *terminal_type, int must_succeed)
encode_terminal_bufsize = 0;
#ifdef HAVE_GPM
- /* TODO: Can't get Gpm_Snapshot in term_mouse_position to work: test with
- (mouse-position). Also set-mouse-position won't work as is. */
- /* mouse_position_hook = term_mouse_position; */
-
- mouse_face_window = Qnil;
+ mouse_position_hook = term_mouse_position;
+ Qmouse_face_window = Qnil;
#endif
#ifdef WINDOWSNT
@@ -3899,6 +3906,8 @@ bigger, or it may make it blink, or it may do nothing at all. */);
#ifdef HAVE_GPM
defsubr (&Sterm_open_connection);
defsubr (&Sterm_close_connection);
+
+ staticpro (&Qmouse_face_window);
#endif /* HAVE_GPM */
}
diff --git a/src/termhooks.h b/src/termhooks.h
index 373d1e34987..1ca9234cac2 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -297,6 +297,7 @@ enum {
#ifdef HAVE_GPM
#include <gpm.h>
extern int handle_one_term_event (struct tty_display_info *, Gpm_Event *, struct input_event *);
+extern void term_mouse_moveto (int, int);
/* Nonzero means mouse is enabled on Linux console */
extern int term_gpm;
diff --git a/src/window.c b/src/window.c
index 154743e5b5d..90fdbf6c9b5 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1534,7 +1534,7 @@ delete_window (window)
if (!EQ (window, pwindow))
break;
/* Otherwise, try another window for SWINDOW. */
- swindow = Fnext_window (swindow, Qlambda, Qnil);;
+ swindow = Fnext_window (swindow, Qlambda, Qnil);
/* If we get back to the frame's selected window,
it means there was no acceptable alternative,
diff --git a/src/xdisp.c b/src/xdisp.c
index 8459be7abb7..268f1ec8b8c 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -6256,7 +6256,7 @@ next_element_from_buffer (it)
it->c = *p, it->len = 1;
/* Record what we have and where it came from. */
- it->what = IT_CHARACTER;;
+ it->what = IT_CHARACTER;
it->object = it->w->buffer;
it->position = it->current.pos;
@@ -10840,7 +10840,7 @@ redisplay_internal (preserve_echo_area)
int must_finish = 0;
struct text_pos tlbufpos, tlendpos;
int number_of_visible_frames;
- int count;
+ int count, count1;
struct frame *sf;
int polling_stopped_here = 0;
@@ -10978,6 +10978,10 @@ redisplay_internal (preserve_echo_area)
update_mode_lines++;
}
+ /* Avoid invocation of point motion hooks by `current_column' below. */
+ count1 = SPECPDL_INDEX ();
+ specbind (Qinhibit_point_motion_hooks, Qt);
+
/* If %c is in the mode line, update it if needed. */
if (!NILP (w->column_number_displayed)
/* This alternative quickly identifies a common case
@@ -10989,6 +10993,8 @@ redisplay_internal (preserve_echo_area)
!= (int) current_column ())) /* iftc */
w->update_mode_line = Qt;
+ unbind_to (count1, Qnil);
+
FRAME_SCROLL_BOTTOM_VPOS (XFRAME (w->frame)) = -1;
/* The variable buffer_shared is set in redisplay_window and
diff --git a/src/xfaces.c b/src/xfaces.c
index ca55b82a9b2..86a40078919 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -8010,7 +8010,7 @@ syms_of_xfaces ()
staticpro (&QCforeground);
QCbackground = intern (":background");
staticpro (&QCbackground);
- QCstipple = intern (":stipple");;
+ QCstipple = intern (":stipple");
staticpro (&QCstipple);
QCwidth = intern (":width");
staticpro (&QCwidth);