aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2004-02-18 17:10:32 +0000
committerKaroly Lorentey2004-02-18 17:10:32 +0000
commitac3d262560b0182146962f183d32725602d82f3c (patch)
tree735abbd9cd9e245ed6ce33240d260ccfc2e5e5f2 /src
parente581a4668750ed98d77f13500c983439770ec600 (diff)
parent58ec79cfdf24cf6fa662768a42931ca042c54f85 (diff)
downloademacs-ac3d262560b0182146962f183d32725602d82f3c.tar.gz
emacs-ac3d262560b0182146962f183d32725602d82f3c.zip
Merged in changes from CVS HEAD
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-98 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-99 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-100 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-101 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-102 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-78
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog35
-rw-r--r--src/Makefile.in10
-rw-r--r--src/cmds.c2
-rw-r--r--src/keyboard.c62
-rw-r--r--src/xdisp.c9
5 files changed, 87 insertions, 31 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 179b7a16a48..020e02cafcf 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,38 @@
12004-02-17 Kim F. Storm <storm@cua.dk>
2
3 * xdisp.c (fast_find_position): Fix return value of new version;
4 it was inverted compared to the 21.1 version.
5 (get_window_cursor_type): Don't look at glyph if NULL.
6 (display_and_set_cursor): Set glyph to NULL if cursor in fringe.
7
8 * keyboard.c: Rework previous change; it didn't consider that the
9 buf array was allocated on the stack.
10 (prev_read): Remove variable.
11 (read_avail_input_buf): New static event buffer array.
12 (in_read_avail_input): New static variable to handle re-entrancy.
13 (read_avail_input): Change buf to pinter to read_avail_input_buf.
14 Use in_read_avail_input to handle re-entrance; when re-entered,
15 fully initialize and use tmp_buf array instead of read_avail_input_buf.
16 Do not initialize read_avail_input_buf in full here; instead assume it
17 is always cleared on entry. To ensure that, we clear (just) the
18 entries that were used before we return.
19 (init_keyboard): Initialize read_avail_input_buf here.
20
212004-02-16 Jesper Harder <harder@ifa.au.dk> (tiny change)
22
23 * cmds.c (Fend_of_line): Doc fix.
24
252004-02-16 Dmitry Antipov <dmitry.antipov@mail.ru> (tiny change)
26
27 * keyboard.c (prev_read): New static variable.
28 (read_avail_input): Use it to zero out only those slots in buf[]
29 that were used last time we were called.
30
312004-02-16 Eli Zaretskii <eliz@elta.co.il>
32
33 * Makefile.in (obj): Move fringe.o from here...
34 (XOBJ, MAC_OBJ): ...to here.
35
12004-02-16 Stephen Eglen <stephen@gnu.org> 362004-02-16 Stephen Eglen <stephen@gnu.org>
2 37
3 * fringe.c (init_fringe_bitmap): Define j in MAC_OS code. 38 * fringe.c (init_fringe_bitmap): Define j in MAC_OS code.
diff --git a/src/Makefile.in b/src/Makefile.in
index ac9cae31061..9f4dcd2b26f 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -310,9 +310,9 @@ ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(TOOLKIT_DEFINES) $(MYCPPFLAGS) -I. -I${srcd
310/* Include xmenu.o in the list of X object files. */ 310/* Include xmenu.o in the list of X object files. */
311 311
312#ifdef USE_GTK 312#ifdef USE_GTK
313XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o gtkutil.o 313XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o gtkutil.o fringe.o
314#else 314#else
315XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o 315XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o
316#endif 316#endif
317 317
318/* The X Menu stuff is present in the X10 distribution, but missing 318/* The X Menu stuff is present in the X10 distribution, but missing
@@ -334,7 +334,7 @@ LIBXMENU= -lXMenu
334 334
335/* Otherwise, omit xmenu.o from the list of X object files, and 335/* Otherwise, omit xmenu.o from the list of X object files, and
336 don't worry about the menu library at all. */ 336 don't worry about the menu library at all. */
337XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o 337XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o
338LIBXMENU= 338LIBXMENU=
339#endif /* not HAVE_MENUS */ 339#endif /* not HAVE_MENUS */
340 340
@@ -562,7 +562,7 @@ MSDOS_OBJ = dosfns.o msdos.o w16select.o
562#ifdef HAVE_CARBON 562#ifdef HAVE_CARBON
563mac = $(dot)$(dot)/mac/ 563mac = $(dot)$(dot)/mac/
564XMENU_OBJ = 564XMENU_OBJ =
565MAC_OBJ = mac.o macterm.o macfns.o macmenu.o fontset.o 565MAC_OBJ = mac.o macterm.o macfns.o macmenu.o fontset.o fringe.o
566emacsapp = $(PWD)/$(mac)Emacs.app/ 566emacsapp = $(PWD)/$(mac)Emacs.app/
567emacsappsrc = ${srcdir}/../mac/Emacs.app/ 567emacsappsrc = ${srcdir}/../mac/Emacs.app/
568#else 568#else
@@ -571,7 +571,7 @@ XMENU_OBJ = xmenu.o
571 571
572/* lastfile must follow all files 572/* lastfile must follow all files
573 whose initialized data areas should be dumped as pure by dump-emacs. */ 573 whose initialized data areas should be dumped as pure by dump-emacs. */
574obj= dispnew.o frame.o scroll.o xdisp.o fringe.o $(XMENU_OBJ) window.o \ 574obj= dispnew.o frame.o scroll.o xdisp.o $(XMENU_OBJ) window.o \
575 charset.o coding.o category.o ccl.o \ 575 charset.o coding.o category.o ccl.o \
576 cm.o term.o xfaces.o $(XOBJ) \ 576 cm.o term.o xfaces.o $(XOBJ) \
577 emacs.o keyboard.o macros.o keymap.o sysdep.o \ 577 emacs.o keyboard.o macros.o keymap.o sysdep.o \
diff --git a/src/cmds.c b/src/cmds.c
index 02e9e723881..b989bab46ee 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -181,7 +181,7 @@ DEFUN ("end-of-line", Fend_of_line, Send_of_line, 0, 1, "p",
181 doc: /* Move point to end of current line. 181 doc: /* Move point to end of current line.
182With argument N not nil or 1, move forward N - 1 lines first. 182With argument N not nil or 1, move forward N - 1 lines first.
183If point reaches the beginning or end of buffer, it stops there. 183If point reaches the beginning or end of buffer, it stops there.
184To ignore intangibility, bind `inhibit-text-motion-hooks' to t. 184To ignore intangibility, bind `inhibit-point-motion-hooks' to t.
185 185
186This command does not move point across a field boundary unless doing so 186This command does not move point across a field boundary unless doing so
187would move beyond there to a different line; if N is nil or 1, and 187would move beyond there to a different line; if N is nil or 1, and
diff --git a/src/keyboard.c b/src/keyboard.c
index 8223049d79d..26b1bfa89e1 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -6560,6 +6560,14 @@ record_asynch_buffer_change ()
6560 6560
6561#ifndef VMS 6561#ifndef VMS
6562 6562
6563/* We make the read_avail_input buffer static to avoid zeroing out the
6564 whole struct input_event buf on every call. */
6565static struct input_event read_avail_input_buf[KBD_BUFFER_SIZE];
6566
6567/* I don't know whether it is necessary, but make read_avail_input
6568 re-entrant. */
6569static int in_read_avail_input = 0;
6570
6563/* Read any terminal input already buffered up by the system 6571/* Read any terminal input already buffered up by the system
6564 into the kbd_buffer, but do not wait. 6572 into the kbd_buffer, but do not wait.
6565 6573
@@ -6576,14 +6584,21 @@ static int
6576read_avail_input (expected) 6584read_avail_input (expected)
6577 int expected; 6585 int expected;
6578{ 6586{
6579 struct input_event buf[KBD_BUFFER_SIZE]; 6587 struct input_event *buf = read_avail_input_buf;
6588 struct input_event tmp_buf[KBD_BUFFER_SIZE];
6580 register int i; 6589 register int i;
6581 struct display *d;
6582 int nread = 0; 6590 int nread = 0;
6591 struct display *d;
6583 6592
6584 for (i = 0; i < KBD_BUFFER_SIZE; i++) 6593 /* Trivial hack to make read_avail_input re-entrant. */
6585 EVENT_INIT (buf[i]); 6594 if (in_read_avail_input++)
6595 {
6596 buf = tmp_buf;
6597 for (i = 0; i < KBD_BUFFER_SIZE; i++)
6598 EVENT_INIT (buf[i]);
6599 }
6586 6600
6601 /* Loop through the available displays, and call their input hooks. */
6587 d = display_list; 6602 d = display_list;
6588 while (d) 6603 while (d)
6589 { 6604 {
@@ -6593,7 +6608,7 @@ read_avail_input (expected)
6593 /* No need for FIONREAD or fcntl; just say don't wait. */ 6608 /* No need for FIONREAD or fcntl; just say don't wait. */
6594 nread = (*d->read_socket_hook) (d, buf, KBD_BUFFER_SIZE, expected); 6609 nread = (*d->read_socket_hook) (d, buf, KBD_BUFFER_SIZE, expected);
6595 6610
6596 if (nread == -2) 6611 if (nread == -2) /* -2 means non-transient error */
6597 { 6612 {
6598 /* The display device terminated; it should be closed. */ 6613 /* The display device terminated; it should be closed. */
6599 6614
@@ -6627,6 +6642,11 @@ read_avail_input (expected)
6627 break; 6642 break;
6628 } 6643 }
6629 6644
6645 /* Clear used events */
6646 if (--in_read_avail_input == 0)
6647 for (i = 0; i < nread; i++)
6648 EVENT_INIT (buf[i]);
6649
6630 return nread; 6650 return nread;
6631} 6651}
6632 6652
@@ -6647,13 +6667,12 @@ tty_read_avail_input (struct display *display,
6647 unsigned char cbuf[KBD_BUFFER_SIZE - 1]; 6667 unsigned char cbuf[KBD_BUFFER_SIZE - 1];
6648 int n_to_read, i; 6668 int n_to_read, i;
6649 struct tty_display_info *tty = display->display_info.tty; 6669 struct tty_display_info *tty = display->display_info.tty;
6650 Lisp_Object frame;
6651 int nread = 0; 6670 int nread = 0;
6652 6671
6653 if (display->type != output_termcap) 6672 if (display->type != output_termcap)
6654 abort (); 6673 abort ();
6655 6674
6656 /* XXX I think the following code should be moved to separate 6675 /* XXX I think the following code should be moved to separate hook
6657 functions in system-dependent files. */ 6676 functions in system-dependent files. */
6658#ifdef WINDOWSNT 6677#ifdef WINDOWSNT
6659 return 0; 6678 return 0;
@@ -6668,7 +6687,7 @@ tty_read_avail_input (struct display *display,
6668 6687
6669#else /* not MSDOS */ 6688#else /* not MSDOS */
6670 6689
6671 if (! tty->term_initted) 6690 if (! tty->term_initted) /* In case we get called during bootstrap. */
6672 return 0; 6691 return 0;
6673 6692
6674 /* Determine how many characters we should *try* to read. */ 6693 /* Determine how many characters we should *try* to read. */
@@ -6704,20 +6723,16 @@ tty_read_avail_input (struct display *display,
6704 process group won't get SIGHUP's at logout time. BSDI adheres to 6723 process group won't get SIGHUP's at logout time. BSDI adheres to
6705 this part standard and returns -1 from read (0) with errno==EIO 6724 this part standard and returns -1 from read (0) with errno==EIO
6706 when the control tty is taken away. 6725 when the control tty is taken away.
6707 Jeffrey Honig <jch@bsdi.com> says this is generally safe. */ 6726 Jeffrey Honig <jch@bsdi.com> says this is generally safe. */
6708 if (nread == -1 && errno == EIO) 6727 if (nread == -1 && errno == EIO)
6709 { 6728 return -2; /* Close this display. */
6710 return -2; /* Close this display. */
6711 }
6712#if defined (AIX) && (! defined (aix386) && defined (_BSD)) 6729#if defined (AIX) && (! defined (aix386) && defined (_BSD))
6713 /* The kernel sometimes fails to deliver SIGHUP for ptys. 6730 /* The kernel sometimes fails to deliver SIGHUP for ptys.
6714 This looks incorrect, but it isn't, because _BSD causes 6731 This looks incorrect, but it isn't, because _BSD causes
6715 O_NDELAY to be defined in fcntl.h as O_NONBLOCK, 6732 O_NDELAY to be defined in fcntl.h as O_NONBLOCK,
6716 and that causes a value other than 0 when there is no input. */ 6733 and that causes a value other than 0 when there is no input. */
6717 if (nread == 0) 6734 if (nread == 0)
6718 { 6735 return -2; /* Close this display. */
6719 return -2; /* Close this display. */
6720 }
6721#endif 6736#endif
6722 } 6737 }
6723 while ( 6738 while (
@@ -6751,11 +6766,6 @@ tty_read_avail_input (struct display *display,
6751#endif /* not MSDOS */ 6766#endif /* not MSDOS */
6752#endif /* not WINDOWSNT */ 6767#endif /* not WINDOWSNT */
6753 6768
6754 /* Select the frame corresponding to the active tty. Note that the
6755 value of selected_frame is not reliable here, redisplay tends to
6756 temporarily change it. */
6757 frame = tty->top_frame;
6758
6759 for (i = 0; i < nread; i++) 6769 for (i = 0; i < nread; i++)
6760 { 6770 {
6761 buf[i].kind = ASCII_KEYSTROKE_EVENT; 6771 buf[i].kind = ASCII_KEYSTROKE_EVENT;
@@ -6766,7 +6776,10 @@ tty_read_avail_input (struct display *display,
6766 cbuf[i] &= ~0x80; 6776 cbuf[i] &= ~0x80;
6767 6777
6768 buf[i].code = cbuf[i]; 6778 buf[i].code = cbuf[i];
6769 buf[i].frame_or_window = frame; 6779 /* Set the frame corresponding to the active tty. Note that the
6780 value of selected_frame is not reliable here, redisplay tends
6781 to temporarily change it. */
6782 buf[i].frame_or_window = tty->top_frame;
6770 buf[i].arg = Qnil; 6783 buf[i].arg = Qnil;
6771 } 6784 }
6772 6785
@@ -10658,6 +10671,13 @@ init_keyboard ()
10658 do_mouse_tracking = Qnil; 10671 do_mouse_tracking = Qnil;
10659#endif 10672#endif
10660 input_pending = 0; 10673 input_pending = 0;
10674#ifndef VMS
10675 {
10676 int i;
10677 for (i = 0; i < KBD_BUFFER_SIZE; i++)
10678 EVENT_INIT (read_avail_input_buf[i]);
10679 }
10680#endif
10661 10681
10662 /* This means that command_loop_1 won't try to select anything the first 10682 /* This means that command_loop_1 won't try to select anything the first
10663 time through. */ 10683 time through. */
diff --git a/src/xdisp.c b/src/xdisp.c
index edd7cc62e61..96d51b27480 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -19028,7 +19028,7 @@ get_window_cursor_type (w, glyph, width, active_cursor)
19028 cursor_type = get_specified_cursor_type (b->cursor_type, width); 19028 cursor_type = get_specified_cursor_type (b->cursor_type, width);
19029 19029
19030 /* Use normal cursor if not blinked off. */ 19030 /* Use normal cursor if not blinked off. */
19031 if (!w->cursor_off_p) 19031 if (!w->cursor_off_p && glyph != NULL)
19032 { 19032 {
19033 if (glyph->type == IMAGE_GLYPH) { 19033 if (glyph->type == IMAGE_GLYPH) {
19034 if (cursor_type == FILLED_BOX_CURSOR) 19034 if (cursor_type == FILLED_BOX_CURSOR)
@@ -19367,7 +19367,8 @@ display_and_set_cursor (w, on, hpos, vpos, x, y)
19367 19367
19368 current_glyphs = w->current_matrix; 19368 current_glyphs = w->current_matrix;
19369 glyph_row = MATRIX_ROW (current_glyphs, vpos); 19369 glyph_row = MATRIX_ROW (current_glyphs, vpos);
19370 glyph = glyph_row->glyphs[TEXT_AREA] + hpos; 19370 glyph = (glyph_row->cursor_in_fringe_p ? NULL
19371 : glyph_row->glyphs[TEXT_AREA] + hpos);
19371 19372
19372 /* If cursor row is not enabled, we don't really know where to 19373 /* If cursor row is not enabled, we don't really know where to
19373 display the cursor. */ 19374 display the cursor. */
@@ -19655,7 +19656,7 @@ fast_find_position (w, charpos, hpos, vpos, x, y, stop)
19655 if (charpos < MATRIX_ROW_START_CHARPOS (first)) 19656 if (charpos < MATRIX_ROW_START_CHARPOS (first))
19656 { 19657 {
19657 *x = *y = *hpos = *vpos = 0; 19658 *x = *y = *hpos = *vpos = 0;
19658 return 0; 19659 return 1;
19659 } 19660 }
19660 else 19661 else
19661 { 19662 {
@@ -19695,7 +19696,7 @@ fast_find_position (w, charpos, hpos, vpos, x, y, stop)
19695 } 19696 }
19696 19697
19697 *hpos = glyph - row->glyphs[TEXT_AREA]; 19698 *hpos = glyph - row->glyphs[TEXT_AREA];
19698 return past_end; 19699 return !past_end;
19699} 19700}
19700 19701
19701#else /* not 1 */ 19702#else /* not 1 */