summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog18
-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/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
13 files changed, 81 insertions, 40 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index bafb3991d2e..31b8f51bf18 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,21 @@
+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):
diff --git a/src/ccl.c b/src/ccl.c
index c13f7c863b1..96f6b413bc5 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -1222,7 +1222,7 @@ ccl_driver (ccl, source, destination, src_size, dst_size, charset_list)
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 af166329f81..32e5a6892aa 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1575,7 +1575,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 86d9407db9a..9460a7c87c2 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -4585,7 +4585,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 284b04494a8..4b26e087c85 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1549,6 +1549,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/macterm.c b/src/macterm.c
index f7b375c22da..64b4e094d14 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]));
}
}
@@ -7577,7 +7577,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 d40aafdcb34..151aec5561d 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 202cab4abd2..95ad90c2a1b 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1679,7 +1679,7 @@ init_sys_modes ()
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 b8e972043a4..f23963cc39c 100644
--- a/src/term.c
+++ b/src/term.c
@@ -427,7 +427,7 @@ int term_gpm = 0;
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
@@ -2494,10 +2494,23 @@ set_tty_color_mode (f, val)
***********************************************************************/
#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;
@@ -2573,12 +2586,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.
@@ -2679,7 +2692,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);
@@ -2737,7 +2750,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. */
@@ -2762,7 +2775,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
@@ -2812,7 +2825,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,
@@ -2847,7 +2860,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,
@@ -2934,33 +2947,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.
@@ -3059,7 +3070,7 @@ handle_one_term_event (Gpm_Event *event, struct input_event* hold_quit)
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);
@@ -3074,7 +3085,6 @@ handle_one_term_event (Gpm_Event *event, struct input_event* hold_quit)
else {
f->mouse_moved = 0;
term_mouse_click (&ie, event, f);
- //kbd_buffer_store_event_hold (&ie, hold_quit);
}
done:
@@ -3159,11 +3169,8 @@ term_init (terminal_type)
encode_terminal_dst_size = 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
@@ -3616,6 +3623,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 */
fullscreen_hook = NULL;
diff --git a/src/termhooks.h b/src/termhooks.h
index 1e9968530e8..ee6e707e6b5 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -453,6 +453,7 @@ enum {
#ifdef HAVE_GPM
#include <gpm.h>
extern int handle_one_term_event (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 3fb558d637a..f417c7458d4 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1532,7 +1532,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 48e894afcec..1cc8cf10611 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -6417,7 +6417,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;
@@ -10996,7 +10996,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;
@@ -11134,6 +11134,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
@@ -11145,6 +11149,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 660fa34d5cf..1b314a6fa13 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -8477,7 +8477,7 @@ syms_of_xfaces ()
staticpro (&QCforeground);
QCbackground = intern (":background");
staticpro (&QCbackground);
- QCstipple = intern (":stipple");;
+ QCstipple = intern (":stipple");
staticpro (&QCstipple);
QCwidth = intern (":width");
staticpro (&QCwidth);