aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2007-04-22 12:12:29 +0000
committerKaroly Lorentey2007-04-22 12:12:29 +0000
commite18c709364b095ea0be8ecabe458ac9a642a252f (patch)
treeefe814a842f932f387b3947c572bf43a548d17ef /src
parent81088e260b086fe28f36964f32b6338210ec6fd8 (diff)
parent9f25e707aaad5ed14a9448e9c5d345ff0bdbc5a7 (diff)
downloademacs-e18c709364b095ea0be8ecabe458ac9a642a252f.tar.gz
emacs-e18c709364b095ea0be8ecabe458ac9a642a252f.zip
Merged from emacs@sv.gnu.org
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-660 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-661 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-662 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-663 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-664 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-665 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-666 Fix read-only prompt problem in isearch * emacs@sv.gnu.org/emacs--devo--0--patch-667 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-668 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-669 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-670 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-671 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-672 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-673 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-206 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-207 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-208 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-600
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog201
-rw-r--r--src/ChangeLog.32
-rw-r--r--src/Makefile.in32
-rw-r--r--src/buffer.c4
-rw-r--r--src/dired.c11
-rw-r--r--src/dispnew.c6
-rw-r--r--src/editfns.c4
-rw-r--r--src/fileio.c8
-rw-r--r--src/image.c8
-rw-r--r--src/keyboard.c41
-rw-r--r--src/keymap.c2
-rw-r--r--src/lisp.h1
-rw-r--r--src/lread.c19
-rw-r--r--src/macfns.c22
-rw-r--r--src/macmenu.c15
-rw-r--r--src/macterm.c68
-rw-r--r--src/macterm.h3
-rw-r--r--src/minibuf.c40
-rw-r--r--src/print.c7
-rw-r--r--src/process.c41
-rw-r--r--src/sound.c22
-rw-r--r--src/term.c5
-rw-r--r--src/window.c11
-rw-r--r--src/xdisp.c15
-rw-r--r--src/xselect.c13
-rw-r--r--src/xterm.c17
26 files changed, 471 insertions, 147 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d9633301be2..76414a593f6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,7 +1,183 @@
12007-03-02 Stuart D. Herring <herring@lanl.gov> 12007-03-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2 2
3 * keymap.c (Fkey_binding): Don't consider two-element lists as 3 * Makefile.in (alloca.o, gtkutil.o): Depend on systime.h.
4 events. 4 (dired.o, editfns.o, fileio.o, msdos.o): Depend on atimer.h.
5 (dosfns.o, window.o, fns.o, macselect.o): Depend on atimer.h and
6 systime.h.
7 (term.o, print.o, lread.o): Depend on blockinput.h, atimer.h, and
8 systime.h.
9 (macfns.o): Remove duplicate dependency on systime.h.
10
11 * dispnew.c (Fopen_termscript): Add BLOCK_INPUT around fclose.
12 (Fsend_string_to_terminal): Add BLOCK_INPUT around fwrite.
13
14 * fileio.c (do_auto_save_unwind): Add BLOCK_INPUT around fclose.
15 (Fdo_auto_save): Add BLOCK_INPUT around fwrite.
16
17 * keyboard.c (record_char): Add BLOCK_INPUT around fwrite.
18 (Fopen_dribble_file): Add BLOCK_INPUT around fclose.
19
20 * lread.c: Include blockinput.h.
21 (readchar, Fget_file_char): Add BLOCK_INPUT around getc.
22 (unreadchar): Add BLOCK_INPUT around ungetc.
23 (load_unwind): Add BLOCK_INPUT around fclose.
24
25 * print.c: Include blockinput.h.
26 (Fredirect_debugging_output): Add BLOCK_INPUT around fclose.
27
28 * process.c (Fmake_network_process) [HAVE_GETADDRINFO]: Clear
29 immediate_quit before calling freeaddrinfo. Add BLOCK_INPUT
30 around freeaddrinfo.
31
32 * term.c: Include blockinput.h.
33 (write_glyphs, insert_glyphs): Add BLOCK_INPUT around fwrite.
34
352007-03-19 Richard Stallman <rms@gnu.org>
36
37 * keyboard.c (NUM_RECENT_KEYS): Bump up to 300.
38
39 * buffer.c (syms_of_buffer): Doc fix.
40
412007-03-18 Chong Yidong <cyd@stupidchicken.com>
42
43 * image.c (pbm_load): Signal error for invalid image size.
44
452007-03-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
46
47 * macterm.c (note_mouse_movement): Don't return immediately for
48 LeaveNotify case.
49
50 * macmenu.c (popup_activated_flag): New variable.
51 (x_activate_menubar, mac_menu_show): Set it during menu tracking.
52 (popup_activated): New function.
53
54 * xdisp.c (redisplay_internal, note_mouse_highlight): Check
55 popup_activated for MAC_OS.
56
572007-03-17 Juanma Barranquero <lekktu@gmail.com>
58
59 * buffer.c (syms_of_buffer) <buffer-display-table>: Doc fix.
60 Reported by Nikolaj Schumacher <n_schumacher@web.de>.
61
622007-03-17 Richard Stallman <rms@gnu.org>
63
64 * dired.c (file_name_completion): gcpro NAME.
65
662007-03-17 Chong Yidong <cyd@stupidchicken.com>
67
68 * xdisp.c (try_window_id): Increment matrix positions if the
69 buffer's byte count has increased, but not the character count.
70
712007-03-12 Andreas Schwab <schwab@suse.de>
72
73 * lisp.h: Declare check_obarray.
74
75 * process.c (Fdelete_process): Properly handle deletion of first
76 element of deleted_pid_list.
77 (create_process): Declare pid as pid_t.
78
792007-03-12 Kim F. Storm <storm@cua.dk>
80
81 * process.c (sigchld_handler): Change type of pid to pid_t.
82 Scan deleted_pid_list explicitly to avoid using Fmember which don't
83 know about mark bits and make_fixnum_or_float which may malloc.
84 Reported by Andreas Schwab.
85
86 * keyboard.c (read_key_sequence): Store original event into keybuf
87 when replaying sequence with local keymap(s) from string.
88
892007-03-12 Glenn Morris <rgm@gnu.org>
90
91 * editfns.c (Fdecode_time, Fencode_time): Doc fix ("daylight
92 savings" to "daylight saving").
93
942007-03-11 Sam Steingold <sds@gnu.org>
95
96 * process.c (sigchld_handler): Sleep before wait3 to avoid a busyloop.
97
982007-03-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
99
100 * macfns.c (Fx_server_vendor): Change vendor string to "Apple Inc.".
101
1022007-03-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
103
104 * macterm.c [USE_CARBON_EVENTS] (mac_handle_mouse_event):
105 Ignore mouse wheel movement on title bar or tool bar.
106
1072007-03-10 Chong Yidong <cyd@stupidchicken.com>
108
109 * keyboard.c (help_form_saved_window_configs): New var.
110 (read_char_help_form_unwind): New function.
111 (read_char): Don't restore window configuration if a mouse click
112 arrives while the help form is being displayed.
113
1142007-03-10 Kim F. Storm <storm@cua.dk>
115
116 * xdisp.c (redisplay_window): Don't automatically select a new window
117 start for a contination line during mouse-click.
118
1192007-03-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
120
121 * xterm.c (handle_one_xevent): Ignore buttons > 3 for the tool bar.
122
1232007-03-09 Juanma Barranquero <lekktu@gmail.com>
124
125 * keymap.c (Fdescribe_buffer_bindings): Check that BUFFER is valid.
126
1272007-03-08 Richard Stallman <rms@gnu.org>
128
129 * keyboard.c (syms_of_keyboard): Doc fix.
130
1312007-03-08 Chong Yidong <cyd@stupidchicken.com>
132
133 * minibuf.c (Ftry_completion): Don't short circuit if
134 completion-ignore-case is non-nil.
135
1362007-03-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
137
138 * macfns.c (mac_set_scroll_bar_width, mac_frame_parm_handlers):
139 Undo 2006-03-06 changes.
140
141 * macterm.c (XTset_vertical_scroll_bar) [MAC_OSX]: Don't show scroll
142 bar if its width is smaller than that of Aqua small scroll bar.
143
1442007-03-07 Stefan Monnier <monnier@iro.umontreal.ca>
145
146 * minibuf.c (read_minibuf): Bind inhibit-read-only a bit longer so as
147 to handle correctly prompts with read-only property.
148
1492007-03-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
150
151 * sound.c (wav_play): Check header->data_length to see how much we
152 shall read.
153 (alsa_period_size): Convert ALSA period size in frames to bytes.
154 (alsa_write): Return if frames is zero.
155
1562007-03-06 Kenichi Handa <handa@m17n.org>
157
158 * xselect.c (Vselection_coding_system): Documentation improved.
159
1602007-03-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
161
162 * macterm.c (x_scroll_bar_create, XTread_socket): Replace #if
163 USE_TOOLKIT_SCROLL_BARS with #ifdef USE_TOOLKIT_SCROLL_BARS.
164 (x_set_window_size): Call SET_FRAME_GARBAGED. Clear window if
165 internal border width has changed.
166
167 * macterm.h (struct mac_output): New member `internal_border_width'.
168
1692007-03-04 Richard Stallman <rms@gnu.org>
170
171 * window.c (Fdisplay_buffer): Doc fix.
172
1732007-03-03 Glenn Morris <rgm@gnu.org>
174
175 * Makefile.in: Don't clear out LIB_X11_LIB, since XFT_LIBS does
176 not include -lX11 on Solaris.
177
1782007-03-02 Stuart D. Herring <herring@lanl.gov>
179
180 * keymap.c (Fkey_binding): Don't consider one-element lists as events.
5 181
62007-03-01 Kenichi Handa <handa@m17n.org> 1822007-03-01 Kenichi Handa <handa@m17n.org>
7 183
@@ -30,8 +206,8 @@
30 (x_scroll_bar_create, XTset_vertical_scroll_bar) 206 (x_scroll_bar_create, XTset_vertical_scroll_bar)
31 [USE_TOOLKIT_SCROLL_BARS]: Initialize bar->min_handle. 207 [USE_TOOLKIT_SCROLL_BARS]: Initialize bar->min_handle.
32 208
33 * macterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS]: New 209 * macterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS]:
34 member `min_handle'. 210 New member `min_handle'.
35 211
362007-02-23 Kim F. Storm <storm@cua.dk> 2122007-02-23 Kim F. Storm <storm@cua.dk>
37 213
@@ -54,11 +230,11 @@
54 (mac_flush_display_optional) [USE_CG_DRAWING]: New function. 230 (mac_flush_display_optional) [USE_CG_DRAWING]: New function.
55 (x_redisplay_interface) [USE_CG_DRAWING]: Set it as handler for 231 (x_redisplay_interface) [USE_CG_DRAWING]: Set it as handler for
56 flush_display_optional. 232 flush_display_optional.
57 [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_press): New 233 [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_press):
58 argument MOUSE_POS. All uses changed. Set bar->dragging to 234 New argument MOUSE_POS. All uses changed. Set bar->dragging to
59 negative integer if scroll bar handle is pressed. 235 negative integer if scroll bar handle is pressed.
60 [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_release): Negative 236 [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_release):
61 bar->dragging means scroll bar handle is not dragged. 237 Negative bar->dragging means scroll bar handle is not dragged.
62 [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_drag): Get initial 238 [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_drag): Get initial
63 offset of scroll bar handle from negative bar->dragging. 239 offset of scroll bar handle from negative bar->dragging.
64 (XTread_socket) [USE_TOOLKIT_SCROLL_BARS]: Modifiers for scroll 240 (XTread_socket) [USE_TOOLKIT_SCROLL_BARS]: Modifiers for scroll
@@ -93,8 +269,7 @@
93 269
94 * w32menu.c (current_popup_menu): Make available globally. 270 * w32menu.c (current_popup_menu): Make available globally.
95 (menubar_selection_callback): Free menu strings before pushing the 271 (menubar_selection_callback): Free menu strings before pushing the
96 menu event into the keyboard buffer. Remove 272 menu event into the keyboard buffer. Remove menu_command_in_progress.
97 menu_command_in_progress.
98 273
99 * w32fns.c (current_popup_menu): Use from w32menu.c. 274 * w32fns.c (current_popup_menu): Use from w32menu.c.
100 (w32_wnd_proc) [WM_EXITMENULOOP, WM_TIMER]: Use menubar_active 275 (w32_wnd_proc) [WM_EXITMENULOOP, WM_TIMER]: Use menubar_active
@@ -364,8 +539,8 @@
364 539
3652007-01-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 5402007-01-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
366 541
367 * macmenu.c (create_and_show_dialog) [TARGET_API_MAC_CARBON]: Use 542 * macmenu.c (create_and_show_dialog) [TARGET_API_MAC_CARBON]:
368 DisableControl for disabled items. Set default button to first 543 Use DisableControl for disabled items. Set default button to first
369 enabled one. Use icon of application in execution. 544 enabled one. Use icon of application in execution.
370 545
3712007-01-13 Eli Zaretskii <eliz@gnu.org> 5462007-01-13 Eli Zaretskii <eliz@gnu.org>
diff --git a/src/ChangeLog.3 b/src/ChangeLog.3
index 343eec689a2..d6e1dff4e32 100644
--- a/src/ChangeLog.3
+++ b/src/ChangeLog.3
@@ -5706,7 +5706,7 @@
5706 HAVE_TIMEVAL is defined and NEED_TIME_H isn't. 5706 HAVE_TIMEVAL is defined and NEED_TIME_H isn't.
5707 5707
5708 * systime.h: Note that the tz_dsttime field of the struct timezone 5708 * systime.h: Note that the tz_dsttime field of the struct timezone
5709 returned by gettimeofday doesn't say whether daylight savings is 5709 returned by gettimeofday doesn't say whether daylight saving is
5710 _currently- active; rather it specifies whether it is *ever* 5710 _currently- active; rather it specifies whether it is *ever*
5711 active. 5711 active.
5712 (EMACS_GET_TZ_OFFSET_AND_SAVINGS): Removed `savings_flag' 5712 (EMACS_GET_TZ_OFFSET_AND_SAVINGS): Removed `savings_flag'
diff --git a/src/Makefile.in b/src/Makefile.in
index e19083e3e15..31fc7b5c23e 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -403,8 +403,6 @@ LIBXT=$(LIBW)
403#endif /* not USE_X_TOOLKIT */ 403#endif /* not USE_X_TOOLKIT */
404 404
405#if HAVE_XFT 405#if HAVE_XFT
406#undef LIB_X11_LIB /* XFT_LIBS includes -lX11 */
407#define LIB_X11_LIB
408XFT_LIBS=@XFT_LIBS@ 406XFT_LIBS=@XFT_LIBS@
409#endif /* HAVE_XFT */ 407#endif /* HAVE_XFT */
410 408
@@ -1088,7 +1086,7 @@ stamp-oldxmenu:
1088 They should define HAVE_ALLOCA. 1086 They should define HAVE_ALLOCA.
1089 Some use the C version in alloca.c (these define C_ALLOCA in config.h). 1087 Some use the C version in alloca.c (these define C_ALLOCA in config.h).
1090 */ 1088 */
1091alloca.o: alloca.c blockinput.h atimer.h 1089alloca.o: alloca.c blockinput.h atimer.h systime.h
1092 1090
1093/* Nearly all the following files depend on lisp.h, 1091/* Nearly all the following files depend on lisp.h,
1094 but it is not included as a dependency because 1092 but it is not included as a dependency because
@@ -1121,7 +1119,7 @@ pre-crt0.o: pre-crt0.c
1121ecrt0.o: ecrt0.c $(config_h) 1119ecrt0.o: ecrt0.c $(config_h)
1122 CRT0_COMPILE ${srcdir}/ecrt0.c 1120 CRT0_COMPILE ${srcdir}/ecrt0.c
1123dired.o: dired.c commands.h buffer.h $(config_h) charset.h coding.h regex.h \ 1121dired.o: dired.c commands.h buffer.h $(config_h) charset.h coding.h regex.h \
1124 systime.h blockinput.h 1122 systime.h blockinput.h atimer.h
1125dispnew.o: dispnew.c systime.h commands.h process.h frame.h \ 1123dispnew.o: dispnew.c systime.h commands.h process.h frame.h \
1126 window.h buffer.h dispextern.h termchar.h termopts.h termhooks.h cm.h \ 1124 window.h buffer.h dispextern.h termchar.h termopts.h termhooks.h cm.h \
1127 disptab.h indent.h intervals.h \ 1125 disptab.h indent.h intervals.h \
@@ -1130,14 +1128,15 @@ dispnew.o: dispnew.c systime.h commands.h process.h frame.h \
1130doc.o: doc.c $(config_h) epaths.h buffer.h keyboard.h keymap.h charset.h 1128doc.o: doc.c $(config_h) epaths.h buffer.h keyboard.h keymap.h charset.h
1131doprnt.o: doprnt.c charset.h $(config_h) 1129doprnt.o: doprnt.c charset.h $(config_h)
1132dosfns.o: buffer.h termchar.h termhooks.h frame.h blockinput.h window.h \ 1130dosfns.o: buffer.h termchar.h termhooks.h frame.h blockinput.h window.h \
1133 msdos.h dosfns.h dispextern.h charset.h coding.h $(config_h) 1131 msdos.h dosfns.h dispextern.h charset.h coding.h atimer.h systime.h \
1132 $(config_h)
1134editfns.o: editfns.c window.h buffer.h systime.h $(INTERVAL_SRC) charset.h \ 1133editfns.o: editfns.c window.h buffer.h systime.h $(INTERVAL_SRC) charset.h \
1135 coding.h dispextern.h frame.h blockinput.h $(config_h) 1134 coding.h dispextern.h frame.h blockinput.h atimer.h $(config_h)
1136emacs.o: emacs.c commands.h systty.h syssignal.h blockinput.h process.h \ 1135emacs.o: emacs.c commands.h systty.h syssignal.h blockinput.h process.h \
1137 termhooks.h buffer.h atimer.h systime.h $(INTERVAL_SRC) $(config_h) \ 1136 termhooks.h buffer.h atimer.h systime.h $(INTERVAL_SRC) $(config_h) \
1138 window.h dispextern.h keyboard.h keymap.h 1137 window.h dispextern.h keyboard.h keymap.h
1139fileio.o: fileio.c window.h buffer.h systime.h $(INTERVAL_SRC) charset.h \ 1138fileio.o: fileio.c window.h buffer.h systime.h $(INTERVAL_SRC) charset.h \
1140 coding.h msdos.h dispextern.h blockinput.h $(config_h) 1139 coding.h msdos.h dispextern.h blockinput.h atimer.h $(config_h)
1141filelock.o: filelock.c buffer.h charset.h coding.h systime.h epaths.h $(config_h) 1140filelock.o: filelock.c buffer.h charset.h coding.h systime.h epaths.h $(config_h)
1142filemode.o: filemode.c $(config_h) 1141filemode.o: filemode.c $(config_h)
1143frame.o: frame.c xterm.h window.h frame.h termhooks.h commands.h keyboard.h \ 1142frame.o: frame.c xterm.h window.h frame.h termhooks.h commands.h keyboard.h \
@@ -1176,7 +1175,7 @@ minibuf.o: minibuf.c syntax.h dispextern.h frame.h window.h keyboard.h \
1176mktime.o: mktime.c $(config_h) 1175mktime.o: mktime.c $(config_h)
1177msdos.o: msdos.c msdos.h dosfns.h systime.h termhooks.h dispextern.h frame.h \ 1176msdos.o: msdos.c msdos.h dosfns.h systime.h termhooks.h dispextern.h frame.h \
1178 termopts.h termchar.h charset.h coding.h ccl.h disptab.h window.h \ 1177 termopts.h termchar.h charset.h coding.h ccl.h disptab.h window.h \
1179 keyboard.h intervals.h buffer.h commands.h blockinput.h $(config_h) 1178 keyboard.h intervals.h buffer.h commands.h blockinput.h atimer.h $(config_h)
1180process.o: process.c process.h buffer.h window.h termhooks.h termopts.h \ 1179process.o: process.c process.h buffer.h window.h termhooks.h termopts.h \
1181 commands.h syssignal.h systime.h systty.h syswait.h frame.h dispextern.h \ 1180 commands.h syssignal.h systime.h systty.h syswait.h frame.h dispextern.h \
1182 blockinput.h atimer.h charset.h coding.h ccl.h msdos.h composite.h \ 1181 blockinput.h atimer.h charset.h coding.h ccl.h msdos.h composite.h \
@@ -1196,7 +1195,7 @@ sysdep.o: sysdep.c syssignal.h systty.h systime.h syswait.h blockinput.h \
1196 frame.h atimer.h window.h msdos.h dosfns.h keyboard.h cm.h $(config_h) 1195 frame.h atimer.h window.h msdos.h dosfns.h keyboard.h cm.h $(config_h)
1197term.o: term.c termchar.h termhooks.h termopts.h $(config_h) cm.h frame.h \ 1196term.o: term.c termchar.h termhooks.h termopts.h $(config_h) cm.h frame.h \
1198 disptab.h dispextern.h keyboard.h charset.h coding.h ccl.h msdos.h \ 1197 disptab.h dispextern.h keyboard.h charset.h coding.h ccl.h msdos.h \
1199 window.h keymap.h 1198 window.h keymap.h blockinput.h atimer.h systime.h
1200termcap.o: termcap.c $(config_h) 1199termcap.o: termcap.c $(config_h)
1201terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \ 1200terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \
1202 keyboard.h $(config_h) 1201 keyboard.h $(config_h)
@@ -1213,7 +1212,8 @@ widget.o: widget.c xterm.h frame.h dispextern.h widgetprv.h \
1213 $(srcdir)/../lwlib/lwlib.h $(config_h) 1212 $(srcdir)/../lwlib/lwlib.h $(config_h)
1214window.o: window.c indent.h commands.h frame.h window.h buffer.h termchar.h \ 1213window.o: window.c indent.h commands.h frame.h window.h buffer.h termchar.h \
1215 disptab.h keyboard.h dispextern.h msdos.h composite.h \ 1214 disptab.h keyboard.h dispextern.h msdos.h composite.h \
1216 keymap.h blockinput.h $(INTERVAL_SRC) xterm.h w32term.h macterm.h $(config_h) 1215 keymap.h blockinput.h atimer.h systime.h $(INTERVAL_SRC) \
1216 xterm.h w32term.h macterm.h $(config_h)
1217xdisp.o: xdisp.c macros.h commands.h process.h indent.h buffer.h dispextern.h coding.h \ 1217xdisp.o: xdisp.c macros.h commands.h process.h indent.h buffer.h dispextern.h coding.h \
1218 termchar.h frame.h window.h disptab.h termhooks.h charset.h $(config_h) \ 1218 termchar.h frame.h window.h disptab.h termhooks.h charset.h $(config_h) \
1219 keyboard.h $(INTERVAL_SRC) region-cache.h xterm.h w32term.h macterm.h \ 1219 keyboard.h $(INTERVAL_SRC) region-cache.h xterm.h w32term.h macterm.h \
@@ -1238,7 +1238,8 @@ xrdb.o: xrdb.c $(config_h) epaths.h
1238xsmfns.o: xsmfns.c $(config_h) systime.h sysselect.h termhooks.h xterm.h \ 1238xsmfns.o: xsmfns.c $(config_h) systime.h sysselect.h termhooks.h xterm.h \
1239 lisp.h termopts.h 1239 lisp.h termopts.h
1240gtkutil.o: gtkutil.c gtkutil.h xterm.h lisp.h frame.h $(config_h) \ 1240gtkutil.o: gtkutil.c gtkutil.h xterm.h lisp.h frame.h $(config_h) \
1241 blockinput.h window.h atimer.h termhooks.h keyboard.h charset.h coding.h 1241 blockinput.h window.h atimer.h systime.h termhooks.h keyboard.h \
1242 charset.h coding.h
1242 1243
1243hftctl.o: hftctl.c $(config_h) 1244hftctl.o: hftctl.c $(config_h)
1244sound.o: sound.c dispextern.h $(config_h) 1245sound.o: sound.c dispextern.h $(config_h)
@@ -1256,10 +1257,10 @@ eval.o: eval.c commands.h keyboard.h blockinput.h atimer.h systime.h \
1256floatfns.o: floatfns.c $(config_h) 1257floatfns.o: floatfns.c $(config_h)
1257fns.o: fns.c commands.h $(config_h) frame.h buffer.h charset.h keyboard.h \ 1258fns.o: fns.c commands.h $(config_h) frame.h buffer.h charset.h keyboard.h \
1258 keymap.h frame.h window.h dispextern.h $(INTERVAL_SRC) coding.h md5.h \ 1259 keymap.h frame.h window.h dispextern.h $(INTERVAL_SRC) coding.h md5.h \
1259 blockinput.h xterm.h termhooks.h 1260 blockinput.h atimer.h systime.h xterm.h termhooks.h
1260print.o: print.c process.h frame.h window.h buffer.h keyboard.h charset.h \ 1261print.o: print.c process.h frame.h window.h buffer.h keyboard.h charset.h \
1261 $(config_h) dispextern.h termchar.h $(INTERVAL_SRC) msdos.h composite.h \ 1262 $(config_h) dispextern.h termchar.h $(INTERVAL_SRC) msdos.h composite.h \
1262 termchar.h 1263 blockinput.h atimer.h systime.h
1263lread.o: lread.c commands.h keyboard.h buffer.h epaths.h charset.h \ 1264lread.o: lread.c commands.h keyboard.h buffer.h epaths.h charset.h \
1264 $(config_h) $(INTERVAL_SRC) termhooks.h coding.h msdos.h 1265 $(config_h) $(INTERVAL_SRC) termhooks.h coding.h msdos.h
1265 1266
@@ -1285,14 +1286,15 @@ mac.o: mac.c process.h sysselect.h blockinput.h atimer.h systime.h charset.h \
1285 coding.h ccl.h $(config_h) 1286 coding.h ccl.h $(config_h)
1286macfns.o: macfns.c charset.h macterm.h macgui.h frame.h window.h buffer.h \ 1287macfns.o: macfns.c charset.h macterm.h macgui.h frame.h window.h buffer.h \
1287 dispextern.h macgui.h fontset.h $(INTERVAL_SRC) keyboard.h blockinput.h \ 1288 dispextern.h macgui.h fontset.h $(INTERVAL_SRC) keyboard.h blockinput.h \
1288 atimer.h systime.h epaths.h termhooks.h coding.h systime.h $(config_h) 1289 atimer.h systime.h epaths.h termhooks.h coding.h $(config_h)
1289macmenu.o: macmenu.c termhooks.h frame.h window.h dispextern.h macgui.h \ 1290macmenu.o: macmenu.c termhooks.h frame.h window.h dispextern.h macgui.h \
1290 keyboard.h blockinput.h atimer.h systime.h buffer.h macterm.h $(config_h) 1291 keyboard.h blockinput.h atimer.h systime.h buffer.h macterm.h $(config_h)
1291macterm.o: blockinput.h atimer.h systime.h syssignal.h macterm.h macgui.h \ 1292macterm.o: blockinput.h atimer.h systime.h syssignal.h macterm.h macgui.h \
1292 frame.h charset.h ccl.h dispextern.h fontset.h termhooks.h termopts.h \ 1293 frame.h charset.h ccl.h dispextern.h fontset.h termhooks.h termopts.h \
1293 termchar.h gnu.h disptab.h buffer.h window.h keyboard.h $(INTERVAL_SRC) \ 1294 termchar.h gnu.h disptab.h buffer.h window.h keyboard.h $(INTERVAL_SRC) \
1294 process.h coding.h $(config_h) 1295 process.h coding.h $(config_h)
1295macselect.o: blockinput.h macterm.h macgui.h frame.h keymap.h $(config_h) 1296macselect.o: blockinput.h atimer.h systime.h macterm.h macgui.h frame.h \
1297 keymap.h $(config_h)
1296 1298
1297${emacsapp}Contents/Resources/English.lproj: 1299${emacsapp}Contents/Resources/English.lproj:
1298 mkdir -p $@ 1300 mkdir -p $@
diff --git a/src/buffer.c b/src/buffer.c
index 73e2fb376f7..6e2f097ae88 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5712,8 +5712,8 @@ characters or nil. The value nil means display the character in the
5712default fashion; otherwise, the characters from the vector are delivered 5712default fashion; otherwise, the characters from the vector are delivered
5713to the screen instead of the original character. 5713to the screen instead of the original character.
5714 5714
5715For example, (aset buffer-display-table ?X ?Y) will cause Emacs to display 5715For example, (aset buffer-display-table ?X [?Y]) tells Emacs
5716a capital Y instead of each X character. 5716to display a capital Y instead of each X character.
5717 5717
5718In addition, a char-table has six extra slots to control the display of: 5718In addition, a char-table has six extra slots to control the display of:
5719 5719
diff --git a/src/dired.c b/src/dired.c
index c542f8019db..ee76fe47be2 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -670,8 +670,15 @@ file_name_completion (file, dirname, all_flag, ver_flag, predicate)
670 if (!NILP (predicate)) 670 if (!NILP (predicate))
671 { 671 {
672 Lisp_Object decoded; 672 Lisp_Object decoded;
673 Lisp_Object val;
674 struct gcpro gcpro1;
675
676 GCPRO1 (name);
673 decoded = Fexpand_file_name (DECODE_FILE (name), dirname); 677 decoded = Fexpand_file_name (DECODE_FILE (name), dirname);
674 if (NILP (call1 (predicate, decoded))) 678 val = call1 (predicate, decoded);
679 UNGCPRO;
680
681 if (NILP (val))
675 continue; 682 continue;
676 } 683 }
677 684
@@ -694,7 +701,7 @@ file_name_completion (file, dirname, all_flag, ver_flag, predicate)
694 compare = min (bestmatchsize, len); 701 compare = min (bestmatchsize, len);
695 p1 = SDATA (bestmatch); 702 p1 = SDATA (bestmatch);
696 p2 = (unsigned char *) dp->d_name; 703 p2 = (unsigned char *) dp->d_name;
697 matchsize = scmp(p1, p2, compare); 704 matchsize = scmp (p1, p2, compare);
698 if (matchsize < 0) 705 if (matchsize < 0)
699 matchsize = compare; 706 matchsize = compare;
700 if (completion_ignore_case) 707 if (completion_ignore_case)
diff --git a/src/dispnew.c b/src/dispnew.c
index 4c3a4ca3f02..697773f4daf 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6381,7 +6381,11 @@ FILE = nil means just close any termscript file currently open. */)
6381 tty = CURTTY (); 6381 tty = CURTTY ();
6382 6382
6383 if (tty->termscript != 0) 6383 if (tty->termscript != 0)
6384 {
6385 BLOCK_INPUT;
6384 fclose (tty->termscript); 6386 fclose (tty->termscript);
6387 UNBLOCK_INPUT;
6388 }
6385 tty->termscript = 0; 6389 tty->termscript = 0;
6386 6390
6387 if (! NILP (file)) 6391 if (! NILP (file))
@@ -6412,6 +6416,7 @@ currently selected frame. */)
6412 6416
6413 /* ??? Perhaps we should do something special for multibyte strings here. */ 6417 /* ??? Perhaps we should do something special for multibyte strings here. */
6414 CHECK_STRING (string); 6418 CHECK_STRING (string);
6419 BLOCK_INPUT;
6415 6420
6416 if (!t) 6421 if (!t)
6417 error ("Unknown terminal device"); 6422 error ("Unknown terminal device");
@@ -6425,6 +6430,7 @@ currently selected frame. */)
6425 } 6430 }
6426 fwrite (SDATA (string), 1, SBYTES (string), tty->output); 6431 fwrite (SDATA (string), 1, SBYTES (string), tty->output);
6427 fflush (tty->output); 6432 fflush (tty->output);
6433 UNBLOCK_INPUT;
6428 return Qnil; 6434 return Qnil;
6429} 6435}
6430 6436
diff --git a/src/editfns.c b/src/editfns.c
index 5053119d0c4..fc99bf977d0 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1729,7 +1729,7 @@ support. MINUTE is an integer between 0 and 59. HOUR is an integer
1729between 0 and 23. DAY is an integer between 1 and 31. MONTH is an 1729between 0 and 23. DAY is an integer between 1 and 31. MONTH is an
1730integer between 1 and 12. YEAR is an integer indicating the 1730integer between 1 and 12. YEAR is an integer indicating the
1731four-digit year. DOW is the day of week, an integer between 0 and 6, 1731four-digit year. DOW is the day of week, an integer between 0 and 6,
1732where 0 is Sunday. DST is t if daylight savings time is effect, 1732where 0 is Sunday. DST is t if daylight saving time is in effect,
1733otherwise nil. ZONE is an integer indicating the number of seconds 1733otherwise nil. ZONE is an integer indicating the number of seconds
1734east of Greenwich. (Note that Common Lisp has different meanings for 1734east of Greenwich. (Note that Common Lisp has different meanings for
1735DOW and ZONE.) */) 1735DOW and ZONE.) */)
@@ -1778,7 +1778,7 @@ This is the reverse operation of `decode-time', which see.
1778ZONE defaults to the current time zone rule. This can 1778ZONE defaults to the current time zone rule. This can
1779be a string or t (as from `set-time-zone-rule'), or it can be a list 1779be a string or t (as from `set-time-zone-rule'), or it can be a list
1780\(as from `current-time-zone') or an integer (as from `decode-time') 1780\(as from `current-time-zone') or an integer (as from `decode-time')
1781applied without consideration for daylight savings time. 1781applied without consideration for daylight saving time.
1782 1782
1783You can pass more than 7 arguments; then the first six arguments 1783You can pass more than 7 arguments; then the first six arguments
1784are used as SECOND through YEAR, and the *last* argument is used as ZONE. 1784are used as SECOND through YEAR, and the *last* argument is used as ZONE.
diff --git a/src/fileio.c b/src/fileio.c
index 074a7a0527c..7cb45a72db7 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5806,7 +5806,11 @@ do_auto_save_unwind (arg) /* used as unwind-protect function */
5806 FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer; 5806 FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer;
5807 auto_saving = 0; 5807 auto_saving = 0;
5808 if (stream != NULL) 5808 if (stream != NULL)
5809 fclose (stream); 5809 {
5810 BLOCK_INPUT;
5811 fclose (stream);
5812 UNBLOCK_INPUT;
5813 }
5810 return Qnil; 5814 return Qnil;
5811} 5815}
5812 5816
@@ -5936,6 +5940,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
5936 if (STRINGP (b->auto_save_file_name) 5940 if (STRINGP (b->auto_save_file_name)
5937 && stream != NULL && do_handled_files == 0) 5941 && stream != NULL && do_handled_files == 0)
5938 { 5942 {
5943 BLOCK_INPUT;
5939 if (!NILP (b->filename)) 5944 if (!NILP (b->filename))
5940 { 5945 {
5941 fwrite (SDATA (b->filename), 1, 5946 fwrite (SDATA (b->filename), 1,
@@ -5945,6 +5950,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
5945 fwrite (SDATA (b->auto_save_file_name), 1, 5950 fwrite (SDATA (b->auto_save_file_name), 1,
5946 SBYTES (b->auto_save_file_name), stream); 5951 SBYTES (b->auto_save_file_name), stream);
5947 putc ('\n', stream); 5952 putc ('\n', stream);
5953 UNBLOCK_INPUT;
5948 } 5954 }
5949 5955
5950 if (!NILP (current_only) 5956 if (!NILP (current_only)
diff --git a/src/image.c b/src/image.c
index 49d25d819bc..198ffaf4651 100644
--- a/src/image.c
+++ b/src/image.c
@@ -5744,6 +5744,14 @@ pbm_load (f, img)
5744 } 5744 }
5745 else 5745 else
5746 { 5746 {
5747 if (raw_p && (p + 3 * height * width > end))
5748 {
5749 x_destroy_x_image (ximg);
5750 image_error ("Invalid image size in image `%s'",
5751 img->spec, Qnil);
5752 goto error;
5753 }
5754
5747 for (y = 0; y < height; ++y) 5755 for (y = 0; y < height; ++y)
5748 for (x = 0; x < width; ++x) 5756 for (x = 0; x < width; ++x)
5749 { 5757 {
diff --git a/src/keyboard.c b/src/keyboard.c
index 82e97441667..686d16a504f 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -138,10 +138,10 @@ KBOARD the_only_kboard;
138 do not execute it; call disabled-command-function's value instead. */ 138 do not execute it; call disabled-command-function's value instead. */
139Lisp_Object Qdisabled, Qdisabled_command_function; 139Lisp_Object Qdisabled, Qdisabled_command_function;
140 140
141#define NUM_RECENT_KEYS (100) 141#define NUM_RECENT_KEYS (300)
142int recent_keys_index; /* Index for storing next element into recent_keys */ 142int recent_keys_index; /* Index for storing next element into recent_keys */
143int total_keys; /* Total number of elements stored into recent_keys */ 143int total_keys; /* Total number of elements stored into recent_keys */
144Lisp_Object recent_keys; /* A vector, holding the last 100 keystrokes */ 144Lisp_Object recent_keys; /* Vector holds the last NUM_RECENT_KEYS keystrokes */
145 145
146/* Vector holding the key sequence that invoked the current command. 146/* Vector holding the key sequence that invoked the current command.
147 It is reused for each command, and it may be longer than the current 147 It is reused for each command, and it may be longer than the current
@@ -2533,6 +2533,17 @@ Lisp_Object print_help ();
2533static Lisp_Object kbd_buffer_get_event (); 2533static Lisp_Object kbd_buffer_get_event ();
2534static void record_char (); 2534static void record_char ();
2535 2535
2536static Lisp_Object help_form_saved_window_configs;
2537static Lisp_Object
2538read_char_help_form_unwind (arg)
2539{
2540 Lisp_Object window_config = XCAR (help_form_saved_window_configs);
2541 help_form_saved_window_configs = XCDR (help_form_saved_window_configs);
2542 if (!NILP (window_config))
2543 Fset_window_configuration (window_config);
2544 return Qnil;
2545}
2546
2536#define STOP_POLLING \ 2547#define STOP_POLLING \
2537do { if (! polling_stopped_here) stop_polling (); \ 2548do { if (! polling_stopped_here) stop_polling (); \
2538 polling_stopped_here = 1; } while (0) 2549 polling_stopped_here = 1; } while (0)
@@ -3427,8 +3438,10 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
3427 Lisp_Object tem0; 3438 Lisp_Object tem0;
3428 count = SPECPDL_INDEX (); 3439 count = SPECPDL_INDEX ();
3429 3440
3430 record_unwind_protect (Fset_window_configuration, 3441 help_form_saved_window_configs
3431 Fcurrent_window_configuration (Qnil)); 3442 = Fcons (Fcurrent_window_configuration (Qnil),
3443 help_form_saved_window_configs);
3444 record_unwind_protect (read_char_help_form_unwind, Qnil);
3432 3445
3433 tem0 = Feval (Vhelp_form); 3446 tem0 = Feval (Vhelp_form);
3434 if (STRINGP (tem0)) 3447 if (STRINGP (tem0))
@@ -3436,7 +3449,12 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
3436 3449
3437 cancel_echoing (); 3450 cancel_echoing ();
3438 do 3451 do
3439 c = read_char (0, 0, 0, Qnil, 0, NULL); 3452 {
3453 c = read_char (0, 0, 0, Qnil, 0, NULL);
3454 if (EVENT_HAS_PARAMETERS (c)
3455 && EQ (EVENT_HEAD_KIND (EVENT_HEAD (c)), Qmouse_click))
3456 XSETCAR (help_form_saved_window_configs, Qnil);
3457 }
3440 while (BUFFERP (c)); 3458 while (BUFFERP (c));
3441 /* Remove the help from the frame */ 3459 /* Remove the help from the frame */
3442 unbind_to (count, Qnil); 3460 unbind_to (count, Qnil);
@@ -3615,6 +3633,7 @@ record_char (c)
3615 If you, dear reader, have a better idea, you've got the source. :-) */ 3633 If you, dear reader, have a better idea, you've got the source. :-) */
3616 if (dribble) 3634 if (dribble)
3617 { 3635 {
3636 BLOCK_INPUT;
3618 if (INTEGERP (c)) 3637 if (INTEGERP (c))
3619 { 3638 {
3620 if (XUINT (c) < 0x100) 3639 if (XUINT (c) < 0x100)
@@ -3640,6 +3659,7 @@ record_char (c)
3640 } 3659 }
3641 3660
3642 fflush (dribble); 3661 fflush (dribble);
3662 UNBLOCK_INPUT;
3643 } 3663 }
3644} 3664}
3645 3665
@@ -9592,6 +9612,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
9592 if (!NILP (map) || !NILP (map2)) 9612 if (!NILP (map) || !NILP (map2))
9593 { 9613 {
9594 from_string = string; 9614 from_string = string;
9615 keybuf[t++] = key;
9616 mock_input = t;
9595 goto replay_sequence; 9617 goto replay_sequence;
9596 } 9618 }
9597 } 9619 }
@@ -10483,7 +10505,7 @@ if there is a doubt, the value is t. */)
10483} 10505}
10484 10506
10485DEFUN ("recent-keys", Frecent_keys, Srecent_keys, 0, 0, 0, 10507DEFUN ("recent-keys", Frecent_keys, Srecent_keys, 0, 0, 0,
10486 doc: /* Return vector of last 100 events, not counting those from keyboard macros. */) 10508 doc: /* Return vector of last 300 events, not counting those from keyboard macros. */)
10487 () 10509 ()
10488{ 10510{
10489 Lisp_Object *keys = XVECTOR (recent_keys)->contents; 10511 Lisp_Object *keys = XVECTOR (recent_keys)->contents;
@@ -10627,7 +10649,9 @@ If FILE is nil, close any open dribble file. */)
10627{ 10649{
10628 if (dribble) 10650 if (dribble)
10629 { 10651 {
10652 BLOCK_INPUT;
10630 fclose (dribble); 10653 fclose (dribble);
10654 UNBLOCK_INPUT;
10631 dribble = 0; 10655 dribble = 0;
10632 } 10656 }
10633 if (!NILP (file)) 10657 if (!NILP (file))
@@ -11731,6 +11755,9 @@ syms_of_keyboard ()
11731 menu_bar_items_vector = Qnil; 11755 menu_bar_items_vector = Qnil;
11732 staticpro (&menu_bar_items_vector); 11756 staticpro (&menu_bar_items_vector);
11733 11757
11758 help_form_saved_window_configs = Qnil;
11759 staticpro (&help_form_saved_window_configs);
11760
11734 defsubr (&Scurrent_idle_time); 11761 defsubr (&Scurrent_idle_time);
11735 defsubr (&Sevent_convert_list); 11762 defsubr (&Sevent_convert_list);
11736 defsubr (&Sread_key_sequence); 11763 defsubr (&Sread_key_sequence);
@@ -11797,7 +11824,7 @@ An element of the form (t . EVENT) forces EVENT to be added to that list. */);
11797 DEFVAR_LISP ("unread-post-input-method-events", &Vunread_post_input_method_events, 11824 DEFVAR_LISP ("unread-post-input-method-events", &Vunread_post_input_method_events,
11798 doc: /* List of events to be processed as input by input methods. 11825 doc: /* List of events to be processed as input by input methods.
11799These events are processed before `unread-command-events' 11826These events are processed before `unread-command-events'
11800and actual keyboard input without given to `input-method-function'. */); 11827and actual keyboard input, but are not given to `input-method-function'. */);
11801 Vunread_post_input_method_events = Qnil; 11828 Vunread_post_input_method_events = Qnil;
11802 11829
11803 DEFVAR_LISP ("unread-input-method-events", &Vunread_input_method_events, 11830 DEFVAR_LISP ("unread-input-method-events", &Vunread_input_method_events,
diff --git a/src/keymap.c b/src/keymap.c
index 0f1e922969c..0aaf9373ba1 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -2985,6 +2985,8 @@ Keyboard translations:\n\n\
2985You type Translation\n\ 2985You type Translation\n\
2986-------- -----------\n"; 2986-------- -----------\n";
2987 2987
2988 CHECK_BUFFER (buffer);
2989
2988 shadow = Qnil; 2990 shadow = Qnil;
2989 GCPRO1 (shadow); 2991 GCPRO1 (shadow);
2990 2992
diff --git a/src/lisp.h b/src/lisp.h
index 7a03836021b..8a060b19941 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2649,6 +2649,7 @@ EXFUN (Fread_char, 3);
2649EXFUN (Fread_event, 3); 2649EXFUN (Fread_event, 3);
2650extern Lisp_Object read_filtered_event P_ ((int, int, int, int, Lisp_Object)); 2650extern Lisp_Object read_filtered_event P_ ((int, int, int, int, Lisp_Object));
2651EXFUN (Feval_region, 4); 2651EXFUN (Feval_region, 4);
2652extern Lisp_Object check_obarray P_ ((Lisp_Object));
2652extern Lisp_Object intern P_ ((const char *)); 2653extern Lisp_Object intern P_ ((const char *));
2653extern Lisp_Object make_symbol P_ ((char *)); 2654extern Lisp_Object make_symbol P_ ((char *));
2654extern Lisp_Object oblookup P_ ((Lisp_Object, const char *, int, int)); 2655extern Lisp_Object oblookup P_ ((Lisp_Object, const char *, int, int));
diff --git a/src/lread.c b/src/lread.c
index f1671c4543c..cee6cf5a92e 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -38,6 +38,7 @@ Boston, MA 02110-1301, USA. */
38#include "frame.h" 38#include "frame.h"
39#include "termhooks.h" 39#include "termhooks.h"
40#include "coding.h" 40#include "coding.h"
41#include "blockinput.h"
41 42
42#ifdef lint 43#ifdef lint
43#include <sys/inode.h> 44#include <sys/inode.h>
@@ -326,14 +327,18 @@ readchar (readcharfun)
326 327
327 if (EQ (readcharfun, Qget_file_char)) 328 if (EQ (readcharfun, Qget_file_char))
328 { 329 {
330 BLOCK_INPUT;
329 c = getc (instream); 331 c = getc (instream);
332 UNBLOCK_INPUT;
330#ifdef EINTR 333#ifdef EINTR
331 /* Interrupted reads have been observed while reading over the network */ 334 /* Interrupted reads have been observed while reading over the network */
332 while (c == EOF && ferror (instream) && errno == EINTR) 335 while (c == EOF && ferror (instream) && errno == EINTR)
333 { 336 {
334 QUIT; 337 QUIT;
335 clearerr (instream); 338 clearerr (instream);
339 BLOCK_INPUT;
336 c = getc (instream); 340 c = getc (instream);
341 UNBLOCK_INPUT;
337 } 342 }
338#endif 343#endif
339 return c; 344 return c;
@@ -416,7 +421,11 @@ unreadchar (readcharfun, c)
416 else if (EQ (readcharfun, Qlambda)) 421 else if (EQ (readcharfun, Qlambda))
417 read_bytecode_char (1); 422 read_bytecode_char (1);
418 else if (EQ (readcharfun, Qget_file_char)) 423 else if (EQ (readcharfun, Qget_file_char))
419 ungetc (c, instream); 424 {
425 BLOCK_INPUT;
426 ungetc (c, instream);
427 UNBLOCK_INPUT;
428 }
420 else 429 else
421 call1 (readcharfun, make_number (c)); 430 call1 (readcharfun, make_number (c));
422} 431}
@@ -627,7 +636,9 @@ DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0,
627 () 636 ()
628{ 637{
629 register Lisp_Object val; 638 register Lisp_Object val;
639 BLOCK_INPUT;
630 XSETINT (val, getc (instream)); 640 XSETINT (val, getc (instream));
641 UNBLOCK_INPUT;
631 return val; 642 return val;
632} 643}
633 644
@@ -1046,7 +1057,11 @@ load_unwind (arg) /* used as unwind-protect function in load */
1046{ 1057{
1047 FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer; 1058 FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer;
1048 if (stream != NULL) 1059 if (stream != NULL)
1049 fclose (stream); 1060 {
1061 BLOCK_INPUT;
1062 fclose (stream);
1063 UNBLOCK_INPUT;
1064 }
1050 if (--load_in_progress < 0) load_in_progress = 0; 1065 if (--load_in_progress < 0) load_in_progress = 0;
1051 return Qnil; 1066 return Qnil;
1052} 1067}
diff --git a/src/macfns.c b/src/macfns.c
index 9be0d0e9ea5..c05906d6499 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -1909,24 +1909,6 @@ x_set_scroll_bar_default_width (f)
1909#endif /* not MAC_OSX */ 1909#endif /* not MAC_OSX */
1910} 1910}
1911 1911
1912void
1913mac_set_scroll_bar_width (f, arg, oldval)
1914 struct frame *f;
1915 Lisp_Object arg, oldval;
1916{
1917#ifdef MAC_OSX
1918 if (INTEGERP (arg) && XINT (arg) > 0)
1919 {
1920 if (XINT (arg) < (MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH
1921 + MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH) / 2)
1922 XSETINT (arg, MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH);
1923 else
1924 XSETINT (arg, MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH);
1925 }
1926#endif
1927 x_set_scroll_bar_width (f, arg, oldval);
1928}
1929
1930static void 1912static void
1931mac_set_font (f, arg, oldval) 1913mac_set_font (f, arg, oldval)
1932 struct frame *f; 1914 struct frame *f;
@@ -3052,7 +3034,7 @@ If omitted or nil, that stands for the selected frame's display. */)
3052 (display) 3034 (display)
3053 Lisp_Object display; 3035 Lisp_Object display;
3054{ 3036{
3055 return build_string ("Apple Computers"); 3037 return build_string ("Apple Inc.");
3056} 3038}
3057 3039
3058DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, 3040DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
@@ -4677,7 +4659,7 @@ frame_parm_handler mac_frame_parm_handlers[] =
4677 x_set_menu_bar_lines, 4659 x_set_menu_bar_lines,
4678 x_set_mouse_color, 4660 x_set_mouse_color,
4679 x_explicitly_set_name, 4661 x_explicitly_set_name,
4680 mac_set_scroll_bar_width, 4662 x_set_scroll_bar_width,
4681 x_set_title, 4663 x_set_title,
4682 x_set_unsplittable, 4664 x_set_unsplittable,
4683 x_set_vertical_scroll_bars, 4665 x_set_vertical_scroll_bars,
diff --git a/src/macmenu.c b/src/macmenu.c
index 82322515c31..c7a84df7106 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -259,6 +259,9 @@ static int menu_items_n_panes;
259/* Current depth within submenus. */ 259/* Current depth within submenus. */
260static int menu_items_submenu_depth; 260static int menu_items_submenu_depth;
261 261
262/* Nonzero means a menu is currently active. */
263static int popup_activated_flag;
264
262/* This is set nonzero after the user activates the menu bar, and set 265/* This is set nonzero after the user activates the menu bar, and set
263 to zero again after the menu bars are redisplayed by prepare_menu_bar. 266 to zero again after the menu bars are redisplayed by prepare_menu_bar.
264 While it is nonzero, all calls to set_frame_menubar go deep. 267 While it is nonzero, all calls to set_frame_menubar go deep.
@@ -1141,7 +1144,9 @@ x_activate_menubar (f)
1141 set_frame_menubar (f, 0, 1); 1144 set_frame_menubar (f, 0, 1);
1142 BLOCK_INPUT; 1145 BLOCK_INPUT;
1143 1146
1147 popup_activated_flag = 1;
1144 menu_choice = MenuSelect (saved_menu_event_location); 1148 menu_choice = MenuSelect (saved_menu_event_location);
1149 popup_activated_flag = 0;
1145 menu_id = HiWord (menu_choice); 1150 menu_id = HiWord (menu_choice);
1146 menu_item = LoWord (menu_choice); 1151 menu_item = LoWord (menu_choice);
1147 1152
@@ -2237,7 +2242,9 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
2237 install_menu_quit_handler (MAC_MENU_POPUP_SUB, menu); 2242 install_menu_quit_handler (MAC_MENU_POPUP_SUB, menu);
2238 2243
2239 /* Display the menu. */ 2244 /* Display the menu. */
2245 popup_activated_flag = 1;
2240 menu_item_choice = PopUpMenuSelect (menu, pos.v, pos.h, 0); 2246 menu_item_choice = PopUpMenuSelect (menu, pos.v, pos.h, 0);
2247 popup_activated_flag = 0;
2241 2248
2242 /* Get the refcon to find the correct item */ 2249 /* Get the refcon to find the correct item */
2243 if (menu_item_choice) 2250 if (menu_item_choice)
@@ -3218,6 +3225,14 @@ dispose_menus (kind, id)
3218 3225
3219#endif /* HAVE_MENUS */ 3226#endif /* HAVE_MENUS */
3220 3227
3228/* Detect if a menu is currently active. */
3229
3230int
3231popup_activated ()
3232{
3233 return popup_activated_flag;
3234}
3235
3221/* The following is used by delayed window autoselection. */ 3236/* The following is used by delayed window autoselection. */
3222 3237
3223DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0, 3238DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0,
diff --git a/src/macterm.c b/src/macterm.c
index f4e52a01174..f26c06680bc 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -4484,25 +4484,24 @@ note_mouse_movement (frame, pos)
4484 last_mouse_motion_position = *pos; 4484 last_mouse_motion_position = *pos;
4485 XSETFRAME (last_mouse_motion_frame, frame); 4485 XSETFRAME (last_mouse_motion_frame, frame);
4486 4486
4487 if (frame == dpyinfo->mouse_face_mouse_frame
4487#if TARGET_API_MAC_CARBON 4488#if TARGET_API_MAC_CARBON
4488 if (!PtInRect (*pos, GetWindowPortBounds (FRAME_MAC_WINDOW (frame), &r))) 4489 && !PtInRect (*pos, GetWindowPortBounds (FRAME_MAC_WINDOW (frame), &r))
4489#else 4490#else
4490 if (!PtInRect (*pos, &FRAME_MAC_WINDOW (frame)->portRect)) 4491 && !PtInRect (*pos, &FRAME_MAC_WINDOW (frame)->portRect)
4491#endif 4492#endif
4493 )
4492 { 4494 {
4493 if (frame == dpyinfo->mouse_face_mouse_frame) 4495 /* This case corresponds to LeaveNotify in X11. If we move
4494 /* This case corresponds to LeaveNotify in X11. */ 4496 outside the frame, then we're certainly no longer on any text
4495 { 4497 in the frame. */
4496 /* If we move outside the frame, then we're certainly no 4498 clear_mouse_face (dpyinfo);
4497 longer on any text in the frame. */ 4499 dpyinfo->mouse_face_mouse_frame = 0;
4498 clear_mouse_face (dpyinfo); 4500 if (!dpyinfo->grabbed)
4499 dpyinfo->mouse_face_mouse_frame = 0; 4501 rif->define_frame_cursor (frame,
4500 if (!dpyinfo->grabbed) 4502 frame->output_data.mac->nontext_cursor);
4501 rif->define_frame_cursor (frame,
4502 frame->output_data.mac->nontext_cursor);
4503 }
4504 return 1;
4505 } 4503 }
4504
4506 /* Has the mouse moved off the glyph it was on at the last sighting? */ 4505 /* Has the mouse moved off the glyph it was on at the last sighting? */
4507 if (frame != last_mouse_glyph_frame 4506 if (frame != last_mouse_glyph_frame
4508 || !PtInRect (*pos, &last_mouse_glyph)) 4507 || !PtInRect (*pos, &last_mouse_glyph))
@@ -4963,7 +4962,7 @@ x_scroll_bar_create (w, top, left, width, height, disp_top, disp_height)
4963#endif 4962#endif
4964#if TARGET_API_MAC_CARBON 4963#if TARGET_API_MAC_CARBON
4965 ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", 4964 ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p",
4966#if USE_TOOLKIT_SCROLL_BARS 4965#ifdef USE_TOOLKIT_SCROLL_BARS
4967 false, 4966 false,
4968#else 4967#else
4969 width < disp_height, 4968 width < disp_height,
@@ -5217,7 +5216,11 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
5217#ifdef USE_TOOLKIT_SCROLL_BARS 5216#ifdef USE_TOOLKIT_SCROLL_BARS
5218 if (NILP (bar->track_top)) 5217 if (NILP (bar->track_top))
5219 { 5218 {
5220 if (sb_width >= disp_height) 5219 if (sb_width >= disp_height
5220#ifdef MAC_OSX
5221 || sb_width < MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH
5222#endif
5223 )
5221 { 5224 {
5222 XSETINT (bar->track_top, 0); 5225 XSETINT (bar->track_top, 0);
5223 XSETINT (bar->track_height, 0); 5226 XSETINT (bar->track_height, 0);
@@ -6223,6 +6226,16 @@ x_set_window_size (f, change_gravity, cols, rows)
6223#endif 6226#endif
6224 mac_handle_size_change (f, pixelwidth, pixelheight); 6227 mac_handle_size_change (f, pixelwidth, pixelheight);
6225 6228
6229 if (f->output_data.mac->internal_border_width
6230 != FRAME_INTERNAL_BORDER_WIDTH (f))
6231 {
6232 mac_clear_window (f);
6233 f->output_data.mac->internal_border_width
6234 = FRAME_INTERNAL_BORDER_WIDTH (f);
6235 }
6236
6237 SET_FRAME_GARBAGED (f);
6238
6226 UNBLOCK_INPUT; 6239 UNBLOCK_INPUT;
6227} 6240}
6228 6241
@@ -9974,23 +9987,30 @@ mac_handle_mouse_event (next_handler, event, data)
9974 if (err != noErr || axis != kEventMouseWheelAxisY) 9987 if (err != noErr || axis != kEventMouseWheelAxisY)
9975 break; 9988 break;
9976 9989
9977 err = GetEventParameter (event, kEventParamMouseWheelDelta,
9978 typeSInt32, NULL, sizeof (SInt32),
9979 NULL, &delta);
9980 if (err != noErr)
9981 break;
9982 err = GetEventParameter (event, kEventParamMouseLocation, 9990 err = GetEventParameter (event, kEventParamMouseLocation,
9983 typeQDPoint, NULL, sizeof (Point), 9991 typeQDPoint, NULL, sizeof (Point),
9984 NULL, &point); 9992 NULL, &point);
9985 if (err != noErr) 9993 if (err != noErr)
9986 break; 9994 break;
9995
9996 SetPortWindowPort (wp);
9997 GlobalToLocal (&point);
9998 if (point.h < 0 || point.v < 0
9999 || EQ (window_from_coordinates (f, point.h, point.v, 0, 0, 0, 1),
10000 f->tool_bar_window))
10001 break;
10002
10003 err = GetEventParameter (event, kEventParamMouseWheelDelta,
10004 typeSInt32, NULL, sizeof (SInt32),
10005 NULL, &delta);
10006 if (err != noErr)
10007 break;
10008
9987 read_socket_inev->kind = WHEEL_EVENT; 10009 read_socket_inev->kind = WHEEL_EVENT;
9988 read_socket_inev->code = 0; 10010 read_socket_inev->code = 0;
9989 read_socket_inev->modifiers = 10011 read_socket_inev->modifiers =
9990 (mac_event_to_emacs_modifiers (event) 10012 (mac_event_to_emacs_modifiers (event)
9991 | ((delta < 0) ? down_modifier : up_modifier)); 10013 | ((delta < 0) ? down_modifier : up_modifier));
9992 SetPortWindowPort (wp);
9993 GlobalToLocal (&point);
9994 XSETINT (read_socket_inev->x, point.h); 10014 XSETINT (read_socket_inev->x, point.h);
9995 XSETINT (read_socket_inev->y, point.v); 10015 XSETINT (read_socket_inev->y, point.v);
9996 XSETFRAME (read_socket_inev->frame_or_window, f); 10016 XSETFRAME (read_socket_inev->frame_or_window, f);
@@ -11045,7 +11065,7 @@ XTread_socket (sd, expected, hold_quit)
11045 else 11065 else
11046 { 11066 {
11047 /* A window has been deactivated */ 11067 /* A window has been deactivated */
11048#if USE_TOOLKIT_SCROLL_BARS 11068#ifdef USE_TOOLKIT_SCROLL_BARS
11049 if (dpyinfo->grabbed && tracked_scroll_bar) 11069 if (dpyinfo->grabbed && tracked_scroll_bar)
11050 { 11070 {
11051 struct input_event event; 11071 struct input_event event;
diff --git a/src/macterm.h b/src/macterm.h
index 6ee57d60d01..f2d69b7821d 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -327,6 +327,9 @@ struct mac_output
327 They are changed only when a different background is involved. */ 327 They are changed only when a different background is involved. */
328 unsigned long relief_background; 328 unsigned long relief_background;
329 329
330 /* Width of the internal border. */
331 int internal_border_width;
332
330 /* Hints for the size and the position of a window. */ 333 /* Hints for the size and the position of a window. */
331 XSizeHints *size_hints; 334 XSizeHints *size_hints;
332 335
diff --git a/src/minibuf.c b/src/minibuf.c
index 51a64ffed8b..e3fb8641615 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -702,27 +702,27 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
702 specbind (Qinhibit_read_only, Qt); 702 specbind (Qinhibit_read_only, Qt);
703 specbind (Qinhibit_modification_hooks, Qt); 703 specbind (Qinhibit_modification_hooks, Qt);
704 Ferase_buffer (); 704 Ferase_buffer ();
705
706 if (!NILP (current_buffer->enable_multibyte_characters)
707 && ! STRING_MULTIBYTE (minibuf_prompt))
708 minibuf_prompt = Fstring_make_multibyte (minibuf_prompt);
709
710 /* Insert the prompt, record where it ends. */
711 Finsert (1, &minibuf_prompt);
712 if (PT > BEG)
713 {
714 Fput_text_property (make_number (BEG), make_number (PT),
715 Qfront_sticky, Qt, Qnil);
716 Fput_text_property (make_number (BEG), make_number (PT),
717 Qrear_nonsticky, Qt, Qnil);
718 Fput_text_property (make_number (BEG), make_number (PT),
719 Qfield, Qt, Qnil);
720 Fadd_text_properties (make_number (BEG), make_number (PT),
721 Vminibuffer_prompt_properties, Qnil);
722 }
705 unbind_to (count1, Qnil); 723 unbind_to (count1, Qnil);
706 } 724 }
707 725
708 if (!NILP (current_buffer->enable_multibyte_characters)
709 && ! STRING_MULTIBYTE (minibuf_prompt))
710 minibuf_prompt = Fstring_make_multibyte (minibuf_prompt);
711
712 /* Insert the prompt, record where it ends. */
713 Finsert (1, &minibuf_prompt);
714 if (PT > BEG)
715 {
716 Fput_text_property (make_number (BEG), make_number (PT),
717 Qfront_sticky, Qt, Qnil);
718 Fput_text_property (make_number (BEG), make_number (PT),
719 Qrear_nonsticky, Qt, Qnil);
720 Fput_text_property (make_number (BEG), make_number (PT),
721 Qfield, Qt, Qnil);
722 Fadd_text_properties (make_number (BEG), make_number (PT),
723 Vminibuffer_prompt_properties, Qnil);
724 }
725
726 minibuf_prompt_width = (int) current_column (); /* iftc */ 726 minibuf_prompt_width = (int) current_column (); /* iftc */
727 727
728 /* Put in the initial input. */ 728 /* Put in the initial input. */
@@ -1489,6 +1489,10 @@ is used to further constrain the set of candidates. */)
1489 matchcount++; 1489 matchcount++;
1490 bestmatchsize = matchsize; 1490 bestmatchsize = matchsize;
1491 if (matchsize <= SCHARS (string) 1491 if (matchsize <= SCHARS (string)
1492 /* If completion-ignore-case is non-nil, don't
1493 short-circuit because we want to find the best
1494 possible match *including* case differences. */
1495 && !completion_ignore_case
1492 && matchcount > 1) 1496 && matchcount > 1)
1493 /* No need to look any further. */ 1497 /* No need to look any further. */
1494 break; 1498 break;
diff --git a/src/print.c b/src/print.c
index ed233729c6f..cbf5830a85b 100644
--- a/src/print.c
+++ b/src/print.c
@@ -33,6 +33,7 @@ Boston, MA 02110-1301, USA. */
33#include "dispextern.h" 33#include "dispextern.h"
34#include "termchar.h" 34#include "termchar.h"
35#include "intervals.h" 35#include "intervals.h"
36#include "blockinput.h"
36 37
37Lisp_Object Vstandard_output, Qstandard_output; 38Lisp_Object Vstandard_output, Qstandard_output;
38 39
@@ -976,7 +977,11 @@ append to existing target file. */)
976 Lisp_Object file, append; 977 Lisp_Object file, append;
977{ 978{
978 if (initial_stderr_stream != NULL) 979 if (initial_stderr_stream != NULL)
979 fclose (stderr); 980 {
981 BLOCK_INPUT;
982 fclose (stderr);
983 UNBLOCK_INPUT;
984 }
980 stderr = initial_stderr_stream; 985 stderr = initial_stderr_stream;
981 initial_stderr_stream = NULL; 986 initial_stderr_stream = NULL;
982 987
diff --git a/src/process.c b/src/process.c
index 8b1da4ac5cc..6d84d4c4a87 100644
--- a/src/process.c
+++ b/src/process.c
@@ -817,7 +817,7 @@ nil, indicating the current buffer's process. */)
817 Lisp_Object symbol; 817 Lisp_Object symbol;
818 /* Assignment to EMACS_INT stops GCC whining about limited range 818 /* Assignment to EMACS_INT stops GCC whining about limited range
819 of data type. */ 819 of data type. */
820 EMACS_INT pid = p->pid;; 820 EMACS_INT pid = p->pid;
821 821
822 /* No problem storing the pid here, as it is still in Vprocess_alist. */ 822 /* No problem storing the pid here, as it is still in Vprocess_alist. */
823 deleted_pid_list = Fcons (make_fixnum_or_float (pid), 823 deleted_pid_list = Fcons (make_fixnum_or_float (pid),
@@ -830,7 +830,8 @@ nil, indicating the current buffer's process. */)
830 if (CONSP (p->status)) 830 if (CONSP (p->status))
831 symbol = XCAR (p->status); 831 symbol = XCAR (p->status);
832 if (EQ (symbol, Qsignal) || EQ (symbol, Qexit)) 832 if (EQ (symbol, Qsignal) || EQ (symbol, Qexit))
833 Fdelete (make_fixnum_or_float (pid), deleted_pid_list); 833 deleted_pid_list
834 = Fdelete (make_fixnum_or_float (pid), deleted_pid_list);
834 else 835 else
835#endif 836#endif
836 { 837 {
@@ -1818,7 +1819,8 @@ create_process (process, new_argv, current_dir)
1818 char **new_argv; 1819 char **new_argv;
1819 Lisp_Object current_dir; 1820 Lisp_Object current_dir;
1820{ 1821{
1821 int pid, inchannel, outchannel; 1822 int inchannel, outchannel;
1823 pid_t pid;
1822 int sv[2]; 1824 int sv[2];
1823#ifdef POSIX_SIGNALS 1825#ifdef POSIX_SIGNALS
1824 sigset_t procmask; 1826 sigset_t procmask;
@@ -3339,13 +3341,17 @@ usage: (make-network-process &rest ARGS) */)
3339#endif 3341#endif
3340 } 3342 }
3341 3343
3344 immediate_quit = 0;
3345
3342#ifdef HAVE_GETADDRINFO 3346#ifdef HAVE_GETADDRINFO
3343 if (res != &ai) 3347 if (res != &ai)
3344 freeaddrinfo (res); 3348 {
3349 BLOCK_INPUT;
3350 freeaddrinfo (res);
3351 UNBLOCK_INPUT;
3352 }
3345#endif 3353#endif
3346 3354
3347 immediate_quit = 0;
3348
3349 /* Discard the unwind protect for closing S, if any. */ 3355 /* Discard the unwind protect for closing S, if any. */
3350 specpdl_ptr = specpdl + count1; 3356 specpdl_ptr = specpdl + count1;
3351 3357
@@ -6491,7 +6497,7 @@ sigchld_handler (signo)
6491 6497
6492 while (1) 6498 while (1)
6493 { 6499 {
6494 register EMACS_INT pid; 6500 pid_t pid;
6495 WAITTYPE w; 6501 WAITTYPE w;
6496 Lisp_Object tail; 6502 Lisp_Object tail;
6497 6503
@@ -6500,12 +6506,17 @@ sigchld_handler (signo)
6500#define WUNTRACED 0 6506#define WUNTRACED 0
6501#endif /* no WUNTRACED */ 6507#endif /* no WUNTRACED */
6502 /* Keep trying to get a status until we get a definitive result. */ 6508 /* Keep trying to get a status until we get a definitive result. */
6503 do 6509 while (1)
6504 { 6510 {
6505 errno = 0; 6511 errno = 0;
6506 pid = wait3 (&w, WNOHANG | WUNTRACED, 0); 6512 pid = wait3 (&w, WNOHANG | WUNTRACED, 0);
6513 if (! (pid < 0 && errno == EINTR))
6514 break;
6515 /* Avoid a busyloop: wait3 is a system call, so we do not want
6516 to prevent the kernel from actually sending SIGCHLD to emacs
6517 by asking for it all the time. */
6518 sleep (1);
6507 } 6519 }
6508 while (pid < 0 && errno == EINTR);
6509 6520
6510 if (pid <= 0) 6521 if (pid <= 0)
6511 { 6522 {
@@ -6531,11 +6542,15 @@ sigchld_handler (signo)
6531 /* Find the process that signaled us, and record its status. */ 6542 /* Find the process that signaled us, and record its status. */
6532 6543
6533 /* The process can have been deleted by Fdelete_process. */ 6544 /* The process can have been deleted by Fdelete_process. */
6534 tail = Fmember (make_fixnum_or_float (pid), deleted_pid_list); 6545 for (tail = deleted_pid_list; GC_CONSP (tail); tail = XCDR (tail))
6535 if (!NILP (tail))
6536 { 6546 {
6537 Fsetcar (tail, Qnil); 6547 Lisp_Object xpid = XCAR (tail);
6538 goto sigchld_end_of_loop; 6548 if ((GC_INTEGERP (xpid) && pid == (pid_t) XINT (xpid))
6549 || (GC_FLOATP (xpid) && pid == (pid_t) XFLOAT_DATA (xpid)))
6550 {
6551 XSETCAR (tail, Qnil);
6552 goto sigchld_end_of_loop;
6553 }
6539 } 6554 }
6540 6555
6541 /* Otherwise, if it is asynchronous, it is in Vprocess_alist. */ 6556 /* Otherwise, if it is asynchronous, it is in Vprocess_alist. */
diff --git a/src/sound.c b/src/sound.c
index 7fb79e64048..5a27e7a6232 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -621,12 +621,18 @@ wav_play (s, sd)
621 char *buffer; 621 char *buffer;
622 int nbytes; 622 int nbytes;
623 int blksize = sd->period_size ? sd->period_size (sd) : 2048; 623 int blksize = sd->period_size ? sd->period_size (sd) : 2048;
624 int data_left = header->data_length;
624 625
625 buffer = (char *) alloca (blksize); 626 buffer = (char *) alloca (blksize);
626 lseek (s->fd, sizeof *header, SEEK_SET); 627 lseek (s->fd, sizeof *header, SEEK_SET);
627 628 while (data_left > 0
628 while ((nbytes = emacs_read (s->fd, buffer, blksize)) > 0) 629 && (nbytes = emacs_read (s->fd, buffer, blksize)) > 0)
629 sd->write (sd, buffer, nbytes); 630 {
631 /* Don't play possible garbage at the end of file */
632 if (data_left < nbytes) nbytes = data_left;
633 data_left -= nbytes;
634 sd->write (sd, buffer, nbytes);
635 }
630 636
631 if (nbytes < 0) 637 if (nbytes < 0)
632 sound_perror ("Error reading sound file"); 638 sound_perror ("Error reading sound file");
@@ -986,7 +992,8 @@ alsa_period_size (sd)
986 struct sound_device *sd; 992 struct sound_device *sd;
987{ 993{
988 struct alsa_params *p = (struct alsa_params *) sd->data; 994 struct alsa_params *p = (struct alsa_params *) sd->data;
989 return p->period_size; 995 int fact = snd_pcm_format_size (sd->format, 1) * sd->channels;
996 return p->period_size * (fact > 0 ? fact : 1);
990} 997}
991 998
992static void 999static void
@@ -1209,9 +1216,10 @@ alsa_write (sd, buffer, nbytes)
1209 1216
1210 while (nwritten < nbytes) 1217 while (nwritten < nbytes)
1211 { 1218 {
1212 err = snd_pcm_writei (p->handle, 1219 snd_pcm_uframes_t frames = (nbytes - nwritten)/fact;
1213 buffer + nwritten, 1220 if (frames == 0) break;
1214 (nbytes - nwritten)/fact); 1221
1222 err = snd_pcm_writei (p->handle, buffer + nwritten, frames);
1215 if (err < 0) 1223 if (err < 0)
1216 { 1224 {
1217 if (err == -EPIPE) 1225 if (err == -EPIPE)
diff --git a/src/term.c b/src/term.c
index a12f982844c..dcbe3f88a16 100644
--- a/src/term.c
+++ b/src/term.c
@@ -47,6 +47,7 @@ Boston, MA 02110-1301, USA. */
47#include "dispextern.h" 47#include "dispextern.h"
48#include "window.h" 48#include "window.h"
49#include "keymap.h" 49#include "keymap.h"
50#include "blockinput.h"
50#include "syssignal.h" 51#include "syssignal.h"
51#include "systty.h" 52#include "systty.h"
52 53
@@ -695,11 +696,13 @@ tty_write_glyphs (struct frame *f, struct glyph *string, int len)
695 conversion_buffer = encode_terminal_code (string, n, coding); 696 conversion_buffer = encode_terminal_code (string, n, coding);
696 if (coding->produced > 0) 697 if (coding->produced > 0)
697 { 698 {
699 BLOCK_INPUT;
698 fwrite (conversion_buffer, 1, coding->produced, tty->output); 700 fwrite (conversion_buffer, 1, coding->produced, tty->output);
699 if (ferror (tty->output)) 701 if (ferror (tty->output))
700 clearerr (tty->output); 702 clearerr (tty->output);
701 if (tty->termscript) 703 if (tty->termscript)
702 fwrite (conversion_buffer, 1, coding->produced, tty->termscript); 704 fwrite (conversion_buffer, 1, coding->produced, tty->termscript);
705 UNBLOCK_INPUT;
703 } 706 }
704 len -= n; 707 len -= n;
705 string += n; 708 string += n;
@@ -781,11 +784,13 @@ tty_insert_glyphs (struct frame *f, struct glyph *start, int len)
781 784
782 if (coding->produced > 0) 785 if (coding->produced > 0)
783 { 786 {
787 BLOCK_INPUT;
784 fwrite (conversion_buffer, 1, coding->produced, tty->output); 788 fwrite (conversion_buffer, 1, coding->produced, tty->output);
785 if (ferror (tty->output)) 789 if (ferror (tty->output))
786 clearerr (tty->output); 790 clearerr (tty->output);
787 if (tty->termscript) 791 if (tty->termscript)
788 fwrite (conversion_buffer, 1, coding->produced, tty->termscript); 792 fwrite (conversion_buffer, 1, coding->produced, tty->termscript);
793 UNBLOCK_INPUT;
789 } 794 }
790 795
791 OUTPUT1_IF (tty, tty->TS_pad_inserted_char); 796 OUTPUT1_IF (tty, tty->TS_pad_inserted_char);
diff --git a/src/window.c b/src/window.c
index 1554ef7ec3b..94e56d10371 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3614,11 +3614,12 @@ The variables `special-display-buffer-names',
3614`same-window-regexps' customize how certain buffer names are handled. 3614`same-window-regexps' customize how certain buffer names are handled.
3615The latter two take effect only if NOT-THIS-WINDOW is nil. 3615The latter two take effect only if NOT-THIS-WINDOW is nil.
3616 3616
3617If optional argument FRAME is `visible', search all visible frames. 3617If optional argument FRAME is `visible', check all visible frames
3618If FRAME is 0, search all visible and iconified frames. 3618for a window to use.
3619If FRAME is t, search all frames. 3619If FRAME is 0, check all visible and iconified frames.
3620If FRAME is a frame, search only that frame. 3620If FRAME is t, check all frames.
3621If FRAME is nil, search only the selected frame 3621If FRAME is a frame, check only that frame.
3622If FRAME is nil, check only the selected frame
3622 (actually the last nonminibuffer frame), 3623 (actually the last nonminibuffer frame),
3623 unless `pop-up-frames' or `display-buffer-reuse-frames' is non-nil, 3624 unless `pop-up-frames' or `display-buffer-reuse-frames' is non-nil,
3624 which means search visible and iconified frames. 3625 which means search visible and iconified frames.
diff --git a/src/xdisp.c b/src/xdisp.c
index 1885735d327..aea7ab515ab 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10876,7 +10876,7 @@ redisplay_internal (preserve_echo_area)
10876 return; 10876 return;
10877 } 10877 }
10878 10878
10879#if defined (USE_X_TOOLKIT) || defined (USE_GTK) 10879#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (MAC_OS)
10880 if (popup_activated ()) 10880 if (popup_activated ())
10881 return; 10881 return;
10882#endif 10882#endif
@@ -13143,8 +13143,15 @@ redisplay_window (window, just_this_one_p)
13143 13143
13144 /* If first window line is a continuation line, and window start 13144 /* If first window line is a continuation line, and window start
13145 is inside the modified region, but the first change is before 13145 is inside the modified region, but the first change is before
13146 current window start, we must select a new window start.*/ 13146 current window start, we must select a new window start.
13147
13148 However, if this is the result of a down-mouse event (e.g. by
13149 extending the mouse-drag-overlay), we don't want to select a
13150 new window start, since that would change the position under
13151 the mouse, resulting in an unwanted mouse-movement rather
13152 than a simple mouse-click. */
13147 if (NILP (w->start_at_line_beg) 13153 if (NILP (w->start_at_line_beg)
13154 && NILP (do_mouse_tracking)
13148 && CHARPOS (startp) > BEGV) 13155 && CHARPOS (startp) > BEGV)
13149 { 13156 {
13150 /* Make sure beg_unchanged and end_unchanged are up to date. 13157 /* Make sure beg_unchanged and end_unchanged are up to date.
@@ -14903,7 +14910,7 @@ try_window_id (w)
14903 sync_frame_with_window_matrix_rows (w); 14910 sync_frame_with_window_matrix_rows (w);
14904 14911
14905 /* Adjust buffer positions in reused rows. */ 14912 /* Adjust buffer positions in reused rows. */
14906 if (delta) 14913 if (delta || delta_bytes)
14907 increment_matrix_positions (current_matrix, 14914 increment_matrix_positions (current_matrix,
14908 first_unchanged_at_end_vpos + dvpos, 14915 first_unchanged_at_end_vpos + dvpos,
14909 bottom_vpos, delta, delta_bytes); 14916 bottom_vpos, delta, delta_bytes);
@@ -22679,7 +22686,7 @@ note_mouse_highlight (f, x, y)
22679 struct buffer *b; 22686 struct buffer *b;
22680 22687
22681 /* When a menu is active, don't highlight because this looks odd. */ 22688 /* When a menu is active, don't highlight because this looks odd. */
22682#if defined (USE_X_TOOLKIT) || defined (USE_GTK) 22689#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (MAC_OS)
22683 if (popup_activated ()) 22690 if (popup_activated ())
22684 return; 22691 return;
22685#endif 22692#endif
diff --git a/src/xselect.c b/src/xselect.c
index f34b62c8700..cb00903c41e 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -3007,8 +3007,17 @@ it merely informs you that they have happened. */);
3007 3007
3008 DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system, 3008 DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system,
3009 doc: /* Coding system for communicating with other X clients. 3009 doc: /* Coding system for communicating with other X clients.
3010When sending or receiving text via selection and clipboard, the text is 3010
3011encoded or decoded by this coding system. 3011When sending text via selection and clipboard, if the requested
3012data-type is not "UTF8_STRING", the text is encoded by this coding
3013system.
3014
3015When receiving text, if the data-type of the received text is not
3016"UTF8_STRING", it is decoded by this coding system.
3017
3018See also the documentation of the variable `x-select-request-type' how
3019to control which data-type to request for receiving text.
3020
3012The default value is `compound-text-with-extensions'. */); 3021The default value is `compound-text-with-extensions'. */);
3013 Vselection_coding_system = intern ("compound-text-with-extensions"); 3022 Vselection_coding_system = intern ("compound-text-with-extensions");
3014 3023
diff --git a/src/xterm.c b/src/xterm.c
index 5fb04d8103e..6a574533a2c 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -5292,7 +5292,7 @@ x_scroll_bar_expose (bar, event)
5292 5292
5293 x_scroll_bar_set_handle (bar, XINT (bar->start), XINT (bar->end), 1); 5293 x_scroll_bar_set_handle (bar, XINT (bar->start), XINT (bar->end), 1);
5294 5294
5295 /* Switch to scroll bar foreground color. */ 5295 /* Switch to scroll bar foreground color. */
5296 if (f->output_data.x->scroll_bar_foreground_pixel != -1) 5296 if (f->output_data.x->scroll_bar_foreground_pixel != -1)
5297 XSetForeground (FRAME_X_DISPLAY (f), gc, 5297 XSetForeground (FRAME_X_DISPLAY (f), gc,
5298 f->output_data.x->scroll_bar_foreground_pixel); 5298 f->output_data.x->scroll_bar_foreground_pixel);
@@ -6772,15 +6772,16 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6772 int y = event.xbutton.y; 6772 int y = event.xbutton.y;
6773 6773
6774 window = window_from_coordinates (f, x, y, 0, 0, 0, 1); 6774 window = window_from_coordinates (f, x, y, 0, 0, 0, 1);
6775 if (EQ (window, f->tool_bar_window)) 6775 tool_bar_p = EQ (window, f->tool_bar_window);
6776
6777 if (tool_bar_p && event.xbutton.button < 4)
6776 { 6778 {
6777 if (event.xbutton.type == ButtonPress) 6779 if (event.xbutton.type == ButtonPress)
6778 handle_tool_bar_click (f, x, y, 1, 0); 6780 handle_tool_bar_click (f, x, y, 1, 0);
6779 else 6781 else
6780 handle_tool_bar_click (f, x, y, 0, 6782 handle_tool_bar_click (f, x, y, 0,
6781 x_x_to_emacs_modifiers (dpyinfo, 6783 x_x_to_emacs_modifiers (dpyinfo,
6782 event.xbutton.state)); 6784 event.xbutton.state));
6783 tool_bar_p = 1;
6784 } 6785 }
6785 } 6786 }
6786 6787