aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2012-11-27 22:03:42 +0900
committerKenichi Handa2012-11-27 22:03:42 +0900
commit45d0fdd8f0a7e4679931a9703fd0bb715552288b (patch)
tree2bef73a476ad16ccf423616795ad71884944f6c0 /src
parent2aaec2d9be5cec44ea3b59cba476fd3e091f2fc9 (diff)
parent026822f9666e1ff2830a561c7f26c50099d2a6ff (diff)
downloademacs-45d0fdd8f0a7e4679931a9703fd0bb715552288b.tar.gz
emacs-45d0fdd8f0a7e4679931a9703fd0bb715552288b.zip
merge trunk
Diffstat (limited to 'src')
-rw-r--r--src/.gdbinit3
-rw-r--r--src/ChangeLog68
-rw-r--r--src/dired.c46
-rw-r--r--src/fileio.c4
-rw-r--r--src/fontset.c2
-rw-r--r--src/frame.c8
-rw-r--r--src/frame.h3
-rw-r--r--src/gmalloc.c8
-rw-r--r--src/gnutls.c14
-rw-r--r--src/indent.c8
-rw-r--r--src/keyboard.c37
-rw-r--r--src/lread.c2
-rw-r--r--src/nsterm.h3
-rw-r--r--src/process.c13
-rw-r--r--src/sysdep.c2
-rw-r--r--src/unexcoff.c6
-rw-r--r--src/w32menu.c13
-rw-r--r--src/w32term.h16
-rw-r--r--src/xdisp.c6
-rw-r--r--src/xterm.h14
20 files changed, 120 insertions, 156 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index fa580cc99bf..e1ee81e66b5 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -495,7 +495,8 @@ define pgx
495 end 495 end
496 xgettype ($g.object) 496 xgettype ($g.object)
497 if ($type == Lisp_String) 497 if ($type == Lisp_String)
498 printf " str=%x[%d]", $g.object, $g.charpos 498 xgetptr $g.object
499 printf " str=0x%x[%d]", ((struct Lisp_String *)$ptr)->data, $g.charpos
499 else 500 else
500 printf " pos=%d", $g.charpos 501 printf " pos=%d", $g.charpos
501 end 502 end
diff --git a/src/ChangeLog b/src/ChangeLog
index c230b4bef24..efa404afc2f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -8,6 +8,74 @@
8 * font.c (font_unparse_xlfd): Exclude special characters from the 8 * font.c (font_unparse_xlfd): Exclude special characters from the
9 generating XLFD name. 9 generating XLFD name.
10 10
112012-11-27 Paul Eggert <eggert@cs.ucla.edu>
12
13 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
14 * dired.c (stat_uname, stat_gname):
15 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
16
17 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
18 * dired.c (directory_files_internal, file_name_completion):
19 Assume EAGAIN and EINTR are defined.
20
21 * fileio.c (Fcopy_file): Assume EISDIR is defined.
22 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
23 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
24 * lread.c (readbyte_from_file): Assume EINTR is defined.
25 * process.c (wait_reading_process_output, send_process) [subprocesses]:
26 Assume EIO and EAGAIN are defined.
27 * unexcoff.c (write_segment): Assume EFAULT is defined.
28
292012-11-27 Eli Zaretskii <eliz@gnu.org>
30
31 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
32 (Bug#11964)
33
34 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
35 highlighting on the frame was cleared. Prevents assertion
36 violations when repeatedly clicking on the "Top" link of the
37 "bread-crumbs" in Info buffers.
38
392012-11-25 Paul Eggert <eggert@cs.ucla.edu>
40
41 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
42
432012-11-24 Ken Brown <kbrown@cornell.edu>
44
45 * keyboard.c (HAVE_MOUSE):
46 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
47 were always defined.
48
492012-11-24 Eli Zaretskii <eliz@gnu.org>
50
51 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
52 between bpos_covered and bpos_max. This fixes cursor display when
53 several display strings follow each other.
54
55 * .gdbinit (pgx): If the glyph's object is a string, display the
56 pointer to string data, rather than the value of the string object
57 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
58
59 * indent.c (Fvertical_motion): If the starting position is covered
60 by a display string, return to one position before that, to avoid
61 overshooting it inside move_it_to. (Bug#12930)
62
632012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
64
65 * frame.h (struct frame): Remove display_preempted member
66 since all users are dead long ago.
67 * nsterm.h (struct x_output): Use the only dummy member.
68 * w32menu.c (pending_menu_activation): Remove since not
69 really used.
70 (set_frame_menubar): Adjust user.
71 * w32term.h (struct x_output): Drop outdated #if 0 code.
72 (struct w32_output): Use bitfields for explicit_parent,
73 asked_for_visible and menubar_active members. Drop
74 unused pending_menu_activation member.
75 * xterm.h (struct x_output): Drop outdated #if 0 code.
76 Use bitfields for explicit_parent, asked_for_visible,
77 has_been_visible and net_wm_state_hidden_seen members.
78
112012-11-23 Eli Zaretskii <eliz@gnu.org> 792012-11-23 Eli Zaretskii <eliz@gnu.org>
12 80
13 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead 81 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
diff --git a/src/dired.c b/src/dired.c
index 3530b74ecb4..bdb71c46364 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -193,19 +193,15 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full,
193 193
194 errno = 0; 194 errno = 0;
195 dp = readdir (d); 195 dp = readdir (d);
196 196 if (!dp)
197 if (dp == NULL && (0 197 {
198#ifdef EAGAIN 198 if (errno == EAGAIN || errno == EINTR)
199 || errno == EAGAIN 199 {
200#endif 200 QUIT;
201#ifdef EINTR 201 continue;
202 || errno == EINTR 202 }
203#endif 203 break;
204 )) 204 }
205 { QUIT; continue; }
206
207 if (dp == NULL)
208 break;
209 205
210 len = dirent_namelen (dp); 206 len = dirent_namelen (dp);
211 name = finalname = make_unibyte_string (dp->d_name, len); 207 name = finalname = make_unibyte_string (dp->d_name, len);
@@ -480,17 +476,15 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag,
480 476
481 errno = 0; 477 errno = 0;
482 dp = readdir (d); 478 dp = readdir (d);
483 if (dp == NULL && (0 479 if (!dp)
484# ifdef EAGAIN 480 {
485 || errno == EAGAIN 481 if (errno == EAGAIN || errno == EINTR)
486# endif 482 {
487# ifdef EINTR 483 QUIT;
488 || errno == EINTR 484 continue;
489# endif 485 }
490 )) 486 break;
491 { QUIT; continue; } 487 }
492
493 if (!dp) break;
494 488
495 len = dirent_namelen (dp); 489 len = dirent_namelen (dp);
496 490
@@ -826,7 +820,7 @@ stat_uname (struct stat *st)
826#ifdef WINDOWSNT 820#ifdef WINDOWSNT
827 return st->st_uname; 821 return st->st_uname;
828#else 822#else
829 struct passwd *pw = (struct passwd *) getpwuid (st->st_uid); 823 struct passwd *pw = getpwuid (st->st_uid);
830 824
831 if (pw) 825 if (pw)
832 return pw->pw_name; 826 return pw->pw_name;
@@ -841,7 +835,7 @@ stat_gname (struct stat *st)
841#ifdef WINDOWSNT 835#ifdef WINDOWSNT
842 return st->st_gname; 836 return st->st_gname;
843#else 837#else
844 struct group *gr = (struct group *) getgrgid (st->st_gid); 838 struct group *gr = getgrgid (st->st_gid);
845 839
846 if (gr) 840 if (gr)
847 return gr->gr_name; 841 return gr->gr_name;
diff --git a/src/fileio.c b/src/fileio.c
index 442c66550d3..48dbf20b88f 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1042,7 +1042,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
1042 o [p - nm] = 0; 1042 o [p - nm] = 0;
1043 1043
1044 block_input (); 1044 block_input ();
1045 pw = (struct passwd *) getpwnam (o + 1); 1045 pw = getpwnam (o + 1);
1046 unblock_input (); 1046 unblock_input ();
1047 if (pw) 1047 if (pw)
1048 { 1048 {
@@ -1995,10 +1995,8 @@ on the system, we copy the SELinux context of FILE to NEWNAME. */)
1995 { 1995 {
1996 if (!(S_ISREG (st.st_mode)) && !(S_ISLNK (st.st_mode))) 1996 if (!(S_ISREG (st.st_mode)) && !(S_ISLNK (st.st_mode)))
1997 { 1997 {
1998#if defined (EISDIR)
1999 /* Get a better looking error message. */ 1998 /* Get a better looking error message. */
2000 errno = EISDIR; 1999 errno = EISDIR;
2001#endif /* EISDIR */
2002 report_file_error ("Non-regular file", Fcons (file, Qnil)); 2000 report_file_error ("Non-regular file", Fcons (file, Qnil));
2003 } 2001 }
2004 } 2002 }
diff --git a/src/fontset.c b/src/fontset.c
index b76a216bac2..660ca432fad 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1876,6 +1876,8 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
1876 } 1876 }
1877 if (! CHAR_VALID_P (c)) 1877 if (! CHAR_VALID_P (c))
1878 return Qnil; 1878 return Qnil;
1879 if (!FRAME_WINDOW_P (f))
1880 return Qnil;
1879 face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c, pos, Qnil); 1881 face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c, pos, Qnil);
1880 face = FACE_FROM_ID (f, face_id); 1882 face = FACE_FROM_ID (f, face_id);
1881 if (face->font) 1883 if (face->font)
diff --git a/src/frame.c b/src/frame.c
index d580bf7f148..3501fc36675 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1467,7 +1467,6 @@ and returns whatever that function returns. */)
1467 f = SELECTED_FRAME (); 1467 f = SELECTED_FRAME ();
1468 x = y = Qnil; 1468 x = y = Qnil;
1469 1469
1470#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
1471 /* It's okay for the hook to refrain from storing anything. */ 1470 /* It's okay for the hook to refrain from storing anything. */
1472 if (FRAME_TERMINAL (f)->mouse_position_hook) 1471 if (FRAME_TERMINAL (f)->mouse_position_hook)
1473 { 1472 {
@@ -1487,7 +1486,6 @@ and returns whatever that function returns. */)
1487 XSETINT (x, col); 1486 XSETINT (x, col);
1488 XSETINT (y, row); 1487 XSETINT (y, row);
1489 } 1488 }
1490#endif
1491 XSETFRAME (lispy_dummy, f); 1489 XSETFRAME (lispy_dummy, f);
1492 retval = Fcons (lispy_dummy, Fcons (x, y)); 1490 retval = Fcons (lispy_dummy, Fcons (x, y));
1493 GCPRO1 (retval); 1491 GCPRO1 (retval);
@@ -1514,7 +1512,6 @@ and nil for X and Y. */)
1514 f = SELECTED_FRAME (); 1512 f = SELECTED_FRAME ();
1515 x = y = Qnil; 1513 x = y = Qnil;
1516 1514
1517#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
1518 /* It's okay for the hook to refrain from storing anything. */ 1515 /* It's okay for the hook to refrain from storing anything. */
1519 if (FRAME_TERMINAL (f)->mouse_position_hook) 1516 if (FRAME_TERMINAL (f)->mouse_position_hook)
1520 { 1517 {
@@ -1526,7 +1523,6 @@ and nil for X and Y. */)
1526 &time_dummy); 1523 &time_dummy);
1527 } 1524 }
1528 1525
1529#endif
1530 XSETFRAME (lispy_dummy, f); 1526 XSETFRAME (lispy_dummy, f);
1531 return Fcons (lispy_dummy, Fcons (x, y)); 1527 return Fcons (lispy_dummy, Fcons (x, y));
1532} 1528}
@@ -1557,7 +1553,7 @@ before calling this function on it, like this.
1557 /* Warping the mouse will cause enternotify and focus events. */ 1553 /* Warping the mouse will cause enternotify and focus events. */
1558 x_set_mouse_position (XFRAME (frame), XINT (x), XINT (y)); 1554 x_set_mouse_position (XFRAME (frame), XINT (x), XINT (y));
1559#else 1555#else
1560#if defined (MSDOS) && defined (HAVE_MOUSE) 1556#if defined (MSDOS)
1561 if (FRAME_MSDOS_P (XFRAME (frame))) 1557 if (FRAME_MSDOS_P (XFRAME (frame)))
1562 { 1558 {
1563 Fselect_frame (frame, Qnil); 1559 Fselect_frame (frame, Qnil);
@@ -1598,7 +1594,7 @@ before calling this function on it, like this.
1598 /* Warping the mouse will cause enternotify and focus events. */ 1594 /* Warping the mouse will cause enternotify and focus events. */
1599 x_set_mouse_pixel_position (XFRAME (frame), XINT (x), XINT (y)); 1595 x_set_mouse_pixel_position (XFRAME (frame), XINT (x), XINT (y));
1600#else 1596#else
1601#if defined (MSDOS) && defined (HAVE_MOUSE) 1597#if defined (MSDOS)
1602 if (FRAME_MSDOS_P (XFRAME (frame))) 1598 if (FRAME_MSDOS_P (XFRAME (frame)))
1603 { 1599 {
1604 Fselect_frame (frame, Qnil); 1600 Fselect_frame (frame, Qnil);
diff --git a/src/frame.h b/src/frame.h
index 87c4fcb0555..5ebfc2f7ec3 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -357,9 +357,6 @@ struct frame
357 unsigned int external_menu_bar : 1; 357 unsigned int external_menu_bar : 1;
358#endif 358#endif
359 359
360 /* Nonzero if last attempt at redisplay on this frame was preempted. */
361 unsigned display_preempted : 1;
362
363 /* visible is nonzero if the frame is currently displayed; we check 360 /* visible is nonzero if the frame is currently displayed; we check
364 it to see if we should bother updating the frame's contents. 361 it to see if we should bother updating the frame's contents.
365 DON'T SET IT DIRECTLY; instead, use FRAME_SET_VISIBLE. 362 DON'T SET IT DIRECTLY; instead, use FRAME_SET_VISIBLE.
diff --git a/src/gmalloc.c b/src/gmalloc.c
index dc584955661..c325ca79910 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -1645,14 +1645,6 @@ memalign (size_t alignment, size_t size)
1645 return result; 1645 return result;
1646} 1646}
1647 1647
1648#ifndef ENOMEM
1649#define ENOMEM 12
1650#endif
1651
1652#ifndef EINVAL
1653#define EINVAL 22
1654#endif
1655
1656int 1648int
1657posix_memalign (void **memptr, size_t alignment, size_t size) 1649posix_memalign (void **memptr, size_t alignment, size_t size)
1658{ 1650{
diff --git a/src/gnutls.c b/src/gnutls.c
index e3d84a0b61b..03f753fa8cc 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -359,12 +359,7 @@ emacs_gnutls_write (struct Lisp_Process *proc, const char *buf, ptrdiff_t nbyte)
359 359
360 if (proc->gnutls_initstage != GNUTLS_STAGE_READY) 360 if (proc->gnutls_initstage != GNUTLS_STAGE_READY)
361 { 361 {
362#ifdef EWOULDBLOCK
363 errno = EWOULDBLOCK;
364#endif
365#ifdef EAGAIN
366 errno = EAGAIN; 362 errno = EAGAIN;
367#endif
368 return 0; 363 return 0;
369 } 364 }
370 365
@@ -384,14 +379,7 @@ emacs_gnutls_write (struct Lisp_Process *proc, const char *buf, ptrdiff_t nbyte)
384 appropriately so that send_process retries the 379 appropriately so that send_process retries the
385 correct way instead of erroring out. */ 380 correct way instead of erroring out. */
386 if (rtnval == GNUTLS_E_AGAIN) 381 if (rtnval == GNUTLS_E_AGAIN)
387 { 382 errno = EAGAIN;
388#ifdef EWOULDBLOCK
389 errno = EWOULDBLOCK;
390#endif
391#ifdef EAGAIN
392 errno = EAGAIN;
393#endif
394 }
395 break; 383 break;
396 } 384 }
397 } 385 }
diff --git a/src/indent.c b/src/indent.c
index eee96061e25..a3abf88feeb 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2048,7 +2048,13 @@ whether or not it is currently displayed in some window. */)
2048 comment said this is "so we don't move too far" (2005-01-19 2048 comment said this is "so we don't move too far" (2005-01-19
2049 checkin by kfs). But this does nothing useful that I can 2049 checkin by kfs). But this does nothing useful that I can
2050 tell, and it causes Bug#2694 . -- cyd */ 2050 tell, and it causes Bug#2694 . -- cyd */
2051 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); 2051 /* When the position we started from is covered by a display
2052 string, move_it_to will overshoot it, while vertical-motion
2053 wants to put the cursor _before_ the display string. So in
2054 that case, we move to buffer position before the display
2055 string, and avoid overshooting. */
2056 move_it_to (&it, disp_string_at_start_p ? PT - 1 : PT,
2057 -1, -1, -1, MOVE_TO_POS);
2052 2058
2053 /* IT may move too far if truncate-lines is on and PT lies 2059 /* IT may move too far if truncate-lines is on and PT lies
2054 beyond the right margin. IT may also move too far if the 2060 beyond the right margin. IT may also move too far if the
diff --git a/src/keyboard.c b/src/keyboard.c
index 951d4ad79dc..60e6d71cdff 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -306,9 +306,7 @@ static Lisp_Object Qmake_frame_visible;
306static Lisp_Object Qselect_window; 306static Lisp_Object Qselect_window;
307Lisp_Object Qhelp_echo; 307Lisp_Object Qhelp_echo;
308 308
309#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
310static Lisp_Object Qmouse_fixup_help_message; 309static Lisp_Object Qmouse_fixup_help_message;
311#endif
312 310
313/* Symbols to denote kinds of events. */ 311/* Symbols to denote kinds of events. */
314static Lisp_Object Qfunction_key; 312static Lisp_Object Qfunction_key;
@@ -417,12 +415,10 @@ static Lisp_Object read_char_x_menu_prompt (ptrdiff_t, Lisp_Object *,
417static Lisp_Object read_char_minibuf_menu_prompt (int, ptrdiff_t, 415static Lisp_Object read_char_minibuf_menu_prompt (int, ptrdiff_t,
418 Lisp_Object *); 416 Lisp_Object *);
419static Lisp_Object make_lispy_event (struct input_event *); 417static Lisp_Object make_lispy_event (struct input_event *);
420#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
421static Lisp_Object make_lispy_movement (struct frame *, Lisp_Object, 418static Lisp_Object make_lispy_movement (struct frame *, Lisp_Object,
422 enum scroll_bar_part, 419 enum scroll_bar_part,
423 Lisp_Object, Lisp_Object, 420 Lisp_Object, Lisp_Object,
424 Time); 421 Time);
425#endif
426static Lisp_Object modify_event_symbol (ptrdiff_t, int, Lisp_Object, 422static Lisp_Object modify_event_symbol (ptrdiff_t, int, Lisp_Object,
427 Lisp_Object, const char *const *, 423 Lisp_Object, const char *const *,
428 Lisp_Object *, ptrdiff_t); 424 Lisp_Object *, ptrdiff_t);
@@ -1234,8 +1230,6 @@ DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0,
1234 user_error ("No recursive edit is in progress"); 1230 user_error ("No recursive edit is in progress");
1235} 1231}
1236 1232
1237#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
1238
1239/* Restore mouse tracking enablement. See Ftrack_mouse for the only use 1233/* Restore mouse tracking enablement. See Ftrack_mouse for the only use
1240 of this function. */ 1234 of this function. */
1241 1235
@@ -1310,7 +1304,6 @@ some_mouse_moved (void)
1310 return 0; 1304 return 0;
1311} 1305}
1312 1306
1313#endif /* HAVE_MOUSE || HAVE_GPM */
1314 1307
1315/* This is the actual command reading loop, 1308/* This is the actual command reading loop,
1316 sans error-handling encapsulation. */ 1309 sans error-handling encapsulation. */
@@ -1402,14 +1395,11 @@ command_loop_1 (void)
1402 1395
1403 Vdeactivate_mark = Qnil; 1396 Vdeactivate_mark = Qnil;
1404 1397
1405#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
1406
1407 /* Don't ignore mouse movements for more than a single command 1398 /* Don't ignore mouse movements for more than a single command
1408 loop. (This flag is set in xdisp.c whenever the tool bar is 1399 loop. (This flag is set in xdisp.c whenever the tool bar is
1409 resized, because the resize moves text up or down, and would 1400 resized, because the resize moves text up or down, and would
1410 generate false mouse drag events if we don't ignore them.) */ 1401 generate false mouse drag events if we don't ignore them.) */
1411 ignore_mouse_drag_p = 0; 1402 ignore_mouse_drag_p = 0;
1412#endif
1413 1403
1414 /* If minibuffer on and echo area in use, 1404 /* If minibuffer on and echo area in use,
1415 wait a short time and redraw minibuffer. */ 1405 wait a short time and redraw minibuffer. */
@@ -2182,7 +2172,6 @@ show_help_echo (Lisp_Object help, Lisp_Object window, Lisp_Object object,
2182 return; 2172 return;
2183 } 2173 }
2184 2174
2185#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
2186 if (!noninteractive && STRINGP (help)) 2175 if (!noninteractive && STRINGP (help))
2187 { 2176 {
2188 /* The mouse-fixup-help-message Lisp function can call 2177 /* The mouse-fixup-help-message Lisp function can call
@@ -2195,7 +2184,6 @@ show_help_echo (Lisp_Object help, Lisp_Object window, Lisp_Object object,
2195 if (f) 2184 if (f)
2196 f->mouse_moved = 1; 2185 f->mouse_moved = 1;
2197 } 2186 }
2198#endif
2199 2187
2200 if (STRINGP (help) || NILP (help)) 2188 if (STRINGP (help) || NILP (help))
2201 { 2189 {
@@ -3390,11 +3378,9 @@ readable_events (int flags)
3390 return 1; 3378 return 1;
3391 } 3379 }
3392 3380
3393#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
3394 if (!(flags & READABLE_EVENTS_IGNORE_SQUEEZABLES) 3381 if (!(flags & READABLE_EVENTS_IGNORE_SQUEEZABLES)
3395 && !NILP (do_mouse_tracking) && some_mouse_moved ()) 3382 && !NILP (do_mouse_tracking) && some_mouse_moved ())
3396 return 1; 3383 return 1;
3397#endif
3398 if (single_kboard) 3384 if (single_kboard)
3399 { 3385 {
3400 if (current_kboard->kbd_queue_has_data) 3386 if (current_kboard->kbd_queue_has_data)
@@ -3762,10 +3748,8 @@ kbd_buffer_get_event (KBOARD **kbp,
3762 3748
3763 if (kbd_fetch_ptr != kbd_store_ptr) 3749 if (kbd_fetch_ptr != kbd_store_ptr)
3764 break; 3750 break;
3765#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
3766 if (!NILP (do_mouse_tracking) && some_mouse_moved ()) 3751 if (!NILP (do_mouse_tracking) && some_mouse_moved ())
3767 break; 3752 break;
3768#endif
3769 3753
3770 /* If the quit flag is set, then read_char will return 3754 /* If the quit flag is set, then read_char will return
3771 quit_char, so that counts as "available input." */ 3755 quit_char, so that counts as "available input." */
@@ -3780,10 +3764,8 @@ kbd_buffer_get_event (KBOARD **kbp,
3780#endif 3764#endif
3781 if (kbd_fetch_ptr != kbd_store_ptr) 3765 if (kbd_fetch_ptr != kbd_store_ptr)
3782 break; 3766 break;
3783#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
3784 if (!NILP (do_mouse_tracking) && some_mouse_moved ()) 3767 if (!NILP (do_mouse_tracking) && some_mouse_moved ())
3785 break; 3768 break;
3786#endif
3787 if (end_time) 3769 if (end_time)
3788 { 3770 {
3789 EMACS_TIME now = current_emacs_time (); 3771 EMACS_TIME now = current_emacs_time ();
@@ -4040,7 +4022,6 @@ kbd_buffer_get_event (KBOARD **kbp,
4040 } 4022 }
4041 } 4023 }
4042 } 4024 }
4043#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
4044 /* Try generating a mouse motion event. */ 4025 /* Try generating a mouse motion event. */
4045 else if (!NILP (do_mouse_tracking) && some_mouse_moved ()) 4026 else if (!NILP (do_mouse_tracking) && some_mouse_moved ())
4046 { 4027 {
@@ -4085,7 +4066,6 @@ kbd_buffer_get_event (KBOARD **kbp,
4085 if (!NILP (x) && NILP (obj)) 4066 if (!NILP (x) && NILP (obj))
4086 obj = make_lispy_movement (f, bar_window, part, x, y, t); 4067 obj = make_lispy_movement (f, bar_window, part, x, y, t);
4087 } 4068 }
4088#endif /* HAVE_MOUSE || HAVE GPM */
4089 else 4069 else
4090 /* We were promised by the above while loop that there was 4070 /* We were promised by the above while loop that there was
4091 something for us to read! */ 4071 something for us to read! */
@@ -5397,7 +5377,6 @@ make_lispy_event (struct input_event *event)
5397 return Qnil; 5377 return Qnil;
5398#endif 5378#endif
5399 5379
5400#ifdef HAVE_MOUSE
5401 /* A mouse click. Figure out where it is, decide whether it's 5380 /* A mouse click. Figure out where it is, decide whether it's
5402 a press, click or drag, and build the appropriate structure. */ 5381 a press, click or drag, and build the appropriate structure. */
5403 case MOUSE_CLICK_EVENT: 5382 case MOUSE_CLICK_EVENT:
@@ -5849,7 +5828,6 @@ make_lispy_event (struct input_event *event)
5849 Fcons (files, 5828 Fcons (files,
5850 Qnil))); 5829 Qnil)));
5851 } 5830 }
5852#endif /* HAVE_MOUSE */
5853 5831
5854#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \ 5832#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \
5855 || defined (HAVE_NS) || defined (USE_GTK) 5833 || defined (HAVE_NS) || defined (USE_GTK)
@@ -5968,8 +5946,6 @@ make_lispy_event (struct input_event *event)
5968 } 5946 }
5969} 5947}
5970 5948
5971#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
5972
5973static Lisp_Object 5949static Lisp_Object
5974make_lispy_movement (FRAME_PTR frame, Lisp_Object bar_window, enum scroll_bar_part part, 5950make_lispy_movement (FRAME_PTR frame, Lisp_Object bar_window, enum scroll_bar_part part,
5975 Lisp_Object x, Lisp_Object y, Time t) 5951 Lisp_Object x, Lisp_Object y, Time t)
@@ -5997,8 +5973,6 @@ make_lispy_movement (FRAME_PTR frame, Lisp_Object bar_window, enum scroll_bar_pa
5997 } 5973 }
5998} 5974}
5999 5975
6000#endif /* HAVE_MOUSE || HAVE GPM */
6001
6002/* Construct a switch frame event. */ 5976/* Construct a switch frame event. */
6003static Lisp_Object 5977static Lisp_Object
6004make_lispy_switch_frame (Lisp_Object frame) 5978make_lispy_switch_frame (Lisp_Object frame)
@@ -6986,10 +6960,7 @@ tty_read_avail_input (struct terminal *terminal,
6986 an EAGAIN error. Does anybody know of a situation 6960 an EAGAIN error. Does anybody know of a situation
6987 where a retry is actually needed? */ 6961 where a retry is actually needed? */
6988#if 0 6962#if 0
6989 nread < 0 && (errno == EAGAIN 6963 nread < 0 && (errno == EAGAIN || errno == EFAULT
6990#ifdef EFAULT
6991 || errno == EFAULT
6992#endif
6993#ifdef EBADSLT 6964#ifdef EBADSLT
6994 || errno == EBADSLT 6965 || errno == EBADSLT
6995#endif 6966#endif
@@ -11233,9 +11204,7 @@ init_keyboard (void)
11233 recent_keys_index = 0; 11204 recent_keys_index = 0;
11234 kbd_fetch_ptr = kbd_buffer; 11205 kbd_fetch_ptr = kbd_buffer;
11235 kbd_store_ptr = kbd_buffer; 11206 kbd_store_ptr = kbd_buffer;
11236#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
11237 do_mouse_tracking = Qnil; 11207 do_mouse_tracking = Qnil;
11238#endif
11239 input_pending = 0; 11208 input_pending = 0;
11240 interrupt_input_blocked = 0; 11209 interrupt_input_blocked = 0;
11241 pending_signals = 0; 11210 pending_signals = 0;
@@ -11386,9 +11355,7 @@ syms_of_keyboard (void)
11386 DEFSYM (Qvertical_scroll_bar, "vertical-scroll-bar"); 11355 DEFSYM (Qvertical_scroll_bar, "vertical-scroll-bar");
11387 DEFSYM (Qmenu_bar, "menu-bar"); 11356 DEFSYM (Qmenu_bar, "menu-bar");
11388 11357
11389#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
11390 DEFSYM (Qmouse_fixup_help_message, "mouse-fixup-help-message"); 11358 DEFSYM (Qmouse_fixup_help_message, "mouse-fixup-help-message");
11391#endif
11392 11359
11393 DEFSYM (Qabove_handle, "above-handle"); 11360 DEFSYM (Qabove_handle, "above-handle");
11394 DEFSYM (Qhandle, "handle"); 11361 DEFSYM (Qhandle, "handle");
@@ -11508,9 +11475,7 @@ syms_of_keyboard (void)
11508 defsubr (&Sread_key_sequence); 11475 defsubr (&Sread_key_sequence);
11509 defsubr (&Sread_key_sequence_vector); 11476 defsubr (&Sread_key_sequence_vector);
11510 defsubr (&Srecursive_edit); 11477 defsubr (&Srecursive_edit);
11511#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
11512 defsubr (&Strack_mouse); 11478 defsubr (&Strack_mouse);
11513#endif
11514 defsubr (&Sinput_pending_p); 11479 defsubr (&Sinput_pending_p);
11515 defsubr (&Scommand_execute); 11480 defsubr (&Scommand_execute);
11516 defsubr (&Srecent_keys); 11481 defsubr (&Srecent_keys);
diff --git a/src/lread.c b/src/lread.c
index 6d0ff9f780e..6647382a254 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -440,7 +440,6 @@ readbyte_from_file (int c, Lisp_Object readcharfun)
440 block_input (); 440 block_input ();
441 c = getc (instream); 441 c = getc (instream);
442 442
443#ifdef EINTR
444 /* Interrupted reads have been observed while reading over the network. */ 443 /* Interrupted reads have been observed while reading over the network. */
445 while (c == EOF && ferror (instream) && errno == EINTR) 444 while (c == EOF && ferror (instream) && errno == EINTR)
446 { 445 {
@@ -450,7 +449,6 @@ readbyte_from_file (int c, Lisp_Object readcharfun)
450 clearerr (instream); 449 clearerr (instream);
451 c = getc (instream); 450 c = getc (instream);
452 } 451 }
453#endif
454 452
455 unblock_input (); 453 unblock_input ();
456 454
diff --git a/src/nsterm.h b/src/nsterm.h
index 2e868b86caf..005701ed415 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -630,8 +630,7 @@ struct ns_output
630/* this dummy decl needed to support TTYs */ 630/* this dummy decl needed to support TTYs */
631struct x_output 631struct x_output
632{ 632{
633 unsigned long background_pixel; 633 int unused;
634 unsigned long foreground_pixel;
635}; 634};
636 635
637 636
diff --git a/src/process.c b/src/process.c
index 0036ce595f5..b23f06fd025 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4432,14 +4432,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4432 total_nread += nread; 4432 total_nread += nread;
4433 got_some_input = 1; 4433 got_some_input = 1;
4434 } 4434 }
4435#ifdef EIO 4435 else if (nread == -1 && (errno == EIO || errno == EAGAIN))
4436 else if (nread == -1 && EIO == errno)
4437 break; 4436 break;
4438#endif
4439#ifdef EAGAIN
4440 else if (nread == -1 && EAGAIN == errno)
4441 break;
4442#endif
4443#ifdef EWOULDBLOCK 4437#ifdef EWOULDBLOCK
4444 else if (nread == -1 && EWOULDBLOCK == errno) 4438 else if (nread == -1 && EWOULDBLOCK == errno)
4445 break; 4439 break;
@@ -5517,13 +5511,10 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len,
5517 5511
5518 if (rv < 0) 5512 if (rv < 0)
5519 { 5513 {
5520 if (0 5514 if (errno == EAGAIN
5521#ifdef EWOULDBLOCK 5515#ifdef EWOULDBLOCK
5522 || errno == EWOULDBLOCK 5516 || errno == EWOULDBLOCK
5523#endif 5517#endif
5524#ifdef EAGAIN
5525 || errno == EAGAIN
5526#endif
5527 ) 5518 )
5528 /* Buffer is full. Wait, accepting input; 5519 /* Buffer is full. Wait, accepting input;
5529 that may allow the program 5520 that may allow the program
diff --git a/src/sysdep.c b/src/sysdep.c
index bc4dc91509f..1a3834f0379 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -453,7 +453,7 @@ sys_subshell (void)
453 int st; 453 int st;
454 char oldwd[MAXPATHLEN+1]; /* Fixed length is safe on MSDOS. */ 454 char oldwd[MAXPATHLEN+1]; /* Fixed length is safe on MSDOS. */
455#endif 455#endif
456 int pid; 456 pid_t pid;
457 struct save_signal saved_handlers[5]; 457 struct save_signal saved_handlers[5];
458 Lisp_Object dir; 458 Lisp_Object dir;
459 unsigned char *volatile str_volatile = 0; 459 unsigned char *volatile str_volatile = 0;
diff --git a/src/unexcoff.c b/src/unexcoff.c
index 966dd58cb6e..6e29951a962 100644
--- a/src/unexcoff.c
+++ b/src/unexcoff.c
@@ -332,11 +332,7 @@ write_segment (int new, const char *ptr, const char *end)
332 a gap between the old text segment and the old data segment. 332 a gap between the old text segment and the old data segment.
333 This gap has probably been remapped into part of the text segment. 333 This gap has probably been remapped into part of the text segment.
334 So write zeros for it. */ 334 So write zeros for it. */
335 if (ret == -1 335 if (ret == -1 && errno == EFAULT)
336#ifdef EFAULT
337 && errno == EFAULT
338#endif
339 )
340 { 336 {
341 /* Write only a page of zeros at once, 337 /* Write only a page of zeros at once,
342 so that we don't overshoot the start 338 so that we don't overshoot the start
diff --git a/src/w32menu.c b/src/w32menu.c
index 36bf9574fdc..84fb1bdc71e 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -114,17 +114,6 @@ static int fill_in_menu (HMENU, widget_value *);
114 114
115void w32_free_menu_strings (HWND); 115void w32_free_menu_strings (HWND);
116 116
117
118
119/* This is set nonzero after the user activates the menu bar, and set
120 to zero again after the menu bars are redisplayed by prepare_menu_bar.
121 While it is nonzero, all calls to set_frame_menubar go deep.
122
123 I don't understand why this is needed, but it does seem to be
124 needed on Motif, according to Marcus Daniels <marcus@sysc.pdx.edu>. */
125
126int pending_menu_activation;
127
128#ifdef HAVE_MENUS 117#ifdef HAVE_MENUS
129 118
130DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 3, 0, 119DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 3, 0,
@@ -389,8 +378,6 @@ set_frame_menubar (FRAME_PTR f, bool first_time, bool deep_p)
389 378
390 if (! menubar_widget) 379 if (! menubar_widget)
391 deep_p = 1; 380 deep_p = 1;
392 else if (pending_menu_activation && !deep_p)
393 deep_p = 1;
394 381
395 if (deep_p) 382 if (deep_p)
396 { 383 {
diff --git a/src/w32term.h b/src/w32term.h
index ce709c1231d..28d4ca6c490 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -251,16 +251,10 @@ extern Lisp_Object x_get_focus_frame (struct frame *);
251 diffs between X and w32 code. */ 251 diffs between X and w32 code. */
252struct x_output 252struct x_output
253{ 253{
254#if 0 /* These are also defined in struct frame. Use that instead. */
255 PIX_TYPE background_pixel;
256 PIX_TYPE foreground_pixel;
257#endif
258
259 /* Keep track of focus. May be EXPLICIT if we received a FocusIn for this 254 /* Keep track of focus. May be EXPLICIT if we received a FocusIn for this
260 frame, or IMPLICIT if we received an EnterNotify. 255 frame, or IMPLICIT if we received an EnterNotify.
261 FocusOut and LeaveNotify clears EXPLICIT/IMPLICIT. */ 256 FocusOut and LeaveNotify clears EXPLICIT/IMPLICIT. */
262 int focus_state; 257 int focus_state;
263
264}; 258};
265 259
266enum 260enum
@@ -347,17 +341,13 @@ struct w32_output
347 341
348 /* Nonzero means our parent is another application's window 342 /* Nonzero means our parent is another application's window
349 and was explicitly specified. */ 343 and was explicitly specified. */
350 char explicit_parent; 344 unsigned explicit_parent : 1;
351 345
352 /* Nonzero means tried already to make this frame visible. */ 346 /* Nonzero means tried already to make this frame visible. */
353 char asked_for_visible; 347 unsigned asked_for_visible : 1;
354 348
355 /* Nonzero means menubar is currently active. */ 349 /* Nonzero means menubar is currently active. */
356 char menubar_active; 350 unsigned menubar_active : 1;
357
358 /* Nonzero means menubar is about to become active, but should be
359 brought up to date first. */
360 volatile char pending_menu_activation;
361 351
362 /* Relief GCs, colors etc. */ 352 /* Relief GCs, colors etc. */
363 struct relief 353 struct relief
diff --git a/src/xdisp.c b/src/xdisp.c
index 5d260d851ef..3b19d5d14d4 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -14233,7 +14233,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
14233 GLYPH_BEFORE and GLYPH_AFTER. */ 14233 GLYPH_BEFORE and GLYPH_AFTER. */
14234 if (!((row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end) 14234 if (!((row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end)
14235 && BUFFERP (glyph->object) && glyph->charpos == pt_old) 14235 && BUFFERP (glyph->object) && glyph->charpos == pt_old)
14236 && bpos_covered < pt_old) 14236 && !(bpos_max < pt_old && pt_old <= bpos_covered))
14237 { 14237 {
14238 /* An empty line has a single glyph whose OBJECT is zero and 14238 /* An empty line has a single glyph whose OBJECT is zero and
14239 whose CHARPOS is the position of a newline on that line. 14239 whose CHARPOS is the position of a newline on that line.
@@ -23506,7 +23506,9 @@ draw_glyphs (struct window *w, int x, struct glyph_row *row,
23506 23506
23507 /* If mouse highlighting is on, we may need to draw adjacent 23507 /* If mouse highlighting is on, we may need to draw adjacent
23508 glyphs using mouse-face highlighting. */ 23508 glyphs using mouse-face highlighting. */
23509 if (area == TEXT_AREA && row->mouse_face_p) 23509 if (area == TEXT_AREA && row->mouse_face_p
23510 && hlinfo->mouse_face_beg_row >= 0
23511 && hlinfo->mouse_face_end_row >= 0)
23510 { 23512 {
23511 struct glyph_row *mouse_beg_row, *mouse_end_row; 23513 struct glyph_row *mouse_beg_row, *mouse_end_row;
23512 23514
diff --git a/src/xterm.h b/src/xterm.h
index 6ef3d11fe48..d63ed1c4583 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -506,12 +506,6 @@ struct x_output
506 value contains an ID of the fontset, else -1. */ 506 value contains an ID of the fontset, else -1. */
507 int fontset; 507 int fontset;
508 508
509 /* Pixel values used for various purposes.
510 border_pixel may be -1 meaning use a gray tile. */
511#if 0 /* These are also defined in struct frame. Use that instead. */
512 unsigned long background_pixel;
513 unsigned long foreground_pixel;
514#endif
515 unsigned long cursor_pixel; 509 unsigned long cursor_pixel;
516 unsigned long border_pixel; 510 unsigned long border_pixel;
517 unsigned long mouse_pixel; 511 unsigned long mouse_pixel;
@@ -574,13 +568,13 @@ struct x_output
574 568
575 /* Nonzero means our parent is another application's window 569 /* Nonzero means our parent is another application's window
576 and was explicitly specified. */ 570 and was explicitly specified. */
577 char explicit_parent; 571 unsigned explicit_parent : 1;
578 572
579 /* Nonzero means tried already to make this frame visible. */ 573 /* Nonzero means tried already to make this frame visible. */
580 char asked_for_visible; 574 unsigned asked_for_visible : 1;
581 575
582 /* Nonzero if this frame was ever previously visible. */ 576 /* Nonzero if this frame was ever previously visible. */
583 char has_been_visible; 577 unsigned has_been_visible : 1;
584 578
585#ifdef HAVE_X_I18N 579#ifdef HAVE_X_I18N
586 /* Input context (currently, this means Compose key handler setup). */ 580 /* Input context (currently, this means Compose key handler setup). */
@@ -634,7 +628,7 @@ struct x_output
634 int top_before_move; 628 int top_before_move;
635 629
636 /* Non-zero if _NET_WM_STATE_HIDDEN is set for this frame. */ 630 /* Non-zero if _NET_WM_STATE_HIDDEN is set for this frame. */
637 int net_wm_state_hidden_seen; 631 unsigned net_wm_state_hidden_seen : 1;
638}; 632};
639 633
640#define No_Cursor (None) 634#define No_Cursor (None)