Add support for fullscreen in the NS port.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
dd946752
JD
12012-09-30 Jan Djärv <jan.h.d@swipnet.se>
2
3 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
4
5 * nsterm.m (NEW_STYLE_FS): New define.
6 (ns_fullscreen_hook, windowWillEnterFullScreen)
7 (windowDidEnterFullScreen, windowWillExitFullScreen)
8 (windowDidExitFullScreen, toggleFullScreen, handleFS)
9 (setFSValue): New functions.
10 (EmacsFSWindow): New implementation.
11 (canBecomeKeyWindow): New function for EmacsFSWindow.
12 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
13 (dealloc): Release nonfs_window if in fullscreen.
14 (updateFrameSize:): Call windowDidMove to update top/left.
15 (windowWillResize:toSize:): Check if frame is still maximized.
16 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
17 next_maximized, maximized_width, maximized_height and nonfs_window.
18 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
19 tbar_height.
20 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
21 fullscreen. Set maximized_width/height. Act on next_maximized.
22
23 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
24 (EmacsView): Add variables for fullscreen.
25 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
26 (EmacsFSWindow): New interface for fullscreen.
27
427730eb
JB
282012-09-30 Juanma Barranquero <lekktu@gmail.com>
29
30 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
31
48de8b12
CY
322012-09-30 Chong Yidong <cyd@gnu.org>
33
34 * fns.c (Frandom): Doc fix.
35
5938d519
MR
362012-09-30 Martin Rudalics <rudalics@gmx.at>
37
38 * window.c (Vwindow_combination_limit): New default value.
39 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
40
cb5b0266
PE
412012-09-30 Paul Eggert <eggert@cs.ucla.edu>
42
43 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
44 Suggested by Eli Zaretskii in
45 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
46
84f72efd
EZ
472012-09-30 Eli Zaretskii <eliz@gnu.org>
48
49 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
50 HAVE_TIMER_SETTIME is defined.
51
9d4dcdc9
PE
522012-09-30 Paul Eggert <eggert@cs.ucla.edu>
53
d89460ed
PE
54 Profiler improvements: more-accurate timers, overflow checks.
55 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
56 signal.h, setjmp.h. Include systime.h instead.
57 (saturated_add): New function.
58 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
59 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
60 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
61 New static vars.
84f72efd 62 (enum profiler_cpu_running): New enum.
d89460ed
PE
63 (profiler_cpu_running): Now of that enum type, not bool.
64 All uses changed to store the new value.
65 (handle_profiler_signal): Rename from sigprof_handler_1,
66 for consistency with other handlers. Do not check whether
67 cpu_log is a hash-table if garbage collecting, since it
68 doesn't matter in that case.
69 (deliver_profiler_signal): Rename from sigprof_handler,
70 for consistency with other handlers.
71 (setup_cpu_timer): New function, with much of what used to be in
72 Fprofiler_cpu_start. Check for out-of-range argument.
73 Prefer timer_settime if available, and prefer
74 thread cputime clocks, then process cputime clocks, then
75 monotonic clocks, to the old realtime clock. Use make_timeval
76 to round more-correctly when falling back to setitimer.
77 (Fprofiler_cpu_start): Use it.
78 (Fprofiler_cpu_stop): Prefer timer_settime if available.
79 Don't assume that passing NULL as the 2nd argument of setitimer
80 is the same as passing a pointer to all-zero storage.
81 Ignore SIGPROF afterwards.
82 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
83 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
84 non-fatal signal handlers. Ignore SIGPROF on startup.
85 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
86 in profiler.c, since sysdep.c now uses it.
87
9d4dcdc9
PE
88 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
89 Suggested by Eli Zaretskii in
90 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
91
8e5691a0
JB
922012-09-29 Juanma Barranquero <lekktu@gmail.com>
93
94 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
95
e7c1b6ef
SM
962012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
97
98 * lisp.h (struct backtrace): Remove indirection for `function' field.
99 * xdisp.c (redisplay_internal):
100 * profiler.c (record_backtrace, sigprof_handler_1):
101 * alloc.c (Fgarbage_collect):
102 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
103 (Fbacktrace_frame): Adjust accordingly.
104
e61d39cd 1052012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
106
107 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
108 (Frun_hook_with_args_until_failure): Doc fixes.
109
404043ea
EZ
1102012-09-28 Eli Zaretskii <eliz@gnu.org>
111
112 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
113 Qautomatic_redisplay and change the symbol name. All users changed.
114
704d3f45
TM
1152012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
116
117 * profiler.c (sigprof_handler): Fix race condition.
118
757140ff
GM
1192012-09-28 Glenn Morris <rgm@gnu.org>
120
121 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
122
a615a3ae
PE
1232012-09-27 Paul Eggert <eggert@cs.ucla.edu>
124
125 Check more robustly for timer_settime.
89d17fd0
PE
126 * Makefile.in (LIB_TIMER_TIME): New macro.
127 (LIBES): Add it.
a615a3ae
PE
128 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
129 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
130 call timer_settime.
131
3670daf7
TM
1322012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
133
134 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
135
6a586b7f
JB
1362012-09-26 Juanma Barranquero <lekktu@gmail.com>
137
138 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
139
41c8bfcf
PE
1402012-09-26 Paul Eggert <eggert@cs.ucla.edu>
141
142 * character.h (MAYBE_UNIFY_CHAR): Remove.
143 * charset.c, charset.h (maybe_unify_char): Now static.
144 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
145 Since this stuff is now private to charset.c, there's no need for
146 a public macro and no need to inline by hand.
147
3a880af4
SM
1482012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
149 Stefan Monnier <monnier@iro.umontreal.ca>
150 Juanma Barranquero <lekktu@gmail.com>
611b7507 151
3a880af4
SM
152 * profiler.c: New file.
153 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
154 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
155 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
156 * emacs.c (main): Call syms_of_profiler.
157 * alloc.c (Qautomatic_gc): New constant.
158 (MALLOC_PROBE): New macro.
159 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
160 (total_bytes_of_live_objects): New function.
161 (Fgarbage_collect): Use it. Record itself in backtrace_list.
162 Call malloc_probe for the memory profiler.
163 (syms_of_alloc): Define Qautomatic_gc.
164 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
165 race condition.
166 (struct backtrace): Move definition...
167 * lisp.h (struct backtrace): ..here.
168 (Qautomatic_gc, profiler_memory_running): Declare vars.
169 (malloc_probe, syms_of_profiler): Declare functions.
170 * xdisp.c (Qautomatic_redisplay): New constant.
171 (redisplay_internal): Record itself in backtrace_list.
172 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 173
5938d519 1742012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
1752012-09-25 Juanma Barranquero <lekktu@gmail.com>
176
177 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
178
e26fd2e4
PE
1792012-09-25 Paul Eggert <eggert@cs.ucla.edu>
180
181 Prefer POSIX timers if available.
182 They avoid a race if the timer is too close to the current time.
183 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
184 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 185 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 186
eedec3ee
EZ
1872012-09-25 Eli Zaretskii <eliz@gnu.org>
188
189 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
190 CHAR_STRING_ADVANCE.
191 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
192 STRING_CHAR_ADVANCE.
193
aa15c6bb
JB
1942012-09-25 Juanma Barranquero <lekktu@gmail.com>
195
196 Move Vlibrary_cache to emacs.c and reset before dumping.
197
198 * lisp.h (reset_image_types): Declare.
199 [WINDOWSNT] (Vlibrary_cache): Declare.
200
201 * image.c (reset_image_types): New function.
202
203 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
204 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
205 (Fdump_emacs): Reset Vlibrary_cache and image_types.
206
207 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
208 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
209
210 * w32.h (Vlibrary_cache): Do not declare.
211
54d629be
EZ
2122012-09-25 Eli Zaretskii <eliz@gnu.org>
213
16b22fef
EZ
214 * w32proc.c (sys_signal): Handle all signals defined by the
215 MS-Windows runtime, not just SIGCHLD. Actually install the signal
216 handlers for signals supported by Windows. Don't override
217 term_ntproc as the handler for SIGABRT.
218 (sigaction): Rewrite to call sys_signal instead of duplicating its
219 code.
220 (sys_kill): Improve commentary.
221
222 * w32.c (term_ntproc): Accept (and ignore) one argument, for
223 consistency with a signature of a signal handler. All callers
224 changed.
225 (init_ntproc): Accept an argument DUMPING. If dumping, don't
226 install term_ntproc as a signal handler for SIGABRT, as that
227 should be done by the dumped Emacs.
228
229 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
230
231 * w32select.c (term_w32select): Protect against repeated
232 invocation by setting clipboard_owner to NULL after calling
233 DestroyWindow.
234
235 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
236 and term_ntproc to their modified signatures.
237
54d629be
EZ
238 * character.c (char_string, string_char): Remove calls to
239 MAYBE_UNIFY_CHAR. See the discussion starting at
240 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
241 for the details.
242
59f7af81
CY
2432012-09-25 Chong Yidong <cyd@gnu.org>
244
245 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
246
22e8cf4a
SM
2472012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
248
249 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
250 when encountering an unknown bytecode.
251
578098f3
PE
2522012-09-24 Paul Eggert <eggert@cs.ucla.edu>
253
254 image.c, indent.c: Use bool for booleans.
255 * dispextern.h (struct image_type): Members valid_p, load, init
256 now return bool, not int. All uses changed.
257 * image.c: Omit unnecessary static decls.
258 (x_create_bitmap_mask, x_build_heuristic_mask):
259 Return void, not int, since callers don't care about the return value.
260 (x_create_bitmap_mask, define_image_type, valid_image_p)
261 (struct image_keyword, parse_image_spec, image_spec_value)
262 (check_image_size, image_background)
263 (image_background_transparent, x_clear_image_1)
264 (postprocess_image, lookup_image, x_check_image_size)
265 (x_create_x_image_and_pixmap, xbm_image_p)
266 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
267 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
268 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
269 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
270 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
271 (png_image_p, init_png_functions, png_load_body, png_load)
272 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
273 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
274 (init_gif_functions, gif_load, imagemagick_image_p)
275 (imagemagick_load_image, imagemagick_load, svg_image_p)
276 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
277 (gs_load):
278 * nsimage.m (ns_load_image):
279 * nsterm.m (ns_defined_color):
280 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
281 * xfns.c (x_defined_color):
282 * xterm.c (x_alloc_lighter_color_for_widget)
283 (x_alloc_nearest_color_1, x_alloc_nearest_color)
284 (x_alloc_lighter_color):
285 * indent.c (disptab_matches_widthtab, current_column)
286 (scan_for_column, string_display_width, indented_beyond_p)
287 (compute_motion, vmotion, Fvertical_motion):
288 Use bool for booleans.
289
a5f2b6ec
CY
2902012-09-24 Chong Yidong <cyd@gnu.org>
291
292 * chartab.c (Fset_char_table_default): Obsolete function removed.
293
18e27ea8
PE
2942012-09-23 Paul Eggert <eggert@cs.ucla.edu>
295
afea8a8a
PE
296 Move pid_t related decls out of lisp.h.
297 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
298 (interruptible_wait_for_termination):
299 Move these decls from lisp.h to syswait.h, since they use pid_t.
300 Needed on FreeBSD; see Herbert J. Skuhra in
301 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
302 * callproc.c: Include syswait.h.
303
18e27ea8
PE
304 gnutls.c, gtkutil.c: Use bool for boolean.
305 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
306 (emacs_gnutls_handle_error):
307 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
308 (xg_hide_tooltip, xg_create_frame_widgets)
309 (create_dialog, xg_uses_old_file_dialog)
310 (xg_get_file_with_chooser, xg_get_file_with_selection)
311 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
312 (xg_item_label_same_p, xg_update_menubar)
313 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
314 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
315 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
316 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
317 (update_frame_tool_bar, free_frame_tool_bar):
318 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
319 * nsmenu.m (ns_update_menubar):
320 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
321 * xfns.c (Fx_show_tip) [USE_GTK]:
322 Use bool for boolean.
323 * gtkutil.c (xg_update_frame_menubar):
324 * xmenu.c (update_frame_menubar):
325 Return void, not int, since caller ignores return value.
326 * gtkutil.c (xg_change_toolbar_position):
327 Return void, not 1.
328
af0e9f75
JB
3292012-09-23 Juanma Barranquero <lekktu@gmail.com>
330
331 * makefile.w32-in (BLOCKINPUT_H): Remove.
332 (SYSSIGNAL_H): New macro.
333 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
334 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
335 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
336 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
337 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
338 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
339 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
340 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
341 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
342 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
343 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
344 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
345 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
346 ($(BLD)/w32xfns.$(O)): Update dependencies.
347
5101529e
EZ
3482012-09-23 Eli Zaretskii <eliz@gnu.org>
349
350 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
351 fatal_error_backtrace.
352
353 * w32proc.c (sys_kill): Undo last change: don't do anything when
354 invoked to deliver SIGABRT to our own process. This is now
355 handled by emacs_raise.
356
2c3ee0ad
JB
3572012-09-23 Juanma Barranquero <lekktu@gmail.com>
358
359 * w32term.c (w32_read_socket): Remove leftover reference to
360 interrupt_input_pending.
361
62a1d661
PE
3622012-09-23 Paul Eggert <eggert@cs.ucla.edu>
363
364 Do not use SA_NODEFER.
365 Problem reported by Dani Moncayo in
366 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
367 * alloc.c (die):
368 * sysdep.c (emacs_abort): Do not reset signal handler.
369 * emacs.c (terminate_due_to_signal): Reset signal handler here.
370 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
371 wanted even on POSIXish hosts, and it doesn't work on Windows.
372
a0942b9a
JD
3732012-09-23 Jan Djärv <jan.h.d@swipnet.se>
374
375 * xterm.c (x_term_init): Call fixup_locale before and after calling
376 gtk_init (Bug#12392).
377
d07ff9db
CY
3782012-09-23 Chong Yidong <cyd@gnu.org>
379
380 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
381 Vdynamic_library_alist.
382
383 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
384 (Fgnutls_available_p): Caller changed.
385
386 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
387 (Flibxml_parse_xml_region): Likewise.
388
389 * dispextern.h (struct image_type): Remove arg from init function.
390
391 * image.c (Finit_image_library, lookup_image_type)
392 (define_image_type): Remove now-unneeded second arg.
393 (init_xpm_functions, init_png_functions, init_jpeg_functions)
394 (init_tiff_functions, init_gif_functions, init_svg_functions):
395 Arglist and w32_delayed_load calling convention changed.
396 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 397 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 398
4d7e6e51
PE
3992012-09-23 Paul Eggert <eggert@cs.ucla.edu>
400
401 Simplify and avoid signal-handling races (Bug#12471).
402 * alloc.c (die):
403 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
404 Avoid recursive loop if there's a fatal error in the function itself.
405 * atimer.c (pending_atimers):
406 * blockinput.h: Don't include "atimer.h"; no longer needed.
407 (interrupt_input_pending): Remove. All uses removed.
408 pending_signals now counts both atimers and ordinary interrupts.
409 This is less racy than having three separate pending-signal flags.
410 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
411 (input_blocked_p):
412 Rename from their upper-case counterparts BLOCK_INPUT,
413 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
414 INPUT_BLOCKED_P, and turn into functions. All uses changed.
415 This makes it easier to access volatile variables more accurately.
416 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
417 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
418 that's more reliable if the code is buggy and sets
419 interrupt_input_blocked to a negative value. All uses changed.
420 * atimer.c (deliver_alarm_signal):
421 Remove. No need to deliver this to the parent; any thread can
422 handle this signal now. All uses replaced by underlying handler.
423 * atimer.c (turn_on_atimers):
424 * dispnew.c (handle_window_change_signal):
425 * emacs.c (handle_danger_signal):
426 * keyboard.c (kbd_buffer_get_event):
427 Don't reestablish signal handler; not needed with sigaction.
428 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
429 (UNBLOCK_INPUT_TO):
430 Rework to avoid unnecessary accesses to volatile variables.
431 (UNBLOCK_INPUT_TO): Now a function.
432 (totally_unblock_input, unblock_input): New decls.
433 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
434 (init_data): Remove. Necessary stuff now done in init_signal.
435 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
436 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
437 (fatal_error_code): Remove; no longer needed.
438 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
439 it doesn't always backtrace. All uses changed. No need to reset
440 signal to default, since sigaction and/or die does that for us now.
441 Use emacs_raise (FOO), not kill (getpid (), FOO).
442 (main): Check more-accurately whether we're dumping.
443 Move fatal-error setup to sysdep.c
444 * floatfns.c: Do not include "syssignal.h"; no longer needed.
445 * gtkutil.c (xg_get_file_name, xg_get_font):
446 Remove no-longer-needed signal-mask manipulation.
447 * keyboard.c, process.c (POLL_FOR_INPUT):
448 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
449 * keyboard.c (read_avail_input): Remove.
450 All uses replaced by gobble_input.
451 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
452 (kbd_buffer_store_event_hold, gobble_input):
453 (record_asynch_buffer_change) [USABLE_SIGIO]:
454 (store_user_signal_events):
455 No need to mess with signal mask.
456 (gobble_input): If blocking input and there are terminals, simply
457 set pending_signals to 1 and return. All hooks changed to not
458 worry about whether input is blocked.
459 (process_pending_signals): Clear pending_signals before processing
460 them, in case a signal comes in while we're processing.
461 By convention callers now test pending_signals before calling us.
462 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
463 New functions, to support changes to blockinput.h.
464 (handle_input_available_signal): Now extern.
465 (reinvoke_input_signal): Remove. All uses replaced by
466 handle_async_input.
467 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
468 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
469 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
470 Clear sigmask reliably, even if Fsignal returns, which it can.
471 Omit unnecessary accesses to volatile var.
472 (quit_throw_to_read_char): No need to restore sigmask.
473 * keyboard.c (gobble_input, handle_user_signal):
474 * process.c (wait_reading_process_output):
475 Call signal-handling code rather than killing ourselves.
476 * lisp.h: Include <float.h>, for...
477 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
478 (pending_signals): Now volatile.
479 (syms_of_data): Now const if IEEE floating point.
480 (handle_input_available_signal) [USABLE_SIGIO]:
481 (terminate_due_to_signal, record_child_status_change): New decls.
482 * process.c (create_process): Avoid disaster if memory is exhausted
483 while we're processing a vfork, by tightening the critical section
484 around the vfork.
485 (send_process_frame, process_sent_to, handle_pipe_signal)
486 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
487 ignores SIGPIPE.
488 (send_process): No need for setjmp/longjmp any more, since the
489 SIGPIPE stuff is now gone. Instead, report an error if errno
490 is EPIPE.
491 (record_child_status_change): Now extern. PID and W are now args.
492 Return void, not bool. All callers changed.
493 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
494 Remove. All uses removed. This bug should be fixed now in a
495 different way.
496 (wait_for_termination_1): Use waitpid rather than sigsuspend,
497 and record the child status change directly. This avoids the
498 need to futz with the signal mask.
499 (process_fatal_action): Move here from emacs.c.
500 (emacs_sigaction_flags): New function, containing
501 much of what used to be in emacs_sigaction_init.
502 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
503 caught by emacs, to make races less likely.
504 (deliver_process_signal): Rename from handle_on_main_thread.
505 All uses changed.
506 (BACKTRACE_LIMIT_MAX): Now at top level.
507 (thread_backtrace_buffer, threadback_backtrace_pointers):
508 New static vars.
509 (deliver_thread_signal, deliver_fatal_thread_signal):
510 New functions, for more-accurate delivery of thread-specific signals.
511 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
512 (deliver_arith_signal): Handle in this thread, not
513 in the main thread, since it's triggered by this thread.
514 (maybe_fatal_sig): New function.
515 (init_signals): New arg DUMPING so that we can be more accurate
516 about whether we're dumping. Caller changed.
517 Treat thread-specific signals differently from process-general signals.
518 Block all signals while handling fatal error; that's safer.
519 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
520 on IEEE hosts.
521 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
522 Ignore SIGPIPE unless batch.
523 (emacs_backtrace): Output backtrace for the appropriate thread,
524 which is not necessarily the main thread.
525 * syssignal.h: Include <stdbool.h>.
526 (emacs_raise): New macro.
527 * xterm.c (x_connection_signal): Remove; no longer needed
528 now that we use sigaction.
529 (x_connection_closed): No need to mess with sigmask now.
530 (x_initialize): No need to reset SIGPIPE handler here, since
531 init_signals does this for us now.
532
8f4635e9
JD
5332012-09-23 Jan Djärv <jan.h.d@swipnet.se>
534
535 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 536 background rect may be larger (Bug#12245).
8f4635e9 537
3296976d
CY
5382012-09-23 Chong Yidong <cyd@gnu.org>
539
540 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
541
d41e491e
PE
5422012-09-22 Paul Eggert <eggert@cs.ucla.edu>
543
544 * .gdbinit: Just stop at fatal_error_backtrace.
545 See Stefan Monnier's request in
546 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
547 Remove no-longer-used query of system type.
548
c88b867f
CY
5492012-09-22 Chong Yidong <cyd@gnu.org>
550
551 * search.c (Freplace_match): Doc fix (Bug#12325).
552
553 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
554
555 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
556 (Fline_end_position): Doc fix.
557
558 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
559
bb4d86b4
CY
5602012-09-22 Chong Yidong <cyd@gnu.org>
561
562 * dispextern.h (struct image_type): Add new slot, storing a type
563 initialization function.
564
565 * image.c (define_image_type): Call the image initializer function
566 if it is defined. Arguments and return value changed.
567 (valid_image_p, make_image): Callers changed.
568 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
569 (gif_type, imagemagick_type, svg_type, gs_type):
570 Add initialization functions.
bb4d86b4
CY
571 (Finit_image_library): Call lookup_image_type.
572 (CHECK_LIB_AVAILABLE): Macro deleted.
573 (lookup_image_type): Call define_image_type here, rather than via
574 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
575 (syms_of_image): Move define_image_type calls for xbm_type and
576 pbm_type to lookup_image_type.
577
df9685f3
EZ
5782012-09-22 Eli Zaretskii <eliz@gnu.org>
579
580 * keyboard.c (timer_check_2): Move calculation of 'timers' and
581 'idle_timers' from here ...
582 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
583 lists, to avoid infloops when the timer does something stupid,
584 like reinvoke itself with the same or smaller time-out.
585 (Bug#12447)
586
8e17c9ba
MR
5872012-09-22 Martin Rudalics <rudalics@gmx.at>
588
589 * window.c (Fsplit_window_internal): Handle only Qt value of
590 Vwindow_combination_limit separately.
591 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
592 (Vwindow_combination_limit): New default value.
593 Rewrite doc-string.
8e17c9ba 594
589bd69b
EZ
5952012-09-22 Eli Zaretskii <eliz@gnu.org>
596
597 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
598 the new overlay string. (Bug#10159)
599
01108e3f
PE
6002012-09-22 Paul Eggert <eggert@cs.ucla.edu>
601
602 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
603 or that fprintf is async-signal-safe. POSIX doesn't require
604 either assumption.
605
82f8cd94
CY
6062012-09-22 Chong Yidong <cyd@gnu.org>
607
608 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
609 (Bug#8207).
610
3cccbd87
KH
6112012-09-22 Kenichi Handa <handa@gnu.org>
612
613 * composite.c (composition_reseat_it): Handle the case that a
614 grapheme cluster is not covered by a single font (Bug#12352).
615
09c01941
CY
6162012-09-21 Chong Yidong <cyd@gnu.org>
617
618 * image.c (define_image_type): Avoid adding duplicate types to
619 image_types (Bug#12463). Suggested by Jörg Walter.
620
acfa068f 6212012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
622
623 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
624 (print_load_command_name): Add case LC_DATA_IN_CODE.
625 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
626
acfa068f 6272012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
628
629 * eval.c (Frun_hook_with_args_until_success)
630 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
631
acfa068f 6322012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
633
634 * fileio.c (Ffile_selinux_context): Only call freecon when
635 lgetfilecon succeeded.
636 (Fset_file_selinux_context): Likewise. (Bug#12444)
637
acfa068f 6382012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
639
640 * xdisp.c (try_window_reusing_current_matrix): Under bidi
641 reordering, locate the cursor by calling set_cursor_from_row; if
642 that fails, clear the desired glyph matrix before returning a
643 failure indication to the caller. Fixes leaving garbled display
644 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
645 (compute_stop_pos_backwards): Fix a typo that caused crashes while
646 scrolling through multibyte text.
aa36e4d2 647
e99f70c8
SM
6482012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
649
650 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
651 calling mark_vectorlike since that's the one that marks the window.
652 (mark_discard_killed_buffers): Mark the final cdr.
653 * window.h (struct window): Move prev/next_buffers to the
654 non-standard fields.
655 * window.c (make_window): Initialize prev/next_buffers manually.
656
f75beb47
PE
6572012-09-20 Paul Eggert <eggert@cs.ucla.edu>
658
659 Omit unused arg EXPECTED from socket hooks.
660 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
661 * nsterm.m (ns_term_init):
662 * termhooks.h (struct terminal.read_socket_hook):
663 * w32inevt.c (w32_console_read_socket):
664 * w32term.c (w32_read_socket):
665 * xterm.c (XTread_socket):
666 Omit unused arg EXPECTED. All callers changed.
667 (store_user_signal_events): Return void, not int, since callers no
668 longer care about the return value. All uses changed.
669
b019b76a
JB
6702012-09-20 Juanma Barranquero <lekktu@gmail.com>
671
672 * w32gui.h (XParseGeometry): Do not declare.
673
05642592
PE
6742012-09-19 Paul Eggert <eggert@cs.ucla.edu>
675
e4bce92a
PE
676 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
677 Ignore 'expected'. See Eli Zaretskii in
678 <http://bugs.gnu.org/12471#8> (last line).
679
05642592
PE
680 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
681 (XParseGeometry): Now static. Substitute extremal values for
682 values that are out of range.
683
e543ae91
JD
6842012-09-19 Jan Djärv <jan.h.d@swipnet.se>
685
686 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
687
688 * nsfns.m (XParseGeometry): Remove.
689 (Fx_create_frame): Call x_set_offset to correctly interpret
690 top_pos in geometry.
691
3a880af4 692 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
693 (Fx_parse_geometry): If there is a space in string, call
694 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
695
45ba16c7
EZ
6962012-09-17 Eli Zaretskii <eliz@gnu.org>
697
c8b9f1bc
EZ
698 * search.c (scan_buffer): Use character positions in calls to
699 region_cache_forward and region_cache_backward, not byte
700 positions. (Bug#12196)
701
b4c932a2
EZ
702 * w32term.c (w32_read_socket): Set pending_signals to 1, like
703 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
704
45ba16c7
EZ
705 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
706 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
707 emacs_blocked_malloc, now deleted.
708
eeceac93
PE
7092012-09-17 Paul Eggert <eggert@cs.ucla.edu>
710
711 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
712 The workaround was for improving performance on Solaris 2.4, but
713 is getting in the way now. Emacs will still work if someone is
714 still running Solaris 2.4 in a museum somewhere; Sun dropped
715 support for Solaris 2.4 in 2003.
716 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
717 * process.c (create_process) [HAVE_WORKING_VFORK]:
718 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
719 since Emacs no longer uses vfork on that platform.
720
78f83752
GM
7212012-09-17 Glenn Morris <rgm@gnu.org>
722
723 * emacs.c: Use COPYRIGHT.
724
634b8cac
PE
7252012-09-16 Paul Eggert <eggert@cs.ucla.edu>
726
0caaedb1
PE
727 Remove configure's --without-sync-input option (Bug#12450).
728 When auditing signal-handling in preparation for cleaning it up,
729 I found that SYNC_INPUT has race conditions and would be a real
730 pain to fix. Since it's an undocumented and deprecated
731 configure-time option, now seems like a good time to remove it.
732 Also see <http://bugs.gnu.org/11080#16>.
733 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
734 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
735 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
736 (malloc_hysteresis):
737 (check_depth) [XMALLOC_OVERRUN_CHECK]:
738 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
739 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
740 (dont_register_blocks, bytes_used_when_reconsidered)
741 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
742 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
743 [!SYSTEM_MALLOC && !SYNC_INPUT]:
744 Remove. All uses removed.
745 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
746 implementation, one that depends on whether the new macro
747 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
748 is defined.
749 * atimer.c (run_timers, handle_alarm_signal):
750 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
751 (handle_async_input, process_pending_signals)
752 (handle_input_available_signal, init_keyboard):
753 * nsterm.m (ns_read_socket):
754 * process.c (wait_reading_process_output):
755 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
756 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
757 (emacs_write):
758 * xterm.c (XTread_socket):
759 Assume SYNC_INPUT.
760 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
761 * eval.c (handling_signal): Remove. All uses removed.
762 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
763 All uses replaced with the SYNC_INPUT version.
764 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
765 Remove decls.
766 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
767 Now static.
768
634b8cac
PE
769 * font.c (Ffont_shape_gstring): Remove unused local.
770
83da1b55
GM
7712012-09-16 Glenn Morris <rgm@gnu.org>
772
518650a5
GM
773 * Makefile.in (clean): No longer run nextstep's clean.
774
83da1b55
GM
775 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
776 (ns_frag): Remove.
777 (ns-app): Move here from ns.mk, and simplify.
778 (clean): Simplify nextstep entry.
779 * ns.mk: Remove file.
780
85a43e2e
KH
7812012-09-17 Kenichi Handa <handa@gnu.org>
782
783 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
784 not covert the last few charactes.
785
ba13e616 7862012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
787
788 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
789 here, but just check the validity of glyphs in the glyph-string.
790
a8c729af
MR
7912012-09-16 Martin Rudalics <rudalics@gmx.at>
792
3a880af4
SM
793 * window.c (Fwindow_parameter, Fset_window_parameter):
794 Accept any window as argument (Bug#12452).
a8c729af 795
c077c059
JD
7962012-09-16 Jan Djärv <jan.h.d@swipnet.se>
797
798 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
799 to ns_term_init to avoid memory leak.
800
801 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
802 explicit retain/release.
803 (ns_term_init): Only allow one display. Initialize outerpool and
804 ns_*_types.
805
39a57ad0
PE
8062012-09-15 Paul Eggert <eggert@cs.ucla.edu>
807
808 Port _setjmp fix to POSIXish hosts as well as Microsoft.
809 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
810 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
811 the Microsoft problem in a different way, by altering ../nt/config.nt.
812
7105c8cb
EZ
8132012-09-15 Eli Zaretskii <eliz@gnu.org>
814
815 * w32xfns.c:
816 * w32uniscribe.c:
817 * w32term.c:
818 * w32select.c:
819 * w32reg.c:
820 * w32proc.c:
821 * w32menu.c:
822 * w32inevt.c:
823 * w32heap.c:
824 * w32font.c:
825 * w32fns.c:
826 * w32console.c:
827 * w32.c:
828 * w16select.c: Remove inclusion of setjmp.h, as it is now included
829 by lisp.h. This completes removal of setjmp.h inclusion
830 erroneously announced in the previous commit. (Bug#12446)
831
832 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
833 more accurate.
834
835 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
836 not defined as a macro. The latter happens on MS-Windows.
837 (Bug#12446)
838
0328b6de
PE
8392012-09-15 Paul Eggert <eggert@cs.ucla.edu>
840
841 Port better to POSIX hosts lacking _setjmp (Bug#12446).
842 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 843 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
844 only reason for the instance was because "lisp.h" was included.
845 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
846 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
847 and _longjmp with the new symbols. Emacs already uses _setjmp if
848 available, so this change affects only POSIXish hosts that have
849 sigsetjmp but not _setjmp, such as some versions of Solaris and
850 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
851 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
852 (png_load_body) [HAVE_PNG]:
853 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
854 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
855 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
856 since PNG requires jmp_buf. This is the only exception to the
857 general rule that we now use sys_setjmp and sys_longjmp.
858 This exception is OK since this code does not change the signal
859 mask or longjmp out of a signal handler.
860
2af03429
PE
8612012-09-14 Paul Eggert <eggert@cs.ucla.edu>
862
863 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
864 Include "syssignal.h", for 'main_thread'.
865
2f294edf
DA
8662012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
867
868 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
869 * insdel.c (replace_range, replace_range_2):
870 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
871 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
872 Remove redundant check before calling offset_intervals.
873
6b533e9c
MR
8742012-09-14 Martin Rudalics <rudalics@gmx.at>
875
876 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
877 current buffer (Bug#12387).
878
2a7931e3
JB
8792012-09-14 Juanma Barranquero <lekktu@gmail.com>
880
881 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
882
c18e885b
PE
8832012-09-13 Paul Eggert <eggert@cs.ucla.edu>
884
885 Use a more backwards-compatible timer format (Bug#12430).
886 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
887 vector element, not from the 4th, since PSECS is now at the end.
888 (Fcurrent_idle_time): Doc fix.
889
d59a1afb
DA
8902012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
891
892 Function to mark objects and remove killed buffers at once.
893 * alloc.c (discard_killed_buffers): Rename to ...
894 (mark_discard_killed buffers) ... new name. Add marking
895 of remaining objects. Fix comment. Adjust users.
896 (mark_object): Do not touch frame buffer lists here.
897 * frame.c (delete_frame): Reset frame buffer lists here.
898
5f0cb45a
PE
8992012-09-13 Paul Eggert <eggert@cs.ucla.edu>
900
8ea47e3a
PE
901 Better workaround for GNOME bug when --enable-gcc-warnings.
902 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
903 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
904 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
905
4a4bbad2
PE
906 Simplify SIGIO usage (Bug#12408).
907 The code that dealt with SIGIO was crufty and confusing, e.g., it
908 played tricks like "#undef SIGIO" but these tricks were not used
909 consistently. Simplify mostly by not #undeffing standard symbols,
910 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
911 or not as we please) rather than "defined SIGIO" (standard symbol
912 that we probably shouldn't #undef).
913 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
914 Modules that need it can include it.
915 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
916 * dispextern.h (ignore_sigio): New decl.
917 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
918 unconditionally, since it's now a no-op if !USABLE_SIGIO.
919 * emacs.c (shut_down_emacs):
920 * keyboard.c (kbd_buffer_store_event_hold):
921 Use ignore_sigio rather than invoking 'signal' directly.
922 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
923 for FIONREAD.
924 (FIONREAD, SIGIO): Do not #undef.
925 (tty_read_avail_input): Use #error rather than a syntax error.
926 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
927 for I_PIPE, used by SETUP_SLAVE_PTY.
928 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
929 * sysdep.c (croak): Remove; no longer needed. This bit of
930 temporary code, with Fred N. Fish's comment that it's temporary,
931 has been in Emacs since at least 1992!
932 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
933 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
934 * syssignal.h (croak): Remove decl.
935 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
936 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
937 now that we're termios-only.
938 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
939 * term.c (dissociate_if_controlling_tty): Use #error rather than
940 a run-time error.
941
5f0cb45a
PE
942 Work around GCC and GNOME bugs when --enable-gcc-warnings.
943 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
944 to work around GNOME bug 683906.
945 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
946 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
947 This works around GCC bug 54561.
948
40bce90b
PE
9492012-09-12 Paul Eggert <eggert@cs.ucla.edu>
950
951 More fixes for 'volatile' and setjmp/longjmp.
952 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
953 * image.c (struct png_load_context) [HAVE_PNG]: New type.
954 (png_load_body) [HAVE_PNG]:
955 (jpeg_load_body) [HAVE_JPEG]:
956 New function, with most of the old parent function's body.
957 (png_load) [HAVE_PNG]:
958 (jpeg_load) [HAVE_JPEG]:
959 Invoke the new function, to avoid longjmp munging our locals.
960 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
961 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
962 longjmp is passed 2, as the C standard doesn't guarantee this.
963 Instead, store the failure code into mgr->failure_code.
964
bfeae2cf
SM
9652012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
966
967 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
968 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
969 (syms_of_keyboard): Remove support for unread-command-char.
970
8099e36b
EZ
9712012-09-12 Eli Zaretskii <eliz@gnu.org>
972
973 * w32proc.c (sys_kill): If PID is our process ID and the signal is
974 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
975 violation. (Bug#12426)
976
92547ff9
PE
9772012-09-12 Paul Eggert <eggert@cs.ucla.edu>
978
979 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
980
45b82ad0
SM
9812012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
982
983 * eval.c: Add `inhibit-debugger'.
984 (Qinhibit_debugger): New symbol.
985 (call_debugger): Bind it instead of Qdebug_on_error.
986 (maybe_call_debugger): Test Vinhibit_debugger.
987 (syms_of_eval): Define inhibit-debugger.
988 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
989 (syms_of_xdisp): Remove inhibit-debug-on-message.
990
5779a1dc
PE
9912012-09-11 Paul Eggert <eggert@cs.ucla.edu>
992
50f2e553
PE
993 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
994 If a nonvolatile local variable is written before a _longjmp to
995 the frame containing the variable, and is read after the _longjmp,
996 the value read is indeterminate. Some local variables of type
997 'struct handler' and 'struct catchtag' are used in this way, so
998 mark each of their slots as volatile if the slot can be set before
999 _longjmp and read afterwards.
1000 * lisp.h (struct handler): var and chosen_clause are now volatile.
1001 (struct catchtag): val, next, and pdlcount are now volatile.
1002
ae1d87e2
PE
1003 * bidi.c (bidi_push_it, bidi_pop_it):
1004 * fns.c (copy_hash_table):
1005 * image.c (define_image_type):
1006 * keyboard.c (kbd_buffer_store_event_hold):
1007 * process.c (Fprocess_send_eof):
1008 * xfaces.c (x_create_gc) [HAVE_NS]:
1009 * xgselect.c (xg_select):
1010 Prefer assignment to memcpy when either will do.
1011
5779a1dc
PE
1012 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1013 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1014 time an item is removed. No need to mark this function 'inline';
1015 the compiler knows better than we do.
1016
c4c9756b
JD
10172012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1018
1019 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1020 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1021 to change_frame_size (Bug#12388).
1022 (windowDidResize:): Pass YES to updateFrameSize.
1023
1024 * nsterm.h: Add delay parameter to updateFrameSize.
1025
d73e321c
DA
10262012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1027
1028 Discard killed buffers from deleted window and frame objects.
1029 This reduces an amount of references to killed buffers and
1030 helps GC to reclaim them faster.
1031 * alloc.c (discard_killed_buffers): New function.
1032 (mark_object): Use it for deleted windows and frames.
1033 (mark_object): If symbol's value is set up for a killed buffer
1034 or deleted frame, restore it's global binding.
1035 * data.c (swap_in_global_binding): Add GC notice.
1036 (swap_in_symval_forwarding): Use convenient set_blv_where.
1037 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1038 * window.h: ... to here.
1039
e578f381
DA
10402012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1041
1042 Convenient macro to check whether the buffer is live.
1043 * buffer.h (BUFFER_LIVE_P): New macro.
1044 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1045 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1046
3057e615
YM
10472012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1048
1049 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1050 composition cases (Bug#12364).
1051
1052 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1053 overhang of succeeding glyphs overlapping box cursor.
1054
1055 * w32term.c (x_draw_glyph_string): Likewise.
1056
6fda35f2
PE
10572012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1058
c990426a
PE
1059 Simplify, document, and port floating-point (Bug#12381).
1060 The porting part of this patch fixes bugs on non-IEEE platforms
1061 with frexp, ldexp, logb.
1062 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1063 Now static.
1064 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1065 support, by removing commented-out code and briefly listing the
1066 C89 functions excluded. The commented-out stuff was confusing
1067 maintenance, e.g., we thought we needed cbrt but it was commented out.
1068 (logb): Remove decl; no longer needed.
1069 (isfinite): New macro, if not already supplied.
1070 (isnan): Don't replace any existing macro.
1071 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1072 are present on all C89 platforms.
1073 (Ffrexp): Do not special-case zero, as frexp does the right thing
1074 for that case.
1075 (Flogb): Do not use logb, as it doesn't have the desired meaning
1076 on hosts that use non-base-2 floating point. Instead, stick with
1077 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1078 frexp, to avoid getting an unspecified result.
1079
6fda35f2
PE
1080 * xdisp.c (Qinhibit_debug_on_message): Now static.
1081
16130a58
JD
10822012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1083
1084 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1085 NSBezierPath (Bug#12131).
1086
d105a573
CY
10872012-09-10 Chong Yidong <cyd@gnu.org>
1088
1089 * fns.c (Fdelq, Fdelete): Doc fix.
1090
ff55dfe8
PE
10912012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1092
1093 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1094 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1095
e7032e7c
SM
10962012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1097
1098 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1099 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1100 Use it.
1101
e9957956
EZ
11022012-09-09 Eli Zaretskii <eliz@gnu.org>
1103
aba05ce9
EZ
1104 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1105 left fringe if the window has a left margin. This avoids leaving
1106 traces of the cursor because its leftmost pixel is not drawn over.
1107
e9957956
EZ
1108 * dispnew.c (update_window_line): When the left margin area of a
1109 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1110 that screen line. (Bug#12277)
1111
f6196b87
PE
11122012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1113
1114 Assume C89 or later for math functions (Bug#12381).
1115 This simplifies the code, and makes it a bit smaller and faster,
1116 and (most important) makes it easier to clean up signal handling
1117 since we can stop worring about floating-point exceptions in
1118 library code. That was a problem before C89, but the problem
1119 went away many years ago on all practical Emacs targets.
1120 * data.c, image.c, lread.c, print.c:
1121 Don't include <math.h>; no longer needed.
1122 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1123 might be autoconfigured, as that never happens.
1124 * data.c (fmod):
1125 * doprnt.c (DBL_MAX_10_EXP):
1126 * print.c (DBL_DIG):
1127 Remove. C89 or later always defines these.
1128 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1129 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1130 (arith_error, domain_error, domain_error2):
1131 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1132 no longer needed -- we simply return what C returns. All uses removed.
1133 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1134 the wrapped code.
1135 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1136 Remove. All uses expanded, as these macros are no longer used
1137 more than once and are now more trouble than they're worth.
1138 (Ftan): Use tan, not sin / cos.
1139 (Flogb): Assume C89 frexp.
1140 (fmod_float): Assume C89 fmod.
1141 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1142 (init_floatfns): Remove. All uses removed.
1143
9d7f1863
JD
11442012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1145
1146 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1147 compositeToPoint for OSX < 10.6 (Bug#12390).
1148
eabf0404
PE
11492012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1150
1151 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1152 This produces more-accurate results.
1153
0b3b1d23
JD
11542012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1155
1156 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1157 changes (Bug#12088).
1158
6dcef6ec
CY
11592012-09-08 Chong Yidong <cyd@gnu.org>
1160
1161 * syntax.c (Fstring_to_syntax): Doc fix.
1162
aa7d57c5
JD
11632012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1164
1165 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1166 in the internal border.
1167 (x_set_window_size): Remove static variables and their usage.
1168 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
1169 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1170 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
1171 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1172 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1173 (ns_fix_rect_ibw): Remove.
1174 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1175 (ns_dumpglyphs_box_or_relief): Ditto.
1176 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1177 adjustment.
1178 (ns_dumpglyphs_image): Ditto.
fc0c31f8 1179 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
1180 border adjustment.
1181 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1182 their usage. Add fringe_extended_p and its use as in other terms.
1183 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1184 scroll bar was removed.
1185 (updateFrameSize): New function.
1186 (windowDidResize): Move code to updateFrameSize and call it.
1187
1188 * nsterm.h (EmacsView): Add updateFrameSize.
1189
1a5432bc
CY
11902012-09-07 Chong Yidong <cyd@gnu.org>
1191
b4f5313e
CY
1192 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1193
1a5432bc
CY
1194 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1195
1a4f1e9b
PE
11962012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1197
1198 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
1199 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1200 Problem introduced when merging patches. Noted by Eli Zaretskii in
1201 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
1202 * floatfns.c: Comment fix.
1203 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1204 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1205 and anyway the declaration is harmless even if SIGDANGER is not defined.
1206 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1207 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1208 source files not surprisingly expected syssignal.h to define, or
1209 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1210 Include <sys/ioctl.h>, for FIONREAD.
1211 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1212 This eliminates a problem whereby other files mysteriously had
1213 to include "syssignal.h" before including "systty.h" if they
1214 wanted to use "#ifdef SIGIO".
1215
bc8000ff
EZ
12162012-09-07 Eli Zaretskii <eliz@gnu.org>
1217
3e6d6928
EZ
1218 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1219
1220 * w32.c (sigemptyset): Empty the set.
1221 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1222
bc8000ff
EZ
1223 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1224
b4fa72f2
DA
12252012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1226
1227 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1228 (mark_object): Likewise for frame objects.
1229
30730c93
PE
12302012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1231
1232 * syssignal.h (handle_on_main_thread): Always declare,
1233 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1234 This ports to platforms without HAVE_PTHREAD.
1235
2fe28299
PE
12362012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1237
1238 Signal-handler cleanup (Bug#12327).
1239 Emacs's signal handlers were written in the old 4.2BSD style with
1240 sigblock and sigmask and so forth, and this led to some
1241 inefficiencies and confusion. Rewrite these to use
1242 pthread_sigmask etc. without copying signal sets around. Also,
1243 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1244 'signal', and instead use functions that do not attempt to take
1245 over the system name space. This patch causes Emacs's text
1246 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1247 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1248 Do not include <signal.h> or "syssignal.h", as these
1249 modules do not use signals.
1250 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1251 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1252 Do not include <signal.h>, as "syssignal.h" does that for us now.
1253 * atimer.c (sigmask_atimers): New function.
1254 (block_atimers, unblock_atimers): New functions,
1255 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1256 All uses replaced.
1257 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1258 no longer needed here.
1259 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 1260 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
1261 * sysdep.c (struct save_signal): New member 'action', replacing
1262 old member 'handler'.
1263 (save_signal_handlers, restore_signal_handlers):
1264 Use sigaction instead of 'signal' to save and restore.
1265 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1266 New function. All users of 'signal' modified to use set_sighandler
1267 if they're writeonly, and to use sys_signal if they're read+write.
1268 (emacs_sigaction_init, forwarded_signal): New functions.
1269 (sys_signal): Remove. All uses replaced by calls to sigaction
1270 and emacs_sigaction_init, or by direct calls to 'signal'.
1271 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1272 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1273 all uses replaced by pthread_sigmask etc. calls.
1274 * syssignal.h: Include <signal.h>.
1275 (emacs_sigaction_init, forwarded_signal): New decls.
1276 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1277 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1278 (sigmask, sys_sigmask): Remove; no longer needed.
1279 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1280 (sigblock, sigunblock, sigfree):
1281 (sigsetmask) [!defined sigsetmask]:
1282 Remove. All uses replaced by pthread_sigmask.
1283 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1284 no longer need to be replaced, and its typical old uses
1285 are now done via emacs_sigaction_init and sigaction.
1286 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1287 (sys_sigdel): Remove; unused.
1288 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1289
0216c128
EZ
12902012-09-06 Eli Zaretskii <eliz@gnu.org>
1291
1292 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1293 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1294
c752cfa9
DA
12952012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1296
1297 Explicitly mark buffer_defaults and buffer_local_symbols.
1298 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1299 mark_local_symbols here.
1300 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1301 since special buffers aren't marked here any more.
1302 (allocate_buffer): Chain new buffer with all_buffers here...
1303 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1304 not here.
1305 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1306 (syms_of_buffer): Remove staticpro of the above.
1307 (init_buffer_once): Set names for buffer_defaults and
1308 buffer_local_symbols.
1309
a864ef14
PE
13102012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1311
1312 Use bool for booleans in font-related modules.
1313 * font.c (font_intern_prop, font_style_to_value)
1314 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1315 (generate_otf_features, font_check_otf_features, font_check_otf)
1316 (font_match_p, font_list_entities, font_at):
1317 * fontset.c (fontset_id_valid_p, reorder_font_vector
1318 (fontset_find_font, Fset_fontset_font)
1319 (face_suitable_for_char_p) [0]:
1320 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1321 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1322 (m17n_flt_initialized, ftfont_shape_by_flt):
1323 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1324 * nsfont.m (nsfont_draw):
1325 * w32font.c (w32font_draw):
1326 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1327 Use bool for booleans.
1328 * font.h: Adjust to above API changes.
1329 (struct font, struct font_driver, struct font_driver_list):
1330 Use bool for booleans.
1331 (struct font): Remove useless member encoding_type.
1332 All users removed.
1333 * fontset.c, xftfont.c: Omit unnecessary static decls.
1334
0699fc18
DA
13352012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1336
1337 * alloc.c (mark_object): Revert window marking code
1338 since it's unsafe for the Fset_window_configuration.
1339
20ef56db
PE
13402012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1341
2fe28299 1342 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
1343 Be more systematic about preserving errno whenever a signal
1344 handler returns, even if it's not in the main thread. Do this by
1345 renaming signal handlers to distinguish between signal delivery
1346 and signal handling. All uses changed.
1347 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1348 * data.c (deliver_arith_signal): Rename from arith_error.
1349 * dispnew.c (deliver_window_change_signal): Rename from
1350 window_change_signal.
1351 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1352 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1353 * keyboard.c (deliver_input_available_signal): Rename from
1354 input_available_signal.
1355 (deliver_user_signal): Rename from handle_user_signal.
1356 (deliver_interrupt_signal): Rename from interrupt_signal.
1357 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1358 (deliver_child_signal): Rename from sigchld_handler.
1359 * atimer.c (handle_alarm_signal):
1360 * data.c (handle_arith_signal):
1361 * dispnew.c (handle_window_change_signal):
1362 * emacs.c (handle_fatal_signal, handle_danger_signal):
1363 * keyboard.c (handle_input_available_signal):
1364 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1365 * process.c (handle_pipe_signal, handle_child_signal):
1366 New functions, with the actual signal-handling code taken from the
1367 original respective signal handlers, sans the sporadic attempts to
1368 preserve errno, since that's now done by handle_on_main_thread.
1369 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1370 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1371 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1372 Move to sysdep.c.
1373 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1374 Move initialization of main_thread to sysdep.c's init_signals.
1375 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1376 our usage, and simplifies the mainline code.
1377 (record_child_status_change): New static function, as a helper
1378 for handle_child_signal, and with most of the old child handler's
1379 contents.
1380 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1381 (handle_child_signal): Use the above.
1382 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1383 Moved here from emacs.c.
1384 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1385 code moved here from emacs.c's main function.
1386 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
1387 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1388 This lets callers save and restore errno properly.
20ef56db 1389
e3ccf108
DA
13902012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1391
1392 Remove redundant or unused things here and there.
1393 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1394 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1395 * editfns.c (Fcompare_buffer_substrings): Likewise.
1396 * frame.h (struct terminal, struct font_driver_list):
1397 Remove redundant declarations.
1398 * window.h (Qleft, Qright): Likewise.
1399
697e1e39
DA
14002012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1401
1402 Do not mark objects from deleted buffers, windows and frames.
1403 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1404 (mark_object): Likewise for windows and frames.
1405
c1ca42ca
DA
14062012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1407
1408 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1409 buffer_defaults and buffer_local_symbols as valid objects.
1410 Return special value to denote them.
1411
014d93be
PE
14122012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1413
f75d7a91
PE
1414 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1415 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1416 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1417 (file_name_absolute_p, Fsubstitute_in_file_name):
1418 (check_executable, check_writable, Ffile_accessible_directory_p)
1419 (Fset_file_selinux_context, Fdefault_file_modes)
1420 (Finsert_file_contents, choose_write_coding_system)
1421 (Fwrite_region, build_annotations, a_write, e_write)
1422 (Fdo_auto_save):
1423 * filelock.c (boot_time_initialized, get_boot_time)
1424 (get_boot_time_1, lock_file_1, within_one_second):
1425 * floatfns.c (in_float):
1426 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1427 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1428 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1429 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1430 * window.c (compare_window_configurations):
1431 Use bool for booleans.
1432 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1433 (Fdefault_file_modes): Now mode_t, not int, for modes.
1434 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1435 (internal_delete_file): Now returns void, not a (boolean) int,
1436 since nobody was looking at the return value.
1437 * lisp.h, window.h: Adjust to above API changes.
1438
014d93be
PE
1439 * xdisp.c (set_message): Simplify and reindent last change.
1440
776f29e1
JB
14412012-09-05 Juanma Barranquero <lekktu@gmail.com>
1442
1443 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1444
7f7e0167
LI
14452012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1446
1447 * eval.c (call_debugger): Make the function non-static so that we
1448 can call it from set_message.
1449
1450 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1451 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1452
cf29dd84
PE
14532012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1454
1455 Give more-useful info on a fatal error (Bug#12328).
1456 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1457 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1458 of doing the work ourselves.
1459 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1460 do most of the work.
1461 (fatal_error_backtrace): New function, taken from the guts
1462 of the old fatal_error_signal, but with a new option to output
1463 a backtrace.
1464 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1465 info about the signal than just its number.
1466 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1467 * sysdep.c: Include <execinfo.h>
1468 (emacs_backtrace): New function, taken partly from the previous
1469 code of the 'die' function.
1470 (emacs_abort): Call fatal_error_backtrace rather than abort.
1471
972debf2
SM
14722012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1473
1474 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1475 eager (load-time) macro-expansion.
1476 * lisp.mk (lisp): Add macroexp.
1477
1088b922
PE
14782012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1479
1480 Simplify redefinition of 'abort' (Bug#12316).
1481 Do not try to redefine the 'abort' function. Instead, redo
1482 the code so that it calls 'emacs_abort' rather than 'abort'.
1483 This removes the need for the NO_ABORT configure-time macro
1484 and makes it easier to change the abort code to do a backtrace.
1485 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1486 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1487 Remove; sysdep.c's emacs_abort now takes its place.
1488 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1489 'abort' changed to use 'emacs_abort'.
1490 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1491 (abort) [!defined abort]: Rename to ...
1492 (emacs_abort): ... new name.
1493 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1494 the place of the old 'abort' in emacs.c.
1495 * w32.c, w32fns.c (abort): Do not #undef.
1496 * w32.c (emacs_abort): Rename from w32_abort.
1497
30934d33
EZ
14982012-09-04 Eli Zaretskii <eliz@gnu.org>
1499
1500 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1501 offsets[j].dv, since the y axis of the screen coordinates points
1502 down, while the y axis of the font definition coordinates points
1503 up. This fixes display of Arabic diacritics such as KASRA and
1504 KASRATAN. (Bug#11860)
1505
af26b72c
PE
15062012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1507
1508 Be more systematic about _setjmp vs setjmp.
1509 * alloc.c (test_setjmp, mark_stack):
1510 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1511 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1512 (png_load, my_error_exit, jpeg_load):
1513 * process.c (send_process_trap, send_process):
1514 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1515 The underscored versions are up to 30x faster on some hosts.
1516 Formerly, the code used setjmp+longjmp sometimes and
1517 _setjmp+_longjmp at other times, with no particular reason to
1518 prefer setjmp+longjmp.
1519
26d4541d
PE
15202012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1521
d42f4f0f 1522 Fix minor problem found by static checking.
26d4541d 1523 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 1524
c5e28e39
MR
15252012-09-03 Martin Rudalics <rudalics@gmx.at>
1526
1527 * buffer.c (Fdelete_all_overlays): New function.
1528
3eab3ca9
CY
15292012-09-03 Chong Yidong <cyd@gnu.org>
1530
1531 * gtkutil.c: Add extern decl for Qxft.
1532
c04889f8
PE
15332012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1534
1882aa38
PE
1535 * emacs.c, eval.c: Use bool for boolean.
1536 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1537 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1538 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1539 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1540 (main, decode_env_path, Fdaemon_initialized):
1541 * eval.c (call_debugger, Finteractive_p, interactive_p):
1542 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1543 (maybe_call_debugger, Fbacktrace):
1544 * process.c (read_process_output, exec_sentinel):
1545 Use bool for booleans.
1546 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1547 All callers changed.
1548 * eval.c (interactive_p): Omit always-true boolean argument
1549 EXCLUDE_SUBRS_P. All callers changed.
1550 * dispextern.h, lisp.h: Reflect above API changes.
1551 * firstfile.c (dummy): Use the address of 'main', whose signature
1552 won't change, instead of the address of 'initialize', whose
1553 signature just changed from int to bool.
1554 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1555 * msdos.c (fatal_error_in_progress): ... from here.
1556 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1557 of incrementing it.
1558 (redisplay_internal, unwind_redisplay): Simply clear
1559 REDISPLAYING_P when unwinding, instead of saving its previous,
1560 always-false value and then restoring it.
1561
a411ac43
PE
1562 Clean up some extern decls.
1563 Mostly, this hoists extern decls out of .c files and into .h files.
1564 That way, we're more likely to catch errors if the interfaces change.
1565 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1566 declare xg_mark_data.
1567 * dispextern.h (x_frame_parm_handlers):
1568 * font.h (Qxft):
1569 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1570 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1571 (Qultra_bold, Qoblique, Qitalic):
1572 Move extern decl here from .c file.
1573 * alloc.c (xg_mark_data) [USE_GTK]:
1574 * doc.c (Qclosure):
1575 * eval.c (Qlexical_binding):
1576 * fns.c (time) [!HAVE_UNISTD_H]:
1577 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1578 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1579 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1580 * lread.c (Qinternal_interpreter_environment):
1581 * minibuf.c (Qbuffer):
1582 * process.c (QCfamily, QCfilter):
1583 * widget.c (free_frame_faces):
1584 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1585 * xfont.c (x_clear_errors):
1586 * xterm.c (x_frame_parm_handlers):
1587 Remove now-redundant extern decls.
1588 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1589 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1590 Now static.
1591 * xfaces.c: Remove unnecessary static decls.
1592 * xterm.c (updating_frame): Remove decl of nonexistent object.
1593
c04889f8
PE
1594 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1595 when building globals.h, as the objects that are not built on
1596 this host are not needed to compile C files on this host.
1597
8b339673
JD
15982012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1599
1600 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1601
1602 * frame.h: Add missing prototype for x_wm_set_size_hint.
1603
a08d4ba7
PE
16042012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1605
1606 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1607 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1608 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1609 (Fsubstitute_command_keys):
1610 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1611 (save_excursion_save, save_excursion_restore)
1612 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1613 (format_time_string, general_insert_function)
1614 (make_buffer_string, make_buffer_string_both)
1615 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1616 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1617 (copy_text, insert_1, insert_1_both, insert_from_string)
1618 (insert_from_string_before_markers, insert_from_string_1)
1619 (insert_from_buffer, insert_from_buffer_1, replace_range)
1620 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1621 (del_range_2, modify_region):
1622 * intervals.c (intervals_equal, balance_possible_root_interval)
1623 (adjust_intervals_for_insertion, merge_properties_sticky)
1624 (graft_intervals_into_buffer, lookup_char_property)
1625 (adjust_for_invis_intang, set_point_both)
1626 (get_property_and_range, compare_string_intervals)
1627 (set_intervals_multibyte_1, set_intervals_multibyte):
1628 * keyboard.c (decode_timer):
1629 Use bool for boolean.
1630 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1631 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1632
48c948de
CY
16332012-09-02 Chong Yidong <cyd@gnu.org>
1634
1635 * keymap.c (push_key_description): Print M-TAB as C-M-i
1636 (Bug#11758).
1637
6c49a40b
JB
16382012-09-02 Juanma Barranquero <lekktu@gmail.com>
1639
1640 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1641 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1642 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1643 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1644 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1645 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1646 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1647
4dfbd238
EZ
16482012-09-01 Eli Zaretskii <eliz@gnu.org>
1649
7e510e28
EZ
1650 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1651 more than one grapheme cluster passed to the shaper: compute the
1652 offset adjustment values separately for each cluster. (Bug#11860)
1653
4dfbd238
EZ
1654 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1655 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1656 about implicit conversions from integer to pointer.
1657
86571ae0
DC
16582012-09-01 Daniel Colascione <dancol@dancol.org>
1659
1660 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1661 system used too early.
1662
0e23ef9d
PE
16632012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1664
1665 Better seed support for (random).
1666 * emacs.c (main): Call init_random.
1667 * fns.c (Frandom): Set the seed from a string argument, if given.
1668 Remove long-obsolete Gentzel cruft.
1669 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1670 (init_random): New function.
1671
17a2cbbd
DC
16722012-09-01 Daniel Colascione <dancol@dancol.org>
1673
1674 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1675 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1676 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1677 x_wm_set_size_hint, x_query_colors, x_real_positions,
1678 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1679 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1680 all of which have been moved to common code.
1681
1682 * xfaces.c: Include TERM_HEADER instead of listing all possible
1683 window-system headers.
1684
1685 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1686 to match header.
1687
1688 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1689 directly accessing frame internals.
1690
f18cbb28 1691 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
1692 globals_of_w32font.
1693
1694 * process.c: Include TERM_HEADER instead of listing all possible
1695 window-system headers.
1696
3a880af4
SM
1697 * nsterm.h: Remove declarations now in frame.h.
1698 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
1699
1700 * menu.c: Include TERM_HEADER instead of listing all possible
1701 window-system headers.
1702
1703 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1704 window system.
1705
1706 * keyboard.c: Include TERM_HEADER instead of listing all possible
1707 window-system headers.
1708
1709 * image.c: Include TERM_HEADER instead of listing all possible
1710 window-system headers. Declare Vlibrary_cache when compiling for
1711 Windows.
1712
1713 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1714 window system declarations.
1715
1716 * frame.h: Move common functions here: set_frame_menubar,
1717 x_set_window_size, x_sync, x_get_focus_frame,
1718 x_set_mouse_position, x_set_mouse_pixel_position,
1719 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1720 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1721 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1722 x_activate_menubar, x_real_positions, x_bitmap_icon,
1723 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1724 and x_query_colors.
1725
1726 * frame.c: Include TERM_HEADER instead of listing all possible
1727 window-system headers.
1728
1729 * font.c: Include TERM_HEADER instead of listing all possible
1730 window-system headers.
1731
1732 * emacs.c: Include TERM_HEADER.
1733
f18cbb28
EZ
1734 * dispnew.c: Include TERM_HEADER instead of listing all possible
1735 window-system headers.
17a2cbbd 1736
f18cbb28 1737 * ccl.h: Include character.h.
17a2cbbd
DC
1738
1739 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1740 the current window system; include in list of objects to link into
1741 Emacs.
1742
c650a5de
DA
17432012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1744
1745 Remove mark_ttys function and fix tty_display_info initialization.
1746 * lisp.h (mark_ttys): Remove prototype.
1747 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1748 to mark_ttys because all possible values of 'top_frame' slot are
1749 the frames which are reachable from Vframe_list.
1750 * term.c (mark_ttys): Remove.
1751 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1752
4e0f6479
DA
17532012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1754
1755 Change struct frame bitfields from unsigned char to unsigned.
1756 * frame.h (struct frame): Change type of 'display_preempted',
1757 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1758 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1759 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1760 bitfields from unsigned char to unsigned.
1761
8b96a52c
DA
17622012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1763
1764 Remove unused member of struct x_output and struct w32_output.
1765 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1766 * w32term.h (struct w32_output): Likewise.
1767
b4444c8a
JD
17682012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1769
1770 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1771 does not become zero (Bug#12234).
1772
b98521db
PE
17732012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1774
1775 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1776 for GCC 4.7.1 x86-64.
1777
31d02438
GM
17782012-08-30 Glenn Morris <rgm@gnu.org>
1779
1780 * lread.c (init_lread): For out-of-tree builds, only add the
1781 source directory's site-lisp dir to the load-path if it exists,
1782 consistent with in-tree builds. (Bug#12302)
1783
7f8941d8
JD
17842012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1785
1786 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 1787 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
1788 (windowShouldClose:): Set window_closed.
1789 (dealloc): New member, free button_values.
fc0c31f8
JB
1790 (process_dialog:): Make member function. Remove window argument,
1791 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
1792 in button_values.
1793 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 1794 with tag. Remove return self, declare return value as void.
7f8941d8
JD
1795 (addString:row:): Remove return self, declare return value as void.
1796 (addSplit): Remove return self, declare return value as void.
1797 (clicked:): Remove return self, declare return value as void.
fc0c31f8 1798 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
1799 (initFromContents:isQuestion:): Adjust call to process_dialog.
1800 Code formatting change.
1801 (timeout_handler:): Set timer_fired to YES.
1802 (runDialogAt:): Set timer_fired to NO.
1803 Handle click on close button as quit.
1804
1805 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1806 Add window_closed and button_values. Add void as return value for
1807 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1808 Add process_dialog as new member.
1809
eada0861 18102012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 1811
eada0861
GM
1812 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1813 is not one of the heaps we manage. (Bug#12242)
1814
18152012-08-28 Glenn Morris <rgm@gnu.org>
1816
1817 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1818
457294dd
MR
18192012-08-28 Martin Rudalics <rudalics@gmx.at>
1820
1821 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
1822 auto-buffer-name window parameter. Install revision of reverted
1823 fix.
457294dd 1824
4f2daf31
DA
18252012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1826
1827 Do not allow to set major mode for a dead buffer.
1828 * buffer.c (Fset_buffer_major_mode): Signal an error
1829 if the buffer is dead.
1830 (Fother_buffer, other_buffer_safely): Remove redundant
1831 nested declaration.
1832
66322887
DA
18332012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1834
1835 Always use set_buffer_if_live to restore original buffer at unwind.
1836 * buffer.h (record_unwind_current_buffer): New function.
1837 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1838 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1839 * undo.c, window.c: Adjust users.
1840 * buffer.c (set_buffer_if_live): Fix comment.
1841
a3d794a1
DA
18422012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1843
1844 Fix usage of set_buffer_internal.
1845 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1846 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1847 * coding.c (decode_coding): Omit redundant test.
1848 * fileio.c (decide_coding_unwind): Likewise.
1849 * fns.c (secure_hash): Likewise.
1850 * insdel.c (modify_region): Likewise.
1851 * keyboard.c (command_loop_1): Likewise.
1852 * print.c (PRINTFINISH): Likewise.
1853 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1854
59ea14cd
PE
18552012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1856
1857 * dispnew.c: Use bool for boolean.
1858 (frame_garbaged, display_completed, delayed_size_change)
1859 (fonts_changed_p, add_window_display_history)
1860 (add_frame_display_history, verify_row_hash)
1861 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1862 (row_equal_p, realloc_glyph_pool)
1863 (allocate_matrices_for_frame_redisplay)
1864 (showing_window_margins_p)
1865 (adjust_frame_glyphs_for_frame_redisplay)
1866 (build_frame_matrix_from_leaf_window, make_current)
1867 (mirrored_line_dance, mirror_line_dance, update_frame)
1868 (update_window_tree, update_single_window)
1869 (check_current_matrix_flags, update_window, update_text_area)
1870 (update_window_line, set_window_update_flags, scrolling_window)
1871 (update_frame_1, scrolling, buffer_posn_from_coords)
1872 (do_pending_window_change, change_frame_size)
1873 (change_frame_size_1, sit_for):
1874 Use bool for boolean.
1875 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1876 and remove last int (actually boolean) argument, which was always 0.
1877 All callers changed.
1878 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1879 * dispextern.h (struct composition_it): Use bool for boolean.
1880 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1881 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1882 * dired.c (file_name_completion):
1883 Use bool for boolean. (This was missed in an earlier change.)
1884
95072a94
MR
18852012-08-27 Martin Rudalics <rudalics@gmx.at>
1886
1887 * window.c (Fset_window_configuration): Revert first part of
1888 last change.
1889
0f19feff
JD
18902012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1891
1892 * nsterm.h (NSPanel): New class variable dialog_return.
1893
3a880af4
SM
1894 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
1895 Initialize dialog_return.
0f19feff
JD
1896 (windowShouldClose:): Use stop instead of stopModalWithCode.
1897 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1898 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1899 event.
1900 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1901 modal loop returns.
1902
f10fe38f
PE
19032012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1904
de1339b0
PE
1905 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1906 * composite.c (find_composition, composition_gstring_p)
1907 (composition_reseat_it, find_automatic_composition):
1908 * data.c (let_shadows_buffer_binding_p)
1909 (let_shadows_global_binding_p, set_internal, make_blv)
1910 (Fmake_variable_buffer_local, Fmake_local_variable)
1911 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1912 (cons_to_signed, arith_driver):
1913 * dbusbind.c (xd_in_read_queued_messages):
1914 * dired.c (directory_files_internal, file_name_completion):
1915 Use bool for booleans.
1916 * dired.c (file_name_completion):
1917 * process.h (fd_callback):
1918 Omit int (actually boolean) argument. It wasn't being used.
1919 All uses changed.
1920 * composite.h, lisp.h: Reflect above API changes.
1921
f10fe38f
PE
1922 * cmds.c, coding.c: Use bool for booleans.
1923 * cmds.c (move_point, Fself_insert_command):
1924 * coding.h (struct composition status, struct coding_system):
1925 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1926 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1927 (emacs_mule_char, decode_coding_emacs_mule)
1928 (encode_coding_emacs_mule, detect_coding_iso_2022)
1929 (decode_coding_iso_2022, encode_invocation_designation)
1930 (encode_designation_at_bol, encode_coding_iso_2022)
1931 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1932 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1933 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1934 (encode_coding_raw_text, detect_coding_charset)
1935 (decode_coding_charset, encode_coding_charset, detect_eol)
1936 (detect_coding, get_translation_table, produce_chars)
1937 (consume_chars, reused_workbuf_in_use)
1938 (make_conversion_work_buffer, code_conversion_save)
1939 (decode_coding_object, encode_coding_object)
1940 (detect_coding_system, char_encodable_p)
1941 (Funencodable_char_position, code_convert_region)
1942 (code_convert_string, code_convert_string_norecord)
1943 (Fset_coding_system_priority):
1944 * fileio.c (Finsert_file_contents):
1945 Use bool for booleans.
1946 * coding.h, lisp.h: Reflect above API changes.
1947 * coding.c: Remove unnecessary static function decls.
1948 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1949 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1950 not a boolean 'int', since callers never look at the return value.
1951 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1952 * coding.h (decoding_buffer_size, encoding_buffer_size)
1953 (emacs_mule_string_char): Remove unused extern decls.
1954 (struct iso_2022_spec, struct coding_system):
1955 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1956 (struct emacs_mule_spec): Remove unused field 'full_support'.
1957 All initializations removed.
1958 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1959
5474c384
DA
19602012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1961
f10fe38f 1962 Fix spare memory change (Bug#12286).
5474c384
DA
1963 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1964 (valid_lisp_object_p): Likewise.
1965
c4b6914d
MR
19662012-08-27 Martin Rudalics <rudalics@gmx.at>
1967
1968 * window.c (Fset_window_configuration): Record any window's old
1969 buffer if it's replaced (see Bug#8789). If the new current
1970 buffer doesn't appear in the selected window, go to its old
1971 point (Bug#12208).
1972
35aaa1ea
DA
19732012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1974
1975 Special MEM_TYPE_SPARE to denote reserved memory.
1976 * alloc.c (enum mem_type): New memory type.
1977 (refill_memory_reserve): Use new type for spare memory.
1978 This prevents live_cons_p and live_string_p from incorrect
1979 detection of uninitialized objects from spare memory as live.
1980
6af64513
PE
19812012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1982
8b2e00a3
PE
1983 Spelling fixes.
1984 * Makefile.in (.PHONY): versioclean -> versionclean.
1985
b52d6985
PE
1986 Remove unused external symbols.
1987 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1988 * window.c (Qwindow_valid_p, decode_valid_window):
1989 Now static, not extern.
1990 * data.c (Qinterval): Remove; unused.
1991 (syms_of_data): Do not define 'interval'.
1992 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1993 * window.h (decode_valid_window):
1994 Remove decls.
1995
d5172d4f
PE
1996 * character.c, charset.c, chartab.c: Use bool for booleans.
1997 * character.c (lisp_string_width, string_count_byte8)
1998 (string_escape_byte8):
1999 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2000 (load_charset_map_from_file, map_charset_chars)
2001 (Fdefine_charset_internal, define_charset_internal)
2002 (Fdeclare_equiv_charset, find_charsets_in_text)
2003 (Ffind_charset_region, char_charset, Fiso_charset):
2004 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2005 (sub_char_table_set, sub_char_table_set_range)
2006 (char_table_set_range, optimize_sub_char_table)
2007 (map_sub_char_table):
2008 Use bool for boolean.
2009 * character.c (str_to_unibyte): Omit last boolean argument; it was
2010 always 0. All callers changed.
2011 * character.h, charset.h: Adjust to match previous changes.
2012 * character.h (char_printable_p): Remove decl of nonexistent function.
2013 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2014 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2015 are all boolean, so make them single-bit bitfields.
2016
6af64513
PE
2017 * lisp.h (ASET): Remove attempt to detect side effects.
2018 It was meant to be temporary and it often doesn't work,
2019 because when IDX has side effects the behavior of IDX==IDX
2020 is undefined. See Stefan Monnier in
2021 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2022
e1f29348
BR
20232012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2024
2025 * lisp.h (functionp): New function (extracted from Ffunctionp).
2026 (FUNCTIONP): Use it.
2027 * eval.c (Ffunctionp): Use it.
2028
17c05d74
PE
20292012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2030
0f46bc75
PE
2031 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2032 as that's faster and simpler than static storage. Don't bother
2033 with the g_main_context_query overhead if g_main_context_pending
2034 says no events are pending.
2035 (gfds, gfds_size): Remove these static vars.
2036 (xgselect_initialize): Remove; no longer needed.
2037 All uses and decls removed.
2038
ee4c0f69
PE
2039 * emacs.c (fatal_error_signal_hook): Remove.
2040 All uses removed. This leftover from old code was always 0.
2041
17c05d74
PE
2042 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2043 * casefiddle.c (casify_object, casify_region):
2044 * casetab.c (set_case_table):
2045 * category.c, category.h (word_boundary_p):
2046 * category.h (CHAR_HAS_CATEGORY):
2047 Use bool for booleans, instead of int.
2048
391ceac5
EZ
20492012-08-25 Eli Zaretskii <eliz@gnu.org>
2050
2051 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2052
2f221583
PE
20532012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2054
f4a681b0
PE
2055 On assertion failure, print backtrace if available.
2056 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2057 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2058 * Makefile.in (LIB_EXECINFO): New macro.
2059 (LIBES): Use it.
2060
2f221583
PE
2061 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2062 * bytecode.c (exec_byte_code):
2063 * callint.c (check_mark, Fcall_interactively):
2064 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2065 (getenv_internal, sync_process_alive, call_process_exited):
2066 * lisp.h (USE_SAFE_ALLOCA):
2067 Use bool for booleans, instead of int.
2068 * lisp.h, process.h: Adjust prototypes to match above changes.
2069 * callint.c (Fcall_interactively): Don't assume the mark's
2070 offset fits in 'int'.
2071
37ef52bb
PE
20722012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2073
2074 * buffer.c, buffer.h: Use bool for boolean.
2075 * buffer.c (reset_buffer_local_variables)
2076 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2077 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2078 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2079 (overlay_touches_p, overlay_strings, Foverlay_put)
2080 (report_overlay_modification, call_overlay_mod_hooks):
2081 (mmap_enlarge, mmap_set_vars):
2082 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2083 Use bool for booleans, instead of int.
2084 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2085 since the 1-or-0 return value is always ignored anyway.
2086 (mmap_initialized_p):
2087 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2088 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2089
2cc21167
PE
20902012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2091
2092 * bidi.c: Use bool for boolean.
2093 This is a bit more readable, and makes the text segment of bidi.o
2094 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2095 Presumably it's faster too.
2096 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2097 Now bool.
2098 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2099 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2100 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2101 (bidi_explicit_dir_char, bidi_level_of_next_char)
2102 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2103 Use bool for booleans, instead of int.
2104 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2105 (bidi_unshelve_cache): Adjust decls to match code.
2106
7db4ddf4
MR
21072012-08-23 Martin Rudalics <rudalics@gmx.at>
2108
2109 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2110 argument.
2111
b1bb8011
PE
21122012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2113
2114 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2115 * atimer.h: Include <stdbool.h>.
2116
ff687885
DN
21172012-08-22 Dan Nicolaescu <dann@gnu.org>
2118
2119 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2120 compile time tests instead of run time tests on systems that do
2121 not use them.
2122 (FRAME_MAC_P): Remove leftover from deleted code.
2123 * frame.c (syms_of_frame): Remove leftover from deleted code.
2124
4ce7a138
JD
21252012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2126
2127 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2128
d733ec6d
PE
21292012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2130
2131 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2132 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 2133 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
2134 (fontset_add): Return void, for FONTSET_ADD.
2135
d0d2d26f
PE
21362012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2137
fce31d69
PE
2138 * alloc.c: Use bool for booleans.
2139 (gc_in_progress, abort_on_gc)
2140 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2141 (dont_register_blocks) [GC_MALLOC_CHECK]:
2142 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2143 (check_string_bytes, make_specified_string, memory_full)
2144 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2145 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2146 (mark_stack, valid_pointer_p, make_pure_string)
2147 (Fgarbage_collect, survives_gc_p, gc_sweep):
2148 Use bool for booleans, instead of int.
2149 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2150 Remove unused local.
2151 * alloc.c (PURE_POINTER_P):
2152 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2153 * editfns.c (Fformat):
2154 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2155 (Fdo_auto_save):
2156 * fns.c (sweep_weak_table):
2157 * lisp.h (suppress_checking, push_message, survives_gc_p)
2158 (make_pure_string, gc_in_progress, abort_on_gc):
2159 * lread.c (readchar, read1):
2160 * print.c (Fprin1_to_string):
2161 * xdisp.c (push_message):
2162 Use bool for booleans affected directly or indirectly by
2163 alloc.c's changes.
2164
d0d2d26f
PE
2165 Make recently-introduced setters macros.
2166 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2167 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2168 (set_fontset_default, set_fontset_fallback): Rename from their
2169 upper-case counterparts, and make them functions rather than macros.
2170 This is more consistent with the other recently-introduced setters.
2171 These don't need to be inline, since they're local.
2172
d18e2bb6
JD
21732012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2174
2175 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2176 the loop (Bug#12247).
2177
1b9d9d16
PE
21782012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2179
2180 * lisp.h (vcopy): Use memcpy rather than our own loop.
2181 This fixes a performance regression introduced by the recent
2182 addition of vcopy. This means 'vcopy' will need to be modified
2183 for a copying collector, but that's OK. Also, tighten the
2184 checking in the assertion.
2185
b2f09701
EZ
21862012-08-21 Eli Zaretskii <eliz@gnu.org>
2187
2188 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2189 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2190 non-base glyph for the width of the base character, according to
e1f29348
BR
2191 what x_draw_composite_glyph_string_foreground expects.
2192 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
2193 expectations, to produce correct width of the composed character.
2194 Reverse the sign of the DU offset produced by ScriptPlace.
2195
9b994fed
PE
21962012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2197
2198 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2199
086ca913
DA
22002012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2201
2202 Avoid direct writes to contents member of struct Lisp_Vector.
2203 * lisp.h (vcopy): New function to copy data into vector.
2204 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2205 * fns.c (Ffillarray): Use ASET.
2206 * keyboard.c (timer_check_2): Use AREF and ASET.
2207 (append_tool_bar_item, Frecent_keys): Use vcopy.
2208 * lread.c (read_vector): Use ASET.
2209 * msdos.c (Frecent_doskeys): Use vcopy.
2210 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2211 (Finternal_merge_in_global_face): Use ASET and vcopy.
2212 * xfont.c (xfont_list_pattern): Likewise.
2213
5481664a
MR
22142012-08-21 Martin Rudalics <rudalics@gmx.at>
2215
2216 * window.c (Fwindow_point): For the selected window always return
2217 the position of its buffer's point.
2218 (Fset_window_point): For the selected window always go in its
2219 buffer to the specified position.
2220
6d470bdd
DA
22212012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2222
2223 Setter macros for fontsets.
2224 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2225 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2226 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2227 Adjust users.
2228
24564fe1
GM
22292012-08-20 Glenn Morris <rgm@gnu.org>
2230
2231 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2232 Don't assume that `ln -f' works.
2233
0a05a035
EZ
22342012-08-20 Eli Zaretskii <eliz@gnu.org>
2235
2236 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2237 and later about non-assignments with no effect. See discussion at
2238 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2239 details.
2240
e46f2325
DA
22412012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2242
2243 Inline setter functions for Lisp_Objects slots of struct specbinding.
2244 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2245 Adjust users.
2246
734fbd86
MR
22472012-08-20 Martin Rudalics <rudalics@gmx.at>
2248
2249 * window.c (select_window): Always make selected window's buffer
2250 current.
2251
f1a95992
DA
22522012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2253
2254 Use AREF and ASET for docstrings of category tables.
2255 * category.h (CATEGORY_DOCSTRING): Use AREF.
2256 (SET_CATEGORY_DOCSTRING): Use ASET.
2257 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2258
e83064be
DA
22592012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2260
2261 Inline setter functions for hash table members.
2262 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2263 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2264 (set_hash_key_and_value, set_hash_index, set_hash_next)
2265 (set_hash_hash): New functions.
2266 * charset.c, fns.c: Adjust users.
2267
4ce60d2e
DA
22682012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2269
2270 Inline getter and setter functions for per-buffer values.
2271 * buffer.h (per_buffer_default, set_per_buffer_default)
2272 (per_buffer_value, set_per_buffer_value): New functions.
2273 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2274 * buffer.c, data.c: Adjust users.
2275
c06c9690
JB
22762012-08-20 Juanma Barranquero <lekktu@gmail.com>
2277
2278 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2279
32bd4250
PE
22802012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2281
bad03192 2282 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
2283 as gnulib does this if the system doesn't.
2284 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
2285 Remove declaration. MS-Windows declares it on stdlib.h which is
2286 included by conf_post.h.
b69a6d22
PE
2287 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2288 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2289 * vm-limit.c: Include <unistd.h>, for 'environ'.
2290
22d7feb2
PE
2291 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2292 (start_of_data): Remove decl; mem-limits.h provides it.
2293
32bd4250
PE
2294 * xdisp.c (handle_invisible_prop): Make it a bit faster
2295 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2296
450809af
CY
22972012-08-19 Chong Yidong <cyd@gnu.org>
2298
2299 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2300 ends (Bug#3874).
2301
9e677988
AS
23022012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2303
6b1319ce
AS
2304 * .gdbinit: Use call instead of set when calling a function in the
2305 inferior.
2306
9e677988
AS
2307 * data.c (set_internal): Don't use set_blv_found.
2308 (Fkill_local_variable): Likewise.
2309
d7191076
AA
23102012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2311
2312 * nsfont.m (ns_ascii_average_width): Ensure the string
2313 ascii_printable is initialized with a null-terminated character
2314 array. Otherwise, it can contain undesired extra characters.
2315
e757f1c6
PE
23162012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2317
2318 port new setting code to Sun C 5.8 2005/10/13
2319 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2320 Return void, not Lisp_Object. Otherwise, the compiler
2321 complains about (A?B:C) where B is void and C is Lisp_Object
2322 when compiling CHAR_TABLE_SET, due to the recent change to
2323 the API of sub_char_table_set_contents.
2324
a999ce26
CY
23252012-08-18 Chong Yidong <cyd@gnu.org>
2326
2327 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2328 for the string case (Bug#3874).
2329
3f22b86f
PE
23302012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2331
39eb03f1
PE
2332 * buffer.h (BSET): Remove (Bug#12215).
2333 Replace all uses with calls to new setter functions.
2334 (bset_bidi_paragraph_direction, bset_case_canon_table)
2335 (bset_case_eqv_table, bset_directory, bset_display_count)
2336 (bset_display_time, bset_downcase_table)
2337 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2338 (bset_last_selected_window, bset_local_var_alist)
2339 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2340 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2341 (bset_width_table):
2342 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2343 (bset_auto_fill_function, bset_auto_save_file_format)
2344 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2345 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2346 (bset_cache_long_line_scans, bset_case_fold_search)
2347 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2348 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2349 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2350 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2351 (bset_header_line_format, bset_indicate_buffer_boundaries)
2352 (bset_indicate_empty_lines, bset_invisibility_spec)
2353 (bset_left_fringe_width, bset_major_mode, bset_mark)
2354 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2355 (bset_name, bset_overwrite_mode, bset_pt_marker)
2356 (bset_right_fringe_width, bset_save_length)
2357 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2358 (bset_scroll_up_aggressively, bset_selective_display)
2359 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2360 (bset_word_wrap, bset_zv_marker):
2361 * category.c (bset_category_table):
2362 * syntax.c (bset_syntax_table):
2363 New setter functions.
2364
6a09a33b
PE
2365 * process.h (PSET): Remove (Bug#12215).
2366 Replace all uses with calls to new setter functions.
2367 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2368 (PROCESS_INLINE): New macro.
2369 (pset_childp): New setter function.
2370 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2371 * process.c (PROCESS_INLINE):
2372 Define to EXTERN_INLINE, so that the corresponding functions
2373 are compiled into code.
2374 (pset_buffer, pset_command, pset_decode_coding_system)
2375 (pset_decoding_buf, pset_encode_coding_system)
2376 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2377 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2378 (pset_type, pset_write_queue): New setter functions.
2379
e8c17b81
PE
2380 * window.h (WSET): Remove (Bug#12215).
2381 Replace all uses with calls to new setter functions.
2382 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2383 (WINDOW_INLINE): New macro.
2384 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2385 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2386 (wset_total_lines, wset_vertical_scroll_bar)
2387 (wset_window_end_pos, wset_window_end_valid)
2388 (wset_window_end_vpos): New setter functions.
2389 * window.c (WINDOW_INLINE):
2390 Define to EXTERN_INLINE, so that the corresponding functions
2391 are compiled into code.
2392 (wset_combination_limit, wset_dedicated, wset_display_table)
2393 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2394 (wset_new_normal, wset_new_total, wset_next_buffers)
2395 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2396 (wset_prev_buffers, wset_right_fringe_width)
2397 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2398 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2399 (wset_window_parameters):
2400 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2401 (wset_column_number_displayed, wset_region_showing):
2402 New setter functions.
2403
3f22b86f
PE
2404 * termhooks.h (TSET): Remove (Bug#12215).
2405 Replace all uses with calls to new setter functions.
2406 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2407 (TERMHOOKS_INLINE): New macro.
2408 (tset_charset_list, tset_selection_alist): New setter functions.
2409 * terminal.c (TERMHOOKS_INLINE):
2410 Define to EXTERN_INLINE, so that the corresponding functions
2411 are compiled into code.
2412 (tset_param_alist): New setter function.
2413
742af32f
PE
24142012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2415
15dbb4d6
PE
2416 * keyboard.h (KSET): Remove (Bug#12215).
2417 Replace all uses with calls to new setter functions.
2418 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2419 (KEYBOARD_INLINE): New macro.
2420 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2421 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2422 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2423 New setter functions.
2424 * keyboard.c (KEYBOARD_INLINE):
2425 Define to EXTERN_INLINE, so that the corresponding functions
2426 are compiled into code.
2427 (kset_echo_string, kset_kbd_queue)
2428 (kset_keyboard_translate_table, kset_last_prefix_arg)
2429 (kset_last_repeatable_command, kset_local_function_key_map)
2430 (kset_overriding_terminal_local_map, kset_real_last_command)
2431 (kset_system_key_syms): New setter functions.
2432
f00af5b1
PE
2433 * frame.h (FSET): Remove (Bug#12215).
2434 Replace all uses with calls to new setter functions.
2435 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2436 (FRAME_INLINE): New macro.
2437 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2438 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2439 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2440 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2441 (fset_param_alist, fset_root_window, fset_scroll_bars)
2442 (fset_selected_window, fset_title, fset_tool_bar_items)
2443 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2444 * frame.c (FRAME_INLINE):
2445 Define to EXTERN_INLINE, so that the corresponding functions
2446 are compiled into code.
2447 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2448
0c94c8d6
PE
2449 A few more naming-convention fixes for getters and setters.
2450 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2451 and rename from buffer_overlays_set_before.
2452 (set_buffer_overlays_after): Move here from buffer.h, and rename
2453 from buffer_overlays_set_after.
2454 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2455 All uses changed.
2456 (set_buffer_intervals): Rename from buffer_set_intervals.
2457 * intervals.c (set_interval_object): Move here from intervals.h,
2458 and rename from interval_set_object.
2459 (set_interval_left): Move here from intervals.h, and rename from
2460 interval_set_left.
2461 (set_interval_right): Move here from intervals.h, and rename from
2462 interval_set_right.
2463 (copy_interval_parent): Move here from intervals.h, and rename from
2464 interval_copy_parent.
2465 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2466 (set_interval_plist): Rename from interval_set_plist.
2467 Return void, not Lisp_Object, since no caller uses the result.
2468 * lisp.h (string_intervals): Rename from string_get_intervals.
2469 (set_string_intervals): Rename from string_set_intervals.
2470
34dabdb7
PE
2471 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2472 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 2473 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
2474 All uses changed. See the end of
2475 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2476
742af32f
PE
2477 * lisp.h (CSET): Remove (Bug#12215).
2478 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2479 (set_char_table_purpose): New functions,
2480 replacing CSET. All uses changed. For example, replace
2481 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 2482 "set_char_table_parent (char_table, parent);".
742af32f
PE
2483 The old version was confusing because it used the same name
2484 'parent' for two different things.
2485
a04e2c62
DA
24862012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2487
2488 Functions to get and set Lisp_Object fields of buffer-local variables.
2489 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2490 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2491 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2492 * data.c, eval.c, frame.c: Adjust users.
2493
383dcbf9
CY
24942012-08-17 Chong Yidong <cyd@gnu.org>
2495
2496 * xfaces.c (merge_face_vectors): If the target font specfies a
2497 font spec, make the font's attributes take precedence over
2498 directly-specified attributes.
2499 (merge_face_ref): Recognize :font.
2500
44386687
DA
25012012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2502
2503 Do not use memcpy for copying intervals.
2504 * intervals.c (reproduce_interval): New function.
2505 (reproduce_tree, reproduce_tree_obj): Use it.
2506 (reproduce_tree_obj): Remove prototype.
2507
927c7216
PE
25082012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2509
2510 * lisp.h (duration_to_sec_usec): Remove unused decl.
2511
93044f7b
AA
25122012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2513
2514 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2515 to an allocated instance of NSString, not to the class itself.
2516
9851e4a5
JB
25172012-08-17 Juanma Barranquero <lekktu@gmail.com>
2518
2519 * makefile.w32-in (C_CTYPE_H): New macro.
2520 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2521 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2522 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2523
620f13b0
PE
25242012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2525
2526 Use ASCII tests for character types.
2527 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2528 * xfns.c, xterm.c:
2529 Don't include <ctype.h>; was not needed.
2530 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2531 * sysdep.c, xfaces.c:
2532 Include <c-ctype.h> instead of <ctype.h>.
2533 * nsterm.m: Include <c-ctype.h>.
2534 * charset.c (read_hex):
2535 * doc.c (Fsnarf_documentation):
2536 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2537 (DRIVE_LETTER) [DOS_NT]:
2538 (Ffile_name_directory, Fexpand_file_name)
2539 (Fsubstitute_in_file_name):
2540 * font.c (font_parse_xlfd, font_parse_fcname):
2541 * frame.c (x_set_font_backend):
2542 * gtkutil.c (xg_get_font):
2543 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2544 * nsimage.m (hexchar):
2545 * nsterm.m (ns_xlfd_to_fontname):
2546 * sysdep.c (system_process_attributes):
2547 * xfaces.c (hash_string_case_insensitive):
2548 Use C-locale tests instead of locale-specific tests for character
2549 types, since we want the ASCII interpretation here, not the
2550 interpretation suitable for whatever happens to be the current locale.
2551
52162052
MR
25522012-08-16 Martin Rudalics <rudalics@gmx.at>
2553
2554 Consistently check windows for validity/liveness
2555 (Bug#11984, Bug#12025, Bug#12026).
2556 * lisp.h (CHECK_VALID_WINDOW): New macro.
2557 * window.c (decode_window): Rename to decode_live_window.
2558 (decode_valid_window, Fwindow_valid_p): New functions.
2559 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2560 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2561 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2562 (Fwindow_prev_sibling, Fwindow_combination_limit)
2563 (Fset_window_combination_limit, Fwindow_use_time)
2564 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2565 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2566 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2567 (Fwindow_hscroll, Fset_window_hscroll)
2568 (Fwindow_redisplay_end_trigger)
2569 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2570 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2571 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2572 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2573 (Fwindow_end, Fset_window_point, Fset_window_start)
2574 (Fpos_visible_in_window_p, Fwindow_line_height)
2575 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2576 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2577 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2578 (Fset_window_parameter, Fwindow_display_table)
2579 (Fset_window_display_table, Fdelete_other_windows_internal)
2580 (Fset_window_buffer, Fset_window_new_total)
2581 (Fset_window_new_normal, Fdelete_window_internal)
2582 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2583 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2584 (Fwindow_scroll_bars): Check whether argument window is a valid or
2585 live window. Update doc-strings.
2586 (syms_of_window): New symbol Qwindow_valid_p.
2587 * keyboard.c (Fposn_at_x_y): Check whether argument
2588 frame_or_window denotes a valid window.
2589
2751c80f
DA
25902012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2591
2592 Fix previous char table change.
2593 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2594 * chartab.c (optimize_sub_char_table): Likewise.
2595
032a42c8
CY
25962012-08-16 Chong Yidong <cyd@gnu.org>
2597
a2d19368
CY
2598 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2599
032a42c8
CY
2600 * xfont.c (xfont_open):
2601 * xftfont.c (xftfont_open): Set the font's max_width field.
2602
2603 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2604 min_width to space_width and average_width to the average over
2605 printable ASCII characters.
2606 (ns_char_width): Code cleanup.
2607 (ns_ascii_average_width): New utility function.
2608
2609 * font.h (struct font): Update comments.
2610
a098c930
DA
26112012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2612
032a42c8 2613 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
2614 * lisp.h (CSET): New macro.
2615 (char_table_set_extras, char_table_set_contents)
2616 (sub_char_table_set_contents): New function.
2617 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2618 * syntax.c: Adjust users.
2619
8be3a09c
SM
26202012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2621
2622 * eval.c (eval_sub): Bind lexical-binding.
2623 * lread.c (Qlexical_binding): Make non-static.
2624
ac4845a6
JD
26252012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2626
ddee6515
JD
2627 * nsmenu.m (popupSession): Remove.
2628 (pop_down_menu): Remove endModalSession.
2629 (timeout_handler:): New method.
2630 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2631 Call runModalForWindow. Check timer_fired when it returns.
2632 If not set, cancel timer and break out of loop.
2633 Otherwise loop again, with a new timeout.
2634
2635 * nsterm.m: Include fcntl.h if present.
2636 (fd_entry, t_readfds, inNsSelect): Remove.
2637 (select_writefds, select_valid, select_timeout, selfds)
2638 (select_mutex, apploopnr): Add.
2639 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2640 Otherwise call kbd_buffer_store_event.
2641 (ns_send_appdefined): Remove release of fd_entry.
2642 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2643 Increment and decrement apploopnr.
2644 (ns_select): If no file descriptors, just do a NSTimer.
2645 Otherwise copy read/write masks and start select thread (fd_handler).
2646 Start main loop and wait for application defined event.
2647 Inform select thread to stop selecting after main loop is exited.
2648 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 2649 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
2650 (fd_handler:): Loop forever, wait for info from the main thread
2651 to either start or stop selecting. When select returns, send
2652 and appdefined event.
2653 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2654 If not call kbd_buffer_store_event.
2655
2656 * nsterm.h (EmacsApp): fd_handler takes id argument.
2657 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2658
ac4845a6
JD
2659 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2660
eb424fe3
EZ
26612012-08-15 Eli Zaretskii <eliz@gnu.org>
2662
2663 * region-cache.c (move_cache_gap): Update gap_len using the actual
2664 growth of the boundaries array. Do not change cache_len.
2665 (Bug#12196)
2666
4e6a86c6
DA
26672012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2668
2669 Generalize and cleanup font subsystem checks.
2670 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
2671 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2672 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 2673
5bf192ca
DA
26742012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2675
2676 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2677
f2045622
CY
26782012-08-15 Chong Yidong <cyd@gnu.org>
2679
8be3a09c
SM
2680 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2681 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2682 extract the font descriptor instead of just the font name.
2683 In that case, return a font spec instead of a string.
f2045622
CY
2684 (x_last_font_name): Move to this file from xfns.c.
2685
2686 * xfns.c (Fx_select_font): The return value can also be a font
2687 spec. Move x_last_font_name management to gtkutil.c.
2688
2689 * xfaces.c: Make font weight and style symbols non-static.
2690
7f6feb56
SM
26912012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2692
2693 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2694 (bug#12117).
2695
fecbd8ff
SM
26962012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2697
2698 * alloc.c (Fgarbage_collect): Use plural form consistently.
2699
9b8d5165
EZ
27002012-08-14 Eli Zaretskii <eliz@gnu.org>
2701
2702 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2703 iteration through the command loop. Fixes a problem whereby mouse
2704 movements are ignored until the first mouse click.
2705
f5d9e83a
PE
27062012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2707
2708 Use bool, not int, for Lisp booleans.
2709 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2710 makes Emacs a bit smaller and presumably a bit faster.
2711 * lisp.h: Include <stdbool.h>.
2712 (struct Lisp_Boolfwd, defvar_bool):
2713 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2714 * regex.c [!emacs]: Include <stdbool.h>.
2715 (false, true): Remove; <stdbool.h> does this for us now.
2716
55802e4a
CY
27172012-08-14 Chong Yidong <cyd@gnu.org>
2718
4abcdac8
CY
2719 * character.c (Fcharacterp): Doc fix (Bug#12076).
2720
2721 * data.c (Findirect_variable): Doc fix (Bug#11040).
2722
55802e4a
CY
2723 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2724
2725 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 2726 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 2727
8e99d072
BR
27282012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2729
2730 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2731 (bug#12022).
2732
08908aca
MR
27332012-08-14 Martin Rudalics <rudalics@gmx.at>
2734
2735 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2736 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2737 * minibuf.c (choose_minibuf_frame, read_minibuf):
2738 * w32fns.c (x_create_tip_frame):
2739 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2740 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2741
56120d6f
PE
27422012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2743
2744 * intervals.c (offset_intervals): Remove obsolete comment.
2745
67b77c0b
AS
27462012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2747
2748 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2749
f48b82fd
GR
27502012-08-14 Gergely Risko <gergely@risko.hu>
2751
2752 * coding.c (decode_coding): Record buffer modification before
2753 disabling undo_list (Bug#11773).
2754
fd318b54
DA
27552012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2756
2757 Revert and cleanup some recent overlay changes.
2758 * buffer.h (enum overlay_type): Remove.
2759 (buffer_get_overlays, buffer_set_overlays): Likewise.
2760 (buffer_set_overlays_before, buffer_set_overlays_after):
2761 New function. Adjust users.
2762 (unchain_both): Add eassert.
2763
41a62dd9
DA
27642012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2765
2766 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2767
5884c324
PE
27682012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2769
2770 * gtkutil.c (xg_mark_data): Don't assume C99.
2771
ca06f160
JD
27722012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2773
2774 * gtkutil.c (xg_frame_tb_info): New struct.
2775 (TB_INFO_KEY): New define.
2776 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2777 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2778 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2779 if not present.
2780 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 2781 is up to date. Otherwise store new data.
ca06f160
JD
2782 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2783
7864a3f7
DA
27842012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2785
2786 Use KSET for write access to Lisp_Object members of struct kboard.
2787 * keyboard.h (KSET): New macro.
2788 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2789 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2790 * xterm.c: Adjust users.
2791
4c31be61
DA
27922012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2793
2794 Use BSET for write access to Lisp_Object members of struct buffer.
2795 * buffer.h (BSET): New macro.
2796 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2797 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2798 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2799 * window.c, xdisp.c, xfns.c: Adjust users.
2800
14ae4239
BT
28012012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2802
2803 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2804
32bcadb4
JD
28052012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2806
3d29b2ce 2807 * nsterm.m (not_in_argv): New function.
fc0c31f8 2808 (application:openFile, application:openTempFile:):
3d29b2ce
JD
2809 (application:openFileWithoutUI:, application:openFiles:): Open file
2810 if not_in_argv returns non-zero (bug#12171).
2811
32bcadb4 2812 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
2813 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2814 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
2815 (xg_get_font_name): Use those functions/macros here.
2816 Reported by Frans Oilinki <moilinki@gmail.com>.
2817
9ff9402d 28182012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
2819
2820 * unexmacosx.c (copy_data_segment): Copy initialized data in
2821 statically linked libraries from input file rather than memory.
2822
db74a5fc
YM
2823 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2824 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2825 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2826
25e65510
GM
28272012-08-10 Glenn Morris <rgm@gnu.org>
2828
2829 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2830 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2831
7961135c
DA
28322012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2833
2834 Fix last change to allow compilation with low optimization levels.
2835 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2836 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2837
42b3a444
DA
28382012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2839
2840 Use common inline syntax in intervals.h.
2841 * intervals.h (INTERVALS_INLINE): New macro.
2842 Change all users from LISP_INLINE.
2843
9fb0c957
DA
28442012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2845
2846 Define Qnone once for all platforms.
2847 * frame.c (Qnone): Define here.
2848 (syms_of_frame): DEFSYM it.
2849 * lisp.h (Qnone): New declaration.
2850 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2851 * xfns.c: Remove duplication. Adjust users.
2852
65e8ee52
DA
28532012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2854
2855 Remove unused macros from intervals.h.
2856 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2857 * intervals.c: Adjust comment.
2858
9b855fd6
EZ
28592012-08-10 Eli Zaretskii <eliz@gnu.org>
2860
2861 * w32fns.c <w32_unicode_gui>: New static variable.
2862 (globals_of_w32fns): Initialize it according to os_subtype.
2863 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2864 testing os_subtype.
2865
39cb9e56 28662012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
2867 Eli Zaretskii <eliz@gnu.org>
2868
2869 Fix bug #10299 with Unicode characters sent by customized
2870 keyboards created by MSKLC.
2871 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2872 (w32_init_class): Use it to initialize the Emacs class with either
2873 ANSI or Unicode API calls.
2874 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2875 later.
2876 (w32_wnd_proc): If the character code sent by WM_CHAR or
2877 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2878 original message. Call DefWindowProcW on NT and later.
2879
9374581a
GM
28802012-08-10 Glenn Morris <rgm@gnu.org>
2881
4b94e8cf
GM
2882 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2883
9374581a
GM
2884 * lisp.h (DIRECTORY_SEP): Let configure set it.
2885
a2752828
DA
28862012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2887
2888 Use TSET for write access to Lisp_Object slots of struct terminal.
2889 * termhooks.h (TSET): New macro.
2890 * coding.c, terminal.c, xselect.c: Adjust users.
2891
cc92c454
SM
28922012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2893
2894 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2895 the failing expression, include them in the error message.
2896 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2897 * lisp.h (internal_condition_case_n): Update declaration.
2898
4cb3e6b3
DA
28992012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2900
2901 Inline functions to examine and change buffer overlays.
2902 * buffer.c (unchain_both): New function.
2903 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2904 (buffer_has_overlays): New function.
2905 (enum overlay_type): New enum.
2906 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2907 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2908
8707c1e5
DA
29092012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2910
2911 Inline functions to examine and change buffer intervals.
2912 * alloc.c (mark_interval_tree): Remove.
2913 (MARK_INTERVAL_TREE): Simplify.
2914 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2915 * intervals.c (buffer_balance_intervals): New function.
2916 (graft_intervals_into_buffer): Adjust indentation.
2917 (set_intervals_multibyte): Simplify.
2918 * buffer.h (BUF_INTERVALS): Remove.
2919 (buffer_get_intervals, buffer_set_intervals): New function.
2920 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2921 * intervals.c, textprop.c: Adjust users.
2922
ad8c997f
DA
29232012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2924
2925 Inline functions to examine and change string intervals.
2926 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2927 (string_get_intervals, string_set_intervals): New function.
2928 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2929 * lread.c, print.c, textprop.c: Adjust users.
2930
32ac3a6b
GM
29312012-08-08 Glenn Morris <rgm@gnu.org>
2932
2933 * lisp.mk (lisp): Remove language/persian.elc.
2934
77c7bcb1
DA
29352012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2936
2937 Cleanup intervals.
2938 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2939 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
2940 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2941 Adjust comment. Move under #if 0.
77c7bcb1
DA
2942 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2943 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2944
9c08a8d4
DA
29452012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2946
2947 Check total length of intervals with eassert.
2948 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2949 * intervals.c: Change all users to eassert.
2950
26d16b35
EZ
29512012-08-07 Eli Zaretskii <eliz@gnu.org>
2952
14ae4239
BT
2953 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2954 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
2955 INTERNAL_FIELD in Lisp_Cons.
2956
c644523b
DA
29572012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2958
2959 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2960 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2961 name since all xname users are fixed long time ago. Do not
2962 use INTERNAL_FIELD.
2963 (set_symbol_name, set_symbol_function, set_symbol_plist):
2964 (set_symbol_next, set_overlay_plist): New function.
2965 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2966 (struct Lisp_Overlay): Likewise.
2967 (CVAR, MVAR, SVAR): Remove.
2968 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2969 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2970 * xterm.c: Adjust users.
2971 * .gdbinit: Change to use name field of struct Lisp_Symbol
2972 where appropriate.
2973
6a3d20cc
DA
29742012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2975
2976 Basic functions to set Lisp_Object and pointer slots of intervals.
2977 * intervals.h (interval_set_parent, interval_set_object):
2978 (interval_set_left, interval_set_right, interval_set_plist):
2979 (interval_copy_parent): New function.
2980 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
2981 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2982 Adjust indentation.
6a3d20cc
DA
2983 (INTERVAL_SIZE): Remove. Adjust users.
2984 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2985
4d2b044c
DA
29862012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2987
2988 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2989 * process.h (PGET): Remove.
2990 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2991 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2992
d3d50620
DA
29932012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2994
2995 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2996 * window.h (WGET): Remove.
2997 (struct window): Do not use INTERNAL_FIELD.
2998 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2999 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3000 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3001 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3002 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3003 Adjust users.
3004
d10a51dc
CY
30052012-08-07 Chong Yidong <cyd@gnu.org>
3006
3007 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3008 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3009 (Fdelete_window_internal): Signal an error if the window is not on
3010 a live frame (Bug#12025).
3011
e69b0960
DA
30122012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3013
3014 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3015 * frame.h (FGET): Remove.
3016 (struct frame): Do not use INTERNAL_FIELD.
3017 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3018 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3019 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3020 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3021
25a20a3a
JB
30222012-08-06 Juanma Barranquero <lekktu@gmail.com>
3023
3024 * w32.c: Silence compiler warnings.
3025 (map_w32_filename): Remove unused variable `is_fat'.
3026 (chase_symlinks): Add parentheses around expression.
3027
1c6f11f4
GM
30282012-08-06 Glenn Morris <rgm@gnu.org>
3029
1db4583a
GM
3030 * sysdep.c: Respect BROKEN_GETWD.
3031
1c6f11f4
GM
3032 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3033 Let configure handle it.
3034 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3035
2b90362b
DA
30362012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3037
3038 Use GCALIGNMENT where appropriate.
3039 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3040 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3041 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3042
5f50daf2
EZ
30432012-08-06 Eli Zaretskii <eliz@gnu.org>
3044
14ae4239
BT
3045 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3046 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 3047
cbcc7007
SM
30482012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3049
3050 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3051 that should be sufficient for everyone.
3052
4d365fa4
JD
30532012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3054
3055 * keyboard.c (timer_check_2): Add break so timer_check returns next
3056 timeout.
3057
dd86bd82
DA
30582012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3059
3060 Fix Windows build errors introduced after converting to WGET and WSET.
3061 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3062 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3063
054e1668
JD
30642012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3065
3066 * nsterm.m (ns_frame_rehighlight): Use FSET.
3067
3068 * nsmenu.m (ns_update_menubar): Use FSET.
3069
21238f11
DA
30702012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3071
3072 Separate read and write access to Lisp_Object slots of Lisp_Process.
3073 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3074 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3075
077288cf
DA
30762012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3077
3078 Separate read and write access to Lisp_Object slots of struct window.
3079 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3080 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3081 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3082 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3083 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3084 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3085 Adjust users.
3086
71688bd7
DA
30872012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3088
3089 Fix Windows build errors introduced after converting to FGET and FSET.
3090 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3091 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3092 (w32_judge_scroll_bars): Change to use FSET.
3093 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3094
f99bac93
DA
30952012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3096
3097 Fix replacement typo.
3098 * window.c (replace_window): Set root_window instead of
3099 selected_window. This fixes a total window subsystem
3100 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3101
8c2a0f2d
GM
31022012-08-06 Glenn Morris <rgm@gnu.org>
3103
3104 * lisp.mk (lisp): Add language/persian.elc.
3105
edd74c35
DA
31062012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3107
3108 Separate read and write access to Lisp_Object slots of struct frame.
3109 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3110 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3111 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3112 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3113 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3114
8671676c
AS
31152012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3116
3117 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3118
663e2b3f
DA
31192012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3120
3121 Generalize common compile-time constants.
3122 * lisp.h (header_size, bool_header_size, word_size): Now here.
3123 (struct Lisp_Vector): Add comment.
3124 (struct Lisp_Bool_Vector): Move up to define handy constants.
3125 (VECSIZE, PSEUDOVECSIZE): Simplify.
3126 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3127 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3128 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3129 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3130 * xfont.c, xmenu.c: Use word_size where appropriate.
3131
d32e47af
LM
31322012-08-05 Lawrence Mitchell <wence@gmx.li>
3133
3134 * search.c (Freplace_match): Treat \? in the replacement text
3135 literally (Bug#8161).
3136
e5d9c0d1
CY
31372012-08-05 Chong Yidong <cyd@gnu.org>
3138
3139 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3140 * frame.c (Vdelete_frame_functions):
3141 * emacs.c (Vkill_emacs_hook): Doc fix.
3142
8da0576b
EZ
31432012-08-04 Eli Zaretskii <eliz@gnu.org>
3144
3145 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3146 --with-x-toolkit=no builds.
3147 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3148
02676e5d
CY
31492012-08-04 Chong Yidong <cyd@gnu.org>
3150
3151 * syntax.c (Fmodify_syntax_entry): Doc fix.
3152
97147da9
EZ
31532012-08-04 Eli Zaretskii <eliz@gnu.org>
3154
76151e2c
EZ
3155 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3156 * w32.c (init_environment): Change the default values of many
3157 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
3158 them into environment when they were not already defined.
3159 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 3160 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
3161 (check_windows_init_file): Now external, not static.
3162 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
3163 called when Vload_path is already set up.
3164
3165 * w32.h (check_windows_init_file): Add prototype.
3166
3167 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3168 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3169 compatibility with Posix platforms.
3170 (main): Move the call to check_windows_init_file to here from
3171 w32.c.
3172 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3173 any, in the DEFALT argument into the root of the Emacs build or
3174 installation tree, as appropriate.
3175
3176 * callproc.c (init_callproc_1): Call decode_env_path instead of
3177 doing its equivalent by hand.
3178 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3179 the code that sets Vexec_path run on MS-Windows.
3180
3181 * lread.c (init_lread): Add comments to #ifdef's.
3182
97147da9
EZ
3183 * msdos.c (dos_set_window_size, IT_update_begin)
3184 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3185 instead of direct references.
3186
185ee146
PE
31872012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3188
3189 Export DEFAULT_REHASH_* to GDB.
3190 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3191 Now constants, not macros.
3192
8834c57a
PE
31932012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3194
98c6f1e3
PE
3195 Remove unnecessary casts involving pointers.
3196 These casts are no longer needed now that we assume C89 or later,
3197 since they involve casting to or from void *.
3198 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3199 (make_pure_float, make_pure_vector):
3200 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3201 * macros.c (Fstart_kbd_macro):
3202 * menu.c (find_and_return_menu_selection):
3203 * minibuf.c (read_minibuf_noninteractive):
3204 * sysdep.c (closedir):
3205 * xdisp.c (x_produce_glyphs):
3206 * xfaces.c (compare_fonts_by_sort_order):
3207 * xfns.c (x_real_positions, select_visual):
3208 * xselect.c (x_stop_queuing_selection_requests)
3209 (x_get_window_property, x_get_window_property_as_lisp_data):
3210 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3211 Remove unnecessary pointer casts.
3212 * alloc.c (record_xmalloc): New function.
3213 * lisp.h (record_xmalloc): New decl.
3214 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3215 more like a function. This is because the pointer cast is not
3216 needed. All uses changed.
3217 * print.c (print_string, print_error_message): Avoid length recalc.
3218
8834c57a
PE
3219 Improve fix for macroexp crash with debugging (Bug#12118).
3220 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3221 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3222 not supposed to be invoked from the garbage collector.
3223 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3224 (gc_aset): New function, which is like ASET but can be
3225 used in the garbage collector.
3226 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3227 (set_hash_index): Use it instead of ASET.
3228
6dad7178
EZ
32292012-08-03 Eli Zaretskii <eliz@gnu.org>
3230
3231 Support symlinks on latest versions of MS-Windows.
3232 * w32.c: Include winioctl.h and aclapi.h.
3233 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3234 (revert_to_self): Forward declarations of static functions.
3235 <static BOOL g_b_init_get_security_info>:
3236 <g_b_init_create_symbolic_link>: New static flags.
3237 (globals_of_w32): Initialize them to zero.
3238 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3239 (map_w32_filename): Improve commentary. Simplify switch.
3240 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3241 headers (most versions of MinGW w32api don't).
3242 (get_security_info, create_symbolic_link)
3243 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3244 New functions.
3245 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3246 in the argument file name.
3247 (sys_access): Call unc_volume_file_attributes only if
3248 GetFileAttributes fails with network-related error codes.
3249 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3250 have the required privileges.
14ae4239 3251 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
3252 get_file_security_desc.
3253 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
3254 with addition of handling of symlinks and support for 'lstat'.
3255 If possible, get file's attributes and security information by
6dad7178
EZ
3256 handle, not by name. Produce S_IFLNK bit for symlinks, when
3257 called from 'lstat'.
3258 (stat, lstat): New functions, call 'stat_worker'.
3259 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3260 symlinks when the underlying filesystem supports them.
3261
f162bcc3
PE
32622012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3263
79ea6c20
PE
3264 Fix macroexp crash on Windows with debugging (Bug#12118).
3265 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3266 checking subscripts; problem introduced with the recent
3267 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3268 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3269 since it's used in non-static inline functions now.
3270
c0ce93fd
PE
3271 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3272 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 3273
f162bcc3
PE
3274 Use C99-style 'extern inline' if available.
3275 * buffer.h (BUFFER_INLINE):
3276 * category.h (CATEGORY_INLINE):
3277 * character.h (CHARACTER_INLINE):
3278 * charset.h (CHARSET_INLINE):
3279 * composite.h (COMPOSITE_INLINE):
3280 * dispextern.h (DISPEXTERN_INLINE):
3281 * lisp.h (LISP_INLINE):
3282 * systime.h (SYSTIME_INLINE):
3283 New macro, replacing 'static inline' in this header.
3284 * buffer.h, category.h, character.h, charset.h, composite.h:
3285 * dispextern.h, lisp.h, systime.h:
3286 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3287 * alloc.c (LISP_INLINE):
3288 * buffer.c (BUFFER_INLINE):
3289 * category.c (CATEGORY_INLINE):
3290 * character.c (CHARACTER_INLINE):
3291 * charset.c (CHARSET_INLINE):
3292 * composite.c (COMPOSITE_INLINE):
3293 * dispnew.c (DISPEXTERN_INLINE):
3294 * sysdep.c (SYSTIME_INLINE):
3295 Define to EXTERN_INLINE, so that the corresponding functions
3296 are compiled into code.
3297 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3298 (INLINE_HEADER_END): New macros.
3299 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3300 since it's used in non-static inline functions now.
a8333d03 3301 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 3302
837b365b
GM
33032012-08-02 Glenn Morris <rgm@gnu.org>
3304
d66b744d
GM
3305 * s/: Remove empty directory.
3306
837b365b
GM
3307 * s/ms-w32.h: Move to ../nt/inc.
3308 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3309 Update for new ms-w32.h location.
3310
13294f95
PE
33112012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3312
3313 Port to Solaris 8.
3314 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3315
90df0db3
GM
33162012-08-02 Glenn Morris <rgm@gnu.org>
3317
3318 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3319 hard-coding the path separator.
3320
4939150c
PE
33212012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3322
3323 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3324 This how ASET and AREF are supposed to work, and makes
3325 it easier to think about future improvements. See
3326 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3327 * charset.h (set_charset_attr): New function.
3328 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3329 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3330 (aref_addr): New function. All uses of &AREF(...) changed.
3331 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3332 (set_hash_index): New functions. All lvalue-style uses of
3333 HASH_KEY etc. changed.
3334 * keyboard.c (set_prop): New function. All lvalue-style uses
3335 of PROP changed.
3336
947b2afd
AA
33372012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3338
3339 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3340 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3341 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3342 * nsfns.m (ns_set_name_as_filename): Likewise.
3343 * nsmenu.m (ns_update_menubar): Likewise.
3344 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3345
4f5d0325
EZ
33462012-08-01 Eli Zaretskii <eliz@gnu.org>
3347
2008beae
EZ
3348 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3349 Adapt to latest changes in field names of the corresponding Lisp
288479f6 3350 objects.
2008beae 3351
4f5d0325
EZ
3352 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3353
fe3cc771
GM
33542012-08-01 Glenn Morris <rgm@gnu.org>
3355
3356 * s/msdos.h: Remove file.
3357 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3358 * Makefile.in (S_FILE): Remove.
3359 (config_h): Remove S_FILE.
3360
c90acc54
JB
33612012-08-01 Juanma Barranquero <lekktu@gmail.com>
3362
3363 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3364 Remove; moved to nt/config.nt.
3365
d8a05828
DA
33662012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3367
3368 Use INTERNAL_FIELD for conses and overlays.
3369 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3370 Remove obsolete comment.
3371 (MVAR): New macro.
3372 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3373 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3374
8271d590
DA
33752012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3376
3377 Use INTERNAL_FIELD for symbols.
3378 * lisp.h (SVAR): New macro. Adjust users.
3379 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3380 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3381
3193acd2
DA
33822012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3383
3384 Use INTERNAL_FIELD for processes.
3385 * process.h (PVAR): New macro. Adjust style.
3386 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3387 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3388
3a45383a
DA
33892012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3390
3391 Use INTERNAL_FIELD for windows.
3392 * window.h (WVAR): New macro.
3393 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3394 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3395 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3396 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3397 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3398 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3399
c1dbc63c
PE
34002012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3401
3402 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3403
5c0c0e8a
GM
34042012-08-01 Glenn Morris <rgm@gnu.org>
3405
3406 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3407 Move to configure.ac.
3408
552a99b4
JB
34092012-08-01 Juanma Barranquero <lekktu@gmail.com>
3410
3411 * makefile.w32-in (CONFIG_H): Update dependencies.
3412 (CONF_POST_H): New macro.
3413
3414 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3415
8d8e2dfe
GM
34162012-07-31 Glenn Morris <rgm@gnu.org>
3417
bc96620a
GM
3418 * Makefile.in (S_FILE): No longer set by configure.
3419
476b1b2d
GM
3420 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3421 is available.
3422 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3423
b2c7a106
GM
3424 * process.h (NULL_DEVICE):
3425 * emacs.c (SEPCHAR):
3426 * editfns.c (USER_FULL_NAME): Let configure set them.
3427
d53d062a
GM
3428 * s/README, s/template.h: Remove files.
3429
4515017f
GM
3430 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3431
8d8e2dfe
GM
3432 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3433 Move to configure.ac.
3434
5b20b3cc
EZ
34352012-07-31 Eli Zaretskii <eliz@gnu.org>
3436
1e0afd9a
EZ
3437 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3438 resulting renaming of 'struct frame' members.
3439
5b20b3cc
EZ
3440 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3441
3442 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3443 after introduction of FVAR.
3444
f1310128
JD
34452012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3446
79e721e0
JD
3447 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3448
3449 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3450 instead of compositeToPoint.
3451 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3452
8d7c7eed 3453 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 3454
e34f7f79
DA
34552012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3456
3457 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3458 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 3459 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
3460 (BVAR): Change to use INTERNAL_FIELD.
3461 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3462 (KVAR): Change to use INTERNAL_FIELD.
3463 * frame.h (FVAR): New macro.
3464 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
3465 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3466 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3467 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
3468 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3469
c09bfb2f
DA
34702012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3471
3472 Miscellaneous fixes for non-default X toolkits.
3473 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3474 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3475 Move under #ifdef USE_LUCID.
3476 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3477 definition and usage to avoid warnings.
3478
14c114ae
JD
34792012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3480
3481 * nsterm.m (openFiles): Fix previous checkin.
3482
3bd21e82
PE
34832012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3484
3485 * indent.c (compute_motion): Remove unused local.
3486
c1529ded
GM
34872012-07-31 Glenn Morris <rgm@gnu.org>
3488
400d5621
GM
3489 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3490
268e2432
GM
3491 * conf_post.h [USG5_4]:
3492 Move remaining contents of s/usg5-4-common.h here.
3493 * s/usg5-4-common.h: Remove file.
3494
7552f3ee
GM
3495 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3496 * s/irix6-5.h: Remove file.
3497
6a381852
GM
3498 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3499 * s/darwin.h: Remove file.
3500
c1529ded
GM
3501 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3502 * s/hpux10-20.h: Remove file, which is now empty.
3503
b429a4ee
GM
35042012-07-30 Glenn Morris <rgm@gnu.org>
3505
3506 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3507 * Makefile.in (config_h): Add conf_post.h.
3508 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3509
adff3182
JD
35102012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3511
3512 * nsterm.m (ns_do_open_file): New variable.
b9031d69 3513 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
3514 (openFile, openTempFile, openFileWithoutUI, openFiles):
3515 Open files only if ns_do_open_file.
adff3182 3516
c32af1e4
PE
35172012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3518
7393bcbb
PE
3519 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3520 This no-op macro hasn't been needed for many years.
3521 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3522
c32af1e4
PE
3523 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3524 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3525 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3526 gdb_make_enums_visible.
3527 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3528 (DIRECTORY_SEP): Now a constant, not a macro.
3529
302fc036
EZ
35302012-07-30 Eli Zaretskii <eliz@gnu.org>
3531
3532 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3533 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3534
3535 * w32term.c <w32_keyboard_codepage>: Renamed from
3536 keyboard_codepage and now external. All users changed.
3537
3538 * w32term.h: Add declaration of w32_keyboard_codepage.
3539
3540 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3541 the codepage to translate keys to Unicode. If this argument is
3542 -1, use the value returned by GetConsoleCP. All callers changed.
3543
88fb40b4
PE
35442012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3545
0aee6912
PE
3546 Update .PHONY listings in makefiles.
3547 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3548 bootstrap-clean, distclean, maintainer-clean, versioclean,
3549 extraclean, frc.
3550
88fb40b4
PE
3551 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3552 This is a bit clearer. Fix some commentary typos.
3553
0a763bd1
GM
35542012-07-30 Glenn Morris <rgm@gnu.org>
3555
32bac6d6
GM
3556 * s/netbsd.h: Let configure include signal.h if needed.
3557 Remove file, which is now empty.
3558
b65e7c46
GM
3559 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3560 Let configure set them.
3561 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3562 No more need to undefine.
0a763bd1 3563
169304bd
AS
35642012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3565
3566 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3567 non-single-byte char when adding meta modifier. (Bug#12090)
3568
6cd7a139
DA
35692012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3570
3571 Convert safe_call to use variable number of arguments.
3572 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3573 (safe_call2): Fix comment.
3574 * lisp.h (safe_call): Adjust prototype.
3575 * coding.c (encode_coding_object): Change to use safe_call2.
3576 * xfaces.c (merge_face_heights): Change to use safe_call1.
3577
d34d6ffc
GM
35782012-07-30 Glenn Morris <rgm@gnu.org>
3579
7b8a48e4 3580 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 3581 does that unconditionally. Remove file, which is now empty.
7b8a48e4 3582
d34d6ffc
GM
3583 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3584 Remove empty files.
3585
03a660a6
PE
35862012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3587
3588 Export to GDB most of lisp.h's remaining object-like macros.
3589 * lisp.h (min, max): Move earlier, because they're used earlier now.
3590 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3591 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3592 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3593 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3594 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3595 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3596 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3597 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3598 Now constants, for GDB. They need not be macros.
3599 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3600 Now constants, for GDB, as well as macros, for static initializers.
3601 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3602 Move to after the definition of struct Lisp_Char_Table,
3603 since the former now needs that type defined.
3604 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3605 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3606 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3607 New enums, for gdb_make_enums_visible.
3608 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 3609 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
3610 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3611 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3612 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3613 enum maxargs, enum MAX_ALLOCA.
3614 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3615 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3616 no longer needed, now that they are done in lisp.h.
3617
e499d0ee
DA
36182012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3619
3620 Cleanup string bytes checking.
3621 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3622 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3623 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3624 (check_sblock, compact_small_strings): Simplify.
3625
d5040d2d
PE
36262012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3627
3628 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3629 These macros are confusing and no longer need to be defined, as
3630 the enum values now suffice. All uses replaced with definiens.
3631 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3632
7f259ae6
JB
36332012-07-29 Juanma Barranquero <lekktu@gmail.com>
3634
3635 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3636 ($(BLD)/w32console.$(O)): Update dependencies.
3637
7e63e0c3
DA
36382012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3639
3640 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3641 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3642 time. Adjust users.
3643 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3644
ffd817eb
JD
36452012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3646
3647 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3648 setting sitelisp (Bug#12010).
3649
417a7a0e
EZ
36502012-07-29 Eli Zaretskii <eliz@gnu.org>
3651
14ae4239 3652 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
3653
3654 * w32heap.c (cache_system_info):
3655 * w32.c (sys_rename):
3656 * w32proc.c (find_child_console, sys_kill): All users changed.
3657
387d4d92
PE
36582012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3659
3660 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3661
55a6cca6
EZ
36622012-07-29 Eli Zaretskii <eliz@gnu.org>
3663
3664 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3665
dbcf001c
DA
36662012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3667
3668 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
3669 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3670 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 3671
e2688e4a
DA
36722012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3673
3674 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3675 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3676 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3677 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3678 (replace_range, replace_range_2, del_range_2): Change to eassert.
3679 * marker.c (byte_char_debug_check): Adjust style.
3680
b46a6a83
PE
36812012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3682
3683 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3684 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3685 long-ago-commented-out code that talks about "WIN32".
3686 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3687 All uses changed.
3688
e32a5799
PE
36892012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3690
3691 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3692 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3693 Simplify by using alignof.
3694 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3695 * lisp.h: Include <stdalign.h>.
3696 (GCALIGNMENT): New macro and constant.
3697 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3698 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3699 (stdalign): New macro, if not already defined.
3700
df81cd29
EZ
37012012-07-28 Eli Zaretskii <eliz@gnu.org>
3702
01bd1b0d
EZ
3703 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3704 * w32inevt.c: Include w32inevt.h.
3705 (w32_read_console_input): New inline function, calls either
3706 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3707 w32_console_unicode_input.
3708 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3709 (w32_kbd_patch_key, key_event): Use the codepage returned by
3710 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3711 (key_event): use uChar.UnicodeChar only if
3712 w32_console_unicode_input is non-zero.
3713
3714 * w32console.c: Include w32heap.h.
3715 <w32_console_unicode_input>: New global variable.
3716 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3717 family of Windows, zero otherwise.
3718
3719 * w32inevt.h: Declare w32_console_unicode_input.
3720
df81cd29
EZ
3721 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3722 --without-x. (Bug#11742)
3723
c20fdd9e
PE
37242012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3725
3726 Adjust GDB to reflect pvec_type changes (Bug#12036).
3727 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
3728 2012-07-04 changes to pseudovector representation.
3729 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 3730
32770973 37312012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
3732
3733 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3734 bus address.
3735 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3736
3438fe21
EZ
37372012-07-27 Eli Zaretskii <eliz@gnu.org>
3738
bcfbc9de
EZ
3739 * alloc.c (listn): Fix the order the arguments are consed onto the
3740 list.
3741
3438fe21
EZ
3742 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3743 enumeration constants, as PURE and HEAP are too general, and clash
3744 with other headers and sources, such as gmalloc.c and the
3745 MS-Windows system headers. All users changed.
3746
eeaea515
DA
37472012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3748
3749 Revert last save_excursion_save and save_excursion_restore changes.
3750 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3751 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3752
073c88c2
DA
37532012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3754
3755 Fix recently-introduced typos in Windows port.
3756 Reported by Martin Rudalics <rudalics@gmx.at>.
3757 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 3758 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 3759
4706125e
PE
37602012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3761
3762 Improve GDB symbol export (Bug#12036).
3763 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3764 arms of an 'if', not using conditional expressions; otherwise GDB
3765 complains about the types in the unevaluated arm when the argument
3766 is an integer literal.
3767 (xgetint): Simplify expression.
3768 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3769 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3770 Zaretskii in <http://bugs.gnu.org/12036#13>.
3771 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3772 needed now that we have gdb_make_enums_visible.
3773 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3774 (enum enum_USE_LSB_TAG):
3775 New enum types, packaging up enums that need to be exported to GDB.
3776
694b6c97
DA
37772012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3778
3779 Utility function to make a list from specified amount of objects.
3780 * lisp.h (enum constype): New datatype.
3781 (listn): New prototype.
3782 * alloc.c (listn): New function.
3783 (Fmemory_use_count, syms_of_alloc): Use it.
3784 * buffer.c (syms_of_buffer): Likewise.
3785 * callint.c (syms_of_callint): Likewise.
3786 * charset.c (define_charset_internal): Likewise.
3787 * coding.c (syms_of_coding): Likewise.
3788 * keymap.c (syms_of_keymap): Likewise.
3789 * search.c (syms_of_search): Likewise.
3790 * syntax.c (syms_of_syntax): Likewise.
3791 * w32.c (init_environment): Likewise.
3792 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3793 * xdisp.c (syms_of_xdisp): Likewise.
3794 * xfns.c (syms_of_xfns): Likewise.
3795
6195f384
DA
37962012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3797
3798 Fast save_excursion_save and save_excursion_restore.
3799 * lisp.h (struct Lisp_Excursion): New data type.
3800 (PVEC_EXCURSION): New pseudovector type.
3801 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3802 to deal with it. Adjust comments.
3803 (init_marker, attach_marker): New prototype.
3804 (unchain_marker): Adjust prototype.
3805 * marker.c (attach_marker): Change to global.
3806 (init_marker): New function.
3807 * alloc.c (Fmake_marker, build_marker): Use it.
3808 (build_marker): More easserts.
3809 (mark_object): Handle struct Lisp_Excursion.
3810 * editfns.c (save_excursion_save, save_excursion_restore):
3811 Reimplement to use struct Lisp_Excursion. Add comments.
3812
5eceb8fb
PE
38132012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3814
3815 Fix export of symbols to GDB (Bug#12036).
3816 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3817 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3818 emacs.c, as this is a more-suitable home. Had this been done earlier
3819 the fix for 12036 would have avoided some of the problems noted in
3820 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3821 would have been more obvious.
562157c8
PE
3822 * emacs.c: Do not include <verify.h>; no longer needed.
3823 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
3824 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3825 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3826 Remove; now done in lisp.h.
3827 * lisp.h (PUBLISH_TO_GDB): New macro.
3828 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3829 (DATA_SEG_BITS): Use it.
3830 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3831 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3832 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3833 not be usable in #if. This simplifies things.
3834
d6749401
JB
38352012-07-26 Juanma Barranquero <lekktu@gmail.com>
3836
3837 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3838
1781b9e9
PE
38392012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3840
d89518db 3841 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
3842 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3843 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3844 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3845 Adjust to changes in lisp.h and emacs.c, by using
3846 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3847 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3848 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3849 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3850 instead of gdb_valbits.
3851 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3852 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3853 instead of gdb_array_mark_flag.
3854 (xboolvector): Get size from $->size, not $->header.size.
3855 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3856 (xreload, hook-run, hookpost-run): Remove.
3857 * emacs.c: Include <verify.h>.
3858 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3859 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3860 Remove.
3861 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3862 (gdb_USE_LSB_TAG): New enum constants.
3863 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3864 Also define these as enum constants, so they're visible to GDB.
3865 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3866 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3867 as constants, so they're visible to GDB.
3868 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3869 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3870 Now enum constants, not macros, so they're visible to GDB.
3871 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3872 more convenient now. All uses changed.
3873 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3874 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3875
3628596a
DA
38762012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3877
3878 Explicitly free restriction data that are not needed anymore.
3879 * editfns.c (save_restriction_restore): Free restriction data.
3880
7abaf5cc
SM
38812012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3882
3883 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3884 add argument, tune behavior, and adjust all callers.
3885
71f88e00
PE
38862012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3887
3888 Use typedef for EMACS_INT, EMACS_UINT.
3889 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3890 than macros. This simplifies debugging in the usual case, since
3891 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3892 and it allows expressions involving EMACS_INT casts.
3893 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3894
57ec3034
JD
38952012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3896
3897 * nsterm.m (ns_read_socket): Return early if there is a modal
3898 window (Bug#12043).
3899
8137e7b3
MR
39002012-07-25 Martin Rudalics <rudalics@gmx.at>
3901
3902 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3903 that FOCUS-FRAME can be omitted.
3904
04e9897c
DA
39052012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3906
3907 Adjust buffer text indirection counters at the end of Fkill_buffer.
3908 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3909 buffer is definitely dead. This should really fix an issue reported
3910 by Christoph Scholtes again. (Bug#12007).
3911 (init_buffer_once): Initialize indirection counters of
3912 buffer_defaults and buffer_local_symbols (for sanity and safety).
3913
8a0484e1
EZ
39142012-07-24 Eli Zaretskii <eliz@gnu.org>
3915
3916 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3917 and continuation glyphs on tooltip frames, leave them at zero.
3918 Avoids continued lines in tooltips. (Bug#11832)
3919
fa691a83
DA
39202012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3921
3922 Simplify copy_overlay.
04e9897c 3923 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
3924 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3925
436bc8e0
EZ
39262012-07-23 Eli Zaretskii <eliz@gnu.org>
3927
3928 * print.c (print_object): Don't crash when a frame's name is nil
3929 or invalid. (Bug#12025)
3930
3931 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3932 it signals an error when a tooltip frame is being created.
3933
d7a7fda3
DA
39342012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3935
3936 Cleanup miscellaneous objects allocation and initialization.
3937 * alloc.c (allocate_misc): Change to static. Add argument to
3938 specify the subtype. Adjust comment and users.
3939 (build_overlay): New function.
3940 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3941 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3942 (allocate_misc): Remove prototype.
3943 (build_overlay): Add prototype.
3944
39452012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
3946
3947 Swap buffer text indirection counters in Fbuffer_swap_text.
3948 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3949 This avoids crash reported by Christoph Scholtes at
3950 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3951
9d7fa573
JD
39522012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3953
3954 * nsmenu.m (Popdown_data): New struct.
3955 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3956 free Popdown_data.
3957 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3958 (initWithContentRect): Make imgView and contentView non-static
3959 and autorelease them. Also autorelease img and matrix (Bug#12005).
3960 (dealloc): Remove (Bug#12005).
3961
0dd6d66d
DA
39622012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3963
3964 Adjust consing_since_gc when objects are explicitly freed.
3965 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3966 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3967 (free_cons, free_misc): Subtract object size from consing_since_gc.
3968
d36d71df
DA
39692012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3970
3971 Simplify and cleanup markers positioning code.
3972 * marker.c (attach_marker): More useful eassert.
3973 (live_buffer, set_marker_internal): New function.
3974 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3975 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3976
fb9ea40f
PE
39772012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3978
3979 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3980 as it's limited by the amount of memory, not by INT_MAX.
3981
2d5c5f7d
EZ
39822012-07-21 Eli Zaretskii <eliz@gnu.org>
3983
07fb592e
EZ
3984 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3985 in special-event-map. See the discussion at
3986 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3987 for the reasons.
3988
37a9eac8 3989 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
3990 info.dwItemData. Fixes crashes on 64-bit Windows.
3991 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 3992
c4328746
JD
39932012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3994
fc0c31f8 3995 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 3996 (conversationIdentifier): Return value is NSInteger.
784051c4 3997 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 3998
6e5d1c12
CY
39992012-07-21 Chong Yidong <cyd@gnu.org>
4000
4001 * window.c (decode_any_window): Signal an error if the window is
4002 on a dead frame (Bug#11984).
4003
9928463d
DA
40042012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4005
4006 Add indirection counting to speed up Fkill_buffer.
4007 * buffer.h (struct buffer): New member.
4008 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4009 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4010 base buffer indirection counter.
4011 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4012 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4013 through buffer list if indirection counter is 0.
4014
f8643a6b
DA
40152012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4016
4017 Extend the value returned by Fgarbage_collect with heap statistics.
4018 * alloc.c (Qheap): New symbol.
4019 (syms_of_alloc): DEFSYM it.
4020 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4021 (Fmemory_free): Remove.
4022 (syms_of_alloc): Don't defsubr it.
4023 * buffer.c (Fcompact_buffer): Remove.
4024 (syms_of_buffer): Don't defsubr it.
4025
dac616ff
DA
40262012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4027
4028 Make maybe_gc inline.
4029 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4030 * lisp.h (consing_since_gc, gc_relative_threshold)
4031 (memory_full_cons_threshold): Revert declaration.
4032 (maybe_gc): Remove prototype, define as inline.
4033 * alloc.c: Remove old commented-out code.
4034 (consing_since_gc, gc_relative_threshold)
4035 (memory_full_cons_threshold): Revert to global.
4036 (maybe_gc): Remove.
4037
d7ea76b4
DA
40382012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4039
4040 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4041 * lisp.h (build_unibyte_string): New function.
4042 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4043 * sysdep.c, w32fns.c, xfns.c: Use it.
4044 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4045 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4046 Adjust users accordingly.
4047 * font.h (font_open_by_name): Adjust prototype.
4048
765e61e3
DA
40492012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4050
4051 Cleanup calls to Fgarbage_collect.
4052 * lisp.h (maybe_gc): New prototype.
4053 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4054 Remove declarations.
4055 * alloc.c (maybe_gc): New function.
4056 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4057 Make them static.
4058 * bytecode.c (MAYBE_GC): Use maybe_gc.
4059 * eval.c (eval_sub, Ffuncall): Likewise.
4060 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4061 to avoid dependency from auto-save feature.
4062
52b852c7
PE
40632012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4064
4065 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4066 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4067 'for_each_per_buffer_object_at'.
4068 All uses changed. It's better to use upper-case for macros that
4069 cannot be implemented as functions, to give the reader a clue
4070 that they're special.
4071
5db81e33
SM
40722012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4073
4074 * alloc.c (Fgarbage_collect): Tweak docstring.
4075
5b835e1d
DA
40762012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4077
4078 Tweak the value returned from Fgarbage_collect again.
4079 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4080 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4081 Adjust documentation.
4082 (total_vector_bytes): Rename to total_vector_slots, adjust
4083 accounting.
4084 (total_free_vector_bytes): Rename to total_free_vector_slots,
4085 adjust accounting.
4086 (Qstring_bytes, Qvector_slots): New symbols.
4087 (syms_of_alloc): DEFSYM them.
4088
9cd47b72
DA
40892012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4090
4091 Buffer compaction primitive which may be used from Lisp.
4092 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4093 (syms_of_buffer): Register Fcompact_buffer.
4094 * alloc.c (Fgarbage_collect): Use compact_buffer.
4095 * buffer.h (compact_buffer): New prototype.
4096 (struct buffer_text): New member.
4097
d17337e5
DA
40982012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4099
4100 New macro to iterate over all buffers, miscellaneous cleanups.
4101 * lisp.h (all_buffers): Remove declaration.
4102 * buffer.h (all_buffers): Add declaration, with comment.
4103 (for_each_buffer): New macro.
4104 * alloc.c (Fgarbage_collect, mark_object): Use it.
4105 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4106 (init_buffer): Likewise.
4107 * data.c (Fset_default): Likewise.
4108 * coding.c (code_conversion_restore): Remove redundant check
4109 for dead buffer.
4110 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4111
60cfd278
AS
41122012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4113
4114 Fix bug that created negative-length intervals.
4115 * intervals.c (merge_interval_right, merge_interval_left):
4116 Do not zero out this interval if it is absorbed by its children,
4117 as this interval's total length doesn't change in that case. See
4118 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4119
d06714cb
PE
41202012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4121
83713154
PE
4122 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4123 when invoking (make-bool-vector N t) and N is a positive
4124 multiple of 8 -- the last 8 bits were mistakenly cleared.
4125
d06714cb
PE
4126 Remove some struct layout assumptions in bool vectors.
4127 * alloc.c (bool_header_size): New constant.
4128 (header_size, word_size): Move earlier, as they're now used earlier.
4129 Use 'word_size' in a few more places, where it's appropriate.
4130 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4131 padding before the data member of a bool vector.
4132 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4133 than doing the check by hand with an abort ().
4134
464d5a5e
SM
41352012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4136
5fbc0409
SM
4137 * eval.c (Fdefvar): Don't check constants since we only set the var if
4138 it's not yet defined anyway (bug#11904).
4139
464d5a5e
SM
4140 * lisp.h (last_undo_boundary): Declare new var.
4141 * keyboard.c (command_loop_1): Set it.
4142 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4143 were auto-added by the command loop (bug#11774).
4144
8dc2e44a
AS
41452012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4146
4147 * w32font.c (Qsymbol): Remove local definition.
4148 (syms_of_w32font): Don't DEFSYM it.
4149
169925ec
DA
41502012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4151
4152 Fix sweep_vectors to handle large bool vectors correctly.
4153 * alloc.c (sweep_vectors): Account total_vector_bytes for
4154 bool vectors larger than VBLOCK_BYTES_MAX.
4155
5fbfb018
CY
41562012-07-18 Chong Yidong <cyd@gnu.org>
4157
4158 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4159 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4160
3ab6e069
DA
41612012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4162
4163 Return more descriptive data from Fgarbage_collect.
4164 Suggested by Stefan Monnier in
4165 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4166 * alloc.c (bounded_number): New function.
4167 (total_buffers, total_vectors): New variable.
4168 (total_string_size): Rename to total_string_bytes, adjust users.
4169 (total_vector_size): Rename to total_vector_bytes, adjust users.
4170 (sweep_vectors): Account total_vectors and total_vector_bytes.
4171 (Fgarbage_collect): New return value. Adjust documentation.
4172 (gc_sweep): Account total_buffers.
4173 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4174 (VECTOR_SIZE): Remove.
4175 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4176 (Qinterval, Qmisc): New symbols.
4177 (syms_of_data): Initialize them.
4178 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4179 (Qcons, Qbuffer): New declarations.
4180
6d02fe5b
PE
41812012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4182
4183 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4184 Round up, not down. Improve doc.
4185
b7ffe040
DA
41862012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4187
4188 Restore old code in allocate_string_data to avoid Faset breakage.
4189 Reported by Julien Danjou <julien@danjou.info> in
4190 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4191 * alloc.c (allocate_string_data): Restore old code with minor
4192 adjustments, fix comment to explain this subtle issue.
4193
4dc7c8d5
SM
41942012-07-17 Eli Zaretskii <eliz@gnu.org>
4195
4196 Remove FILE_SYSTEM_CASE.
4197 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4198
4199 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4200 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4201 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4202 call-process-region passes it through expand-file-name.
4203
4204 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4205
42062012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4207
4208 Fix crash when creating indirect buffer (Bug#11917)
4209 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4210 Don't handle unbound variables specially if non-zero.
4211 (Fbuffer_local_variables): Pass zero.
4212 (clone_per_buffer_values): Pass non-zero.
4213
42142012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4215
4216 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4217 to make the loop interruptible.
4218
42192012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4220
4221 * gnutls.c (emacs_gnutls_handshake): Only retry if
4222 GNUTLS_E_INTERRUPTED.
4223
cce7fefc
DA
42242012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4225
4226 Cleanup and convert miscellaneous checks to eassert.
4227 * alloc.c (mark_interval): Fix comment, partially rephrase
4228 old comment from intervals.h (see below).
4229 * intervals.c (find_interval, adjust_intervals_for_insertion)
4230 (delete_interval, adjust_intervals_for_deletion)
4231 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4232 Convert to eassert.
4233 (adjust_intervals_for_insertion, make_new_interval):
4234 Remove obsolete and unused code.
4235 * intervals.h (struct interval): Remove obsolete comment.
4236 * textprotp.c (erase_properties): Remove unused code.
4237 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4238 (Fremove_list_of_text_properties): Convert to eassert.
4239
9ea10cc3
CY
42402012-07-17 Chong Yidong <cyd@gnu.org>
4241
4242 * editfns.c (Finsert_char): Doc fix.
4243
3900d5de
DA
42442012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4245
4246 Fix previous change to make Fmemory_free always accurate.
4247 * alloc.c (make_interval): Update total_free_intervals.
4248 (make_float): Likewise for total_free_floats.
4249 (free_cons, Fcons): Likewise for total_free_conses.
4250 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4251 Likewise for total_free_vector_bytes.
4252 (Fmake_symbol): Likewise for total_free_symbols.
4253 (bytes_free): Remove.
4254
7098646f
DA
42552012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4256
4257 Simple free memory accounting feature.
4258 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4259 (sweep_vectors): Accumulate size of free vectors.
4260 (Fgarbage_collect): Setup bytes_free.
4261 (Fmemory_free): New function.
4262 (syms_of_alloc): Register it.
4263
22657b40
DA
42642012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4265
4266 Cleanup overlays checking.
4267 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4268 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4269 eassert and OVERLAYP.
4270 (sort_overlays): Change to use OVERLAYP.
4271
ddfc8813
RK
42722012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4273
4274 * editfns.c (Finsert_char): Make it interactive, and make the
4275 second arg optional. Copy interactive spec and docstring from
4276 ucs-insert.
4277
7c26cf3c
PE
42782012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4279
4280 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4281 Unlike the other wrapped functions, fabs has an unspecified
4282 effect on errno.
4283
5d127af9
JD
42842012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4285
4286 * nsterm.m (keyDown): Interpret flags without left/right bits
4287 as the left key (Bug#11670).
4288
6a0dd1d7
DA
42892012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4290
4291 Remove empty and useless init functions.
4292 * lisp.h (init_character_once, init_fns, init_image)
4293 (init_filelock, init_sound): Remove prototype.
4294 * character.c (init_character_once): Remove.
4295 * filelock.c (init_filelock): Likewise.
4296 * fns.c (init_fns): Likewise.
4297 * image.c (init_image): Likewise.
4298 * sound.c (init_sound): Likewise.
4299 * emacs.c (main): Adjust accordingly.
4300
7a6136fd
DA
43012012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4302
4303 * gtkutil.h: Tiny cleanups.
4304 (use_old_gtk_file_dialog): Remove useless declaration.
4305 (xg_uses_old_file_dialog): Add suggested const attribute.
4306
ce811ad9
EZ
43072012-07-15 Eli Zaretskii <eliz@gnu.org>
4308
4309 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4310 (bidi_paragraph_init): Use it to limit search forward for a strong
4311 directional character in abnormally large paragraphs full of
4312 neutral or weak characters. (Bug#11943)
4313
c9adfeaa
SF
43142012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4315
4316 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4317 the toolbar (Bug#9451).
4318 (xg_make_tool_item): Give the widget event box a transparent
4319 background.
4320
fff62aa9
DA
43212012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4322
4323 Cleanup basic allocation variables and functions.
4324 * alloc.c (ignore_warnings, init_intervals, init_float)
4325 (init_cons, init_symbol, init_marker): Remove.
4326 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4327 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4328 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4329 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4330 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4331 (staticidx, init_alloc_once, init_strings, free_ablock):
4332 Remove redundant initialization.
4333 * fns.c (init_weak_hash_tables): Remove.
4334 * lisp.h (init_weak_hash_tables): Remove prototype.
4335
9730daca
DA
43362012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4337
4338 Use zero_vector where appropriate.
4339 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4340 accordingly.
4341 * lisp.h (zero_vector): New declaration.
4342 * font.c (null_vector): Remove.
4343 (syms_of_font): Remove initialization and staticpro.
4344 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4345 * keymap.c (Faccessible_keymaps): Likewise.
4346
2e2d2a13
LL
43472012-07-15 Leo Liu <sdl.web@gmail.com>
4348
4349 * fringe.c: Fix typo in comments.
4350
cd276f6e
LL
43512012-07-14 Leo Liu <sdl.web@gmail.com>
4352
4353 * fringe.c: Add a new bitmap exclamation-mark.
4354
5a1131d9
EZ
43552012-07-14 Eli Zaretskii <eliz@gnu.org>
4356
4357 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4358
4359 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4360 (HAVE_MENUS): Don't define, defined by editing config.in with
4361 msdos/sed2v2.inp.
4362 (GMALLOC_INHIBIT_VALLOC): Don't define.
4363 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4364
22e983b7
JB
43652012-07-14 Juanma Barranquero <lekktu@gmail.com>
4366
4367 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4368
5b3f250f
GM
43692012-07-14 Glenn Morris <rgm@gnu.org>
4370
4371 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4372 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4373 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4374
33d63ff4
GM
43752012-07-13 Glenn Morris <rgm@gnu.org>
4376
5b633342
GM
4377 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4378
33d63ff4
GM
4379 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4380 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4381
b55b9f85
JD
43822012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4383
0dc8cf50
JD
4384 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4385 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4386 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4387 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4388 where appropriate.
4389 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4390 as boolean expression.
4391 (x_set_window_size): Remove unused variable toolbar.
4392 (ns_get_color_default, ns_mod_to_lisp): Remove.
4393 (ns_mouse_position): Remove unused variables xchar and ychar.
4394 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4395 (ns_set_vertical_scroll_bar): Remove unused variable count.
4396 (ns_delete_terminal): Remove unused variable i.
4397 (ns_term_init): Remove unused variables r, g and b.
4398 (mouseDown): Remove unused variable window.
4399 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4400 (initFrameFromEmacs): Remove unused variable vbextra.
4401 (mouseEntered): Remove unused variables p and dpyinfo.
4402 (mouseExited): Remove unused variables p and r.
4403 (ns_define_frame_cursor, ns_clear_frame_area)
4404 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4405 (menuDown): Assign [sender tag] to variable and cast the variable.
4406
4407 * nsterm.h (menuDown): Add id as type to argument sender.
4408 (ns_display_info_for_name): Add Lisp_Object argument.
4409 (ns_term_init): Add Lisp_Object argument.
4410 (ns_map_event_to_object): Add void argument.
4411 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4412 prototype with arguments and only declare if __OBJC__.
4413 (nxatoms_of_nsselect): Add void argument.
4414 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4415 (ns_alloc_autorelease_pool): Add void argument.
4416 (ns_release_autorelease_pool): Add void* argument.
4417 (ns_get_defaults_value): Add const char* argument.
4418
4419 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4420 (initFromContents): Use SSDATA where appropriate.
4421 (ns_update_menubar): Add braces to ambigous if-else.
4422 (initWithTitle): Put () around assignment in if statement.
4423 (ns_menu_show): Remove unused variables window and keymap.
4424 (update_frame_tool_bar): Remove unused variable selected_p.
4425 (initWithContentRect): Remove unused variable this_cmd_name.
4426
4427 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4428 appropriate.
4429 (setXBMColor): Remove unused variable len.
4430 (setPixmapData): Put () around assignment in loop statement.
4431
4432 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4433 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4434 where appropriate.
4435 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4436 around assignment in loop statement.
4437 (nsfont_open): Remove unused variable i.
4438 (nsfont_open): Remove unused variable len.
4439 (nsfont_draw): Remove unused variable cs.
4440
4441 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4442 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4443 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4444 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4445 (Fns_font_name, Fns_perform_service)
4446 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4447 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4448 (ns_set_name): Remove unused variable view.
4449 (x_set_menu_bar_lines): Remove unused variable olines.
4450 (x_set_tool_bar_lines): Remove unused variable root_window.
4451 (Fns_list_colors): Put () around assignment in while statement.
4452 (Fns_perform_service): Remove unused variable len.
4453 (Fns_display_usable_bounds): Remove unused variable top.
4454 (syms_of_nsfns): Remove unused variable i.
4455
b55b9f85
JD
4456 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4457 memcpy (Bug#11907).
4458
ed9265fc 44592012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
4460
4461 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4462 and free it with DestroyExceptionInfo (Bug#11558).
4463
ef099b57
JB
44642012-07-13 Juanma Barranquero <lekktu@gmail.com>
4465
4466 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4467 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4468 Set here, not in nt/config.nt.
4469
ea814a5d
EZ
44702012-07-13 Eli Zaretskii <eliz@gnu.org>
4471
4472 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4473 cursor overflow into the last glyph on display line when the right
4474 fringe is off. (Bug#11832)
4475
1a952767
PE
44762012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4477
4478 * xdisp.c (produce_special_glyphs): Now static.
4479 * dispextern.h (produce_special_glyphs): Remove decl.
4480
983188fd
GM
44812012-07-13 Glenn Morris <rgm@gnu.org>
4482
8d7c7eed 4483 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
4484 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4485
983188fd
GM
4486 * s/usg5-4-common.h (USG, USG5):
4487 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4488 * s/sol2-6.h (SOLARIS2):
4489 * s/irix6-5.h (IRIX6_5):
4490 * s/hpux10-20.h (USG, USG5, HPUX):
4491 * s/gnu-linux.h (USG, GNU_LINUX):
4492 * s/freebsd.h (BSD_SYSTEM):
4493 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4494 * s/cygwin.h (CYGWIN):
4495 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4496 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4497
d1e68667 44982012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
4499
4500 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 4501
6de0e799
GM
45022012-07-13 Glenn Morris <rgm@gnu.org>
4503
739ae010
GM
4504 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4505
dbee5793
GM
4506 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4507
6de0e799
GM
4508 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4509 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4510
b82da769
GM
45112012-07-12 Glenn Morris <rgm@gnu.org>
4512
4fae5a7a 4513 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
4514
4515 * process.c (init_process_emacs): Rename from init_process.
4516 The old name is also the name of a Mach system call.
4517 * lisp.h, emacs.c: Update for this name change.
4518 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4519 longer needed.
4520
5a979817
EZ
45212012-07-12 Eli Zaretskii <eliz@gnu.org>
4522
4523 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4524 memmove call that removes glyphs covered by the left truncation
4525 glyph. Improve commentary.
4526 (display_line): Fix display of continuation glyphs on GUI frames
4527 when the right fringe is turned off and variable-size fonts are
4528 used in the window. Move the code that appends a stretch glyph to
4529 produce_special_glyphs, so that it could be used for truncation
4530 and continuation glyphs alike.
4531 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4532 glyph of a suitably computed width, to align the special glyphs at
4533 the window margin. Code moved from display_line. (Bug#11832)
4534
3e91a053
GM
45352012-07-12 Glenn Morris <rgm@gnu.org>
4536
ba9e4b84
GM
4537 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4538
4539 * s/gnu-linux.h, s/hpux10-20.h:
4540 Do not unconditionally define HAVE_XRMSETDATABASE.
4541
3e91a053
GM
4542 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4543
b300b1f4
PE
45442012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4545
4546 Fix typos that broke OS X build.
4547 Reported by Randal L. Schwartz in
4548 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4549 * nsterm.m (ns_timeout): Add missing local decl.
4550 (ns_get_color): snprintf -> sprintf, to fix typo.
4551
6e777848
GM
45522012-07-12 Glenn Morris <rgm@gnu.org>
4553
3f922c37
GM
4554 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4555 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4556 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4557 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4558
0ab7b23a
GM
4559 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4560 Move PTY_OPEN to configure.
4561
6e777848
GM
4562 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4563 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4564 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4565
4a7edc24
DA
45662012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4567
4568 Use empty_unibyte_string where applicable.
4569 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4570 * lread.c (read1): Likewise.
4571 * xsettings.c (syms_of_xsettings): Likewise.
4572
308aab79
GM
45732012-07-12 Glenn Morris <rgm@gnu.org>
4574
42bd1719
GM
4575 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4576 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
4577 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4578 * s/hpux10-20.h (RUN_TIME_REMAP):
4579 * s/bsd-common.h (TABDLY): Move to configure.
4580
4581 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4582
4583 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4584
ea0bbd17 4585 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 4586 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
4587
4588 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 4589
308aab79
GM
4590 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4591 * s/template.h: Move NARROWPROTO to configure.
4592
ee1cf5cf
GM
45932012-07-11 Glenn Morris <rgm@gnu.org>
4594
30fe9bf4
GM
4595 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4596 unused since 2011-01-17 change to systty.h.
4597
ee1cf5cf
GM
4598 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4599 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4600 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4601
63e47e07
PE
46022012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4603
4604 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4605
c43fb4c3
GM
46062012-07-11 Glenn Morris <rgm@gnu.org>
4607
4608 * s/darwin.h, s/gnu-linux.h, s/template.h:
4609 Move INTERRUPT_INPUT to configure.
4610
e8df9267
DA
46112012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4612
4613 Minor adjustments to interning code.
4614 * lisp.h (intern, intern_c_string): Redefine as static inline
4615 wrappers for intern_1 and intern_c_string_1, respectively.
4616 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
4617 * lread.c (intern_1, intern_c_string_1, oblookup):
4618 Simplify Vobarray checking.
e8df9267
DA
4619 * font.c (font_intern_prop): Likewise. Adjust comment.
4620 * w32font.c (intern_font_name): Likewise.
4621
34348bd4
AS
46222012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4623
d96a1e0c
AS
4624 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4625
34348bd4
AS
4626 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4627 of Fcar/Fcdr if possible.
4628 * font.c (check_otf_features): Likewise.
4629 * fontset.c (Fnew_fontset): Likewise.
4630 * gnutls.c (Fgnutls_boot): Likewise.
4631 * minibuf.c (read_minibuf): Likewise.
4632 * msdos.c (IT_set_frame_parameters): Likewise.
4633 * xmenu.c (Fx_popup_dialog): Likewise.
4634 * w32menu.c (Fx_popup_dialog): Likewise.
4635
c8add24e
GM
46362012-07-11 Glenn Morris <rgm@gnu.org>
4637
4b575b3c
GM
4638 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4639 since nothing has defined it on these platforms.
4640
09f4e3b0
GM
4641 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4642 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4643
172bedef
GM
4644 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4645 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4646 Move CLASH_DETECTION to configure.
4647
249685df
GM
4648 * s/gnu.h: Remove file, which is now empty.
4649
c8add24e
GM
4650 * s/gnu.h, s/gnu-linux.h:
4651 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4652
b41253a3
JW
46532012-07-11 John Wiegley <johnw@newartisans.com>
4654
4655 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4656 function attribute, so we only use it if it exists in the
4657 compiler.
4658
d923b542
DA
46592012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4660
4661 Avoid call to strlen in fast_c_string_match_ignore_case.
4662 * search.c (fast_c_string_match_ignore_case): Change to use
4663 length argument. Adjust users accordingly.
4664 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4665
5ebbef1d
PE
46662012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4667
bb352260
PE
4668 Assume mkdir, rmdir.
4669 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4670 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4671
57054ddd
PE
4672 Assume rename.
4673 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4674
b747d3f7
PE
4675 Assume perror.
4676 * s/hpux10-20.h (HAVE_PERROR): Remove.
4677 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4678 Remove dummy definition, as this problem was obsolete long ago.
4679
5ebbef1d
PE
4680 Assume strerror.
4681 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4682
984e7f30
DA
46832012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4684
4685 Avoid calls to strlen in font processing functions.
4686 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
4687 (font_open_by_name): Change to use length argument.
4688 Adjust users accordingly.
d923b542
DA
4689 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4690 Adjust prototypes.
4691 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4692 Change to return ptrdiff_t.
984e7f30
DA
4693 (xfont_list_pattern, xfont_match): Use length returned by
4694 xfont_decode_coding_xlfd.
4695 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4696
20e94fdd
GM
46972012-07-11 Glenn Morris <rgm@gnu.org>
4698
9d596af3
GM
4699 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4700 Move DONT_REOPEN_PTY to configure.
4701
20e94fdd
GM
4702 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4703 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4704
e99a530f
PE
47052012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4706
22ffb973
PE
4707 Remove "#define unix" that is no longer needed (Bug#11905).
4708 * s/aix4-2.h (unix): Remove; no longer needed.
4709
e9a9ae03
PE
4710 EMACS_TIME simplification (Bug#11875).
4711 This replaces macros (which typically do not work in GDB)
4712 with functions, typedefs and enums, making the code easier to debug.
4713 The functional style also makes code easier to read and maintain.
4714 * systime.h: Include <sys/time.h> on all hosts, not just if
4715 WINDOWSNT, since 'struct timeval' is needed in general.
4716 (EMACS_TIME): Now a typedef, not a macro.
4717 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4718 not macros.
4719 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4720 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4721 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4722 (EMACS_TIME_LE): Now functions, not macros.
4723 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4724 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4725 which are not functions. All uses rewritten to use:
4726 (make_emacs_time): New function.
4727 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4728 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4729 not functions. All uses rewritten to use the following, respectively:
4730 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4731 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 4732 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
4733 * fileio.c (Fcopy_file):
4734 * xterm.c (XTflash): Get the current time closer to when it's used.
4735 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4736
ffacb126
PE
4737 * bytecode.c (targets): Suppress -Woverride-init warnings.
4738
e99a530f
PE
4739 Simplify by avoiding confusing use of strncpy etc.
4740 * doc.c (Fsnarf_documentation):
4741 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4742 * frame.c (Fmake_terminal_frame):
4743 * gtkutil.c (get_utf8_string):
4744 * lread.c (openp):
4745 * nsmenu.m (ns_update_menubar):
4746 * regex.c (regerror):
4747 Prefer memcpy to strncpy and strncat when either will do.
4748 * fileio.c (Fsubstitute_in_file_name):
4749 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4750 (menu_separator_name_p):
4751 * nsmenu.m (ns_update_menubar):
4752 Prefer memcmp to strncmp when either will do.
4753 * nsterm.m: Include <ftoastr.h>.
4754 (ns_get_color):
4755 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4756 Prefer snprintf to strncpy.
4757 * nsterm.m (ns_term_init):
4758 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4759 * nsterm.m (ns_term_init):
4760 Avoid the need for strncpy, by using build_string or
4761 make_unibyte_string directly. Use dtoastr, not snprintf.
4762 * process.c (Fmake_network_process): Diagnose service names that
4763 are too long, rather than silently truncating them or creating
4764 non-null-terminated names.
4765 (Fnetwork_interface_info): Likewise, for interface names.
4766 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4767 Prefer sprintf to strncat.
4768 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4769 Prefer vsnprintf to vsprintf + strncpy.
4770
c59592b3
GM
47712012-07-10 Glenn Morris <rgm@gnu.org>
4772
4773 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4774 Clarify fallback case.
4775
7d7bbefd
DA
47762012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4777
4778 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4779 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4780 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 4781 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
4782 where argument type is known to be a Lisp_Cons.
4783
3a4c8000
TT
47842012-07-10 Tom Tromey <tromey@redhat.com>
4785
4786 * bytecode.c (BYTE_CODE_THREADED): New macro.
4787 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4788 (enum byte_code_op): New type.
4789 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4790 (exec_byte_code): Use them. Use token threading when applicable.
4791
2a0213a6
DA
47922012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4793
4794 Optimize pure C strings initialization.
4795 * lisp.h (make_pure_string): Fix prototype.
4796 (build_pure_c_string): New function, defined as static inline. This
4797 provides a better opportunity to optimize away calls to strlen when
4798 the function is called with compile-time constant argument.
4799 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4800 argument, adjust users accordingly. Use build_pure_c_string where
4801 appropriate.
4802 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4803 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4804 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4805
cb1caeaf
DA
48062012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4807
4808 Avoid calls to strlen in miscellaneous functions.
4809 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4810 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4811 * lread.c (openp): Likewise.
4812
c293e30c
DA
48132012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4814
4815 Avoid calls to strlen in path processing functions.
4816 * fileio.c (file_name_as_directory): Add comment. Change to add
4817 srclen argument and return the length of result. Adjust users
4818 accordingly.
4819 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
4820 swap 1st and 2nd arguments to obey the common convention.
4821 Adjust users accordingly.
c293e30c
DA
4822 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4823
9e059e3f
GM
48242012-07-10 Glenn Morris <rgm@gnu.org>
4825
d02eb359
GM
4826 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4827 Move PENDING_OUTPUT_COUNT definition to configure.
4828
882cf227
GM
4829 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4830 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4831 * s/gnu.h (DATA_START): Move definitions to configure.
4832
af6e839f
GM
4833 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4834 We include usg5-4-common.h, which defines them both.
4835
40289a12
GM
4836 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4837 O_RDONLY already includes it).
4838
9e059e3f
GM
4839 Stop ns builds setting the EMACSLOADPATH environment variable.
4840 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4841 Now it does not set EMACSLOADPATH, just returns the load-path string.
4842 * nsterm.h: Update accordingly.
4843 * lread.c [HAVE_NS]: Include nsterm.h.
4844 (init_lread) [HAVE_NS]: Use ns_load_path.
4845 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4846
7c4e8ec0
GM
48472012-07-09 Glenn Morris <rgm@gnu.org>
4848
d4f600ff
GM
4849 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4850 since the included bsd-common.h does so.
4851
cbb31951
GM
4852 Stop ns builds setting the EMACSPATH environment variable.
4853 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4854 (ns_init_paths): Do not set EMACSPATH.
4855 * nsterm.h (ns_exec_path): Add it.
4856 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4857 Use ns_exec_path.
4858
7c4e8ec0
GM
4859 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4860
26bccfae
PE
48612012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4862
a0bee46f
PE
4863 * process.c (wait_reading_process_output): 'waitchannels' was unset
4864 when read_kbd || !NILP (wait_for_cell); fix this.
4865
5994c183
PE
4866 Add GCC-style 'const' attribute to functions that can use it.
4867 * character.h (char_resolve_modifier_mask):
4868 * keyboard.h (make_ctrl_char):
4869 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4870 (init_character_once, next_almost_prime, init_fns, init_image)
4871 (flush_pending_output, init_sound):
4872 * mem-limits.h (start_of_data):
4873 * menu.h (finish_menu_items):
4874 Add ATTRIBUTE_CONST.
4875 * emacs.c (DEFINE_DUMMY_FUNCTION):
4876 Declare the dummy function with ATTRIBUTE_CONST.
4877 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4878 Add decls with ATTRIBUTE_CONST.
4879
26bccfae
PE
4880 Minor improvements to make_formatted_string.
4881 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4882 where int is good enough, as vsprintf returns an int.
4883 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4884
a8290ec3
DA
48852012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4886
4887 Use make_formatted_string to avoid double length calculation.
4888 * lisp.h (make_formatted_string): New prototype.
4889 * alloc.c (make_formatted_string): New function.
4890 * buffer.c (Fgenerate_new_buffer_name): Use it.
4891 * dbus.c (syms_of_dbusbind): Likewise.
4892 * editfns.c (Fcurrent_time_zone): Likewise.
4893 * filelock.c (get_boot_time): Likewise.
4894 * frame.c (make_terminal_frame, set_term_frame_name)
4895 (x_report_frame_params): Likewise.
4896 * image.c (gs_load): Likewise.
4897 * minibuf.c (get_minibuffer): Likewise.
4898 * msdos.c (dos_set_window_size): Likewise.
4899 * process.c (make_process): Likewise.
4900 * xdisp.c (ensure_echo_area_buffers): Likewise.
4901 * xsettings.c (apply_xft_settings): Likewise.
4902
d01ba2f1
GM
49032012-07-09 Glenn Morris <rgm@gnu.org>
4904
4905 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4906 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4907 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4908 * nsterm.h (ns_etc_directory): Add it.
4909 * callproc.c [HAVE_NS]: Include nsterm.h.
4910 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4911
f1f924b6
DA
49122012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4913
4914 Move marker debugging code under MARKER_DEBUG.
4915 * marker.c (MARKER_DEBUG): Move marker debugging code under
4916 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4917 for bootstrap with --enable-checking (~3x slowdown reported
4918 by Juanma Barranquero <lekktu@gmail.com>).
4919 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4920
ab531b66
PE
49212012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4922
4923 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4924 See <http://bugs.gnu.org/11825#29>.
4925
c4b3bc8a
EZ
49262012-07-08 Eli Zaretskii <eliz@gnu.org>
4927
4928 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4929 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
4930 (display_line): Add commentary about displaying truncation glyphs
4931 on GUI frames.
4932 (produce_special_glyphs): Move here from term.c.
4933
4934 * term.c (produce_special_glyphs): Move to xdisp.c.
4935
4936 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4937 section.
c4b3bc8a 4938
b676b881
AS
49392012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4940
f17c5273
AS
4941 * xdisp.c (display_line): Avoid warning about implicit declaration
4942 of FRAME_FONT.
4943
298819b9
AS
4944 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4945
b676b881
AS
4946 * lisp.h: Remove empty conditional.
4947
6045c4fd
PE
49482012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4949
b3350bf9
PE
4950 * lread.c (load_path_check): Now static.
4951
6045c4fd
PE
4952 Fix some minor --with-ns problems found by static checking.
4953 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4954 (x_set_font) [!HAVE_X_WINDOWS]:
4955 * image.c (xpm_load_image) [HAVE_NS]:
4956 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4957 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4958 Remove unused local.
4959 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4960 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4961 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4962 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4963 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4964 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4965 Fix pointer signedness problem.
4966 * xfaces.c (FRAME_X_FONT_TABLE):
4967 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4968
929e7845
GM
49692012-07-07 Glenn Morris <rgm@gnu.org>
4970
4971 * lread.c (load_path_check): New function, split from init_lread.
4972 (init_lread): Reorganize. Motivation:
4973 If EMACSLOADPATH is set, check/warn about that rather than the
4974 defaults, which we are not going to use. Hence we can remove
4975 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4976 Don't warn if site-lisp directories are missing.
4977 If not installed, start from a blank load-path, since
4978 PATH_LOADSEARCH refers to the eventual installation directories.
4979
58dd0aa4
EZ
49802012-07-07 Eli Zaretskii <eliz@gnu.org>
4981
4982 Support truncation and continuation glyphs on GUI frames, when
4983 fringes are disabled. (Bug#11832)
4984 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
4985 continuation glyphs even if on GUI frames.
4986 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
4987 or both, are absent.
4988 (start_display, move_it_in_display_line_to): Handle the case of a
4989 GUI frame without a fringe to display continuation or truncation
4990 glyphs.
4991 (insert_left_trunc_glyphs): Support GUI frames: make sure
4992 truncation glyphs overwrite enough glyphs from the current line to
4993 have sufficient space in pixels.
4994 (display_line): Support truncation and continuation glyphs on GUI
4995 frames. If some spare pixels are left on the line after inserting
4996 the truncation glyphs, fill that space with a stretch glyph of a
4997 suitably computed width.
4998
4999 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5000 produce_glyphs, to support GUI sessions.
5001
31571fd7
PE
50022012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5003
5a16b9bc
PE
5004 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5005
f3047c75
PE
5006 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5007
31571fd7
PE
5008 Do not require float-time's arg to fit in time_t (Bug#11825).
5009 This works better on hosts where time_t is unsigned, and where
5010 float-time is applied to the (negative) difference between two times.
5011 * editfns.c (decode_time_components): Last arg is now double *,
5012 not int *, and means to store all the result as a double, without
5013 worrying about whether the seconds part fits in time_t.
5014 All callers changed.
5015 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5016 All callers changed.
5017 (Ffloat_time): Do not fail merely because the specified time falls
5018 outside of time_t range.
5019
4516fbef
GM
50202012-07-07 Glenn Morris <rgm@gnu.org>
5021
5022 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5023 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5024 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5025
07adc2c6
JB
50262012-07-07 Juanma Barranquero <lekktu@gmail.com>
5027
5028 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5029 Update dependencies.
5030
5031 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5032
fd573f31
PE
50332012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5034
fee5959d
PE
5035 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5036 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5037 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5038 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5039 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5040 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5041
fd573f31
PE
5042 * xfont.c (compare_font_names): Redo to omit the need for casts.
5043
ddadbc0e
AS
50442012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5045
fca8d6b6
AS
5046 * xfns.c (Fx_change_window_property): Doc fix.
5047 * w32fns.c (Fx_change_window_property): Doc fix.
5048
ddadbc0e
AS
5049 * w32fns.c (Fx_window_property): Accept the same arguments as the
5050 X Windows version. Doc fix.
5051 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5052
ed9265fc 50532012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
5054 Eli Zaretskii <eliz@gnu.org>
5055
5056 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5057 Windows-specific code from nt/config.nt moved here.
5058 Obsolete settings removed.
5059
216ee680
PE
50602012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5061
5062 * process.c: Avoid unnecessary calls to gettime.
5063 (wait_reading_process_output): Don't get the time of day
5064 when gobbling data immediately and not waiting, as there's no need
5065 for it in that case. This removes a FIXME.
5066
bdd091e4
JD
50672012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5068
5069 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5070 is defined (Bug#11768).
5071
9d44f8ce
DA
50722012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5073
5074 Fix marker debugging code.
5075 * marker.c (byte_char_debug_check): Do not perform the check
5076 if buffer is not multibyte.
090bd7cb
JB
5077 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5078 Call byte_char_debug_check with correct arguments.
9d44f8ce 5079
90fc4786
DA
50802012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5081
5082 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
5083 * marker.c (byte_char_debug_check, count_markers):
5084 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
5085 (byte_debug_flag): Remove.
5086 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5087 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5088
7b7ae965
DA
50892012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5090
4e57b342
DA
5091 Avoid code repetition in marker-related functions.
5092 * marker.c (attach_marker): New function.
5093 (Fset_marker, set_marker_restricted, set_marker_both)
5094 (set_marker_restricted_both): Use it.
5095 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5096 Consistently rename charno to charpos.
5097 (marker_position): Add eassert.
5098 (marker_byte_position): Convert to eassert.
5099
51002012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5101
5102 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 5103 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 5104 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 5105
657924ff
DA
51062012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5107
5108 Introduce fast path for the widely used marker operation.
5109 * alloc.c (build_marker): New function.
5110 * lisp.h (build_marker): New prototype.
5111 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5112 * composite.c (autocmp_chars): Likewise.
5113 * editfns.c (buildmark): Remove.
5114 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5115 (save_restriction_save): Use build_marker.
5116 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5117 * window.c (save_window_save): Likewise.
5118
041a49a6
DA
51192012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5120
5121 Do not use Fdelete_overlay in delete_all_overlays
5122 to avoid redundant calls to unchain_overlay.
5123 * buffer.c (drop_overlay): New function.
5124 (delete_all_overlays, Fdelete_overlay): Use it.
5125 * minibuf.c (get_minibuffer): Fix comment.
5126
7dca65a4
PE
51272012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5128
5129 Port to OpenBSD 5.1 amd64.
5130 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5131 This is needed for OpenBSD, and should be harmless on all BSD systems.
5132 Also, include <sys/sysctl.h>, as it should be available on all
5133 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5134 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5135 use p_pid member, not kp_proc.pid.
5136
8eb876e2
GM
51372012-07-06 Glenn Morris <rgm@gnu.org>
5138
5139 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5140
38182d90
PE
51412012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5142
5143 More xmalloc and related cleanup.
5144 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5145 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5146 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5147 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5148 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5149 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5150 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5151 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5152 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5153 * xterm.c:
5154 Omit needless casts involving void * pointers and allocation.
5155 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5156 as the former is more robust if P's type is changed.
5157 Prefer xzalloc to xmalloc + memset 0.
5158 Simplify malloc-or-realloc to realloc.
5159 Don't worry about xmalloc returning a null pointer.
5160 Prefer xstrdup to xmalloc + strcpy.
5161 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5162 growing it.
5163 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5164 alloca of a constant.
5165
6dd5a677
EZ
51662012-07-05 Eli Zaretskii <eliz@gnu.org>
5167
5168 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5169 hscroll is larger than the line width. Fixes long and futile
5170 looping inside extend_face_to_end_of_line (on a TTY) producing
5171 glyphs that are not needed and thrown away.
5172
6b312f0f
DA
51732012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5174
5175 * marker.c (set_marker_restricted_both): Simplify by using
5176 clip_to_bounds.
5177
f520ef9b
PE
51782012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5179
5180 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5181
383b7c95
JD
51822012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5183
5184 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5185 not defined (Bug#11768).
5186 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5187 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5188 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5189 followed by gtk_box_set_homogeneous (Bug#11768).
5190 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
5191 (update_theme_scrollbar_width, xg_create_scroll_bar):
5192 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
5193 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5194 (is_box_type): New function (Bug#11768).
5195 (xg_tool_item_stale_p): Call is_box_type.
5293d758 5196 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
5197 with default display (Bug#11768).
5198
d6e7bf45
EZ
51992012-07-05 Eli Zaretskii <eliz@gnu.org>
5200
5201 * xdisp.c (window_hscroll_limited): New function.
5202 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5203 coordinates when window's hscroll is set to insanely large
5204 values. (Bug#11857)
5205
431391ec
JB
52062012-07-05 Juanma Barranquero <lekktu@gmail.com>
5207
5208 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5209 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5210
23f86fce
DA
52112012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5212
5213 Cleanup xmalloc.
5214 * lisp.h (xzalloc): New prototype. Omit needless casts.
5215 * alloc.c (xzalloc): New function. Omit needless casts.
5216 * charset.c: Omit needless casts. Convert all calls to
5217 xmalloc with following memset to xzalloc.
5218 * dispnew.c: Likewise.
5219 * fringe.c: Likewise.
5220 * image.c: Likewise.
5221 * sound.c: Likewise.
5222 * term.c: Likewise.
5223 * w32fns.c: Likewise.
5224 * w32font.c: Likewise.
5225 * w32term.c: Likewise.
5226 * xfaces.c: Likewise.
5227 * xfns.c: Likewise.
5228 * xterm.c: Likewise.
5229 * atimer.c: Omit needless casts.
5230 * buffer.c: Likewise.
5231 * callproc.c: Likewise.
5232 * ccl.c: Likewise.
5233 * coding.c: Likewise.
5234 * composite.c: Likewise.
5235 * doc.c: Likewise.
5236 * doprnt.c: Likewise.
5237 * editfns.c: Likewise.
5238 * emacs.c: Likewise.
5239 * eval.c: Likewise.
5240 * filelock.c: Likewise.
5241 * fns.c: Likewise.
5242 * gtkutil.c: Likewise.
5243 * keyboard.c: Likewise.
5244 * lisp.h: Likewise.
5245 * lread.c: Likewise.
5246 * minibuf.c: Likewise.
5247 * msdos.c: Likewise.
5248 * print.c: Likewise.
5249 * process.c: Likewise.
5250 * region-cache.c: Likewise.
5251 * search.c: Likewise.
5252 * sysdep.c: Likewise.
5253 * termcap.c: Likewise.
5254 * terminal.c: Likewise.
5255 * tparam.c: Likewise.
5256 * w16select.c: Likewise.
5257 * w32.c: Likewise.
5258 * w32reg.c: Likewise.
5259 * w32select.c: Likewise.
5260 * w32uniscribe.c: Likewise.
5261 * widget.c: Likewise.
5262 * xdisp.c: Likewise.
5263 * xmenu.c: Likewise.
5264 * xrdb.c: Likewise.
5265 * xselect.c: Likewise.
5266
0497dc44
PE
52672012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5268
5269 * fileio.c (time_error_value): Check the right error number.
5270 Problem reported by Troels Nielsen in
5271 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5272
356e7178
PE
52732012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5274
4e71fd89
PE
5275 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5276 This should be fixed in a better way; see Eli Zaretskii in
5277 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5278 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5279
f0941253
PE
5280 * fileio.c (time_error_value): Rename from special_mtime.
5281 The old name's problems were noted by Eli Zaretskii in
5282 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5283
065c9eb4
PE
5284 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5285 This variable's comment says Emacs needs at least one GDB-visible
5286 symbol of type enum pvec_type, to work around GDB problems.
5287 The symbol's value doesn't matter.
5288
356e7178
PE
5289 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5290 that causes compilation to fail on pre-C99 compilers.
5291
ed9265fc 52922012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
5293
5294 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5295 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5296
3884d954
DA
52972012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5298
d209e2fb 5299 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
5300 headers for buffer_defaults and buffer_local_symbols.
5301 Reported by Juanma Barranquero <lekktu@gmail.com>.
5302
ee28be33
SM
53032012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5304
5305 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5306 * lisp.h (enum pvec_type): Use fewer bits.
5307 (PSEUDOVECTOR_SIZE_BITS): New constant.
5308 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5309 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5310 change in pvec_type.
5311 (PSEUDOVECTOR_TYPEP): New macro.
5312 (TYPED_PSEUDOVECTORP): Use it.
5313 * fns.c (internal_equal): Adapt code to extract pvectype.
5314 * emacs.c (gdb_pvec_type): Update type.
5315 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5316 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5317 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5318 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5319 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5320 abusing vector->header.next.nbytes.
5321 (live_vector_p): Use PVEC_TYPE.
5322 (mark_object): Adapt code to extract pvectype. Use switch.
5323
c7f2cd7f
PE
53242012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5325
5326 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5327 Tighten new eassert a bit.
5328
8ce70ed2
DA
53292012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5330
5331 Fix compilation with --enable-gcc-warnings and -O1
5332 optimization level.
5333 * doprnt.c (doprnt): Change type of tem to int, initialize
5334 to avoid compiler warning. Add eassert.
5335 * search.c (simple_search): Initialize match_byte to avoid
5336 compiler warning. Add eassert.
5337
dea7f1e5
PE
53382012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5339
24a212eb
PE
5340 Avoid weird behavior with large horizontal scrolls.
5341 Without this change, for example, large hscroll values would
5342 mess up Emacs's display on Fedora 15 x86, presumably due to
5343 overflows in int calculations in the display code.
5344 Also, if buffers had long lines, Emacs would freeze.
5345 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5346 (set_window_hscroll): New function, containing the old guts of
5347 Fset_window_hscroll. Return the clipped value.
5348 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5349 This avoids the need to check against PTRDIFF_MAX.
5350
dea7f1e5
PE
5351 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5352
76046526
DA
53532012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5354
5355 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5356
39adff0d
PE
53572012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5358
63807d47
PE
5359 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5360 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5361 since GCC 4.4.6 issues a bogus warning for them.
5362
39adff0d
PE
5363 Fix bugs in file timestamp newness comparisons.
5364 * fileio.c (Ffile_newer_than_file_p):
5365 * lread.c (Fload): Use full timestamp resolution of files,
5366 not just the 1-second resolution, so that files that are only
5367 slightly newer still count as newer.
5368 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5369 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5370
dbeed9a6
PE
53712012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5372
5373 * fileio.c: Improve handling of file time marker. (Bug#11852)
5374 (special_mtime): New function.
5375 (Finsert_file_contents, Fverify_visited_file_modtime):
5376 Use it to set special mtime values consistently.
5377
636334d6
AS
53782012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5379
5380 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5381 marker for non-existing file. (Bug#11852)
5382
e2017fe2
GM
53832012-07-03 Glenn Morris <rgm@gnu.org>
5384
5385 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5386 and did not make it into globals.h).
5387
404dbd37
TT
53882012-07-03 Tom Tromey <tromey@redhat.com>
5389
5390 * window.c (Fset_window_margins, Fset_window_fringes)
5391 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5392 * textprop.c (Fprevious_property_change): No longer static.
5393 * syntax.c (Fsyntax_table_p): No longer static.
5394 * process.c (Fget_process, Fprocess_datagram_address): No longer
5395 static.
5396 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5397 * keyboard.c (Fcommand_execute): No longer static.
5398 Remove EXFUN.
5399 * insdel.c (Fcombine_after_change_execute): No longer static.
5400 * image.c (Finit_image_library): No longer static.
5401 * fileio.c (Fmake_symbolic_link): No longer static.
5402 * eval.c (Ffetch_bytecode): No longer static.
5403 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
5404 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5405 No longer static.
404dbd37
TT
5406 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5407 static.
5408 * dired.c (Ffile_attributes): No longer static.
5409 * composite.c (Fcomposition_get_gstring): No longer static.
5410 * callproc.c (Fgetenv_internal): No longer static.
5411
5412 * ccl.h: Remove EXFUNs.
5413 * buffer.h: Remove EXFUNs.
5414 * dispextern.h: Remove EXFUNs.
5415 * intervals.h: Remove EXFUNs.
5416 * fontset.h: Remove EXFUN.
5417 * font.h: Remove EXFUNs.
5418 * dosfns.c (system_process_attributes): Remove EXFUN.
5419 * keymap.h: Remove EXFUNs.
5420 * lisp.h: Remove EXFUNs.
5421 * w32term.h: Remove EXFUNs.
5422 * window.h: Remove EXFUNs.
5423 * xsettings.h: Remove EXFUN.
5424 * xterm.h: Remove EXFUN.
5425
8e4fd1e1
GM
54262012-07-03 Glenn Morris <rgm@gnu.org>
5427
5428 * lisp.h (Frandom): Make it visible to C.
5429 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5430 buffer for invisible buffers. (Bug#1229)
5431
ca95b3eb
DA
54322012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5433
5434 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5435 values which aren't power of 2.
14ae4239
BT
5436 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5437 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
5438 accordingly.
5439
7555c33f
SM
54402012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5441
5442 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5443
5444 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5445
d12e8f5a
DA
54462012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5447
5448 * alloc.c (allocate_vector_block): Remove redundant
5449 calls to mallopt if DOUG_LEA_MALLOC is defined.
5450 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5451 avoid calls to mallopt if zero_vector is returned.
5452
296094c3
DA
54532012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5454
5455 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5456 is enabled, avoid dereferencing NULL current_sblock if
5457 running undumped.
5458
36429c89
DA
54592012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5460
5461 Cleanup basic buffer management.
5462 * buffer.h (struct buffer): Change layout to use generic vector
5463 marking code. Fix some comments. Change type of 'clip_changed'
5464 to bitfield. Remove unused #ifndef old.
5465 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5466 (GET_OVERLAYS_AT): Fix indentation.
5467 (for_each_per_buffer_object_at): New macro.
5468 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5469 (Fbuffer_local_variables): Use it.
5470 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5471 * alloc.c (allocate_buffer): Adjust to match new layout of
5472 struct buffer. Fix comment.
5473 (mark_overlay): New function.
5474 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5475 Lisp area of struct buffer.
5476 (mark_object): Use it. Adjust marking of misc objects
5477 and related comments.
5478
3b3e4cac
PE
54792012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5480
5481 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5482 wrapper that is not needed because the wrapped code is a no-op (zero
5483 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5484 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5485
cf5c0175
DA
54862012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5487
5488 * alloc.c (mark_buffer): Simplify. Remove prototype.
5489 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 5490 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
5491 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5492 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 5493
ca26824c
GM
54942012-06-30 Glenn Morris <rgm@gnu.org>
5495
2e4c5312
GM
5496 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5497
ca26824c
GM
5498 * epaths.in (PATH_SITELOADSEARCH): New.
5499 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5500 This is rather than relying on --enable-locallisppath elements
5501 having "site-lisp" in their names. (Bug#10208#25, 11658)
5502
0d23c240
EZ
55032012-06-30 Eli Zaretskii <eliz@gnu.org>
5504
c9240d7a
EZ
5505 * w32proc.c (sys_select): Accept and ignore one more argument.
5506
5507 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5508
0d23c240 5509 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 5510 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
5511
5512 * sysdep.c: Don't include dos.h and dosfns.h.
5513
5514 * process.c (sys_select):
5515 * msdos.c (sys_select): Accept one more argument and ignore it.
5516
5517 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5518 adapt data types and code to that.
5519
5520 * dosfns.c:
5521 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5522 which clashes with the gnulib function of the same name.
5523
af5a5a98
AS
55242012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5525
c5e4379c
AS
5526 * font.c (font_style_to_value, font_style_symbolic)
5527 (font_prop_validate_style): Add type checks for values in
5528 font_style_table.
5529
af5a5a98
AS
5530 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5531 argument.
5532 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5533 uses.
5534
8d38f461
EZ
55352012-06-29 Eli Zaretskii <eliz@gnu.org>
5536
2e5a6631
EZ
5537 * xdisp.c (try_window_id): Undo last change.
5538
8d38f461
EZ
5539 * w32.c (getwd): Adjust commentary about startup_dir.
5540 (init_environment): Always call sys_access, even in non-MSVC
5541 builds. Don't chdir to the directory of the Emacs executable.
5542 This undoes code from 1997 which was justified by the need to
5543 "avoid conflicts when removing and renaming directories". But its
5544 downside was that every relative file name was being interpreted
5545 relative to the directory of the Emacs executable, which can never
5546 be TRT. In particular, it broke sys_access when called with
5547 relative file names.
5548 (sys_access): Map GetLastError to errno.
5549
2af3565e
DA
55502012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5551
5552 * window.h (struct window): Change type of 'fringes_outside_margins'
5553 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 5554 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
5555 Adjust comment.
5556 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5557 to ptrdiff_t.
5558
c8d3a25c 55592012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 5560
c8d3a25c
GM
5561 * gnutls.c (emacs_gnutls_handshake):
5562 Add QUIT to make the loop interruptible.
57570cd3 5563
c8d3a25c 55642012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 5565
c8d3a25c
GM
5566 * charset.c (init_charset): Make lack of etc/charsets fatal.
5567
3e984ee8
DA
55682012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5569
5570 * editfns.c (region_limit): Fix type mismatch.
5571
ef884f23
DA
55722012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5573
5574 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5575 undefined. Convert from xassert to eassert.
5576 * nsmenu.m: Convert from xassert to eassert.
5577 * nsterm.m: Likewise.
5578
7d7e0027
SM
55792012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5580
5581 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5582
aa754e6a
PE
55832012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5584
5585 Avoid integer overflow on scroll-left and scroll-right.
5586 * window.c (HSCROLL_MAX): New macro.
5587 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5588 overflow when requested scroll falls outside ptrdiff_t range.
5589
80b00b08
DA
55902012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5591
5592 * window.h (struct window): Change type of 'hscroll',
5593 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5594 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5595 Adjust users accordingly.
5596 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5597 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5598 from EMACS_INT to ptrdiff_t.
5599 (make_window): Omit redundant initialization.
5600
62b2bcf6
JB
56012012-06-28 Juanma Barranquero <lekktu@gmail.com>
5602
5603 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5604
45942c7d
DA
56052012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5606
5607 * window.h (struct window): Change type of 'use_time' and
5608 'sequence_number' from Lisp_Object to int.
5609 * frame.c (make_frame): Adjust users accordingly.
5610 * print.c (print_object): Likewise.
5611 * window.c (select_window, Fwindow_use_time, make_parent_window)
5612 (make_window): Likewise.
5613
e509cfa6
DA
56142012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5615
5616 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5617 enabled with --enable-checking=[all,glyphs] configure option.
5618 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5619 adjust comments accordingly.
5620 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5621 undefined, adjust comments accordingly.
5622 * image.c: Likewise.
5623 * scroll.c: Likewise.
5624 * w32fns.c: Likewise.
5625 * w32term.c: Likewise.
5626 * xdisp.c: Likewise.
5627 * xfaces.c: Likewise.
5628 * xfns.c: Likewise.
5629 * xterm.c: Likewise.
5630
a54e2c05
DA
56312012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5632
5633 Generalize run-time debugging checks.
5634 * dispextern.h (XASSERTS): Remove.
5635 * fontset.c (xassert): Remove.
5636 Convert from xassert to eassert.
5637 * alloc.c: Convert from xassert to eassert.
5638 * bidi.c: Likewise.
5639 * dispnew.c: Likewise.
5640 * fns.c: Likewise.
5641 * fringe.c: Likewise.
5642 * ftfont.c: Likewise.
5643 * gtkutil.c: Likewise.
5644 * image.c: Likewise.
5645 * keyboard.c: Likewise.
5646 * menu.c: Likewise.
5647 * process.c: Likewise.
5648 * scroll.c: Likewise.
5649 * sound.c: Likewise.
5650 * term.c: Likewise.
5651 * w32console.c: Likewise.
5652 * w32fns.c: Likewise.
5653 * w32term.c: Likewise.
5654 * window.c: Likewise.
5655 * xdisp.c: Likewise.
5656 * xfaces.c: Likewise.
5657 * xfns.c: Likewise.
5658 * xselect.c: Likewise.
5659 * xterm.c: Likewise.
5660
1ec4b7b2
SM
56612012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5662
5663 * fns.c (maybe_resize_hash_table): Output message when growing the
5664 purify-hashtable.
5665
2014308a
DA
56662012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5667
5668 * alloc.c (allocate_string_data): Remove dead code.
5669 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5670 avoid GCC warning about unused macro.
5671
246155eb
DA
56722012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5673
5674 * alloc.c (allocate_string): Omit intervals initialization.
5675 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5676 as in make_pure_string and make_pure_c_string.
5677
43184b7b
DA
56782012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5679
d209e2fb 5680 * alloc.c (allocate_string): Fix last change.
43184b7b 5681
3fe6dd74
DA
56822012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5683
d209e2fb 5684 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
5685 to memset, add explicit initialization where appropriate.
5686
1ba6038a
GM
56872012-06-27 Glenn Morris <rgm@gnu.org>
5688
5689 * lisp.mk (lisp): Remove paths.elc.
5690
c89926a5
CY
56912012-06-27 Chong Yidong <cyd@gnu.org>
5692
5693 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5694
ed6b3510
JW
56952012-06-26 John Wiegley <johnw@newartisans.com>
5696
1ec4b7b2 5697 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
5698 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5699
ed6b3510
JW
5700 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5701 when building with Clang.
5702
8edd4a2b
SM
57032012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5704
5705 * eval.c (Fapply): Allow calling it with a single argument.
5706
f6f62d1b
EZ
57072012-06-26 Eli Zaretskii <eliz@gnu.org>
5708
5709 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5710 _stricmp and _strnicmp.
5711 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5712
62efea5e
DA
57132012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5714
5715 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5716 allocated window.
5717 (allocate_process): Likewise for new process.
8edd4a2b 5718 (allocate_terminal): Change to use offsetof.
62efea5e
DA
5719 (allocate_frame): Likewise.
5720 * frame.c (make_frame): Omit redundant initialization.
5721 * window.c (make_parent_window): Use memset.
5722 (make_window): Omit redundant initialization.
5723 * process.c (make_process): Omit redundant initialization.
5724 * terminal.c (create_terminal): Likewise.
5725
42997f4d
DA
57262012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5727
5728 * term.c (delete_tty): Remove redundant call to memset.
5729
1130ecfc
DA
57302012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5731
5732 * alloc.c: Remove build_string.
5733 * lisp.h: Define build_string as static inline. This provides
5734 a better opportunity to optimize away calls to strlen when the
5735 function is called with compile-time constant argument.
5736 * image.c (imagemagick_error): Convert to build_string.
5737 * w32proc.c (sys_spawnve): Likewise.
5738 * xterm.c (x_term_init): Likewise.
5739
cf38a720
PE
57402012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5741
99027bdd
PE
5742 Use sprintf return value instead of invoking strlen on result.
5743 In the old days this wasn't portable, since some sprintf
5744 implementations returned char *. But they died out years ago and
5745 Emacs already assumes sprintf returns int.
5746 Similarly for float_to_string.
5747 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5748 * ccl.c (ccl_driver):
5749 * character.c (string_escape_byte8):
5750 * data.c (Fnumber_to_string):
5751 * doprnt.c (doprnt):
5752 * print.c (print_object):
5753 * xdisp.c (message_dolog):
5754 * xfns.c (syms_of_xfns):
5755 Use sprintf or float_to_string result to avoid need to call strlen.
5756 * data.c (Fnumber_to_string):
5757 Use make_unibyte_string, since the string must be ASCII.
5758 * lisp.h, print.c (float_to_string): Now returns int length.
5759 * term.c (produce_glyphless_glyph):
5760 Use sprintf result rather than recomputing it.
5761
cf38a720
PE
5762 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5763 * Makefile.in (ALL_CFLAGS):
5764 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5765 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5766
3511c784
DA
57672012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5768
0a08eb21 5769 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
5770 strcasecmp if available.
5771 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5772
fb7da12e
AS
57732012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5774
5775 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5776 Avoid comma operator.
5777 * menu.c (push_submenu_start, push_submenu_end)
5778 (push_left_right_boundary, push_menu_pane): Likewise.
5779 * msdos.c (dos_rawgetc): Likewise.
5780
afa2ffd8
DA
57812012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5782
5783 * xfns.c (xic_create_fontsetname): Remove redundant calls
5784 to memset.
5785
b3b4476b
PE
57862012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5787
4495ff38
PE
5788 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5789 sprintf already null-terminates its output.
5790
b3b4476b
PE
5791 * xfns.c (x_window): Remove redundant cast.
5792
b00876c9
DA
57932012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5794
5795 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5796 `const char *' to `char *' to avoid compiler warning.
5797
d188e26b
PE
57982012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5799
885d1d74
PE
5800 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5801 instead of truncating it to 63 (admittedly a generous limit).
5802
d188e26b
PE
5803 * process.c: Fix spelling and caps in comments.
5804
e2f560b1
DN
58052012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5806
e86db54b 5807 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
5808 * sysdep.c (setpgrp): Remove definition, not used in this file.
5809
7583a3a1
JB
58102012-06-24 Juanma Barranquero <lekktu@gmail.com>
5811
5812 * makefile.w32-in: Update dependencies.
5813
696056c2
EZ
58142012-06-24 Eli Zaretskii <eliz@gnu.org>
5815
5816 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5817 (SYSTIME_H): Add nt/inc/sys/time.h.
5818
5819 * systime.h [WINDOWSNT]: Include sys/time.h.
5820
5821 * s/ms-w32.h (struct timespec): Definition moved from
5822 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5823
845ca893
PE
58242012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5825
5826 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5827 * buffer.h (buffer_slot_type_mismatch):
5828 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5829 * eval.c (unwind_to_catch):
5830 * image.c (my_png_error, my_error_exit):
5831 * keyboard.c (quit_throw_to_read_char, user_error)
5832 (Fexit_recursive_edit, Fabort_recursive_edit):
5833 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5834 (wrong_type_argument, buffer_overflow, __executable_start)
5835 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5836 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5837 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5838 (fatal):
5839 (child_setup) [!DOS_NT]:
5840 * lread.c (end_of_file_error, invalid_syntax):
5841 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5842 * puresize.h (pure_write_error):
5843 * search.c (matcher_overflow):
5844 * sound.c (sound_perror, alsa_sound_perror):
5845 * sysdep.c, syssignal.h (croak):
5846 * term.c (maybe_fatal, vfatal):
5847 * textprop.c (text_read_only):
5848 * undo.c (user_error):
5849 * unexmacosx.c (unexec_error):
5850 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5851 Use _Noreturn rather than NO_RETURN.
5852 No need for separate decl merely because of _Noreturn.
5853 * sound.c (sound_warning, parse_sound):
5854 Remove unnecessary forward decls.
5855
f1dd8073
PE
58562012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5857
5858 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5859 * lisp.h (WAIT_READING_MAX): New macro.
5860 * dispnew.c (Fsleep_for, sit_for):
5861 * keyboard.c (kbd_buffer_get_event):
5862 * process.c (Faccept_process_output):
5863 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5864 This improves on the previous patch, which introduced a bug
5865 when time_t is unsigned and as wide as intmax_t.
5866 See <http://bugs.gnu.org/9000#51>.
5867
b82c1755
EZ
58682012-06-23 Eli Zaretskii <eliz@gnu.org>
5869
5870 * dispnew.c (sit_for, Fsleep_for):
5871 * keyboard.c (kbd_buffer_get_event):
5872 * process.c (Faccept_process_output): Avoid compiler warnings when
5873 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5874
ca300656
JB
58752012-06-23 Juanma Barranquero <lekktu@gmail.com>
5876
049ec95b
JB
5877 * makefile.w32-in: Update dependencies.
5878
ca300656
JB
5879 * w32.c (ltime): Add return type and declare static.
5880 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5881
db7b8d06
PE
58822012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5883
5884 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5885 Privately reported by Herbert J. Skuhra.
5886 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5887 All uses changed.
5888 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5889 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5890
0bd8297f
EZ
58912012-06-23 Eli Zaretskii <eliz@gnu.org>
5892
96512555
EZ
5893 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5894 last argument of make_unibyte_string.
5895
0bd8297f
EZ
5896 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5897 language ID in the event parameters.
5898
5899 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5900 event.code, not the obscure "character set ID".
5901
63def6b6
CY
59022012-06-23 Chong Yidong <cyd@gnu.org>
5903
5904 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5905
e8a02204
EZ
59062012-06-23 Eli Zaretskii <eliz@gnu.org>
5907
388cdec0
EZ
5908 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5909 * w32.c (fdutimens): New function.
5910
5911 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5912
5913 * s/ms-w32.h (pselect): Redirect to sys_select.
5914
5915 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5916
e8a02204
EZ
5917 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5918 in the logic of incrementing and decrementing the value of
5919 use_relocatable_buffers.
5920
d054f3fb
PE
59212012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5922
5923 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5924 Privately reported by Herbert J. Skuhra.
5925 [__FreeBSD__]: Remove "*/" typo after "#include".
5926 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5927 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5928 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5929 Don't assume EMACS_TIME and struct timeval are the same type.
5930
d35af63c
PE
59312012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5932
5933 Support higher-resolution time stamps (Bug#9000).
5934 The time stamps are only nanosecond-resolution at the C level,
5935 since that's the best that any real-world system supports now.
5936 But they are picosecond-resolution at the Lisp level, as that's
5937 easy, and leaves room for future OS improvements.
5938
5939 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5940 (LIBES): Use it.
5941
5942 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5943 Don't get current time unless it's needed.
5944
5945 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5946 now provides it if it's absent.
5947 (start_atimer): Port to higher-res time stamps.
5948 Check for time stamp overflow. Don't get current time more
5949 often than is needed.
5950
5951 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5952 Include systime.h, not time.h.
5953 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5954
5955 * dired.c: Include stat-time.h.
5956 (Ffile-attributes): File times now have higher resolution.
5957
5958 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5959 (struct image): Timestamp now has higher resolution.
5960
5961 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5962 has at least microseconds now. All uses removed.
5963 (update_frame, update_single_window, update_window, update_frame_1)
5964 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 5965 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
5966
5967 * editfns.c (time_overflow): Now extern.
5968 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5969 (float-time, Fformat_time_string, Fcurrent_time_string)
5970 (Fcurrent_time_zone): Accept and generate higher-resolution
5971 time stamps.
5972 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5973 (decode_time_components, lisp_seconds_argument): New functions.
5974 (make_time): Now static.
5975 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5976 Report an error if the time is invalid, rather than having the caller
5977 do that.
5978
5979 * fileio.c: Include <stat-time.h>
5980 (Fcopy_file): Copy higher-resolution time stamps.
5981 Prefer to set the time stamp via a file descriptor if that works.
5982 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5983 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5984 (Fvisited_file_modtime, Fset_visited_file_modtime):
5985 Support higher-resolution time stamps.
5986
5987 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5988
5989 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5990
5991 * image.c (prepare_image_for_display, clear_image_cache)
5992 (lookup_image): Port to higer-resolution time stamps.
5993
5994 * keyboard.c (start_polling, bind_polling_period):
5995 Check for time stamp overflow.
5996 (read_char, kbd_buffer_get_event, timer_start_idle)
5997 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5998 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5999 Port to higher-resolution time stamps. Do not assume time_t is signed.
6000 (decode_timer): New function. Timers are now vectors of length 9,
6001 not 8, to accommodate the picosecond component.
6002 (timer_check_2): Use it.
6003
6004 * nsterm.m (select_timeout, timeval_subtract): Remove.
6005 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6006 as they're a bit more accurate and handle overflow better.
6007 (ns_select): Change prototype to be compatible with pselect.
6008 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6009 * nsterm.h (ns_select): Adjust prototype.
6010
6011 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6012 us-resolution time stamps.
6013 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6014
6015 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6016
6017 * lisp.h (time_overflow): New decl.
6018 (wait_reading_process_output): First arg is now intmax_t, not int,
6019 to accommodate larger waits.
6020
6021 * process.h (struct Lisp_Process.read_output_delay):
6022 Now counts nanoseconds, not microseconds.
6023 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6024 EMACS_HAS_USECS.
6025 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6026 (wait_reading_process_output):
6027 Port to ns-resolution time stamps.
6028 (Faccept_process_output, wait_reading_process_output):
6029 Check for time stamp overflow. Do not assume time_t is signed.
6030 (select_wrapper): Remove; we now use pselect.
6031 (Fprocess_attributes): Now generates ns-resolution time stamps.
6032
6033 * sysdep.c: Include utimens.h. Don't include utime.h
6034 or worry about struct utimbuf; gnulib does that for us now.
6035 (gettimeofday): Remove; gnulib provides a substitute.
6036 (make_timeval): New function.
6037 (set_file_times): Now sets ns-resolution time stamps.
6038 New arg FD; all uses changed.
6039 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6040 (system_process_attributes):
6041 Now returns ns-resolution time stamp. All uses changed.
6042 Check for time stamp overflow.
6043
6044 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6045 provides a substitute now.
6046
6047 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6048 since it guarantees struct timespec.
6049 (EMACS_TIME): Now struct timespec, so that we can support
6050 ns-resolution time stamps.
6051 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6052 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6053 (EMACS_USECS): Remove.
6054 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6055 so multiply the arg by 1000 before storing it.
6056 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6057 New macros.
6058 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6059 Port to ns-resolution time stamps.
6060 (EMACS_TIME_NEG_P): Remove; replaced by....
6061 (EMACS_TIME_SIGN): New macro.
6062 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6063 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6064 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6065 (make_timeval, make_lisp_time, decode_time_components): New decls.
6066 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6067 that it mishandled time_t overflow. You can't compare by subtracting!
6068 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6069 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6070
6071 * term.c: Include <sys/time.h>.
6072 (timeval_to_Time): New function, for proper overflow wraparound.
6073 (term_mouse_position, term_mouse_click): Use it.
6074
6075 * undo.c (record_first_change): Support higher-resolution time stamps
6076 in the undo buffer.
6077 (Fprimitive_undo): Use them when restoring time stamps.
6078
6079 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6080 (w32_get_internal_run_time):
6081 Port to higher-resolution Emacs time stamps.
6082 (ltime): Now accepts single 64-bit integer, as that's more convenient
6083 for callers.
6084
6085 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6086
6087 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6088 for compatibility with pselect. Support ns-resolution time stamps.
6089
6090 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6091
6092 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6093 Check for time stamp overflow, and support ns-resolution time stamps.
6094
6095 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6096 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6097 (timeval_subtract): Remove; no longer needed.
6098 (XTflash, XTring_bell, x_wait_for_event):
6099 Port to ns-resolution time stamps. Don't assume time_t is signed.
6100
b6a92dfe
CY
61012012-06-22 Chong Yidong <cyd@gnu.org>
6102
6103 * xdisp.c (x_consider_frame_title): Revert last change.
6104
d251c37c
EZ
61052012-06-22 Eli Zaretskii <eliz@gnu.org>
6106
6107 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6108 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6109 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6110 staticidx goes up to 1597 out of 1600 = 0x640.)
6111
f10deafb
PE
61122012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6113
6114 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6115 Otherwise, the umask might be mistakenly 0 while handling input signals.
6116
ec6de1e2
SM
61172012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6118
6119 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6120
28be1ada
DA
61212012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6122
6123 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6124 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6125 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6126 access to `contents' member of Lisp_Vector objects with AREF and ASET
6127 where appropriate.
6128
c6bf3022
CY
61292012-06-19 Chong Yidong <cyd@gnu.org>
6130
6131 * frame.c (delete_frame): When selecting a frame on a different
6132 text terminal, do not alter the terminal's top-frame.
6133
6134 * xdisp.c (format_mode_line_unwind_data): Record the target
6135 frame's selected window and its terminal's top-frame.
6136 (unwind_format_mode_line): Restore them.
6137 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6138 Callers changed.
6139 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6140 since tty frames can be explicitly named.
6141 (prepare_menu_bars): Likewise.
6142
6143 * term.c (Ftty_top_frame): New function.
6144
defd4196
PE
61452012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6146
6147 Port byte-code-meter to modern targets.
6148 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6149 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 6150 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
6151 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6152 (METER_1, METER_2): Simplify.
6153
1053a871
SM
61542012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6155
6156 * data.c (Fdefalias): Return `symbol' (bug#11686).
6157
b7e8d081
MR
61582012-06-18 Martin Rudalics <rudalics@gmx.at>
6159
6160 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
6161 gets killed during executing of this function (Bug#11665).
6162 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
6163 (Vkill_buffer_query_functions): In doc-string say that functions
6164 run by this hook should not change the current buffer.
6165
7ea2b339
PE
61662012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6167
6168 Fix recently-introduced process.c problems found by static checking.
6169 * process.c (write_queue_push, write_queue_pop, send_process):
6170 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6171 (write_queue_pop): Fix pointer signedness problem.
6172 (send_process): Remove unused local.
6173
96a313a1
CY
61742012-06-17 Chong Yidong <cyd@gnu.org>
6175
6176 * xdisp.c (redisplay_internal): No need to redisplay terminal
6177 frames that are not on top.
6178
20ca2e94
TN
61792012-06-17 Troels Nielsen <bn.troels@gmail.com>
6180
6181 * process.c (make_process): Initialize write_queue.
6182 (write_queue_push, write_queue_pop): New functions.
6183 (send_process): Use them to maintain correct ordering of process
6184 writes (Bug#10815).
6185
9a900ca9
PE
61862012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6187
310fbfa8
PE
6188 * lisp.h (eassert): Assume C89 or later.
6189 This removes the need for CHECK.
6190 (CHECK): Remove. Its comments about always evaluating its
6191 argument were confusing, as 'eassert' typically does not evaluate
6192 its argument.
6193
27bb1ca4
PE
6194 * coding.c (produce_chars): Use ptrdiff_t, not int.
6195
9a900ca9
PE
6196 * xterm.c (x_draw_underwave): Check for integer overflow.
6197 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6198
41b7f8bc 61992012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
6200
6201 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6202 referenced (Bug#11583).
6203
9b0e3eba
AA
62042012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6205
6206 Implement wave-style variant of underlining.
6207 * dispextern.h (face_underline_type): New enum.
6208 (face): Add field for underline type.
6209 * nsterm.m (ns_draw_underwave): New function.
6210 (ns_draw_text_decoration): Use it.
6211 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6212 New functions.
6213 (x_draw_glyph_string): Use them.
6214 * xfaces.c (Qline, Qwave): New Lisp objects.
6215 (check_lface_attrs, merge_face_ref)
1053a871
SM
6216 (Finternal_set_lisp_face_attribute, realize_x_face):
6217 Handle wave-style underline face attributes.
9b0e3eba
AA
6218 * xterm.c (x_draw_underwave): New function.
6219 (x_draw_glyph_string): Use it.
6220
0fb52f11
JB
62212012-06-16 Juanma Barranquero <lekktu@gmail.com>
6222
6223 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6224 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6225 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6226 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6227 ($(BLD)/w32select.$(O)): Update dependencies.
6228
e5560ff7
AS
62292012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6230
6231 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6232 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6233 * character.c (_fetch_multibyte_char_p): Remove.
6234 * alloc.c: Include "character.h" before "buffer.h".
6235 * bidi.c: Likewise.
6236 * buffer.c: Likewise.
6237 * bytecode.c: Likewise.
6238 * callint.c: Likewise.
6239 * callproc.c: Likewise.
6240 * casefiddle.c: Likewise.
6241 * casetab.c: Likewise.
6242 * category.c: Likewise.
6243 * cmds.c: Likewise.
6244 * coding.c: Likewise.
6245 * composite.c: Likewise.
6246 * dired.c: Likewise.
6247 * dispnew.c: Likewise.
6248 * doc.c: Likewise.
6249 * dosfns.c: Likewise.
6250 * editfns.c: Likewise.
6251 * emacs.c: Likewise.
6252 * fileio.c: Likewise.
6253 * filelock.c: Likewise.
6254 * font.c: Likewise.
6255 * fontset.c: Likewise.
6256 * fringe.c: Likewise.
6257 * indent.c: Likewise.
6258 * insdel.c: Likewise.
6259 * intervals.c: Likewise.
6260 * keyboard.c: Likewise.
6261 * keymap.c: Likewise.
6262 * lread.c: Likewise.
6263 * macros.c: Likewise.
6264 * marker.c: Likewise.
6265 * minibuf.c: Likewise.
6266 * nsfns.m: Likewise.
6267 * nsmenu.m: Likewise.
6268 * print.c: Likewise.
6269 * process.c: Likewise.
6270 * regex.c: Likewise.
6271 * region-cache.c: Likewise.
6272 * search.c: Likewise.
6273 * syntax.c: Likewise.
6274 * term.c: Likewise.
6275 * textprop.c: Likewise.
6276 * undo.c: Likewise.
6277 * unexsol.c: Likewise.
6278 * w16select.c: Likewise.
6279 * w32fns.c: Likewise.
6280 * w32menu.c: Likewise.
6281 * window.c: Likewise.
6282 * xdisp.c: Likewise.
6283 * xfns.c: Likewise.
6284 * xmenu.c: Likewise.
6285 * xml.c: Likewise.
6286 * xselect.c: Likewise.
6287
2f07e6af
EZ
62882012-06-16 Eli Zaretskii <eliz@gnu.org>
6289
1053a871
SM
6290 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6291 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 6292 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
6293 row.
6294 (handle_face_prop): Use chunk-relative overlay string index when
6295 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
6296 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6297 the rightmost. (Bug#11720)
2f07e6af 6298
29b83cec
AS
62992012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6300
6301 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6302 (CATEGORY_MEMBER): Enforce 1/0 value.
6303 * category.c (_temp_category_set): Remove.
6304
4c5501e9
EZ
63052012-06-16 Eli Zaretskii <eliz@gnu.org>
6306
6307 * window.c (Fdelete_other_windows_internal)
6308 (Fdelete_window_internal): Don't access frame's mouse highlight
6309 info of the initial frame. (Bug#11677)
6310
2b570124
PE
63112012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6312
e93864f9
PE
6313 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6314 Assume USE_2_TAGS_FOR_INTS.
6315 (xreload): Adjust $tagmask width to match recent lisp.h change.
6316
2b570124
PE
6317 Simplify lisp.h in minor ways that should not affect code.
6318 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6319 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6320 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6321 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6322 (INTTYPEBITS): New macro, for clarity.
6323 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
6324 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6325 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
6326 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6327 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6328
81755f69
JB
63292012-06-13 Juanma Barranquero <lekktu@gmail.com>
6330
6331 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6332
16192a57
GM
63332012-06-13 Glenn Morris <rgm@gnu.org>
6334
6335 * s/bsd-common.h (BSD4_3):
6336 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6337
646b5f55
AS
63382012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6339
6340 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6341 instead of union.
6342 (XLI, XIL): Define.
1053a871
SM
6343 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6344 Use them.
6345 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 6346 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 6347 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
6348 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6349 * frame.c (delete_frame): Remove outdated comment.
6350 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6351 USE_LISP_UNION_TYPE.
6352 (Fw32_unregister_hot_key): Likewise.
6353 (Fw32_toggle_lock_key): Likewise.
6354 * w32menu.c (add_menu_item): Likewise.
6355 (w32_menu_display_help): Use XIL instead of checking
6356 USE_LISP_UNION_TYPE.
6357 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6358 (init_heap): Likewise.
6359 * w32term.c (w32_read_socket): Update comment.
6360
1d3823c9
GM
63612012-06-13 Glenn Morris <rgm@gnu.org>
6362
c62ff706
GM
6363 * s/usg5-4-common.h, src/s/unixware.h:
6364 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6365
1d3823c9
GM
6366 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6367
bfe3e0a2
PE
63682012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6369
6370 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6371 * alloc.c (make_number) [!defined make_number]:
6372 Remove, as lisp.h always defines this now.
6373 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6374 (roundup_size): Verify that it is a power of 2.
6375 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6376 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6377 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6378 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6379 USE_LSB_TAG now is always defined to be either 0 or 1.
6380 All uses changed.
6381 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6382 code works fine either way, and efficiency is not a concern here,
6383 as the union type is for debugging, not for production.
6384 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6385 Use an inline function on all platforms when using the union type,
6386 since this is simpler and 'static inline' can be used portably
6387 within Emacs now.
6388 (LISP_INITIALLY_ZERO): New macro.
6389 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6390 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6391
45fa9c0f
GM
63922012-06-12 Glenn Morris <rgm@gnu.org>
6393
b4492cba
GM
6394 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6395
6396 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 6397
45fa9c0f
GM
6398 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6399 Move BROKEN_SIGIO to configure.
6400
6401 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6402 Move NO_TERMIO to configure.
6403
0e25d334
CY
64042012-06-12 Chong Yidong <cyd@gnu.org>
6405
6406 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6407 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6408 MagickExportImagePixels is undefined.
6409
43682bb6
PE
64102012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6411
6412 * image.c (imagemagick_load_image): Remove unused label.
6413
a9be7d2b
GM
64142012-06-11 Glenn Morris <rgm@gnu.org>
6415
6416 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6417 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6418 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6419 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6420
3017f87f
SM
64212012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6422
6423 * alloc.c (make_byte_code): New function.
6424 (Fmake_byte_code): Use it. Don't purify here.
6425 * lread.c (read1): Use it as well to avoid extra allocation.
6426
1b9b4cf4
CY
64272012-06-11 Chong Yidong <cyd@gnu.org>
6428
6429 * image.c (imagemagick_load_image): Implement transparency.
6430
95988fcf
AS
64312012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6432
6433 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6434 account for preceding backslashes. (Bug#11663)
6435
cd4eb164
CY
64362012-06-09 Chong Yidong <cyd@gnu.org>
6437
6438 * term.c: Support italics in capable terminals (Bug#9652).
6439 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6440 (turn_on_face): Output using TS_enter_italic_mode if available.
6441 Don't handle unused blinking and alt-charset cases.
6442 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6443 and tty_alt_charset_p cases.
6444 (tty_capable_p, init_tty): Support italics.
6445
6446 * termchar.h (struct tty_display_info): Add field for italics.
6447 Remove unused blink field.
6448
6449 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6450 Handle slant.
6451
6452 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6453 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6454 tty_alt_charset_p. Add tty_italic_p.
6455
ff88beb8
MA
64562012-06-09 Michael Albinus <michael.albinus@gmx.de>
6457
6458 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6459 dbus_type_is_basic if available.
6460 (xd_extract_signed, xd_extract_unsigned): Rename from
6461 extract_signed and extract_unsigned, respectively. Adapt callers.
6462
44286096
CY
64632012-06-09 Chong Yidong <cyd@gnu.org>
6464
1682701f
CY
6465 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6466
44286096
CY
6467 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6468 case (Bug#9752).
6469
d86feb17
PE
64702012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6471
6472 * xdisp.c (vmessage): Treat frame message as multibyte.
6473 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6474 would generate the diagnostic "Making \302\247 buffer-local while
6475 let-bound!".
6476
d5c20fe8
EZ
64772012-06-08 Eli Zaretskii <eliz@gnu.org>
6478
6479 * dispnew.c (showing_window_margins_p): Undo last change, which
6480 was done due to an inadvertent commit.
6481 (adjust_frame_glyphs_for_frame_redisplay): Do call
6482 showing_window_margins_p.
6483
513749ee
SM
64842012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6485
6486 * eval.c (Fmake_var_non_special): New primitive.
6487 (syms_of_eval): Defsubr it.
6488 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6489
d4a8f5c1
JB
64902012-06-08 Juanma Barranquero <lekktu@gmail.com>
6491
6492 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6493 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6494
8bbbc977
EZ
64952012-06-08 Eli Zaretskii <eliz@gnu.org>
6496
6497 * alloc.c (allocate_vectorlike): Fix last change.
6498
f3372c87
DA
64992012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6500
6501 Block-based vector allocation of small vectors.
6502 * lisp.h (struct vectorlike_header): New field `nbytes',
6503 adjust comment accordingly.
6504 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 6505 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
6506 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6507 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6508 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6509 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6510 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6511 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6512 (roundup_size): New constant.
6513 (struct vector_block): New data type.
6514 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 6515 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
6516 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6517 (sweep_vectors): New functions.
6518 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 6519 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
6520 or equal to VBLOCK_BYTES_MAX.
6521 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6522 (init_alloc_once): Add call to init_vectors.
6523
4f18a4ed
SM
65242012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6525
6526 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6527
86f158bc
PE
65282012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6529
6530 * doprnt.c (doprnt): Truncate multibyte char correctly.
6531 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6532 would mishandle a string argument "Xc" if X was a multibyte
6533 character of length 2: it would truncate after X's first byte
6534 rather than including all of X.
6535
c5cfcbe0
CY
65362012-06-06 Chong Yidong <cyd@gnu.org>
6537
6538 * buffer.c (word_wrap): Doc fix.
6539
c05cf390
PE
65402012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6541
6542 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6543
0c3461de
GM
65442012-06-03 Glenn Morris <rgm@gnu.org>
6545
6546 * xdisp.c (tool-bar-style): Doc fix.
6547
c71232db
UM
65482012-06-03 Ulrich Müller <ulm@gentoo.org>
6549
6550 * Makefile.in (PAXCTL): Define.
6551 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6552 binary via PaX flags if the paxctl utility is available.
6553 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6554 Restore PaX flags to their default. (Bug#11398)
6555
383f7350
CY
65562012-06-03 Chong Yidong <cyd@gnu.org>
6557
6558 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6559 buffer (Bug#11226).
6560
5f2c76c6
CY
65612012-06-03 Chong Yidong <cyd@gnu.org>
6562
6563 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6564 (note_mode_line_or_margin_highlight): If there is no help echo,
6565 use mode-line-default-help-echo. Handle the case where the mouse
6566 position is past the end of the mode line string.
6567
6568 * buffer.c (buffer_local_value_1): New function, split from
6569 Fbuffer_local_value; can return Qunbound.
6570 (Fbuffer_local_value): Use it.
6571 (Vmode_line_format): Docstring tweaks.
6572
773d47f6
PE
65732012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6574
6575 * sysdep.c (system_process_attributes): Improve comment.
6576
f2d6a3df
SM
65772012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6578
6579 * keyboard.c: Export real-this-command to Elisp.
6580 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6581 and DEFVAR it. Update all users.
6582
63810350
PE
65832012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6584
7bd5c1f4
PE
6585 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6586
63810350
PE
6587 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6588 Convert pctcpu and pctmem to Lisp float properly.
6589 Let the compiler fold better, as 100.0/0x8000 is exact.
6590
a2821611
AS
65912012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6592
6593 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6594 cons_block.
6595
5fceba1d
PE
65962012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6597
6598 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6599
c98ff5dd
DA
66002012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6601
6602 For a 'struct window', replace some Lisp_Object fields to
6603 bitfields where appropriate, remove unused fields.
6604 * window.h (struct window): Remove unused 'last_mark_x' and
6605 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6606 change it's type from Lisp_Object to bitfield.
6607 Change type of 'force_start', 'optional_new_start',
6608 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 6609 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 6610
ca34e0be
PE
66112012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6612
6613 Pacify gcc -Wdouble-precision when using Xaw.
6614 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6615 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6616 Use 'float' consistently, rather than 'float' in most places
6617 and 'double' in a couple of places.
6618
efc00ab1 66192012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
6620
6621 * xdisp.c (handle_stop): Detect whether we have overlay strings
6622 loaded by testing it->current.overlay_string_index to be
6623 non-negative, instead of checking whether n_overlay_strings is
6624 positive. (Bug#11587)
6625
efc00ab1 66262012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
6627
6628 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6629
6630 * doc.c (Fsubstitute_command_keys): Doc fix.
6631
efc00ab1 66322012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
6633
6634 * search.c (search_buffer): Remove calls to
6635 r_alloc_inhibit_buffer_relocation, as it is now called by
6636 maybe_unify_char, which was the cause of relocation of buffer text
6637 in bug#11519.
6638
efc00ab1 66392012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
6640
6641 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6642 for the duration of call to load_charset, to avoid problems with
6643 callers of maybe_unify_char that access buffer text through C
6644 pointers.
6645
6646 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6647 decrement the inhibition flag, instead of just setting or
6648 resetting it.
6649
ba93a187
PE
66502012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6651
6652 Remove obsolete '#define static' cruft.
6653 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6654 This #undef was "temporary" in 2000; it is no longer needed
6655 now that '#define static' has gone away.
6656 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6657 (gray_bitmap_bits): Remove; no longer needed.
6658 All uses replaced with definiens.
6659 * xterm.c: Include "bitmaps/gray.xbm".
6660
9e4bf381
PE
66612012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6662
6663 Clean up __executable_start, monstartup when --enable-profiling.
6664 The following changes affect the code only when profiling.
6665 * dispnew.c (__executable_start): Rename from safe_bcopy.
6666 Define only on platforms that need it.
6667 * emacs.c: Include <sys/gmon.h> when profiling.
6668 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6669 (__executable_start): Remove decl, since lisp.h does it now.
6670 (safe_bcopy): Remove decl; no longer has that name.
6671 (main): Coalesce #if into single bit of code, for simplicity.
6672 Cast pointers to uintptr_t, since standard libraries want integers
6673 and not pointers.
6674 * lisp.h (__executable_start): New decl.
6675
32d72c2f
GM
66762012-05-31 Glenn Morris <rgm@gnu.org>
6677
6678 * image.c (Fimagemagick_types): Doc fix.
6679
baac5bc7
JM
66802012-05-30 Jim Meyering <meyering@redhat.com>
6681
6682 * callproc.c (Fcall_process_region): Include directory component
6683 in mkstemp error message (Bug#11586).
6684
72cb32cf
PE
66852012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6686
6687 * alloc.c, lisp.h (make_pure_vector): Now static.
6688
61b108cc
SM
66892012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6690
6691 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6692 Move to byte-run.el.
6693 (Fautoload): Do the hash-doc more carefully.
6694 * data.c (Fdefalias): Purify definition, except for keymaps.
6695 (Qdefun): Move from eval.c.
6696 * lisp.h (Qdefun): Remove.
6697 * lread.c (read1): Tiny simplification.
6698
471fe23d
TN
66992012-05-29 Troels Nielsen <bn.troels@gmail.com>
6700
934f3f58 6701 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
6702 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6703 Bug#9642, but explicitly check that the buffer the overlay would
6704 be moved to is live and rearrange lines to make sure that errors
6705 will not put the overlay in an inconsistent state.
6706 (Fdelete_overlay): Cosmetics.
6707
85d0efd1
EZ
67082012-05-28 Eli Zaretskii <eliz@gnu.org>
6709
6710 * w32term.c (my_bring_window_to_top): New function.
6711 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
6712 could be different from the original one.
6713 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
6714 (Bug#11513)
6715
6716 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6717 by calling BringWindowToTop.
6718
6719 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6720 (WM_EMACS_END): Increase by one.
6721
da92a98c
PE
67222012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6723
6724 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6725 This avoids undefined behavior that might cause the eassert
6726 to not catch an out-of-range value.
6727
74d1f848
JB
67282012-05-28 Juanma Barranquero <lekktu@gmail.com>
6729
6730 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6731 Update dependencies.
6732
9e1a06fc
EZ
67332012-05-27 Eli Zaretskii <eliz@gnu.org>
6734
6735 * bidi.c (bidi_mirror_char): Fix last change.
6736
f3dd7312
AS
67372012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6738
6739 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6740 when referring to sectname field in printf format.
6741
81899c91
PE
67422012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6743
57b81a9f
PE
6744 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6745 Only r_alloc_inhibit_buffer_relocation needed to be added;
6746 the others were already declared.
6747
81899c91
PE
6748 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6749 before checking whether it's out of range. Put the check inside
6750 eassert. See
6751 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6752
33017faf 67532012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
6754
6755 * callproc.c (Fcall_process): Restore a line that was accidentally
6756 commented out in the 2011-02-13 change (bug#11547).
6757
33017faf 67582012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
6759
6760 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6761 defined on ralloc.c.
6762
6763 * buffer.c [REL_ALLOC]: Remove prototypes of
6764 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6765 they are now on lisp.h.
6766
6767 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6768
6769 * search.c (search_buffer): Use it to inhibit relocation of buffer
6770 text while re_search_2 is doing its job, because re_search_2 is
6771 passed C pointers to buffer text. (Bug#11519)
6772
23415acf
EZ
6773 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6774 Update value to 24.
6775
44e27368
EZ
6776 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6777 state after an additional call to move_it_in_display_line_to, keep
6778 the values of it->max_ascent and it->max_descent found for the
6779 entire line.
6780 (pos_visible_p): Revert the comparison against bottom_y to what it
6781 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6782 (Bug#11464)
6783
c1892f11
PE
67842012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6785
6786 Fix coding-related core dumps with gcc -ftrapv.
6787 The code was computing A - B, where A and B are pointers, and B is
6788 random garbage. This can lead to core dumps on platforms that
6789 have special pointer registers, and it also leads to core dumps on
6790 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6791 A - B only when B is initialized properly.
6792 * coding.c (coding_set_source, coding_set_destination): Return void.
6793 (coding_change_source, coding_change_destinations): New functions,
6794 with the old behaviors of coding_set_source and coding_set_destination.
6795 All callers that need an offset changed to use these new functions.
6796
eb7afdad
GM
67972012-05-26 Glenn Morris <rgm@gnu.org>
6798
6799 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6800
f12fdf02
EZ
68012012-05-26 Eli Zaretskii <eliz@gnu.org>
6802
53a63be6 6803 Extend mouse support on W32 text-mode console.
61b108cc
SM
6804 * xdisp.c (draw_row_with_mouse_face):
6805 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 6806
eb3f6f01 6807 * w32console.c: Include window.h.
61b108cc
SM
6808 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6809 New functions.
eb3f6f01
EZ
6810 (initialize_w32_display): Initialize mouse-highlight data.
6811
53a63be6
EZ
6812 * w32inevt.c: Include termchar.h and window.h.
6813 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6814 moves, call note_mouse_highlight. If help_echo changed, call
6815 gen_help_event to produce help-echo message in the echo area.
6816 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6817 highlight info.
6818
4cfd81f6
PE
68192012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6820
6821 * lread.c (read1): Simplify slightly to avoid an overflow warning
6822 with GCC 4.7.0 on x86-64.
6823
4446092a
EZ
68242012-05-26 Eli Zaretskii <eliz@gnu.org>
6825
6826 * bidi.c (bidi_mirror_char): Revert last change: an int is
6827 definitely wide enough here.
6828
42b2a986 68292012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 6830
42b2a986 6831 Fix integer width and related bugs (Bug#9874).
eb106a49 6832 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
6833 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6834 (string_bytes, check_sblock, allocate_string_data):
6835 (compact_small_strings, Fmake_bool_vector, make_string)
6836 (make_unibyte_string, make_multibyte_string)
6837 (make_string_from_bytes, make_specified_string)
6838 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6839 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6840 (mark_vectorlike):
6841 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6842 (allocate_pseudovector):
6843 Use int, not EMACS_INT, where int is wide enough.
6844 (inhibit_garbage_collection, Fgarbage_collect):
6845 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6846 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6847 int might not be wide enough.
6848 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6849 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6850 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6851 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6852 (bidi_level_of_next_char, bidi_move_to_visually_next):
6853 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6854 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6855 (Fkill_buffer, Fset_buffer_major_mode)
6856 (advance_to_char_boundary, Fbuffer_swap_text)
6857 (Fset_buffer_multibyte, overlays_at, overlays_in)
6858 (overlay_touches_p, struct sortvec, record_overlay_string)
6859 (overlay_strings, recenter_overlay_lists)
6860 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6861 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6862 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6863 (Foverlay_recenter, last_overlay_modification_hooks_used)
6864 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6865 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
6866 (validate_region): Omit unnecessary test for b <= e,
6867 since that's guaranteed by the previous test.
d311d28c
PE
6868 (adjust_overlays_for_delete): Avoid pos + length overflow.
6869 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6870 (report_overlay_modification):
6871 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6872 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6873 Omit pointer cast, which isn't needed anyway, and doesn't work
6874 after the EMACS_INT -> ptrdiff_t change.
02481186 6875 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
6876 * buffer.h: Adjust decls to match defn changes elsewhere.
6877 (struct buffer_text, struct buffer):
6878 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6879 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
6880 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6881 not int, to avoid needless 32-bit limit on 64-bit hosts.
6882 (exec_byte_code): Use tighter memory-full test, one that checks
6883 for alloca overflow. Don't compute the address of the object just
6884 before an array, as that's not portable. Use EMACS_INT, not
6885 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
6886 * callint.c (Fcall_interactively):
6887 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6888 * callproc.c (call_process_kill, Fcall_process):
6889 Don't assume pid_t fits into an Emacs fixnum.
6890 (call_process_cleanup, Fcall_process, child_setup):
6891 Don't assume pid_t fits into int.
6892 (call_process_cleanup, Fcall_process, delete_temp_file)
6893 (Fcall_process_region):
6894 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6895 (Fcall_process): Simplify handling of volatile integers.
6896 Use int, not EMACS_INT, where int will do.
6897 * casefiddle.c (casify_object, casify_region, operate_on_word)
6898 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6899 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6900 (casify_object): Avoid integer overflow when overallocating buffer.
6901 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 6902 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
6903 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6904 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6905 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6906 integers are now checked earlier. All uses replaced with XINT.
6907 (ccl_driver):
6908 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6909 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
6910 (ccl_driver, Fregister_code_conversion_map):
6911 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
6912 (resolve_symbol_ccl_program): Check that vector header is in range.
6913 Always copy the vector, so that we can check its contents reliably
6914 now rather than having to recheck each instruction as it's being
6915 executed. Check that vector words fit in 'int'.
6916 (ccl_get_compiled_code, Fregister_ccl_program)
6917 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6918 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6919 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6920 contents are in range.
6921 (Fccl_execute_on_string): Check that status is in range.
6922 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6923 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6924 Accept and return EMACS_INT, not int, because callers can pass values
6925 out of 'int' range.
6926 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6927 (multibyte_chars_in_text, parse_str_as_multibyte)
6928 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6929 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6930 (string_escape_byte8, Fget_byte):
6931 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 6932 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
6933 avoid mishandling large integers.
6934 * character.h: Adjust decls to match defn changes elsewhere.
6935 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6936 (Ffind_charset_region):
6937 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6938 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6939 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 6940 Don't assume fixnum fits in int.
d311d28c
PE
6941 (load_charset_map_from_vector, Fmap_charset_chars):
6942 Remove now-unnecessary CHECK_NATNUMs.
6943 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
6944 Don't rely on undefined behavior with signed left shift overflow.
6945 Don't assume unsigned int fits into fixnum, or that fixnum fits
6946 into unsigned int. Don't require max_code to be a valid fixnum;
6947 that's not true for gb10830 4-byte on a 32-bit host. Allow
6948 invalid_code to be a cons, for the same reason. Require code_offset
6949 to be a character. Avoid int overflow if max_char is close
6950 to INT_MAX.
6951 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6952 this is intended anyway and avoids some undefined behavior.
6953 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6954 INDEX_TO_CODE_POINT, as that's what it expects.
6955 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
6956 * charset.h (DECODE_CHAR): Return int, not unsigned;
6957 this is what was intended anyway, and it avoids undefined behavior.
6958 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6959 integer-overflow issues.
6960 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6961 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6962 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
6963 * chartab.c (Fmake_char_table, Fset_char_table_range)
6964 (uniprop_get_decoder, uniprop_get_encoder):
6965 Don't assume fixnum fits in int.
6966 * cmds.c (move_point): New function, that does the gist of
6967 Fforward_char and Fbackward_char, but does so while checking
6968 for integer overflow more accurately.
c96e5d6a 6969 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
6970 (Fforward_line, Fend_of_line, internal_self_insert)
6971 (internal_self_insert):
6972 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6973 Fix a FIXME, by checking for integer overflow when calculating
6974 target_clm and actual_clm.
6975 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 6976 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
6977 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6978 (coding_alloc_by_making_gap, alloc_destination)
6979 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6980 (encode_coding_utf_16, detect_coding_emacs_mule)
6981 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6982 (detect_coding_iso_2022, decode_coding_iso_2022)
6983 (encode_invocation_designation, encode_designation_at_bol)
6984 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6985 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6986 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6987 (encode_coding_ccl, encode_coding_raw_text)
6988 (detect_coding_charset, decode_coding_charset)
6989 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6990 (produce_composition, produce_charset, produce_annotation)
6991 (decode_coding, handle_composition_annotation)
6992 (handle_charset_annotation, consume_chars, decode_coding_gap)
6993 (decode_coding_object, encode_coding_object, detect_coding_system)
6994 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6995 (code_convert_region, code_convert_string)
8f50130c
PE
6996 (Fdefine_coding_system_internal)
6997 (coding_set_source, coding_set_destination):
d311d28c
PE
6998 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6999 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7000 (Fdefine_coding_system_internal):
7001 Don't assume fixnums fit in int.
7002 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 7003 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
7004 (Funencodable_char_position, Fcheck_coding_systems_region)
7005 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 7006 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 7007 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 7008 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 7009 Don't access memory outside of the args array.
d311d28c 7010 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
7011 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7012 result of ENCODE_CHAR.
d311d28c
PE
7013 * coding.h: Adjust decls to match defn changes elsewhere.
7014 (struct coding_system):
7015 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7016 * composite.c (get_composition_id, find_composition)
7017 (run_composition_function, update_compositions)
7018 (compose_text, composition_gstring_put_cache)
7019 (composition_gstring_p, composition_gstring_width)
7020 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7021 (composition_compute_stop_pos, composition_reseat_it)
7022 (composition_update_it, struct position_record)
7023 (find_automatic_composition, composition_adjust_point)
7024 (Fcomposition_get_gstring, Ffind_composition_internal):
7025 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7026 (update_compositions):
7027 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7028 * composite.h: Adjust decls to match defn changes elsewhere.
7029 (struct composition):
7030 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7031 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7032 Do not attempt to compute the address of the object just before a
7033 buffer; this is not portable.
7034 (Faref, Faset):
7035 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7036 (Faset): Use int, not EMACS_INT, where int is wide enough.
7037 (Fstring_to_number): Don't assume fixnums fit in int.
7038 (Frem): Don't assume arg is nonnegative.
7039 * dbusbind.c (xd_append_arg): Check for integers out of range.
7040 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 7041 (extract_signed, extract_unsigned): New functions.
243e0530
PE
7042 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7043 (xd_get_connection_references): Return ptrdiff_t, not int.
7044 All uses changed.
7045 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7046 (xd_read_message_1):
7047 Use int, not unsigned, where the dbus API uses int.
7048 (Fdbus_message_internal): Don't overflow mtype.
7049 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
7050 * dired.c (directory_files_internal, file_name_completion, scmp)
7051 (file_name_completion_stat):
7052 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7053 (file_name_completion): Don't overflow matchcount.
7054 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7055 * dispextern.h: Adjust decls to match defn changes elsewhere.
7056 (struct text_pos, struct glyph, struct bidi_saved_info)
7057 (struct bidi_string_data, struct bidi_it, struct composition_it)
7058 (struct it):
7059 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7060 (struct display_pos, struct composition_it, struct it):
7061 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7062 * dispnew.c (increment_matrix_positions)
7063 (increment_row_positions, mode_line_string)
7064 (marginal_area_string):
7065 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 7066 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
7067 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7068 (duration_to_sec_usec): New function, to check for overflow better.
7069 (Fsleep_for, sit_for): Use it.
7070 * doc.c (get_doc_string, store_function_docstring):
7071 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7072 (get_doc_string, Fsnarf_documentation):
7073 Use int, not EMACS_INT, where int is wide enough.
7074 (get_doc_string):
7075 Use SAFE_ALLOCA, not alloca.
7076 Check for overflow when converting EMACS_INT to off_t.
7077 * doprnt.c (doprnt):
7078 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7079 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7080 Don't assume uid_t fits into fixnum.
7081 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7082 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7083 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7084 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7085 (general_insert_function)
7086 (Finsert_char, make_buffer_string, make_buffer_string_both)
7087 (update_buffer_properties, Fbuffer_substring)
7088 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7089 (Fsubst_char_in_region, check_translation)
7090 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7091 (transpose_markers, Ftranspose_regions):
7092 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7093 (clip_to_bounds): Move to lisp.h as an inline function).
7094 (Fconstrain_to_field): Don't assume integers are nonnegative.
7095 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7096 (Fsubst_char_in_region, Fsave_restriction):
7097 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7098 (Femacs_pid): Don't assume pid_t fits into fixnum.
7099 (lo_time): Use int, not EMACS_INT, when int suffices.
7100 (lisp_time_argument): Check for usec out of range.
7101 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
7102 (Fuser_login_name, Fuser_full_name): Signal an error
7103 if a uid argument is out of range, rather than relying on
7104 undefined behavior.
c8d5c857
PE
7105 (Fformat_time_string): Remove now-unnecessary check.
7106 lisp_time_argument checks for out-of-range usec now.
243e0530 7107 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
7108 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7109 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7110 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7111 (init_cmdargs, Fdump_emacs):
7112 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7113 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7114 the bottom (typically) 32 bits of the fixnum.
7115 * eval.c (specpdl_size, call_debugger):
7116 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7117 (when_entered_debugger, Fbacktrace_debug):
7118 Don't assume fixnum can fit in int.
7119 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7120 the object just before a buffer; this is not portable.
7121 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7122 (grow_specpdl, unbind_to):
7123 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7124 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7125 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 7126 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
7127 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7128 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7129 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7130 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7131 (a_write, e_write):
7132 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7133 (Fcopy_file, non_regular_nbytes, read_non_regular)
7134 (Finsert_file_contents):
7135 Use int, not EMACS_INT, where int is wide enough.
7136 (READ_BUF_SIZE): Verify that it fits in int.
7137 (Finsert_file_contents): Check that counts are in proper range,
7138 rather than assuming fixnums fit into ptrdiff_t etc.
7139 Don't assume fixnums fit into int.
125b3835 7140 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
7141 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7142 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
7143 (string_char_to_byte, string_byte_to_char)
7144 (string_make_multibyte, string_to_multibyte)
7145 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7146 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7147 (substring_both, Fdelete, internal_equal, Ffillarray)
7148 (Fclear_string, mapcar1)
7149 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7150 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7151 (larger_vector, make_hash_table, maybe_resize_hash_table)
7152 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7153 (Fmaphash, secure_hash):
7154 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7155 (concat): Check for string index and length overflow.
7156 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7157 (Frequire):
7158 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7159 (larger_vector): New API (vec, incr_min, size_max) replaces old
7160 one (vec, new_size, init). This catches size overflow.
7161 INIT was removed because it was always Qnil.
7162 All callers changed.
7163 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7164 the upper bound on a hash table index size.
7165 (make_hash_table, maybe_resize_hash_table): Use it.
7166 (secure_hash): Computer start_byte and end_byte only after
7167 they're known to be in ptrdiff_t range.
7168 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7169 (Ffont_get_glyphs, Ffont_at):
7170 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7171 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7172 (Flist_fonts, Fopen_font):
7173 Don't assume fixnum can fit in int.
7174 (check_gstring): Don't assume index can fit in int.
7175 (font_match_p): Check that fixnum is a character, not a nonnegative
7176 fixnum, since the later code needs to stuff it into an int.
7177 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7178 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7179 conversion overflow issues.
7180 (Fopen_font): Check for integer out of range.
7181 (Ffont_get_glyphs): Don't assume index can fit in int.
7182 * font.h: Adjust decls to match defn changes elsewhere.
7183 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7184 integer overflow.
7185 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7186 printmax_t, where ptrdiff_t is wide enough.
7187 (Finternal_char_font):
7188 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7189 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7190 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7191 (Fset_frame_position, x_set_frame_parameters)
7192 (x_set_line_spacing, x_set_border_width)
7193 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7194 Check that fixnums are in proper range for system types.
7195 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7196 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7197 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7198 Use SAFE_ALLOCA_LISP, not alloca.
7199 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7200 intptr_t is wide enough.
7201 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7202 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7203 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7204 Check for fixnum out of range.
7205 * ftfont.c (ftfont_list): Don't assume index fits in int.
7206 Check that fixnums are in proper range for system types.
7207 (ftfont_shape_by_flt):
7208 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
7209 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7210 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7211 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7212 Check that fixnums are in proper range for system types.
7213 * gnutls.h: Adjust decls to match defn changes elsewhere.
7214 * gtkutil.c (xg_dialog_run):
7215 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7216 (update_frame_tool_bar):
7217 Check that fixnums are in proper range for system types.
7218 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 7219 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
7220 * indent.c (last_known_column, last_known_column_point):
7221 (current_column_bol_cache):
7222 (skip_invisible, current_column, check_display_width):
7223 (check_display_width, scan_for_column, current_column_1)
7224 (Findent_to, Fcurrent_indentation, position_indentation)
7225 (indented_beyond_p, Fmove_to_column, compute_motion):
7226 (Fcompute_motion, Fvertical_motion):
7227 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7228 (last_known_column_modified): Use EMACS_INT, not int.
7229 (check_display_width):
7230 (Fcompute_motion):
7231 Check that fixnums and floats are in proper range for system types.
7232 (compute_motion): Don't assume index or fixnum fits in int.
7233 (compute_motion, Fcompute_motion):
7234 Use int, not EMACS_INT, when it is wide enough.
7235 (vmotion): Omit local var start_hpos that is always 0; that way
7236 we don't need to worry about overflow in expressions involving it.
7237 * indent.h: Adjust decls to match defn changes elsewhere.
7238 (struct position):
7239 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7240 Use int, not EMACS_INT, where int is wide enough.
7241 Remove unused members ovstring_chars_done and tab_offset;
7242 all uses removed.
7243 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7244 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7245 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7246 (make_gap, copy_text, insert, insert_and_inherit)
7247 (insert_before_markers, insert_before_markers_and_inherit)
7248 (insert_1, count_combining_before, count_combining_after)
7249 (insert_1_both, insert_from_string)
7250 (insert_from_string_before_markers, insert_from_string_1)
7251 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7252 (adjust_after_replace, adjust_after_insert, replace_range)
7253 (replace_range_2, del_range, del_range_1, del_range_byte)
7254 (del_range_both, del_range_2, modify_region)
7255 (prepare_to_modify_buffer, signal_before_change)
7256 (signal_after_change, Fcombine_after_change_execute):
7257 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7258 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7259 (balance_an_interval, split_interval_right, split_interval_left)
7260 (find_interval, next_interval, update_interval)
7261 (adjust_intervals_for_insertion, delete_node, delete_interval)
7262 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7263 (static_offset_intervals, offset_intervals)
7264 (merge_interval_right, merge_interval_left, make_new_interval)
7265 (graft_intervals_into_buffer, temp_set_point_both)
7266 (temp_set_point, set_point, adjust_for_invis_intang)
7267 (set_point_both, move_if_not_intangible, get_property_and_range)
7268 (get_local_map, copy_intervals, copy_intervals_to_string)
7269 (compare_string_intervals, set_intervals_multibyte_1):
7270 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7271 * intervals.h: Adjust decls to match defn changes elsewhere.
7272 (struct interval):
7273 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7274 * keyboard.c (this_command_key_count, this_single_command_key_start)
7275 (before_command_key_count, before_command_echo_length, echo_now)
7276 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7277 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7278 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7279 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7280 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7281 (last_non_minibuf_size, last_point_position, echo_truncate)
7282 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7283 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7284 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7285 (stuff_buffered_input):
7286 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7287 (last_auto_save, command_loop_1, read_char):
7288 Use EMACS_INT, not int, to avoid integer overflow.
7289 (record_char): Avoid overflow in total_keys computation.
7290 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7291 * keyboard.h: Adjust decls to match defn changes elsewhere.
7292 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7293 (Fkey_description, Fdescribe_vector, Flookup_key):
7294 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7295 (click_position): New function, to check that positions are in range.
7296 (Fcurrent_active_maps):
7297 (describe_command):
7298 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7299 (Faccessible_keymaps, Fkey_description):
7300 (preferred_sequence_p):
7301 Don't assume fixnum can fit into int.
7302 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7303 Check for integer overflow in size calculations.
7304 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7305 avoid mishandling large integers.
7306 * lisp.h: Adjust decls to match defn changes elsewhere.
7307 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7308 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7309 (struct Lisp_Marker):
7310 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7311 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
7312 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7313 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7314 All callers changed.
7315 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7316 Assume the arg has valid form, since it always does.
7317 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7318 unsigned integer system type.
7319 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7320 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7321 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7322 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7323 (duration_to_sec_usec): New decl.
7324 * lread.c (read_from_string_index, read_from_string_index_byte)
7325 (read_from_string_limit, readchar, unreadchar, openp)
7326 (read_internal_start, read1, oblookup):
7327 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7328 (Fload, readevalloop, Feval_buffer, Feval_region):
7329 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7330 (openp): Check for out-of-range argument to 'access'.
7331 (read1): Use int, not EMACS_INT, where int is wide enough.
7332 Don't assume fixnum fits into int.
6efdadfd 7333 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
7334 (read_filtered_event): Use duration_to_sec_usec
7335 to do proper overflow checking on durations.
d311d28c
PE
7336 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7337 in size calculation.
7338 (Fexecute_kbd_macro):
7339 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7340 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7341 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7342 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7343 (set_marker_both, set_marker_restricted_both, marker_position)
7344 (marker_byte_position, Fbuffer_has_markers_at):
7345 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7346 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 7347 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
7348 It now merely ensures that the menu is large enough, without
7349 necessarily growing it, as this avoids some integer overflow issues.
7350 All callers changed.
7351 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7352 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7353 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7354 Use SAFE_ALLOCA_LISP, not alloca.
7355 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7356 to EMACS_INT. Check that fixnums are in proper range for system types.
7357 * minibuf.c (minibuf_prompt_width, string_to_object)
7358 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7359 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7360 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7361 (get_minibuffer, read_minibuf_unwind):
7362 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7363 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7364 this simplifies overflow checking. All callers changed.
7365 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7366 (Ftest_completion):
7367 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7368 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7369 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7370 Check that fixnums are in proper range for system types.
7371 (Fx_create_frame, Fx_show_tip):
7372 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7373 * nsfont.m (ns_findfonts, nsfont_list_family):
7374 Don't assume fixnum fits in long.
7375 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7376 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7377 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7378 wide enough.
17fdb222 7379 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
7380 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7381 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7382 (PRINTDECLARE, PRINTPREPARE):
7383 (strout, print_string):
7384 (print, print_preprocess, print_check_string_charset_prop)
7385 (print_object):
7386 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7387 (PRINTDECLARE):
7388 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7389 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7390 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 7391 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 7392 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
7393 (print_error_message): Use SAFE_ALLOCA, not alloca.
7394 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
7395 (print_depth, new_backquote_output, print_number_index):
7396 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
7397 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7398 (Fset_process_window_size, Fformat_network_address)
7399 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 7400 (sigchld_handler):
d311d28c 7401 Check that fixnums are in proper range for system types.
d44287d4 7402 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
7403 Check for process-ids out of pid_t range rather than relying on
7404 undefined behavior.
e4d81efc 7405 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
7406 (Fformat_network_address, read_process_output, send_process)
7407 (Fprocess_send_region, status_notify):
7408 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7409 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7410 (wait_reading_process_output, read_process_output, exec_sentinel):
7411 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7412 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7413 (Faccept_process_output): Use duration_to_sec_usec to do proper
7414 overflow checking on durations.
dde14581
PE
7415 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7416 Don't assume pid_t fits in int.
02481186
PE
7417 * process.h (struct Lisp_Process): Members tick and update_tick
7418 are now of type EMACS_INT, not int.
b62b53e8
PE
7419 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7420 configured --with-wide-int.
d311d28c
PE
7421 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7422 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7423 * search.c (looking_at_1, string_match_1):
7424 (fast_string_match, fast_c_string_match_ignore_case)
7425 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7426 (scan_newline, find_before_next_newline, search_command)
7427 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7428 (set_search_regs, wordify):
7429 (Freplace_match):
7430 (Fmatch_data):
7431 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7432 (string_match_1, search_buffer, set_search_regs):
7433 (Fmatch_data):
7434 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7435 (wordify): Check for overflow in size calculation.
7436 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7437 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7438 Check that fixnums are in proper range for system types.
7439 * sound.c (struct sound_device)
7440 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7441 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7442 (Fplay_sound_internal):
7443 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 7444 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
7445 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7446 (Fparse_partial_sexp):
7447 Don't assume fixnums can fit in int.
7448 (struct lisp_parse_state, find_start_pos, find_start_value)
7449 (find_start_value_byte, find_start_begv)
7450 (update_syntax_table, char_quoted, dec_bytepos)
7451 (find_defun_start, prev_char_comend_first, back_comment):
7452 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7453 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7454 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7455 (Finternal_describe_syntax_value): Check that match_lisp is a
7456 character, not an integer, since the code stuffs it into int.
7457 (scan_words, scan_sexps_forward):
7458 Check that fixnums are in proper range for system types.
7459 (Fforward_word):
7460 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7461 (scan_sexps_forward):
7462 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7463 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7464 * syntax.h: Adjust decls to match defn changes elsewhere.
7465 (struct gl_state_s):
7466 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
7467 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7468 MOST_POSITIVE_FIXNUM.
d311d28c
PE
7469 * sysdep.c (wait_for_termination_1, wait_for_termination)
7470 (interruptible_wait_for_termination, mkdir):
7471 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7472 (emacs_read, emacs_write):
7473 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
7474 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7475 and double all fit in int.
d311d28c
PE
7476 * term.c (set_tty_color_mode):
7477 Check that fixnums are in proper range for system types.
7478 * termhooks.h (struct input_event):
7479 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7480 * textprop.c (validate_interval_range, interval_of)
7481 (Fadd_text_properties, set_text_properties_1)
7482 (Fremove_text_properties, Fremove_list_of_text_properties)
7483 (Ftext_property_any, Ftext_property_not_all)
7484 (copy_text_properties, text_property_list, extend_property_ranges)
7485 (verify_interval_modification):
7486 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7487 (Fnext_single_char_property_change)
7488 (Fprevious_single_char_property_change):
7489 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
7490 (copy_text_properties):
7491 Check for integer overflow in index calculation.
d311d28c
PE
7492 * undo.c (last_boundary_position, record_point, record_insert)
7493 (record_delete, record_marker_adjustment, record_change)
7494 (record_property_change):
7495 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7496 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7497 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7498 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7499 (Fx_hide_tip, Fx_file_dialog):
7500 * w32menu.c (set_frame_menubar):
7501 Use ptrdiff_t, not int, for consistency with rest of code.
7502 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7503 (select_window, Fdelete_other_windows_internal)
7504 (window_scroll_pixel_based, window_scroll_line_based)
7505 (Frecenter, Fset_window_configuration):
7506 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7507 (Fset_window_hscroll, run_window_configuration_change_hook)
7508 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 7509 (Fscroll_other_window, Frecenter):
d311d28c
PE
7510 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7511 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7512 Don't assume fixnum fits in int.
7513 (Fset_window_scroll_bars):
7514 Check that fixnums are in proper range for system types.
7515 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7516 (string_pos, c_string_pos, number_of_chars, init_iterator)
7517 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7518 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7519 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
7520 (face_before_or_after_it_pos, handle_invisible_prop)
7521 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
7522 (display_prop_intangible_p, string_buffer_position_lim)
7523 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7524 (get_overlay_strings_1, get_overlay_strings)
7525 (iterate_out_of_display_property, forward_to_next_line_start)
7526 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7527 (get_next_display_element, set_iterator_to_next)
7528 (get_visually_first_element, compute_stop_pos_backwards)
7529 (handle_stop_backwards, next_element_from_buffer)
7530 (move_it_in_display_line_to, move_it_in_display_line)
7531 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7532 (add_to_log, message_dolog, message_log_check_duplicate)
7533 (message2, message2_nolog, message3, message3_nolog
7534 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7535 (current_message_1, truncate_echo_area, truncate_message_1)
7536 (set_message, set_message_1, store_mode_line_noprop)
7537 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7538 (text_outside_line_unchanged_p, check_point_in_composition)
7539 (reconsider_clip_changes)
7540 (redisplay_internal, set_cursor_from_row, try_scrolling)
7541 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7542 (redisplay_window, find_last_unchanged_at_beg_row)
7543 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7544 (trailing_whitespace_p, find_row_edges, display_line)
7545 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7546 (display_mode_element, store_mode_line_string)
7547 (pint2str, pint2hrstr, decode_mode_spec)
7548 (display_count_lines, display_string, draw_glyphs)
7549 (x_produce_glyphs, x_insert_glyphs)
7550 (rows_from_pos_range, mouse_face_from_buffer_pos)
7551 (fast_find_string_pos, mouse_face_from_string_pos)
7552 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7553 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7554 (safe_call, init_from_display_pos, handle_fontified_prop)
7555 (handle_single_display_spec, load_overlay_strings)
7556 (with_echo_area_buffer, setup_echo_area_for_printing)
7557 (display_echo_area, echo_area_display)
7558 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7559 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
7560 (redisplay_window, dump_glyph_row, display_mode_line)
7561 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 7562 (handle_display_spec, display_prop_string_p):
d311d28c
PE
7563 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7564 (handle_single_display_spec, build_desired_tool_bar_string)
7565 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7566 (get_specified_cursor_type):
7567 Check that fixnums are in proper range for system types.
7568 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7569 (Flookup_image_map):
7570 Don't assume fixnums fit in int.
7571 (compare_overlay_entries):
7572 Avoid mishandling comparisons due to subtraction overflow.
7573 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7574 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7575 (handle_tool_bar_click):
7576 Use int, not unsigned, since we prefer signed and the signedness
7577 doesn't matter here.
7578 (get_next_display_element, next_element_from_display_vector):
7579 Use int, not EMACS_INT, when int is wide enough.
7580 (start_hourglass): Use duration_to_sec_usec to do proper
7581 overflow checking on durations.
7582 * xfaces.c (Fbitmap_spec_p):
7583 Check that fixnums are in proper range for system types.
7584 (compare_fonts_by_sort_order):
7585 Avoid mishandling comparisons due to subtraction overflow.
7586 (Fx_family_fonts, realize_basic_faces):
7587 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7588 (Fx_family_fonts):
7589 Don't assume fixnum fits in int.
7590 Use SAFE_ALLOCA_LISP, not alloca.
7591 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7592 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7593 (face_at_buffer_position, face_for_overlay_string)
7594 (face_at_string_position):
7595 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7596 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7597 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7598 (Fx_show_tip):
7599 Check that fixnums are in proper range for system types.
7600 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7601 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7602 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7603 (Fx_change_window_property): Don't assume fixnums fit in int.
7604 * xfont.c (xfont_chars_supported):
7605 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7606 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7607 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7608 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7609 * xml.c (parse_region):
7610 * xrdb.c (magic_file_p):
7611 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7612 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7613 (x_get_local_selection, x_reply_selection_request)
7614 (x_handle_selection_request, wait_for_property_change):
7615 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7616 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7617 short is wide enough.
7618 (x_send_client_event): Don't assume fixnum fits in int.
7619 * xterm.c (x_x_to_emacs_modifiers):
7620 Don't assume EMACS_INT overflows nicely into int.
7621 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7622 may come from Lisp.
7623 (handle_one_xevent): NATNUMP can eval its arg twice.
7624 (x_connection_closed):
7625 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7626 * xterm.h: Adjust decls to match defn changes elsewhere.
7627 (struct scroll_bar): Use struct vectorlike_header
7628 rather than rolling our own approximation.
7629 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7630
c6574eb5
GM
76312012-05-25 Glenn Morris <rgm@gnu.org>
7632
7633 * lisp.mk (lisp): Update for more files being compiled now.
7634
e8d32c7e
SM
76352012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7636
48def666
SM
7637 * lread.c: Remove `read_pure' which makes no difference.
7638 (read_pure): Remove var.
7639 (unreadpure): Remove function.
7640 (readevalloop): Don't call read_list with -1 flag.
7641 (read1, read_vector): Don't test read_pure any more.
7642 (read_list): Simplify.
7643
e8d32c7e
SM
7644 * fileio.c, character.h: Minor style tweaks.
7645
4b2addb7
DA
76462012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7647
7648 * window.h (clip_changed): Remove useless declaration.
7649
584461b2
JB
76502012-05-22 Juanma Barranquero <lekktu@gmail.com>
7651
7652 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7653 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7654
34374650
PE
76552012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7656
7657 Remove src/m/*.
7658 This directory predates autoconf and is no longer needed nowadays.
7659 Move its few remaining bits of functionality to where they're needed.
7660 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7661 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7662 * m/template.h: Remove.
7663 * Makefile.in (M_FILE): Remove. All uses removed.
7664 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7665 * lisp.h (USE_LSB_TAG):
7666 * mem-limits.h (EXCEEDS_LISP_PTR):
7667 Use VAL_MAX, not VALBITS, in #if.
7668 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7669 (EMACS_UINT): Define unconditionally now.
7670 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7671 (BITS_PER_EMACS_INT): New constants, replacing
7672 what used to be in config.h, but not useful in #if.
7673 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7674 define them any more.
7675 (VAL_MAX): New macro.
7676 (VALMASK): Use it.
7677 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7678 BITS_PER_EMACS_INT, in #if.
7679 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7680 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7681 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7682 * s/ms-w32.h (DATA_START):
7683 Move here from removed file m/intel386.h.
7684 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7685 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7686
261cb4bb
PE
76872012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7688
7689 Assume C89 or later.
7690 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7691 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7692 (xrealloc):
7693 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7694 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7695 * textprop.c, tparam.c (NULL): Remove.
7696 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7697 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7698 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7699 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7700 * xterm.c (input_signal_count): Assume volatile works.
7701
ff23cd9f
KB
77022012-05-21 Ken Brown <kbrown@cornell.edu>
7703
7704 * xgselect.c (xg_select): Fix first argument in call to 'select'
7705 (bug#11508).
7706
1b170bc6
KB
77072012-05-20 Ken Brown <kbrown@cornell.edu>
7708
7709 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 7710 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 7711
b2f4d39f
KB
77122012-05-19 Ken Brown <kbrown@cornell.edu>
7713
7714 * xfns.c (x_in_use): Remove `static' qualifier.
7715 * xterm.h (x_in_use): Declare.
7716 * xgselect.c: Include xterm.h.
7717 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7718 and `display_arg' (bug#9754).
7719
003fdae2
PE
77202012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7721
9232a6d9
PE
7722 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7723
003fdae2
PE
7724 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7725 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7726
784b56e2
EZ
77272012-05-18 Eli Zaretskii <eliz@gnu.org>
7728
7729 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7730
7731 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 7732 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
7733
7734 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7735 reference to image_cache->refcount.
7736 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7737
a0a79cde
JL
77382012-05-17 Juri Linkov <juri@jurta.org>
7739
7740 * search.c (Fword_search_regexp, Fword_search_backward)
7741 (Fword_search_forward, Fword_search_backward_lax)
7742 (Fword_search_forward_lax): Move functions to isearch.el
7743 (bug#10145, bug#11381).
7744
b0572523
PE
77452012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7746
7747 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7748
9660f5fc
SM
77492012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7750
7751 * lread.c (init_obarray): Declare Qt and Qnil as special.
7752
4374de83
GM
77532012-05-14 Glenn Morris <rgm@gnu.org>
7754
7755 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 7756 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 7757
dc44c39a
PE
77582012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7759
078c97cb
PE
7760 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7761
dc44c39a
PE
7762 * unexaix.c: Port to more-recent AIX compilers.
7763 (report_error, report_error_1, make_hdr, copy_sym)
7764 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7765 Make arguments const char *, not char *, to avoid violations of C
7766 standard and to fix some AIX warnings reported by Gilles Pion.
7767
e18afed7 77682012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
7769
7770 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7771 already have overlays loaded.
7772 (handle_single_display_spec): Before returning without displaying
7773 fringe bitmap, synchronize the bidi iterator with the main display
7774 iterator, by calling iterate_out_of_display_property.
7775 (iterate_out_of_display_property): Detect buffer iteration by
7776 testing that it->string is a Lisp string.
7777 (get_next_display_element): When the current object is exhausted,
7778 and there's something on it->stack, call set_iterator_to_next to
7779 proceed with what's on the stack, instead of returning zero.
7780 (set_iterator_to_next): If called at the end of a Lisp string,
7781 proceed to consider_string_end without incrementing string
7782 position. Don't increment display vector index past the end of
7783 the display vector. (Bug#11417)
c8fb9dc6
EZ
7784 (pos_visible_p): Don't report a position visible when move_it_to
7785 stopped at the last line of window, which happens to be scanned
7786 backwards by the bidi iteration. (Bug#11464)
ac268e67 7787
e18afed7 77882012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
7789
7790 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7791 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
7792 are on a TTY, and thus unable to display on the fringes.
7793 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
7794 so we need to signal to the caller that this is a "replacing"
7795 display spec. This fixes display when the spec is invalid or we
7796 are on a TTY.
7797
e18afed7 77982012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
7799
7800 * unexaix.c (make_hdr): Fix typo in prototype.
7801 This bug broke the build on AIX. Problem reported by Gilles Pion.
7802
9d0a235a
MA
78032012-05-14 Michael Albinus <michael.albinus@gmx.de>
7804
7805 * keyboard.c (kbd_buffer_get_event): Read special events also in
7806 batch mode. (Bug#11415)
7807
9e6b06ed
GM
78082012-05-12 Glenn Morris <rgm@gnu.org>
7809
7810 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7811
c1a1d7a3
EZ
78122012-05-12 Eli Zaretskii <eliz@gnu.org>
7813
7814 * lisp.mk (lisp): Add newcomment.elc.
7815
3fe7cdc8
GM
78162012-05-12 Glenn Morris <rgm@gnu.org>
7817
7818 * Makefile.in (MKDIR_P): New, set by configure.
7819 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7820
53f7d2c0
PE
78212012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7822
7823 Remove unused function hourglass_started.
7824 * dispextern.h (hourglass_started):
7825 * w32fns.c (hourglass_started):
7826 * xdisp.c (hourglass_started): Remove.
7827
75aafb17
JB
78282012-05-10 Juanma Barranquero <lekktu@gmail.com>
7829
7830 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7831 Update dependencies.
7832
12959e8e
PE
78332012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7834
97107e2e
PE
7835 * xgselect.c (xg_select): Put maxfds+1 into a var.
7836 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7837
12959e8e
PE
7838 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7839
836d29b3
DA
78402012-05-10 Dave Abrahams <dave@boostpro.com>
7841
7842 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7843 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7844
5cb67954
MA
78452012-05-09 Michael Albinus <michael.albinus@gmx.de>
7846
7847 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7848 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7849 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7850 Initialize xd_registered_buses.
7851
3478ec45
PE
78522012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7853
b263a6b0
PE
7854 Untag more efficiently if USE_LSB_TAG.
7855 This is based on a proposal by YAMAMOTO Mitsuharu in
7856 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7857 For an admittedly artificial (nth 8000 longlist) benchmark on
7858 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7859 Emacs's overall text size by 1%.
7860 * lisp.h (XUNTAG): New macro.
7861 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7862 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7863 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7864 * eval.c (Fautoload):
7865 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7866 * frame.h (XFRAME): Use XUNTAG.
7867
3478ec45
PE
7868 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7869 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7870 Remove unportable assumptions about print widths of types like
7871 dbus_uint32_t.
7872 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7873 intptr_t when converting between pointer and integer, to avoid GCC
7874 warnings about wrong width.
7875
666b903b 78762012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
7877
7878 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7879 stack for each reader_thread, instead of defaulting to 8MB
7880 determined by the linker. This avoids failures in creating
7881 subprocesses on Windows 7, see the discussion in this thread:
7882 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7883
b120cc17
JC
78842012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7885
7886 Fix up display of the *Minibuf-0* buffer in the mini window.
7887 * keyboard.c (read_char): Don't clear the echo area if there's no
7888 message to clear.
7889 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 7890 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 7891
9a4b36f8
MA
78922012-05-07 Michael Albinus <michael.albinus@gmx.de>
7893
7894 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7895 batch mode.
7896
e5f9458f
CY
78972012-05-06 Chong Yidong <cyd@gnu.org>
7898
7899 * lisp.mk (lisp): Update.
7900
eceeb5fc 79012012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
7902
7903 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7904
71873e2b
SM
79052012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7906
7907 * data.c (PUT_ERROR): New macro.
7908 (syms_of_data): Use it. Add new error type `user-error'.
7909 * undo.c (user_error): New function.
7910 (Fprimitive_undo): Use it.
7911 * print.c (print_error_message): Adjust print style for `user-error'.
7912 * keyboard.c (user_error): New function.
7913 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7914
ab0fa4e4
PE
79152012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7916
7917 Do not limit current-time-string to years 1000..9999.
7918 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7919 (Fcurrent_time_string): Support any year that is supported by the
7920 underlying localtime representation. Don't use asctime, as it
7921 has undefined behavior for years outside the range -999..9999.
7922
7ed806a7
PE
79232012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7924
7925 Fix race conditions involving setenv, gmtime, localtime, asctime.
7926 Without this fix, interrupts could mess up code that uses these
7927 nonreentrant functions, since setting TZ invalidates existing
7928 tm_zone or tzname values, and since most of these functions return
7929 pointers to static storage.
7930 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7931 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7932 Grow the critical sections to include not just invoking
7933 localtime/gmtime, but also accessing these functions' results
7934 including their tm_zone values if any, and any related TZ setting.
7935 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
7936 so that the struct tm is saved in the critical section.
7937 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
7938 motivated by the fact that memory allocation needs to be outside
7939 the critical section.
7940
0c16dfed
DA
79412012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7942
7943 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7944 with RESET_INTERVAL.
7945
7946 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7947 Remove duplicated buffer name initialization.
7948
3f83ace8
JM
79492012-05-02 Jim Meyering <jim@meyering.net>
7950
7951 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7952
c7b8541e
JM
7953 * xfns.c (x_window): Use xstrdup (Bug#11375).
7954
90207a15 79552012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
7956
7957 * xdisp.c (pos_visible_p): If already at a newline from the
7958 display string before the 'while' loop, don't walk back the glyphs
7959 from it3.glyph_row. Solves assertion violation when the display
7960 string begins with a newline (egg.el). (Bug#11367)
7961
b593d6a9
AH
79622012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7963
7964 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7965 Move to simple.el.
7966
4737362e
GM
79672012-05-01 Glenn Morris <rgm@gnu.org>
7968
99cf43f9
GM
7969 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7970 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7971 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7972 All were removed before 23.1.
7973
9311dcff
GM
7974 * dispnew.c: Remove HAVE_LIBNCURSES test;
7975 it is always true on relevant platforms.
7976
4d5c6349
GM
7977 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7978 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7979
4737362e
GM
7980 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7981
74dd3a6b
AS
79822012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7983
7984 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7985 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7986 Remove.
7987
13c379ee
PE
79882012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7989
7990 Do not avoid creating empty evaporating overlays (Bug#9642).
7991 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7992 That is, do not delete an evaporating overlay if it becomes
7993 empty after its bounds are adjusted to fit within its buffer.
7994 This fix caused other problems, and I'm reverting it until we get
7995 to the bottom of them.
7996
a8e7d6d7 79972012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
7998
7999 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8000
a8e7d6d7 80012012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
8002
8003 * xdisp.c (pos_visible_p): If the window start position is beyond
8004 ZV, start the display from buffer beginning. Prevents assertion
8005 violation in init_iterator when the minibuffer window is scrolled
8006 via the scroll bar.
8007
8008 * window.c (window_scroll_pixel_based): Likewise.
8009
a8e7d6d7 80102012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
8011
8012 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8013
a8e7d6d7 80142012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
8015
8016 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8017 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8018
a8e7d6d7 80192012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 8020
b593d6a9
AH
8021 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8022 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 8023
1c6900d9
EZ
80242012-04-26 Eli Zaretskii <eliz@gnu.org>
8025
4c3fa1d9
EZ
8026 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8027 display element, check also the underlying string or buffer
8028 character. (Bug#11341)
8029
1c6900d9
EZ
8030 * w32menu.c: Include w32heap.h.
8031 (add_menu_item): If the call to AppendMenuW (via
8032 unicode_append_menu) fails, disable Unicode menus only if we are
8033 running on Windows 9X/Me.
8034
42bf8205
AS
80352012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8036
8037 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8038 (xgetint): Add missing shift for LSB tags.
8039
b1bac16e
MR
80402012-04-24 Martin Rudalics <rudalics@gmx.at>
8041
8042 * keyboard.c (read_char): Don't wipe echo area for select window
8043 events: These might get delayed via `mouse-autoselect-window'
8044 (Bug#11304).
8045
d69621cc
JB
80462012-04-24 Juanma Barranquero <lekktu@gmail.com>
8047
8048 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8049 manipulation of :loaded-from data.
8050
02fd101b
JB
80512012-04-23 Juanma Barranquero <lekktu@gmail.com>
8052
8053 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8054 now a cons (bug#11311).
8055
888bec30
PE
80562012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8057
89a438bd
PE
8058 Do not create empty overlays with the evaporate property (Bug#9642).
8059 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8060 if it becomes empty after its bounds are adjusted to fit within
8061 its buffer. Without this fix, in a nonempty buffer (let ((o
8062 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8063 yields an empty overlay that has the evaporate property, which is
8064 not supposed to happen.
8065
1068fe4d
PE
8066 Fix minor GTK3 problems found by static checking.
8067 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8068 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8069 (struct _EmacsFixedClass, emacs_fixed_get_type):
8070 Move decls here from emacsgtkfixed.h, since they needn't be public.
8071 (emacs_fixed_get_type): Now static.
8072 (emacs_fixed_class_init): Omit unused local.
8073 (emacs_fixed_child_type): Remove; unused.
8074 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8075 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8076 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8077 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8078 (EMACS_FIXED_GET_CLASS): Remove; unused.
8079 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8080
888bec30
PE
8081 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8082 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8083
de85e130
PE
80842012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8085
d0baac98 8086 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 8087 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
8088 (__malloc_size_t, __malloc_ptrdiff_t):
8089 Remove. All uses removed, replaced by the definiens if needed,
8090 since we can assume C89 or better now.
8091 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8092 (protect_malloc_state, align, get_contiguous_space)
8093 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8094 (malloc_atfork_handler_child, malloc_enable_thread)
8095 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8096 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8097 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8098 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8099 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8100 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8101 Define using prototypes, not old style.
8102 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8103 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8104 (align): Don't assume that signed integer overflow wraps around.
8105 Omit unused local var.
8106 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8107 (_free_internal_nolock, memalign, mallochook, reallochook):
8108 Omit no-longer-needed casts.
8109 (valloc): Use getpagesize, not __getpagesize.
8110 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8111 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8112
de85e130
PE
8113 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8114
dcbf5805
MA
81152012-04-22 Michael Albinus <michael.albinus@gmx.de>
8116
8117 Move functions from C to Lisp. Make non-blocking method calls
8118 the default. Implement further D-Bus standard interfaces.
8119
8120 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8121 (QCdbus_request_name_allow_replacement)
8122 (QCdbus_request_name_replace_existing)
8123 (QCdbus_request_name_do_not_queue)
8124 (QCdbus_request_name_reply_primary_owner)
8125 (QCdbus_request_name_reply_in_queue)
8126 (QCdbus_request_name_reply_exists)
8127 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8128 (QCdbus_registered_serial, QCdbus_registered_method)
8129 (QCdbus_registered_signal): New Lisp objects.
8130 (XD_DEBUG_MESSAGE): Use sizeof.
8131 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8132 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8133 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8134 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8135 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8136 (xd_signature, xd_append_arg): Allow float for integer types.
8137 (xd_get_connection_references): New function.
b593d6a9
AH
8138 (xd_get_connection_address): Rename from xd_initialize.
8139 Return cached address.
dcbf5805
MA
8140 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8141 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8142 level.
8143 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 8144 Return number of refcounts.
dcbf5805
MA
8145 (Fdbus_get_unique_name): Make stronger parameter check.
8146 (Fdbus_message_internal): New defun.
8147 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8148 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8149 (Fdbus_send_signal, Fdbus_register_service)
8150 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8151 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8152 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8153 (Vdbus_compiled_version, Vdbus_runtime_version)
8154 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8155 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8156 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
8157 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8158 Adapt docstring.
dcbf5805 8159
52828e02
PE
81602012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8161
da05bc4c
PE
8162 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8163 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8164 Do not assume ptrdiff_t is the same width as 'int'.
8165
52828e02
PE
8166 * alloc.c: Handle unusual debugging option combinations.
8167 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8168 since the two debugging options are incompatible.
8169 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8170 is defined.
8171 (mem_init, mem_insert, mem_insert_fixup):
8172 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8173 (NEED_MEM_INSERT): Remove; no longer needed.
8174
f01769f9
LL
81752012-04-22 Leo Liu <sdl.web@gmail.com>
8176
8177 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8178
5790543d
PE
81792012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8180
8181 * sysdep.c [__FreeBSD__]: Minor cleanups.
8182 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8183 Use Emacs indenting style more consistently. Avoid some casts.
8184 Use 'double' consistently rather than mixing 'float' and 'double'.
8185
b91b7e4d
EW
81862012-04-21 Eduard Wiebe <usenet@pusto.de>
8187
b593d6a9
AH
8188 * sysdep.c (list_system_processes, system_process_attributes):
8189 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 8190
6114eb15
AS
81912012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8192
8193 * lisp.mk (lisp): Update.
8194
2f38dff7
PE
81952012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8196
8197 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8198 It is never used otherwise.
8199
4ae29f89
SM
82002012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8201
8202 * print.c (print_preprocess): Only check print_depth if print-circle
8203 is nil.
8204 (print_object): Check for cycles even when print-circle is nil and
8205 print-gensym is t, but only check print_depth if print-circle is nil.
8206
f30d612a
CY
82072012-04-20 Chong Yidong <cyd@gnu.org>
8208
8209 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8210 set the status to "failed" and ensure that sentinel is run.
8211
c07a4c0b 82122012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
8213
8214 * process.c (Fset_process_inherit_coding_system_flag)
8215 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 8216 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 8217
c07a4c0b 82182012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
8219
8220 * xdisp.c (string_buffer_position_lim): Limit starting position to
8221 BEGV.
8222 (set_cursor_from_row): If called for a mode-line or header-line
8223 row, return zero immediately.
8224 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
8225 farther than the first row after the header line, if any.
8226 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
8227 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8228
c07a4c0b 82292012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8230
4ae29f89
SM
8231 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8232 (bug#11238).
ad3a2b41 8233
c07a4c0b 82342012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 82352012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
8236
8237 configure: new option --enable-gcc-warnings (Bug#11207)
8238 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8239 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8240 (ALL_CFLAGS): Use new macros rather than old.
8241 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8242 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8243 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8244 -Wunused-result, -Wunused-variable. This should go away once
8245 the Emacs and Gnulib regex code is merged.
8246 (xmalloc, xrealloc): Now static.
8247
aba027e8
PE
82482012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8249
8250 * dired.c (Fsystem_groups): Remove unused local.
8251
e5a36063
GM
82522012-04-17 Glenn Morris <rgm@gnu.org>
8253
8254 * dired.c (Fsystem_users): Doc fix.
8255
316411f0
DA
82562012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8257
8258 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8259 (syms_of_dired): Add them.
8260
9426aba4
PE
82612012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8262
b62a57be
PE
8263 Fix minor alloc.c problems found by static checking.
8264 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8265 New extern decls, to avoid calling undeclared functions.
8266 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8267 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8268 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8269 (NEED_MEM_INSERT): New macro.
8270 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 8271 Remove one incorrect comment and fix another.
b62a57be 8272
3539f31f
PE
8273 Fix minor ralloc.c problems found by static checking.
8274 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8275 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8276 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8277 (r_alloc_sbrk): Now static.
8278
a041960a
PE
8279 Improve ralloc.c interface checking.
8280 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8281 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8282 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8283 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8284 [REL_ALLOC]: ... to here, to check interface.
8285 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8286 Remove decls. This fixes an "It stinks!".
8287
9426aba4
PE
8288 * alloc.c (which_symbols): Fix alignment issue / type clash.
8289
d55c12ed
AS
82902012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8291
8292 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8293 (struct Lisp_Misc_Any): Likewise.
8294 (struct Lisp_Free): Likewise.
8295 * alloc.c (union aligned_Lisp_Symbol): Define.
8296 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8297 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8298 (union aligned_Lisp_Misc): Define.
8299 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8300 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 8301 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 8302
b948ce8b
PE
83032012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8304
8305 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8306 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8307 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8308 * s/netbsd.h, s/sol2-6.h:
8309 Remove definition of GC_MARK_STACK, since the default now works.
8310 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8311 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8312 no longer the default.
8313 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8314
35dc09a1 83152012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8316
35dc09a1
GM
8317 * lread.c (lisp_file_lexically_bound_p):
8318 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 8319
35dc09a1
GM
83202012-04-14 Eli Zaretskii <eliz@gnu.org>
8321
8322 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8323 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8324
83252012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8326
8327 * nsterm.m (constrainFrameRect): Always constrain when there is only
8328 one screen (Bug#10962).
8329
bcd86815
KB
83302012-04-13 Ken Brown <kbrown@cornell.edu>
8331
8332 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8333
c25df26e
RT
83342012-04-13 Reuben Thomas <rrt@sc3d.org>
8335
8336 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8337
0fc59f1e
DC
83382012-04-11 Daniel Colascione <dancol@dancol.org>
8339
8340 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8341 against is gone. It's better to use vfork now so that when Cygwin
8342 gains a new, working vfork, we use it automatically (bug#10398).
8343
de8c03dc
SM
83442012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8345
8346 * window.c (save_window_save): Obey window-point-insertion-type.
8347
2f097256
GM
83482012-04-11 Glenn Morris <rgm@gnu.org>
8349
8350 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8351
453b951e
SM
83522012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8353
8354 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8355
75f1671a 83562012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
8357
8358 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8359 (force_quit_count): New var.
8360 (handle_interrupt): Use it.
8361
2a8ce227
JB
83622012-04-10 Juanma Barranquero <lekktu@gmail.com>
8363
8364 * w32.c (w32_delayed_load): Record the full path of the library
8365 being loaded (bug#10424).
8366
935396c0
GM
83672012-04-09 Glenn Morris <rgm@gnu.org>
8368
05920a43
GM
8369 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8370 not just in the obarray, before snarfing them. (Bug#11036)
8371
935396c0
GM
8372 * Makefile.in ($(leimdir)/leim-list.el):
8373 Pass EMACS rather than BUILT_EMACS.
8374
a18ecafa
TZ
83752012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8376
8377 * process.c (make_process):
8378 * process.h: Add integer `gnutls_handshakes_tried' member to
8379 process struct.
8380
6bbef4e5
JC
8381 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8382 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
8383
8384 * gnutls.c (gnutls_log_function2i): Convenience log function.
8385 (emacs_gnutls_read): Use new log functions,
8386 `gnutls_handshakes_tried' process member, and
8387 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8388 attempts per process (connection).
8389
b4d3bc10
CY
83902012-04-09 Chong Yidong <cyd@gnu.org>
8391
8392 * eval.c (Fuser_variable_p, user_variable_p_eh)
8393 (lisp_indirect_variable): Functions deleted.
8394 (Fdefvar): Caller changed.
8395
8396 * callint.c (Finteractive, Fcall_interactively):
8397 * minibuf.c (Fread_variable): Callers changed.
8398
70f4d973
EZ
83992012-04-09 Eli Zaretskii <eliz@gnu.org>
8400
8401 * xdisp.c (set_cursor_from_row): If the display string appears in
8402 the buffer at position that is closer to point than the position
8403 after the display string, display the cursor on the first glyph of
8404 the display string. Fixes cursor display when a 'display' text
8405 property immediately follows invisible text. (Bug#11094)
8406
cb3c2e3e
PE
84072012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8408
8409 composite.c: use 'double' consistently
8410 * composite.c (get_composition_id): Use 'double' consistently
8411 instead of converting 'float' to 'double' and vice versa; this is
8412 easier to understand and avoids a GCC warning.
8413
fd06db5d
GM
84142012-04-09 Glenn Morris <rgm@gnu.org>
8415
50fe702a
GM
8416 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8417 preparation for dumping it with emacs. (Bug#4789)
8418 (leimdir): New variable.
8419 ($(leimdir)/leim-list.el): New rule.
8420 (emacs$(EXEEXT)): Depend on leim-list.el.
8421
fd06db5d
GM
8422 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8423 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8424 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8425
55c131ee
AS
84262012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8427
8428 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8429 proper alignment.
8430
9209588f
JB
84312012-04-07 Juanma Barranquero <lekktu@gmail.com>
8432
8433 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8434 Remove unused local variable.
8435
e3fb2efb
PE
84362012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8437
8438 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8439 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8440 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8441 objects, as mark_maybe_pointer will catch them otherwise.
8442 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8443 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8444
b5385551
PE
84452012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8446
8447 Fix typo that broke non-Windows builds.
8448 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8449
9078ead6
EZ
84502012-04-07 Eli Zaretskii <eliz@gnu.org>
8451
8452 Support building on MS-Windows with libxml2.
8453
8454 * makefile.w32-in (OBJ2): Add xml.$(O).
8455 (GLOBAL_SOURCES): Add xml.c.
8456 ($(BLD)/xml.$(O)): New dependency list.
8457
8458 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8459 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8460 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8461 [!WINDOWSNT]: New macros.
8462 (init_libxml2_functions, libxml2_loaded_p): New functions.
8463 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8464 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8465 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8466 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8467 linked in).
6bbef4e5
JC
8468 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8469 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
8470 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8471
8472 * emacs.c: Don't include libxml/parser.h.
8473 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8474 xmlCleanupParser directly.
8475
8476 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8477
3811fdf3
EZ
84782012-04-07 Eli Zaretskii <eliz@gnu.org>
8479
8480 * indent.c (Fvertical_motion): If there is a display string at
8481 point, use it.vpos to compute how many lines to backtrack after
8482 move_it_to point. (Bug#11133)
8483
2f8e16b2
EZ
84842012-04-06 Eli Zaretskii <eliz@gnu.org>
8485
8486 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8487 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8488 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8489 macros related to unification of CJK characters. For the details,
8490 see the discussion following the message here:
8491 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8492
3d439cd1
CY
84932012-04-04 Chong Yidong <cyd@gnu.org>
8494
8495 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8496
8bc53d00
EZ
84972012-04-01 Eli Zaretskii <eliz@gnu.org>
8498
8499 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8500 instead of alloca. (Bug#11138)
8501
3b0512a3
AS
85022012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8503
8504 * w32menu.c (is_simple_dialog): Properly check lisp types.
8505 (Bug#11141)
8506
8427ddd2
EZ
85072012-03-31 Eli Zaretskii <eliz@gnu.org>
8508
979022ef
EZ
8509 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8510 position we get to after a call to move_it_to fails the
8511 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8512 only if we wind up in a string from display property. (Bug#11063)
8513
a6b1c7cc
EZ
8514 * window.c (Fdelete_other_windows_internal): Invalidate the row
8515 and column information about mouse highlight, so that redisplay
8516 restores it after reallocating the glyph matrices. (Bug#7464)
8517
8427ddd2
EZ
8518 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8519 string comes from a `display' text property, use the buffer
8520 position of that property as if we actually saw that position in
8521 the row's glyphs.
697ba24b
EZ
8522 (move_it_by_lines): Remove the assertion that
8523 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8524 violated when there's a before-string at the beginning of a line.
8525 (Bug#11063)
8427ddd2 8526
65a0a738
EZ
85272012-03-30 Eli Zaretskii <eliz@gnu.org>
8528
8529 * xdisp.c (append_space_for_newline): If the default face was
8530 remapped, use the remapped face for the appended newline.
8531 (extend_face_to_end_of_line): Use the remapped default face for
8532 extending the face to the end of the line.
8533 (display_line): Call extend_face_to_end_of_line when the default
8534 face was remapped. (Bug#11068)
8535
581355cc
EZ
85362012-03-29 Eli Zaretskii <eliz@gnu.org>
8537
8538 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8539
e8fc049f
SM
85402012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8541
8542 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8543
4fb9a543
GM
85442012-03-27 Glenn Morris <rgm@gnu.org>
8545
8546 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8547 Doc fixes.
8548
679910f1
KH
85492012-03-26 Kenichi Handa <handa@m17n.org>
8550
8551 * dispextern.h (struct glyph): Fix previous change. Change the
8552 bit length of glyphless.ch to 25 (Bug#11082).
8553
90d49b7f
CY
85542012-03-26 Chong Yidong <cyd@gnu.org>
8555
8556 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8557 (command_loop_1): Use it; inhibit selection update for
8558 handle-select-window too (Bug#8996).
8559
f514f6f0
FP
85602012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8561
e8fc049f 8562 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 8563
bf43fa51
KH
85642012-03-25 Kenichi Handa <handa@m17n.org>
8565
8566 * dispextern.h (struct glyph): Change the bit length of
8567 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8568
8a0c01dd
EZ
85692012-03-24 Eli Zaretskii <eliz@gnu.org>
8570
8571 * s/ms-w32.h (tzname): Include time.h before redirecting to
8572 _tzname. Fixes the MSVC build. (Bug#9960)
8573
7d1c3a76
AS
85742012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8575
8ed79523
AS
8576 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8577 characters.
8578
7d1c3a76
AS
8579 * xterm.c (XTread_socket): Only modify handling_signal if
8580 !SYNC_INPUT. (Bug#11080)
8581
e99a9b8b
EZ
85822012-03-23 Eli Zaretskii <eliz@gnu.org>
8583
8584 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8585 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8586 when fetching a multibyte character consumes more bytes than
8587 CHAR_BYTES returns, due to unification of CJK characters in
8588 string_char. (Bug#11073)
8589
5063c0e1
TN
85902012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8591
8592 * process.c (wait_reading_process_output): Handle pty disconnect
8593 by refraining from sending oneself a SIGCHLD (bug#10933).
8594
9f851fbd
CY
85952012-03-22 Chong Yidong <cyd@gnu.org>
8596
8597 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8598
5063c0e1 8599 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
8600 Mark string as coming from a prefix property.
8601 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8602 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8603
fb5b8aca
CY
86042012-03-21 Chong Yidong <cyd@gnu.org>
8605
8606 * xfaces.c (Vface_remapping_alist): Doc fix.
8607
62356a1b
EZ
86082012-03-20 Eli Zaretskii <eliz@gnu.org>
8609
8610 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
8611 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8612 Doc fixes.
62356a1b 8613
025de85b
CY
86142012-03-20 Chong Yidong <cyd@gnu.org>
8615
8616 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8617 to reflect default non-nil value of redisplay-dont-pause.
8618
4827f94e
KH
86192012-03-19 Kenichi Handa <handa@m17n.org>
8620
8621 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8622 it fit in a valid range (Bug#11003).
8623
e50a24a2
EZ
86242012-03-18 Eli Zaretskii <eliz@gnu.org>
8625
8626 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8627 that is not from display property, accept the row as a "cursor
8628 row" if one of the string's character has a non-nil `cursor'
8629 property. Fixes cursor positioning when there are newlines in
8630 overlay strings, e.g. in icomplete.el. (Bug#11035)
8631
9af5ed87
PE
86322012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8633
8634 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8635
d1f55f16
CY
86362012-03-12 Chong Yidong <cyd@gnu.org>
8637
8638 * eval.c (inhibit_lisp_code): Rename from
8639 inhibit_window_configuration_change_hook; move from window.c.
8640
8641 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8642 * window.c (run_window_configuration_change_hook)
8643 (syms_of_window): Callers changed.
8644
66c5eebd
CY
86452012-03-11 Chong Yidong <cyd@gnu.org>
8646
413df973
CY
8647 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8648
66c5eebd
CY
8649 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8650
1de11f56
CY
86512012-03-10 Chong Yidong <cyd@gnu.org>
8652
8653 * frame.c (other_visible_frames): Don't assume the selected frame
8654 is visible (Bug#10955).
8655
cae07000
SM
86562012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8657
8658 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8659
89c94350
JD
86602012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8661
8662 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8663 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8664 zero (Bug#10954).
8665
999dd333
GM
86662012-03-03 Glenn Morris <rgm@gnu.org>
8667
01a6dcc8 8668 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 8669
de0100f2
EZ
86702012-03-02 Eli Zaretskii <eliz@gnu.org>
8671
8672 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8673 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
8674 (redisplay_window, next_element_from_string): Fix typos in
8675 comments.
3e441275
EZ
8676 (redisplay_window): Pass to move_it_vertically the margin in
8677 pixels, not in screen lines.
de0100f2 8678
96a72ee9
GM
86792012-03-02 Glenn Morris <rgm@gnu.org>
8680
8681 * buffer.c (buffer-list-update-hook): Doc fix.
8682
312508d7
EZ
86832012-02-29 Eli Zaretskii <eliz@gnu.org>
8684
8685 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8686 push_it before setting up the iterator for the first overlay
8687 string, even if we have an empty string loaded.
8688 (next_overlay_string): If there's an empty string on the iterator
8689 stack, pop the stack. (Bug#10903)
8690
27f3c637
PE
86912012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8692
8693 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8694 Suggested by Stefan Monnier in
8695 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8696 * alloc.c (widen_to_Lisp_Object): New static function.
8697 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8698 and widening them to Lisp_Objects. This would work even if
8699 USE_LSB_TAG is defined and wide integers are used, which might
8700 happen in a future version of Emacs.
8701
3c9dfce6
CY
87022012-02-25 Chong Yidong <cyd@gnu.org>
8703
fa74b241
CY
8704 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8705 Doc fix.
8706
3c9dfce6
CY
8707 * xselect.c (Fx_selection_exists_p): Doc fix.
8708 (x_clipboard_manager_save_all): Print an informative message
8709 before saving to clipboard manager.
8710
9486df08
CY
87112012-02-24 Chong Yidong <cyd@gnu.org>
8712
8713 * keyboard.c (process_special_events): Handle all X selection
8714 requests in kbd_buffer, not just the next one (Bug#8869).
8715
f01d3321
CY
87162012-02-23 Chong Yidong <cyd@gnu.org>
8717
8718 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8719 call when setting menu-bar-lines and tool-bar-lines parameters.
8720 (unwind_create_frame_1): New helper function.
8721
8722 * window.c (inhibit_window_configuration_change_hook): New var.
8723 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 8724 (syms_of_window): Initialize it.
f01d3321 8725
86b847b6
CY
87262012-02-22 Chong Yidong <cyd@gnu.org>
8727
8728 * xterm.c (x_draw_image_relief): Add missing type check for
8729 Vtool_bar_button_margin (Bug#10743).
8730
a59225b1
CY
87312012-02-21 Chong Yidong <cyd@gnu.org>
8732
8733 * fileio.c (Vfile_name_handler_alist): Doc fix.
8734
8735 * buffer.c (Fget_file_buffer): Protect against invalid file
8736 handler return value.
8737
310f5bd4
PE
87382012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8739
cb3a28cc
PE
8740 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8741 when computing $valmask.
8742
310f5bd4
PE
8743 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8744 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8745 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8746 It's useless in that case, and it can cause problems on hosts
8747 that allocate halves of EMACS_INT values separately.
8748 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8749 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8750 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8751 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8752 it avoids undefined behavior on hosts where shifting right by more
8753 than the word width has undefined behavior.
8754
2375c96a
CY
87552012-02-19 Chong Yidong <cyd@gnu.org>
8756
8757 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8758 (Funhandled_file_name_directory, Ffile_name_as_directory)
8759 (Fdirectory_file_name, Fexpand_file_name)
8760 (Fsubstitute_in_file_name): Protect against invalid file handler
8761 return values (Bug#10845).
8762
3eb49e71
EZ
87632012-02-18 Eli Zaretskii <eliz@gnu.org>
8764
8765 * .gdbinit (pitx): Fix incorrect references to fields of the
8766 iterator stack.
8767
7b926f3f
CY
87682012-02-17 Chong Yidong <cyd@gnu.org>
8769
8770 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8771
11273115
PE
87722012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8773
8774 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8775 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8776
c3a70e2b
CY
87772012-02-15 Chong Yidong <cyd@gnu.org>
8778
8779 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8780 marked as special. Also, starting docstrings with * is obsolete.
8781
0ca43699
AS
87822012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8783
8784 * gnutls.c (emacs_gnutls_write): Fix last change.
8785
2e8f3c56
LI
87862012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8787
8788 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8789 send_process.
8790
af70074f
SM
87912012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8792
8793 * keymap.c (Fsingle_key_description): Handle char ranges.
8794
95986d52
CY
87952012-02-12 Chong Yidong <cyd@gnu.org>
8796
afd83bd1
CY
8797 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8798 as that creates a dangerous corner case.
8799
95986d52
CY
8800 * window.c (Fdelete_window_internal): Invalidate the mouse
8801 highlight (Bug#9904).
8802
bd7da63e
GM
88032012-02-12 Glenn Morris <rgm@gnu.org>
8804
8805 * xselect.c (Fx_own_selection_internal)
8806 (Fx_get_selection_internal, Fx_disown_selection_internal)
8807 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8808 * nsselect.m (Fx_own_selection_internal)
8809 (Fx_disown_selection_internal, Fx_selection_exists_p)
8810 (Fx_selection_owner_p, Fx_get_selection_internal):
8811 Sync docs and argument specs with the xselect.c versions.
8812
77abcbc2
LI
88132012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8814
8815 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8816
90b671e2
EZ
88172012-02-11 Eli Zaretskii <eliz@gnu.org>
8818
1c0ca0b7
EZ
8819 * w32select.c (Fx_selection_exists_p): Sync doc string and
8820 argument list with xselect.c. (Bug#10783)
8821
8822 * w16select.c (Fx_selection_exists_p): Sync doc string and
8823 argument list with xselect.c. (Bug#10783)
90b671e2 8824
49241268
GM
88252012-02-10 Glenn Morris <rgm@gnu.org>
8826
8827 * fns.c (Fsecure_hash): Doc fix.
8828
f998bbe7 88292012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
8830
8831 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8832
0992bd9c
CY
88332012-02-07 Chong Yidong <cyd@gnu.org>
8834
8835 * buffer.c (Fbuffer_local_variables)
8836 (buffer_lisp_local_variables): Handle unbound vars correctly;
8837 don't let Qunbound leak into Lisp.
8838
af008560
GM
88392012-02-07 Glenn Morris <rgm@gnu.org>
8840
dd605cc4
GM
8841 * image.c (Fimagemagick_types): Doc fix.
8842
af008560
GM
8843 * image.c (imagemagick-render-type): Change it from a lisp object
8844 to an integer. Move the doc here from the lisp manual.
8845 Treat all values not equal to 0 the same.
8846
1449fa1d
CY
88472012-02-06 Chong Yidong <cyd@gnu.org>
8848
8849 * doc.c (store_function_docstring): Avoid applying docstring of
8850 alias to base function (Bug#2603).
8851
3723ec07
AS
88522012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8853
8854 * .gdbinit (pp1, pv1): Remove redundant defines.
8855 (pr): Use pp.
8856
79c1cc1e
CY
88572012-02-04 Chong Yidong <cyd@gnu.org>
8858
8859 * nsterm.m: Declare a global (Bug#10694).
8860
d7f29f8e
EZ
88612012-02-04 Eli Zaretskii <eliz@gnu.org>
8862
cae07000
SM
8863 * w32.c (get_emacs_configuration_options):
8864 Include --enable-checking, if specified, in the return value.
d7f29f8e 8865
3b95a6f9
MR
88662012-02-04 Martin Rudalics <rudalics@gmx.at>
8867
8868 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8869 after rounding frame sizes. (Bug#9723)
8870
d6fa96a6
EZ
88712012-02-04 Eli Zaretskii <eliz@gnu.org>
8872
8873 * keyboard.c (adjust_point_for_property): Don't position point
8874 before BEGV. (Bug#10696)
8875
df0b2940
PE
88762012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8877
8878 Handle overflow when computing char display width (Bug#9496).
8879 * character.c (char_width): Return EMACS_INT, not int.
8880 (char_width, c_string_width): Check for overflow when
8881 computing the width; this is possible now that individual
8882 characters can have unbounded width. Problem introduced
8883 by merge from Emacs 23 on 2012-01-19.
8884
6bee44d6
MA
88852012-02-02 Michael Albinus <michael.albinus@gmx.de>
8886
8887 * dbusbind.c (Fdbus_register_method): Mention the return value
8888 :ignore in the docstring.
8889
44f92739
GM
88902012-02-02 Glenn Morris <rgm@gnu.org>
8891
1b9f60cc
GM
8892 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8893
44f92739
GM
8894 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8895 Unconditionally set to t. (Bug#10673)
8896 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8897 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8898 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8899
c5d3843c
KH
89002012-02-02 Kenichi Handa <handa@m17n.org>
8901
8902 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8903 0, do not call append_composite_glyph.
8904
159462d4 89052012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
8906
8907 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8908 NULL (Bug#6988).
8909 (x_produce_glyphs): If the component of a composition is a null
8910 string, set it->pixel_width to 1 to avoid zero-width glyph.
8911
78cef877
EZ
89122012-02-01 Eli Zaretskii <eliz@gnu.org>
8913
8914 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8915 first 2 arguments are identical. This makes inserting large
8916 output from a subprocess an order of magnitude faster on
8917 MS-Windows, where all sbrk'ed memory is always contiguous.
8918
97897668
GM
89192012-01-31 Glenn Morris <rgm@gnu.org>
8920
8921 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 8922 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
8923 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8924
31fd3586
GM
89252012-01-29 Glenn Morris <rgm@gnu.org>
8926
8927 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8928
0e24a8b2
CY
89292012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8930
8931 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8932
cc0adcb0
CY
89332012-01-28 Chong Yidong <cyd@gnu.org>
8934
8935 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8936
acc28cb9
CY
89372012-01-26 Chong Yidong <cyd@gnu.org>
8938
9c69cfb7
CY
8939 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8940
acc28cb9
CY
8941 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8942 repeat counts (Bug#10507).
8943
48da7392
GM
89442012-01-26 Glenn Morris <rgm@gnu.org>
8945
8946 * lread.c (syms_of_lread): Doc fix.
8947
14af5f7f
CY
89482012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8949
8950 * coding.c (encode_designation_at_bol): Change return value to
8951 EMACS_INT.
8952
0b21c100
CY
89532012-01-25 Chong Yidong <cyd@gnu.org>
8954
8955 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8956
3c2907f7
CY
89572012-01-21 Chong Yidong <cyd@gnu.org>
8958
8959 * floatfns.c (Fcopysign): Make the second argument non-optional,
8960 since nil is not allowed anyway.
8961
959ad23f
AS
89622012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8963
8964 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8965 (send_process): Likewise.
8966
34a02f46
MR
89672012-01-19 Martin Rudalics <rudalics@gmx.at>
8968
8969 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
8970 (Vwindow_persistent_parameters): Do not use Qstate.
8971 Rewrite doc-strings.
34a02f46 8972
1259009a 89732012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
8974
8975 * character.c (char_width): New function.
70d4fdf6
GM
8976 (Fchar_width, c_string_width, lisp_string_width):
8977 Use char_width (Bug#9496).
25ed9e61 8978
6a6ee00d
MR
89792012-01-16 Martin Rudalics <rudalics@gmx.at>
8980
8981 * window.c (Vwindow_persistent_parameters): New variable.
8982 (Fset_window_configuration, save_window_save): Handle persistent
8983 window parameters.
8984
c85efaf7
EZ
89852012-01-14 Eli Zaretskii <eliz@gnu.org>
8986
8987 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8988 thrashing the stack of the thread. (Bug#9087)
8989
5944709e
PE
89902012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8991
8992 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8993
e71f5d99
EZ
89942012-01-11 Eli Zaretskii <eliz@gnu.org>
8995
8996 * xdisp.c (rows_from_pos_range): Handle the case where the
8997 highlight ends on a newline. (Bug#10464)
8998 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8999 he end column for display of highlight that ends on a newline
9000 before a R2L line.
9001
ce316182
GM
90022012-01-11 Glenn Morris <rgm@gnu.org>
9003
9004 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9005 from load-path also when installation-directory is nil. (Bug#10208)
9006
5b43da69
GM
90072012-01-10 Glenn Morris <rgm@gnu.org>
9008
74cc8ff9
GM
9009 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9010
7d8d6e4e
GM
9011 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9012 Update template values to be closer to their typical values these days.
5b43da69 9013
a0db8d43
EZ
90142012-01-09 Eli Zaretskii <eliz@gnu.org>
9015
9016 * xdisp.c (rows_from_pos_range): Accept additional argument
9017 DISP_STRING, and accept any glyph in a row whose object is that
9018 string as eligible for mouse highlight. Fixes mouse highlight of
9019 display strings from overlays. (Bug#10464)
9020
9a0115ab 90212012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 9022
b9110d6a 9023 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
9024 * fileio.c (auto_saving_dir_umask): New static var.
9025 (Fmake_directory_internal): Use it.
9026 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9027 creating the directory. The old code temporarily assigns
9028 too-generous permissions to the directory.
9029 (do_auto_save_eh): Clear it.
b9110d6a 9030 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
9031 that the var is always cleared.
9032
6c1bd3f3
EZ
90332012-01-07 Eli Zaretskii <eliz@gnu.org>
9034
9035 * search.c (scan_buffer): Pass character positions to
9036 know_region_cache, not byte positions. (Bug#6540)
9037
069d2b50
L
90382012-01-07 LynX <_LynX@bk.ru> (tiny change)
9039
9040 * w32.c (sys_rename): Report EXDEV when rename of a directory
9041 fails because the target is on another logical disk. (Bug#10284)
9042
75bf0d33
DB
90432012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9044
9045 * xterm.c (x_embed_request_focus): New function.
9046
9047 * xterm.h: Add prototype.
9048
9049 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9050
1c6e5a32
GM
90512012-01-05 Glenn Morris <rgm@gnu.org>
9052
9053 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9054
651e947e
EZ
90552012-01-01 Eli Zaretskii <eliz@gnu.org>
9056
9057 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9058 Load gnutls_transport_set_lowat only if GnuTLS version is below
9059 2.11.1.
9060 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9061 GnuTLS versions below 2.11.1.
9062
3778cdd8
AL
90632011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9064
9065 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9066 to the doc string advising against its use for altering the way
9067 windows are scrolled.
9068
0e5317f7
KH
90692011-12-28 Kenichi Handa <handa@m17n.org>
9070
9071 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9072 coding-system ASCII compatible only when it does not produce BOM
9073 on encoding (Bug#10383).
9074
93d5ca1f
JD
90752011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9076
9077 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9078 can scroll.
9079 (create_and_show_popup_menu): Always use menu_position_func for
9080 Gtk3 (Bug#10361).
9081
ca22b785
AS
90822011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9083
9084 * callint.c (Fcall_interactively): Don't truncate prompt string.
9085
d048e1e6
EZ
90862011-12-23 Eli Zaretskii <eliz@gnu.org>
9087
9088 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9089 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 9090 resumed from there (after widening). (Bug#10360)
d048e1e6 9091
5ccaba1f
JD
90922011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9093
9094 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9095
204ee57f
JD
90962011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9097
b81d40f0
JB
9098 * nsterm.m (x_free_frame_resources):
9099 Release f->output_data.ns->miniimage.
204ee57f
JD
9100 (ns_index_color): Fix indentation. Do not retain
9101 color_table->colors[i].
9102
9103 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9104 before returning.
9105
9106 * nsfns.m (x_set_background_color): Assign return value from
9107 ns_index_color to face-background instead of NSColor*.
9108 (ns_implicitly_set_icon_type): Fix indentation.
9109 Change assignment in for loop to comparison.
9110
9111 * emacs.c (ns_pool): New variable.
9112 (main): Assign ns_pool.
9113 (Fkill_emacs): Call ns_release_autorelease_pool.
9114
9115 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9116 autorelease fdesc, release fdAttrs and tdict.
9117 (ns_get_covering_families): Release charset.
9118 (ns_findfonts): Release NSFontDescriptor created with new.
9119 (ns_uni_to_glyphs): Fix indentation.
9120 (setString): Release attrStr before assigning new value.
9121
c803b2b7
JD
91222011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9123
678f4426
JD
9124 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9125 and NS_IMPL_COCOA.
9126 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9127 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9128
cd394be1 91292011-12-18 David Reitter <reitter@cmu.edu>
678f4426 9130
5fecd5fc
JD
9131 * nsterm.m (ns_term_init): Subscribe for notifications
9132 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9133 to method trackingNotification in EmacsMenu.
9134
9135 * nsmenu.m (trackingMenu): New variable.
3771cb17 9136 (trackingNotification): New method (from Aquamacs).
5fecd5fc 9137 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 9138 from Aquamacs (Bug#7030).
678f4426
JD
9139
91402011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 9141
c803b2b7
JD
9142 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9143 (symbol_to_nsstring): Fix indentation.
9144 (ns_symbol_to_pb): New function.
cae07000
SM
9145 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9146 (Fns_rotate_cut_buffers_internal): Remove.
9147 (Fns_store_selection_internal): Rename from
c803b2b7
JD
9148 Fns_store_cut_buffer_internal.
9149 (ns_get_foreign_selection, Fx_own_selection_internal)
9150 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
9151 (Fns_get_selection_internal, Fns_store_selection_internal):
9152 Use ns_symbol_to_pb and check if return value is nil.
9153 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9154 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
9155 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9156 renamed to Sns_store_selection_internal.
9157 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9158 and remove this function.
9159 (ns_handle_selection_clear): Remove, never used.
9160 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9161 here.
9162
e1b01a3a
KB
91632011-12-17 Ken Brown <kbrown@cornell.edu>
9164
9165 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9166 GID is unknown (Bug#10257).
9167
2adb6e85
PE
91682011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9169
9170 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9171 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9172 which caused a build failure on GNU/Linux IA-64. This problem was
9173 introduced by my 2011-10-07 patch.
9174
d1d7b339
JL
91752011-12-15 Juri Linkov <juri@jurta.org>
9176
9177 * image.c (imagemagick_error): New function. (Bug#10112)
9178 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9179 Use `imagemagick_error' where ImageMagick functions return
9180 `MagickFalse'.
9181 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9182 proper order.
9183
100d5755
KH
91842011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9185
9186 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9187 fill background (Bug#8992).
9188
454592a6
MR
91892011-12-13 Martin Rudalics <rudalics@gmx.at>
9190
9191 * window.c (Vwindow_combination_resize)
9192 (Vwindow_combination_limit): Use t instead of non-nil in
9193 doc-strings.
61d4b438
MR
9194 (Vrecenter_redisplay): Add first sentence of doc-string on
9195 separate line.
53524d93 9196 (Frecenter): Fix doc-string typo.
454592a6 9197
3633e3aa
KH
91982011-12-11 Kenichi Handa <handa@m17n.org>
9199
9200 * coding.c (Funencodable_char_position): Pay attention to the
9201 buffer text relocation (Bug#9389).
9202
7b9d523a 92032011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 9204
7b9d523a
JD
9205 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9206 gtk_init (Bug#10100).
9207
b73189c6
EZ
92082011-12-10 Eli Zaretskii <eliz@gnu.org>
9209
9210 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9211 IT->string is nil. (Bug#10263)
9212
f7dfe5d6
JD
92132011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9214
83faebb4
JD
9215 * nsterm.h (x_free_frame_resources): Declare.
9216
f7dfe5d6
JD
9217 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9218 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9219
9220 * nsterm.h (ns_get_defaults_value): Declare.
9221
9222 * nsterm.m (ns_default): Call ns_get_defaults_value.
9223
7cd4e72c
EZ
92242011-12-09 Eli Zaretskii <eliz@gnu.org>
9225
9226 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9227 (Bug#10170)
9228
b34d7317
YM
92292011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9230
9231 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9232 that where the value of an _OBJC_* symbol points to is in the .bss
9233 section (Bug#10240).
9234
76470ad1
KH
92352011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9236
9237 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 9238 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 9239
745fff94
KH
92402011-12-08 Kenichi Handa <handa@m17n.org>
9241
9242 * ftfont.c (get_adstyle_property): Fix previous change
9243 (Bug#10233).
9244
6e44397c
JB
92452011-12-07 Juanma Barranquero <lekktu@gmail.com>
9246
9247 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9248 dirs from the default value of EMACSLOADPATH (bug#10208).
9249
7efa6272
GM
92502011-12-07 Glenn Morris <rgm@gnu.org>
9251
9252 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9253 installation and source directories as well. (Bug#10208)
9254
f6fc4d87
CY
92552011-12-06 Chong Yidong <cyd@gnu.org>
9256
9257 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9258
2bf26180
GM
92592011-12-06 Glenn Morris <rgm@gnu.org>
9260
9261 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9262 as an error, not just -1. (Bug#10217)
9263
3a6ad4f0
CY
92642011-12-05 Chong Yidong <cyd@gnu.org>
9265
9266 * keyboard.c (process_special_events): New function.
9267 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9268
75a3b399
PE
92692011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9270
9271 * coding.c (encode_designation_at_bol): Don't use uninitialized
9272 local variable (Bug#9318).
9273
c3c9e25e
KH
92742011-12-05 Kenichi Handa <handa@m17n.org>
9275
9276 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9277 return Qnil (Bug#8046, Bug#10193).
9278
5eb05ea3
KH
92792011-12-05 Kenichi Handa <handa@m17n.org>
9280
9281 * coding.c (encode_designation_at_bol): New args charbuf_end and
9282 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
9283 (coding_set_source): Return how many bytes coding->source was
9284 relocated.
9285 (coding_set_destination): Return how many bytes
9286 coding->destination was relocated.
9287 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 9288 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
9289
92902011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9291
9292 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9293 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9294 macro (Bug#9318).
9295
92962011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9297
9298 The following changes are to fix Bug#9318.
9299
a79703f5 9300 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
9301 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9302 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 9303 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 9304
7dbda6df
JB
93052011-12-05 Juanma Barranquero <lekktu@gmail.com>
9306
9307 * lisp.h (process_quit_flag): Fix external declaration.
9308
6d5eb5b0
SM
93092011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9310
9311 Don't macro-inline non-performance-critical code.
9312 * eval.c (process_quit_flag): New function.
9313 * lisp.h (QUIT): Use it.
9314
a0c3fad0
JD
93152011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9316
9317 * nsfns.m (get_geometry_from_preferences): New function.
9318 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9319
6c07aac2
AS
93202011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9321
9322 * emacs.c (Qkill_emacs): Define.
9323 (syms_of_emacs): Initialize it.
9324 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9325 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
9326 (quit_throw_to_read_char): Add parameter `from_signal'.
9327 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
9328 * lisp.h (QUIT): Call Fkill_emacs if requested.
9329
c052ead4
JD
93302011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9331
9332 * widget.c (update_wm_hints): Return if wmshell is null.
9333 (widget_update_wm_size_hints): New function.
9334
9335 * widget.h (widget_update_wm_size_hints): Declare.
9336
9337 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9338 widget_update_wm_size_hints (Bug#10104).
9339
9e49252b
EZ
93402011-12-03 Eli Zaretskii <eliz@gnu.org>
9341
9342 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9343 before a newline, prepare the bidi iterator for consuming the
9344 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 9345 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 9346
02b16839
JL
93472011-12-02 Juri Linkov <juri@jurta.org>
9348
9349 * search.c (Fword_search_regexp): New Lisp function created from
9350 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9351 (Fword_search_backward, Fword_search_forward)
9352 (Fword_search_backward_lax, Fword_search_forward_lax):
9353 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9354 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9355
0068070e
SM
93562011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9357
9358 * fileio.c (Finsert_file_contents): Move after-change-function call
9359 to before the "handled:" label, since all "goto handled" appear in
9360 cases where the *-change-functions have already been properly called
9361 (bug#10117).
9362
3360a3fc
AS
93632011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9364
9365 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9366 waiting for input. (Bug#10169)
9367
73d6c093
EZ
93682011-11-30 Eli Zaretskii <eliz@gnu.org>
9369
9370 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9371 verifies glyph row's hash code--we have just reallocated the
9372 glyphs, so their contents can be complete garbage. (Bug#10164)
9373
febe6bea
JB
93742011-11-30 Juanma Barranquero <lekktu@gmail.com>
9375
9376 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9377
801a4313
EZ
93782011-11-30 Eli Zaretskii <eliz@gnu.org>
9379
9380 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9381 attributes are tested _before_ calling verify_row_hash, to protect
9382 against GCC re-ordering of the tests. (Bug#10164)
9383
2b56b87e
JD
93842011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9385
9386 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9387
9388 * xterm.c (handle_one_xevent): Only set async_visible and friends
9389 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 9390 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
9391 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9392
dbf31225
PE
93932011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9394
9395 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9396 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9397 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9398 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9399 All uses changed to use GCPRO1 etc.
9400 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9401 Revert to old implementation (i.e., before 2011-03-11).
9402
1305621b
YM
94032011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9404
9405 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9406 of scroll runs so as to avoid assigning disabled bogus rows and
9407 unnecessary graphics copy operations.
9408
8c9afb46
EZ
94092011-11-27 Eli Zaretskii <eliz@gnu.org>
9410
9411 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9412 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9413 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9414 (malloc, free, realloc, calloc): Redirect to e_* only when
9415 compiling Emacs.
9416
9417 * lisp.h (GCTYPEBITS): Move before first use.
9418 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9419 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9420 this macro definition.
9421
9422 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9423 _MSC_VER.
9424
54e9e3bf
JD
94252011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9426
6d5eb5b0
SM
9427 * gtkutil.c (xg_create_frame_widgets):
9428 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
9429 present with Gtk+ 2.0.
9430
83aca1cb
PE
94312011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9432
9433 * fileio.c (Finsert_file_contents): Undo previous change; see
9434 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9435
5b76caa4
PE
94362011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9437
9438 Rename locals to avoid shadowing.
9439 * fileio.c (Finsert_file_contents):
9440 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9441 * process.c (wait_reading_process_output):
9442 Rename inner 'proc' to 'p' to avoid shadowing.
9443 Indent for consistency with usual Emacs style.
9444
8c535114
EZ
94452011-11-25 Eli Zaretskii <eliz@gnu.org>
9446
9447 * xdisp.c (redisplay_window): If cursor row is not fully visible
9448 after recentering, and scroll-conservatively is set to a large
9449 number, scroll window by a few more lines to make the cursor fully
9450 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
9451 (start_display): Don't move to the next line if the display should
9452 start at a newline that is part of a display vector or an overlay
9453 string. (Bug#10119)
8c535114 9454
fa4fdb5c
JL
94552011-11-24 Juri Linkov <juri@jurta.org>
9456
9457 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9458 after the `MagickPingImage' call. (Bug#10112)
9459
90ec88df
CY
94602011-11-23 Chong Yidong <cyd@gnu.org>
9461
9462 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9463
56e2e794
MR
94642011-11-23 Martin Rudalics <rudalics@gmx.at>
9465
9466 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9467 making another buffer current. (Bug#10114)
9468
b6e64c41
GM
94692011-11-23 Glenn Morris <rgm@gnu.org>
9470
9471 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9472
6b21de18
CY
94732011-11-23 Chong Yidong <cyd@gnu.org>
9474
9475 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9476 using it (Bug#5984).
9477
b12cd789
EZ
94782011-11-22 Eli Zaretskii <eliz@gnu.org>
9479
9480 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9481 and header-lines, as they don't have one computed for them.
9482 (Bug#10098)
9483
9484 * .gdbinit (prow): Make displayed values more self-explaining.
9485 Add row's hash code.
9486
261b6fd4
LMI
94872011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9488
9489 * process.c (wait_reading_process_output): Fix asynchrounous
9490 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 9491 (wait_reading_process_output): Add comment and URL.
261b6fd4 9492
e7cfd277
JD
94932011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9494
9495 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9496
a9b9b7f5
CY
94972011-11-21 Chong Yidong <cyd@gnu.org>
9498
9499 * window.c (Fnext_window, Fprevious_window): Doc fix.
9500
b0d15b4f
SM
95012011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9502
9503 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9504
fe7a3057
JB
95052011-11-20 Juanma Barranquero <lekktu@gmail.com>
9506
9507 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9508
d2999b1a
MR
95092011-11-20 Martin Rudalics <rudalics@gmx.at>
9510
9511 * window.c (Fset_window_combination_limit): Rename argument
9512 STATUS to LIMIT.
9513 (Vwindow_combination_limit): Remove "status" from doc-string.
9514
d5ff9cd0
AS
95152011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9516
9517 * m/ibms390.h: Remove.
9518 * m/ibms390x.h: Don't include "ibms390.h".
9519
a5bb9bd3
SM
95202011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9521
9522 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9523 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9524
cd1181db
JB
95252011-11-20 Juanma Barranquero <lekktu@gmail.com>
9526
9527 * casetab.c (Fset_case_table):
9528 * charset.c (Fcharset_after): Fix typos.
9529
615a3b8d 95302011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 9531
17e845af
PE
9532 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9533 Otherwise, valgrind does not work on some platforms.
9534 Problem reported by Andreas Schwab in
6a0bf43d
PE
9535 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9536 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9537 is set, removing the need for VIRT_ADDRESS_VARIES.
9538 (PURE_P): Use a more-efficient implementation that needs just one
9539 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9540 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9541 to 4 (xorl, subq, cmpq, setbe).
9542 * alloc.c (pure): Always extern now, since that's the
9543 VIRT_ADDR_VARIES behavior.
9544 (PURE_POINTER_P): Use a single comparison, not two, for
9545 consistency with the new puresize.h.
9546 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9547 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9548 Remove VIRT_ADDR_VARIES no longer needed.
9549
f8fe6f96
EZ
95502011-11-19 Eli Zaretskii <eliz@gnu.org>
9551
9552 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9553 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9554 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9555 behave as if the cursor position were at the window margin.
9556
9557 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9558 and the cursor position is out of bounds, behave as if the cursor
9559 position were at the window margin. (Bug#10075)
9560
df05a53c
CY
95612011-11-18 Chong Yidong <cyd@gnu.org>
9562
9563 * window.c (Fwindow_combination_limit): Make first argument
9564 non-optional, since it is meaningless for live windows like the
9565 selected window.
61ccba97 9566
2071918e
DA
95672011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9568
9569 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9570
b50a28de
SM
95712011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9572
9573 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9574 (graft_intervals_into_buffer): Simplify.
9575
015137db
EZ
95762011-11-18 Eli Zaretskii <eliz@gnu.org>
9577
9578 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9579 hash values of the two rows.
9580 (copy_row_except_pointers): Preserve the used[] arrays and the
9581 hash values of the two rows. (Bug#10035)
68c95424 9582 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
9583
9584 * xdisp.c (row_hash): New function, body extracted from
9585 compute_line_metrics.
9586 (compute_line_metrics): Call row_hash, instead of computing the
9587 hash code inline.
9588
9589 * dispnew.c (verify_row_hash): Call row_hash for computing the
9590 hash code of a row, instead of duplicating code from xdisp.c.
9591
9592 * dispextern.h (row_hash): Add prototype.
9593
a2addb04
TH
95942011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9595
9596 * frame.c (delete_frame): Don't delete the terminal when the last
9597 X frame is closed if emacs is built with GTK toolkit.
9598
df85d315
JB
95992011-11-17 Juanma Barranquero <lekktu@gmail.com>
9600
9601 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9602
a0c2d0ae
MR
96032011-11-17 Martin Rudalics <rudalics@gmx.at>
9604
9605 * window.c (Vwindow_splits): Rename to
9606 Vwindow_combination_resize. Suggested by Juri Linkov.
9607 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9608 of Vwindow_splits.
9609
58179cce
JB
96102011-11-16 Juanma Barranquero <lekktu@gmail.com>
9611
7877f373
JB
9612 * nsfns.m (Fns_font_name):
9613 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 9614
b6f67890
MR
96152011-11-16 Martin Rudalics <rudalics@gmx.at>
9616
9617 * window.h (window): Rename slot "nest" to "combination_limit".
9618 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9619 (Fset_window_nest): Rename to Fset_window_combination_limit.
9620 (Vwindow_nest): Rename to Vwindow_combination_limit.
9621 (recombine_windows, make_parent_window, make_window)
9622 (Fsplit_window_internal, saved_window)
9623 (Fset_window_configuration, save_window_save): Rename all
9624 occurrences of window_nest to window_combination_limit.
9625
c7015153
JB
96262011-11-15 Juanma Barranquero <lekktu@gmail.com>
9627
9628 * image.c (imagemagick_load_image): Fix typo.
9629
322ad6ec
EZ
96302011-11-14 Eli Zaretskii <eliz@gnu.org>
9631
9632 * xdisp.c (display_line): Move the call to
9633 highlight_trailing_whitespace before the call to
9634 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
9635 faces of all the glyphs to compute ROW's hash value.
9636 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 9637
f067b8ec
JB
96382011-11-14 Juanma Barranquero <lekktu@gmail.com>
9639
9640 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9641 just return (bug#10044).
9642
1e5b2111
EZ
96432011-11-12 Eli Zaretskii <eliz@gnu.org>
9644
7ef3cbd5
EZ
9645 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9646 with user-defined heap size. Bump the default size of the temacs
9647 heap to 27MB, to avoid memory warning when running temacs.
9648 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9649
1e5b2111
EZ
9650 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9651 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
9652 (verify_row_hash) [XASSERTS]: New function.
9653 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9654 that the hash value of glyph rows is correct.
1e5b2111 9655
89d61221
MR
96562011-11-12 Martin Rudalics <rudalics@gmx.at>
9657
9658 * window.h (window): Remove splits slot.
9659 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9660 (Fdelete_other_windows_internal, make_parent_window)
9661 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9662 (Fset_window_configuration, save_window_save): Don't deal with
9663 split status of windows.
9664 (saved_window): Remove splits slot.
9665 (Vwindow_splits): Rewrite doc-string.
9666
97f18cc8
JD
96672011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9668
9669 * xfns.c (unwind_create_frame):
9670 * nsfns.m (unwind_create_frame):
9671 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9672 Vframe_list (Bug#9999).
9673
22a648b4
DA
96742011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9675
0b381c7e 9676 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 9677
659afede
KH
96782011-11-11 Kenichi Handa <handa@m17n.org>
9679
9680 * callproc.c (Fcall_process): Set the member dst_multibyte of
9681 process_coding.
9682
9ac0394b
KH
96832011-11-11 Johan Bockgård <bojohan@gnu.org>
9684
9685 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9686 avoid a crash (bug#9496).
9687
2fbdc249
CY
96882011-11-09 Chong Yidong <cyd@gnu.org>
9689
9690 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9691 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9692
ac6b1f81
PE
96932011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9694
9695 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9696
09db192c
PE
96972011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9698
9699 Avoid some portability problems by eschewing 'extern inline' functions.
9700 The trivial performance wins aren't worth the portability hassles; see
9701 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9702 et seq.
9703 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9704 (window_box_width, window_box_left, window_box_left_offset)
9705 (window_box_right, window_box_right_offset): Undo previous change,
9706 by removing the "extern"s.
9707 * intervals.c (adjust_intervals_for_insertion)
9708 (adjust_intervals_for_deletion): Undo previous change,
9709 making these static again.
9710 (offset_intervals, temp_set_point_both, temp_set_point)
9711 (copy_intervals_to_string): No longer inline.
9712 * xdisp.c (window_text_bottom_y, window_box_width)
9713 (window_box_height, window_box_left_offset)
9714 (window_box_right_offset, window_box_left, window_box_right)
9715 (window_box): No longer inline.
9716
105216ed
CY
97172011-11-08 Chong Yidong <cyd@gnu.org>
9718
9719 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
9720 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9721 Signal an error if not a live window.
105216ed
CY
9722 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9723 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9724
ae9e237f
JB
97252011-11-07 Juanma Barranquero <lekktu@gmail.com>
9726
9727 * lisp.h (syms_of_abbrev): Remove declaration.
9728 Reported by CHENG Gao <chenggao@royau.me>.
9729
c7aa8333
EZ
97302011-11-07 Eli Zaretskii <eliz@gnu.org>
9731
9732 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9733 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9734 of temacs in GUI mode.
9735
be7f5545
MR
97362011-11-07 Martin Rudalics <rudalics@gmx.at>
9737
9738 * window.h: Declare delete_all_child_windows instead of
9739 delete_all_subwindows.
9740 * window.c (Fwindow_nest, Fset_window_nest)
9741 (Fset_window_new_total, Fset_window_new_normal)
9742 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9743 (delete_all_subwindows): Rename to delete_all_child_windows.
9744 (Fdelete_other_windows_internal, Fset_window_configuration):
9745 Call delete_all_child_windows instead of delete_all_subwindows.
9746 * frame.c (delete_frame): Call delete_all_child_windows instead
9747 of delete_all_subwindows.
9748
ca78dc43
PE
97492011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9750
9751 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9752 This is also needed for porting to any host where GC_MARK_STACK is
9753 not GC_MAKE_GCPROS_NOOPS.
9754 (which_symbols): Use it.
9755
a0241d01
KH
97562011-11-07 Kenichi Handa <handa@m17n.org>
9757
9758 * coding.c (coding_set_destination): Check coding->src_pos only
9759 when coding->src_object is a buffer (bug#9910).
9760
9761 * process.c (send_process): Set the member src_multibyte of coding
9762 to 0 (bug#9911) when sending a unibyte text.
9763
9764 * callproc.c (Fcall_process): Set the member src_multibyte of
9765 process_coding to 0 (bug#9912).
9766
a64bfdfa 97672011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
9768
9769 * xmenu.c (cleanup_widget_value_tree): New function.
9770 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9771 calling free_menubar_widget_value_tree directly (Bug#9830).
9772
cb41b32a
PE
97732011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9774
9775 Fix some portability problems with 'inline'.
9776 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9777 (window_box_width, window_box_left, window_box_left_offset)
9778 (window_box_right, window_box_right_offset): Declare extern.
9779 Otherwise, these inline functions do not conform to C99 and
9780 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9781 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9782 * intervals.c (adjust_intervals_for_insertion)
9783 (adjust_intervals_for_deletion): Now extern, because otherwise the
9784 extern inline functions 'offset_intervals' couldn't refer to it.
9785 (static_offset_intervals): Remove.
9786 (offset_intervals): Rewrite using the old contents of
9787 static_offset_intervals. The old version didn't conform to C99
9788 because an extern inline function contained a reference to an
9789 identifier with static linkage.
9790
b7041366
AS
97912011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9792
9793 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9794 GC.
9795
88a37c4d
EZ
97962011-11-06 Eli Zaretskii <eliz@gnu.org>
9797
9798 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9799 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9800 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9801 return Qleft_to_right.
9802
49745b39
CY
98032011-11-06 Chong Yidong <cyd@gnu.org>
9804
9805 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9806 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9807 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9808 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9809 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9810 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9811 (Fwindow_vscroll): Doc fix.
9812 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9813 argument, since it makes no sense to pass a live window and for
9814 consistency with window-child.
9815
1f05cd82
CS
98162011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9817
9818 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9819 support MSVC.
9820
22610910
JR
98212011-11-05 Jason Rumney <jasonr@gnu.org>
9822
9823 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9824 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9825 fonts (Bug#6029).
9826 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9827 bitwise arithmetic preventing use of unicode-sip and non-truetype
9828 opentype fonts.
9829
a06776b2
EZ
98302011-11-05 Eli Zaretskii <eliz@gnu.org>
9831
3ad924ba
EZ
9832 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9833 "emacs"-only part.
9834
a06776b2
EZ
9835 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9836 initialization code to keep similarity to xfns.c after changes
9837 from 2011-11-05.
9838
c9e7db78
JD
98392011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9840
a97f8f3f
JD
9841 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9842 (unwind_create_frame): New function (Bug#9943).
9843 (Fx_create_frame): Restructure code to be more similar to the one in
9844 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9845 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9846 Move terminal->reference_count++ just before making the frame official
9847 (Bug#9943).
9848
9849 * nsterm.m (x_free_frame_resources): New function.
9850 (x_destroy_window): Move code to x_free_frame_resources.
9851
c9e7db78 9852 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
9853 (Fx_create_frame, x_create_tip_frame):
9854 Move terminal->reference_count++ just before making the frame
75f1671a 9855 official. Move initialization of image_cache_refcount and
c9e7db78
JD
9856 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9857
a6fc3b5c
EZ
98582011-11-05 Eli Zaretskii <eliz@gnu.org>
9859
9860 Support MSVC build with newer versions of Visual Studio.
9861 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9862 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9863 nt/gmake.defs.
9864
9865 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9866 which are not supported by MSVC.
9867 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9868 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9869 bitfields.
9870 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9871 types in bitfields.
9872 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9873
9874 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9875
58179cce 98762011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
9877
9878 Support MSVC build with newer versions of Visual Studio.
9879 * w32.c: Don't include w32api.h for MSVC.
9880 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9881
9882 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9883 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9884 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9885 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9886 e_* cousins.
9887 (alloca) [_MSC_VER]: Define to _alloca.
9888
9889 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9890
9891 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9892
a58c13ed
EZ
98932011-11-04 Eli Zaretskii <eliz@gnu.org>
9894
9895 * xdisp.c (note_mouse_highlight): If either of
9896 previous/next-single-property-change returns nil, treat that as
9897 the beginning or the end of the buffer. (Bug#9955)
9898
fe0b6370
JD
98992011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9900
a58c13ed 9901 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
9902 label is not null (Bug#9951).
9903 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9904 may be NULL.
9905
89bd5ee1
EZ
99062011-11-04 Eli Zaretskii <eliz@gnu.org>
9907
9908 * window.c (Fwindow_body_size): Mention in the doc string that the
9909 return value is in frame's canonical units. (Bug#9949)
9910
84c3edb9
EZ
99112011-11-03 Eli Zaretskii <eliz@gnu.org>
9912
4e2fb5c7
EZ
9913 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9914
84c3edb9 9915 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 9916 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 9917 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 9918
bc17a887
EZ
99192011-11-01 Eli Zaretskii <eliz@gnu.org>
9920
9921 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9922 Don't stop backward scan on the continuation glyph, even though
9923 its CHARPOS is positive.
6d5eb5b0
SM
9924 (mouse_face_from_buffer_pos, note_mouse_highlight):
9925 Rename cover_string to disp_string.
bc17a887 9926
4ee88440
MR
99272011-11-01 Martin Rudalics <rudalics@gmx.at>
9928
9929 * window.c (temp_output_buffer_show): Don't use
9930 Vtemp_buffer_show_specifiers.
9931 (Vtemp_buffer_show_specifiers): Remove unused variable.
9932
c2ff3c02
EZ
99332011-10-30 Eli Zaretskii <eliz@gnu.org>
9934
9935 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9936 past the beginning of the current glyph matrix.
9937
58179cce 99382011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
9939
9940 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9941 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9942 HAVE_GTK3 (Bug#9869).
b77a6a7f 9943
3b574623
JD
9944 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9945 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9946
b77a6a7f
JD
9947 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9948
9949 * xterm.c: Declare x_handle_net_wm_state to return int.
9950 (handle_one_xevent): Check if we are iconified but don't have
9951 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9952 (get_current_wm_state): Return non-zero if not hidden,
9953 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9954 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9955 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9956 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9957
196e41e4
PE
99582011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9959
9960 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9961 so that this new function doesn't get optimized away by a
9962 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9963
021f2e1a
AS
99642011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9965
9966 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9967
8b058d44
EZ
99682011-10-29 Eli Zaretskii <eliz@gnu.org>
9969
9970 Fix the `xbytecode' command.
9971 * .gdbinit (xprintbytestr): New command.
b50a28de 9972 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
9973 (xbytecode): Print the byte-code string as well.
9974
4452fb80
EZ
99752011-10-29 Kim Storm <storm@cua.dk>
9976
8b058d44
EZ
9977 * alloc.c (which_symbols): New function.
9978
21b72067
AS
99792011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9980
9981 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9982 line. (Bug#9903)
9983
83ed7b5c
GM
99842011-10-29 Glenn Morris <rgm@gnu.org>
9985
9986 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9987 Not clear what it was for, and it causes various bugs. (Bug#9839)
9988
5a7a728b
EZ
99892011-10-28 Eli Zaretskii <eliz@gnu.org>
9990
9991 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9992 possible random value that matches one of those tested as
9993 condition to clear the mouse face.
9994
d3d0842f
CY
99952011-10-28 Chong Yidong <cyd@gnu.org>
9996
9997 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9998
31b39d13
DN
99992011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10000
10001 * window.c (make_window): Initialize phys_cursor_on_p.
10002
9aba6043
SM
100032011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10004
10005 * lisp.h (struct Lisp_Symbol): Update comments.
10006
c20992f4
JB
100072011-10-28 Juanma Barranquero <lekktu@gmail.com>
10008
10009 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10010
db4f02f2
EZ
100112011-10-28 Eli Zaretskii <eliz@gnu.org>
10012
10013 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10014 <oslsachem@gmail.com> for helping to debug this.
10015
10016 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10017 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10018 (g_b_init_get_glyph_outline_w): New static variables.
10019 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10020 (GetGlyphOutlineW_Proc): New typedefs.
10021 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
10022 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10023 New functions.
10024 (w32font_open_internal, compute_metrics):
10025 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
10026 instead of calling the "wide" APIs directly.
10027
10028 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10029
10030 * w32.h (syms_of_w32font): Add prototype.
10031
87e68db4
JB
100322011-10-27 Juanma Barranquero <lekktu@gmail.com>
10033
10034 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10035 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10036 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10037 (Fmove_to_window_line): Doc fix.
10038
435c1d67
CY
100392011-10-27 Chong Yidong <cyd@gnu.org>
10040
10041 * process.c (make_process): Set gnutls_state to NULL.
10042
10043 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10044 non-NULL, regardless of GNUTLS_INITSTAGE.
10045 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10046 an error. Set process slots as soon as we allocate them.
10047
10048 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10049
9c6c6f49
CY
100502011-10-27 Chong Yidong <cyd@gnu.org>
10051
9aba6043
SM
10052 * gnutls.c (emacs_gnutls_deinit): New function.
10053 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
10054 (Fgnutls_deinit, Fgnutls_boot): Use it.
10055
10056 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10057 (deactivate_process): Call emacs_gnutls_deinit.
10058
657d08d3
JB
100592011-10-27 Juanma Barranquero <lekktu@gmail.com>
10060
10061 * image.c (x_create_x_image_and_pixmap):
10062 * w32.c (sys_rename, w32_delayed_load):
10063 * w32font.c (fill_in_logfont):
10064 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10065
5430d399
JB
100662011-10-26 Juanma Barranquero <lekktu@gmail.com>
10067
10068 * w32fns.c (w32_default_color_map): New function,
10069 extracted from Fw32_default_color_map.
a7ef684b 10070 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 10071
fe0055fa
PE
100722011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10073
10074 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10075
e6346438
SM
100762011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10077
10078 * keyboard.c (test_undefined): New function (bug#9751).
10079 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10080
e112cc37
ET
100812011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10082
10083 * sysdep.c (init_sys_modes): Fix the check for the controlling
10084 terminal (Bug#6649).
10085
7b5d6677
EZ
100862011-10-20 Eli Zaretskii <eliz@gnu.org>
10087
10088 * dispextern.h (struct bidi_it): New member next_en_type.
10089
10090 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10091 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10092 current character, check also for next_en_type being WEAK_EN.
10093 (bidi_resolve_weak): Don't enter the expensive loop if the current
10094 position is before next_en_pos. Record the bidi type of the first
10095 non-ET, non-BN character we find, in addition to its position.
10096 (bidi_level_of_next_char): Invalidate next_en_type when
10097 next_en_pos is over-stepped.
10098
7da0b018
PE
100992011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10100
10101 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10102 * editfns.c: Rewrite current-time-zone so that it invokes
10103 the equivalent of (format-time-string "%Z") to get the time zone name.
10104 This fixes a bug when the time zone name contains characters that
10105 need converting from the system time locale to Emacs internal format.
10106 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10107 that patch fixed format-time-string to do the conversion, but
10108 I forgot to fix current-time-zone.
10109 (format_time_string): New function, containing most of
10110 what Fformat_time_string used to contain.
10111 (Fformat_time_string): Rewrite in terms of format_time_string.
10112 This doesn't change this function's behavior.
10113 (current-time-zone): Rewrite to use format_time_string.
10114 This fixes the bug reported by Michael Schierl in
10115 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10116 Jason Rumney's 2007-06-07 change worked around this bug, but
10117 didn't fix it.
10118 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10119
8547b010
EZ
101202011-10-19 Eli Zaretskii <eliz@gnu.org>
10121
10122 * xdisp.c (start_display): If the character at POS is displayed
10123 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
10124 (try_window_reusing_current_matrix): If a line ends in a display
10125 vector or the next line starts in a display vector, continue
10126 redrawing the window even though the character position of
10127 start_row was reached.
8547b010
EZ
10128 (Bug#9771, part 2)
10129
4e948d15
CY
101302011-10-18 Chong Yidong <cyd@gnu.org>
10131
10132 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10133 with nobreak-char-display too.
10134
4787455f
EZ
101352011-10-18 Eli Zaretskii <eliz@gnu.org>
10136
10137 Fix part 3 of bug#9771.
10138 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10139 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10140 non-neutral characters if the current character is a paragraph
10141 separator (a.k.a. Newline). This avoids running the same
10142 expensive loop twice, once when we consume the preceding newline
10143 and the other time when the line actually needs to be displayed.
10144 Avoid the loop when we see neutrals on the base embedding level
10145 following a character whose directionality is the same as the
10146 paragraph's. This avoids running the expensive loop when a line
10147 ends in a long sequence of neutrals, like control characters.
10148 Add assertion against STRONG_AL type. Slightly rearrange code
10149 that determines the type of a neutral given the first non-neutral
10150 that follows it.
10151 (bidi_level_of_next_char): Set next_en_pos to zero when
10152 invalidating its info.
10153
2c91f553
EZ
101542011-10-17 Eli Zaretskii <eliz@gnu.org>
10155
10156 * xdisp.c (push_display_prop): Determine whether to record string
10157 or buffer position by IT->string, not by IT->method. Allow
10158 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
10159 (move_it_vertically_backward): Don't look for character position
10160 immediately after the newline when in a continuation line.
10161 (Bug#9771, part 1)
2c91f553 10162
c7b08b0d
MR
101632011-10-15 Martin Rudalics <rudalics@gmx.at>
10164
10165 * window.c (coordinates_in_window): Rewrite and delabelize
10166 vertical border check. (Bug#5357) (Bug#9618)
10167
6b02f655
SM
101682011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10169
10170 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10171 errors in XSetWindowBorder (bug#9310).
10172
81d40c92
DA
101732011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10174
10175 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10176 avoid crash when xmalloc overrun checking is enabled.
10177
d4172c3b
EZ
101782011-10-13 Eli Zaretskii <eliz@gnu.org>
10179
10180 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10181 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10182 cursor motion with <left> and <right> arrow keys.
10183
10184 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10185 some callers set that themselves.
10186
b00eea75
EZ
101872011-10-12 Eli Zaretskii <eliz@gnu.org>
10188
10189 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10190 display string and the previous row comes from the same string and
10191 is empty. (Bug#9739) (Bug#9738)
10192
8fe012c4
SM
101932011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10194
10195 * doc.c (get_doc_string): Encode file name (bug#9735).
10196
0074aef2
EZ
101972011-10-12 Eli Zaretskii <eliz@gnu.org>
10198
79beb178
EZ
10199 * bidi.c (bidi_level_of_next_char):
10200 * xdisp.c (get_visually_first_element): Remove old incorrect
10201 comments regarding the Unicode Line Separator character.
10202
0074aef2
EZ
10203 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10204
6e4b3fbe
DA
102052011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10206
10207 * alloc.c (Fgc_status): Do not access beyond zombies array
10208 boundary if nzombies > MAX_ZOMBIES.
10209 * alloc.c (dump_zombies): Add missing format specifier.
10210
0324f3af
PE
102112011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10212
b5525cac
PE
10213 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10214 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10215
0324f3af
PE
10216 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10217 Some packages use them to denote characters with modifiers.
10218
e9b5f888
AS
102192011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10220
10221 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10222 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10223 matching a pp-number. Rename parameter var to var1.
10224
127827c0
SM
102252011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10226
10227 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10228
c8fd3bd0
GM
102292011-10-08 Glenn Morris <rgm@gnu.org>
10230
10231 * callint.c (Fcall_interactively): Give a more explicit error for the
10232 'c' case with a non-character input. (Bug#8479)
10233
352ec8ff
EZ
102342011-10-08 Eli Zaretskii <eliz@gnu.org>
10235
03669ccb
EZ
10236 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10237 lines.
7061c986
EZ
10238 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10239 lines that are hscrolled on the left.
03669ccb 10240
352ec8ff
EZ
10241 * dispnew.c (buffer_posn_from_coords): Account for a possible
10242 presence of header-line. (Bug#4426)
10243
a66cfb1c
SM
102442011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10245
6b02f655
SM
10246 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10247 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 10248
7c5ee88e
PE
102492011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10250
10251 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10252 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10253 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10254 this makes Emacs dump core during garbage collection on rare
10255 occasions. sizeof is obviously inferior to offsetof here, so
10256 stick with offsetof.
10257 (GC_POINTER_ALIGNMENT): New macro.
10258 (mark_memory): Omit 3rd (offset) arg; caller changed.
10259 Don't assume EMACS_INT alignment is the same as pointer alignment.
10260
df1bbe5b
SM
102612011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10262
10263 * keyboard.c (read_key_sequence_remapped): New var.
10264 (read_key_sequence): Compute remapping in the right buffer.
10265 (command_loop_1): Use read_key_sequence's remapping directly.
10266
51553db6
SM
102672011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10268
32c1fffd
SM
10269 * dired.c (file_name_completion): Don't expand file name.
10270 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10271 before checking file name handler.
10272
51553db6
SM
10273 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10274 they've been requested explicitly (bug#9591).
10275
b6bd1599 102762011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
10277
10278 * keymap.c (Fsingle_key_description): Use make_specified_string
10279 instead of build_string to build string from push_key_description.
10280 (Bug#5193)
10281
f701dc2a
PE
102822011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10283
4222c55d
PE
10284 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10285 This fixes a Y2038 bug on 64-bit hosts.
10286 * buffer.c (reset_buffer):
10287 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10288 (Fclear_buffer_auto_save_failure):
10289 Use 0, not -1, to represent an unset failure time, since time_t
10290 might not be signed.
10291
f701dc2a
PE
10292 Remove dependency on glibc malloc internals.
10293 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10294 Move back here from lisp.h, but with their new implementations.
10295 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10296 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10297 * charset.c (charset_table_init): New static var.
10298 (syms_of_charset): Use it instead of xmalloc. This removes a
10299 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10300 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10301 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10302 Move back to alloc.c.
10303 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10304 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10305
9ceebf39
JD
103062011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10307
10308 * nsterm.m (windowDidResize): Call x_set_window_size only when
10309 ns_in_resize is true. Otherwise set pixelwidth/height and
10310 call change_frame_size (Bug#9628).
10311
cb993c58
PE
103122011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10313
3930c88b
PE
10314 Port --enable-checking=all to Fedora 14 x86-64.
10315 * charset.c (syms_of_charset): Also account for glibc malloc's
10316 internal overhead when calculating the initial malloc maximum.
10317
cb993c58
PE
10318 Port --enable-checking=all to Fedora 14 x86.
10319 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10320 Move to lisp.h.
10321 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10322 (overrun_check_realloc, overrun_check_free):
10323 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10324 That way, xmalloc returns a properly-aligned pointer even if
10325 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10326 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10327 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10328 into account when calculating the initial malloc maximum.
10329 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10330 Move here from alloc.c, so that charset.c can use it too.
10331 Properly align; the old code wasn't right for common 32-bit hosts
10332 when configured with --enable-checking=all.
10333 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10334 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10335
31bed486
EZ
103362011-09-29 Eli Zaretskii <eliz@gnu.org>
10337
04c70788 10338 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
10339 use EDOM.
10340
fbcaa2f3
EZ
103412011-09-28 Eli Zaretskii <eliz@gnu.org>
10342
10343 * xdisp.c (compute_display_string_end): If there's no display
10344 string at CHARPOS, return -1.
10345
10346 * bidi.c (bidi_fetch_char): When compute_display_string_end
10347 returns a negative value, treat the character as a normal
10348 character not covered by a display string. (Bug#9624)
10349
a239d4e9
JB
103502011-09-28 Juanma Barranquero <lekktu@gmail.com>
10351
10352 * lread.c (Fread_from_string): Fix typo in docstring.
10353
88652fd5
EZ
103542011-09-27 Eli Zaretskii <eliz@gnu.org>
10355
10356 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10357 newline, reseat the iterator instead of bidi-iterating there one
10358 character at a time. (Bug#9610)
32c1fffd
SM
10359 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10360 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 10361
ed497dd4
AS
103622011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10363
10364 * lread.c (readevalloop): Use correct code for NBSP.
10365 (read1): Likewise. (Bug#9608)
10366
b2bf61aa
MA
103672011-09-25 Michael Albinus <michael.albinus@gmx.de>
10368
10369 * dbusbind.c (Fdbus_register_signal): When service is not
10370 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10371
32bbb17c
GM
103722011-09-25 Glenn Morris <rgm@gnu.org>
10373
10374 * buffer.c (truncate-lines): Doc fix.
10375
94e0933e
CY
103762011-09-24 Chong Yidong <cyd@stupidchicken.com>
10377
10378 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10379 (Fset_window_next_buffers): Doc fix.
10380
cddde921
GM
103812011-09-24 Glenn Morris <rgm@gnu.org>
10382
10383 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10384
1260aef1
PE
103852011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10386
25b4bfa0
PE
10387 Fix minor problems found by static checking.
10388 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
10389 * indent.c (Fvertical_motion): Fix == vs = typo.
10390
e3cbd34b
EZ
103912011-09-24 Eli Zaretskii <eliz@gnu.org>
10392
a66cfb1c
SM
10393 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10394 Default value is now t. Doc fix.
6bf7006f 10395
e3cbd34b 10396 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 10397 logic when moving up, not only when moving down. Fix the
e3cbd34b 10398 confusing name and values of the it_overshoot_expected variable;
32c1fffd 10399 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
10400
10401 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10402 CHARPOS is covered by a display string which includes newlines.
10403 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10404 is covered by a display string with embedded newlines.
10405
a3de0cbd
MA
104062011-09-24 Michael Albinus <michael.albinus@gmx.de>
10407
10408 * dbusbind.c (Fdbus_register_signal): Add match rule to
10409 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
10410 (Fdbus_register_method, Vdbus_registered_objects_table):
10411 Fix docstring.
a3de0cbd 10412
b260039d
JM
104132011-09-24 Jim Meyering <meyering@redhat.com>
10414
32c1fffd 10415 do not ignore write error for any output size
b260039d
JM
10416 The previous change was incomplete.
10417 While it makes emacs --batch detect the vast majority of stdout
10418 write failures, errors were still ignored whenever the output size is
10419 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10420 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10421 && echo FAIL: ignored write error
10422 FAIL: ignored write error
10423 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10424 && echo FAIL: ignored write error
10425 FAIL: ignored write error
10426 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10427
8eca8a7c
AS
104282011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10429
10430 * emacs.c (Fkill_emacs): In noninteractive mode exit
10431 non-successfully if a write error occurred on stdout. (Bug#9574)
10432
3341db62
EZ
104332011-09-21 Eli Zaretskii <eliz@gnu.org>
10434
10435 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10436 the xassert test.
10437
10438 * dispextern.h (struct it): Update the comment documenting what
10439 can it->OBJECT be.
10440
8c203dbf
EZ
104412011-09-20 Eli Zaretskii <eliz@gnu.org>
10442
10443 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10444 a display string, extend search for cursor position to end of row.
10445 (find_row_edges): If the row ends in a newline from a display
10446 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10447 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
10448 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10449 non-empty line. Fixes confusing cursor motion with arrow keys at
10450 the beginning of a line that starts with whitespace.
8c203dbf 10451
a4824228
LMI
104522011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10453
10454 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10455 (bug#9493).
10456
33ed493b
CY
104572011-09-18 Chong Yidong <cyd@stupidchicken.com>
10458
10459 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10460 boolean (Bug#9154).
10461
56cd55c8
EZ
104622011-09-18 Eli Zaretskii <eliz@gnu.org>
10463
10464 * xdisp.c (display_line): Record maximum and minimum buffer
10465 positions even if no glyphs were produced (e.g., by a zero-width
10466 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10467 buffer positions that will be removed from the glyph row because
10468 they don't fit.
c02dcedf
EZ
10469 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10470 column is beyond frame width: don't subtract 1 "pixel" when
10471 computing width of the stretch.
3e62b7e0
EZ
10472 (reseat_at_next_visible_line_start): Undo the change made on
10473 2011-09-17 that saved paragraph information and restored it after
10474 the call to `reseat'. (Bug#9545)
56cd55c8 10475
5ed99d36 104762011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
10477
10478 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10479 and turn window cursor on if cleared (Bug#9415).
10480
5ed99d36 104812011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
10482
10483 * search.c (boyer_moore): Take unibyte characters from pattern
10484 literally. (Bug#9458)
10485
9bade7b2
EZ
104862011-09-18 Eli Zaretskii <eliz@gnu.org>
10487
10488 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10489
e5e9d610
PE
104902011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10491
87e4427a
PE
10492 Fix minor problem found by static checking.
10493 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10494 initialized, to pacify gcc -Wuninitialized.
10495
e5e9d610
PE
10496 * fileio.c: Report proper errno when syscall falls.
10497 (Finsert_file_contents): Save and restore errno,
10498 so that report_file_error outputs the correct diagnostic.
10499 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10500
a1674f0b
EZ
105012011-09-18 Eli Zaretskii <eliz@gnu.org>
10502
10503 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10504
fbfb6dd4
EZ
105052011-09-17 Eli Zaretskii <eliz@gnu.org>
10506
10507 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10508 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10509
bb187662
EZ
105102011-09-17 Eli Zaretskii <eliz@gnu.org>
10511
1137e8b8 10512 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 10513 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
10514
10515 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10516 (bidi_find_paragraph_start): Search back for paragraph beginning
10517 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10518 (bidi_move_to_visually_next): Only trigger paragraph-related
10519 computations when the last character is a newline or at EOB, not
10520 just any NEUTRAL_B. (Bug#9470)
10521
bb187662
EZ
10522 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10523 truncated lines if point is covered by a display string. (Bug#9524)
10524
2e621251
PE
105252011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10526
10527 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10528 (cons_to_x_long): New function.
10529 (lisp_data_to_selection_data): Use it. Correct the test for
10530 short-versus-long data; it was negated. Break out of vector
10531 loop, for efficiency, when a long datum is discovered.
10532
91a15bc6
SM
105332011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10534
10535 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10536
b41c3a35
EZ
105372011-09-16 Eli Zaretskii <eliz@gnu.org>
10538
10539 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10540 GCC PR/17406) by declaring this function with external scope.
10541
7812ba2d
PE
105422011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10543
10544 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10545 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10546
cf7edc2a
AS
105472011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10548
10549 * editfns.c (Fformat): Correctly handle text properties on "%%".
10550
bd01620e
EZ
105512011-09-15 Eli Zaretskii <eliz@gnu.org>
10552
10553 * xterm.c (x_draw_composite_glyph_string_foreground):
10554 * w32term.c (x_draw_composite_glyph_string_foreground):
10555 * term.c (encode_terminal_code):
10556 * composite.c (composition_update_it, get_composition_id):
10557 * xdisp.c (get_next_display_element)
10558 (fill_composite_glyph_string): Add comments about special meaning
10559 of TAB characters in a composition.
10560
a02719a3
PE
105612011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10562
10563 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
10564 This occurs when processing a multibyte format.
10565 Problem reported by Wolfgang Jenker.
a02719a3 10566
72589a3c
JB
105672011-09-15 Johan Bockgård <bojohan@gnu.org>
10568
10569 * xdisp.c (try_cursor_movement): Only check for exact match if
10570 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10571
1c14176c
PE
105722011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10573
10574 Remove unused external symbols.
10575 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10576 * xdisp.c (calc_pixel_width_or_height): Now static.
10577 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10578 * indent.c (check_display_width):
10579 * w32term.c: Fix comment to match code.
10580 * xterm.c, xterm.h (x_catching_errors): Remove.
10581
d2eea5b5
PE
105822011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10583
10584 * xselect.c: Use signed conversions more consistently (Bug#9498).
10585 (selection_data_to_lisp_data): Assume incoming selection data are
10586 signed integers, not unsigned. This is to be consistent with
10587 outgoing selection data, which was modified to use signed integers
10588 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10589 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10590 expects long, not unsigned long.
10591
46888499
EZ
105922011-09-14 Eli Zaretskii <eliz@gnu.org>
10593
10594 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10595 computation of loop end. Reported by Johan Bockgård
10596 <bojohan@gnu.org>.
10597
ef8ef9fb
CY
105982011-09-13 Chong Yidong <cyd@stupidchicken.com>
10599
10600 * frame.c (Fother_visible_frames_p): Function deleted.
10601
fa819fed
EZ
106022011-09-12 Eli Zaretskii <eliz@gnu.org>
10603
10604 * indent.c (compute_motion): Process display vector front to back
10605 rather than the other way around. (Bug#2496)
10606
2ba8e008
SM
106072011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10608
10609 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10610
20f53c69
CY
106112011-09-11 Chong Yidong <cyd@stupidchicken.com>
10612
10613 * minibuf.c (Fread_from_minibuffer): Doc fix.
10614
d562d7a4
EZ
106152011-09-11 Eli Zaretskii <eliz@gnu.org>
10616
10617 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10618 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10619
1c4d7f3d
LMI
106202011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10621
10622 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10623 value for non-existent files.
10624
b885bf36
EZ
106252011-09-11 Eli Zaretskii <eliz@gnu.org>
10626
10627 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10628 set its "size" to -1. This will set the modtime_size field of
10629 the corresponding buffer to -1, which is what
10630 verify-visited-file-modtime expects for files that do not exist.
10631 (Bug#9139)
10632
6612f0bf
PE
106332011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10634
10635 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10636 here ...
10637 * lisp.h: ... from here. push_key_description is no longer
10638 defined in keyboard.c, so its declaration should not be in
10639 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10640 logically belongs with push_key_description.
10641
dfb3f755
PE
106422011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10643
10644 * buffer.h: Include <sys/types.h> instead of <time.h>.
10645 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10646 Problem reported by Herbert J. Skuhra.
10647
3134906c
LMI
106482011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10649
10650 * xml.c (parse_region): Make the parsing work for
10651 non-comment-starting XML files again (bug#9144).
10652
8d903f4e
AS
106532011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10654
10655 * image.c (gif_load): Fix calculation of bottom and right corner.
10656 (Bug#9468)
10657
80ad64f4
EZ
106582011-09-10 Eli Zaretskii <eliz@gnu.org>
10659
10660 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10661 redisplay in small windows.
10662
208a048d
EZ
106632011-09-09 Eli Zaretskii <eliz@gnu.org>
10664
10665 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10666
9b1c252e
MR
106672011-09-08 Martin Rudalics <rudalics@gmx.at>
10668
10669 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10670 Operate on live windows only.
10671
2949f33b
JB
106722011-09-08 Juanma Barranquero <lekktu@gmail.com>
10673
10674 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10675
e08dcafd
EZ
106762011-09-07 Eli Zaretskii <eliz@gnu.org>
10677
10678 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10679 only under bidi iteration.
10680
115b96bd
JD
106812011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10682
10683 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10684
c8199d0f
PE
106852011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10686
10687 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10688 Without this fix, the command to link temacs failed due to an
10689 undefined symbol __builtin_isnan. This is because
10690 /usr/include/iso/math_c99.h #defines isnan(x) to
10691 __builtin_isnan(x), but the bundled gcc, which identifies itself
10692 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10693 a __builtin_isnan.
10694 * floatfns.c (isnan): #undef, and then #define to a clone of
10695 what's in data.c.
10696 (Fisnan): Always define, since it's always available now.
10697 (syms_of_floatfns): Always define isnan at the Lisp level.
10698
e39b275c 106992011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
10700
10701 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10702
b2db44d9 107032011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 10704
f4af5137 10705 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
10706 The previous code assumed that file offsets (off_t values) fit in
10707 EMACS_INT variables, which is not true on typical 32-bit hosts.
10708 The code messed up by falsely reporting buffer overflow in cases
10709 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10710 when "big" contains more than 2**29 bytes, even though this
10711 inserts just one byte and does not overflow the buffer.
10712 (Finsert_file_contents): Store file offsets as off_t
10713 values, not as EMACS_INT values. Check for overflow when
10714 converting between EMACS_INT and off_t. When checking for
10715 buffer overflow or for overlap, take the offsets into account.
10716 Don't use EMACS_INT for small values where int suffices.
10717 When checking for overlap, fix a typo: ZV was used where
10718 ZV_BYTE was intended.
10719 (Fwrite_region): Don't assume off_t fits into 'long'.
10720 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10721
ecfc0a49
MA
107222011-09-05 Michael Albinus <michael.albinus@gmx.de>
10723
10724 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10725
6511acf2 107262011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 10727
0999621a 10728 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
10729
10730 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 10731 (esprintf, exprintf, evxprintf): New functions.
62f19c19 10732 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 10733 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
10734 (modify_event_symbol): Do not assume that the length of
10735 name_alist_or_stem is safe to alloca and fits in int.
10736 (Fexecute_extended_command): Likewise for function name and binding.
10737 (Frecursion_depth): Wrap around reliably on integer overflow.
10738 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10739 since some callers pass EMACS_INT values.
10740 (Fsingle_key_description): Don't crash if symbol name contains more
10741 than MAX_ALLOCA bytes.
10742 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10743 (get_minibuffer): Arg is now EMACS_INT, not int.
10744 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 10745 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
10746 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10747
2be7d702
PE
10748 * dbusbind.c (signature_cat): New function.
10749 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
10750 Do not overrun buffer; instead, report string overflow.
10751
9d1df220
PE
10752 * dispnew.c (add_window_display_history): Don't overrun buffer.
10753 Truncate instead; this is OK since it's just a log.
10754
33ef5c64
PE
10755 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10756 even if the time zone offset is outlandishly large.
10757 Don't mishandle offset == INT_MIN.
10758
66c6fdd5
PE
10759 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10760 when creating daemon; the previous buffer-overflow check was incorrect.
10761
d749b01b
PE
10762 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10763 which has the guts of the old verror function.
10764
b5cd1905
PE
10765 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10766 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10767
6e1a67fb
PE
10768 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10769 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 10770 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 10771 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
10772 length of string rather than counting it via multiple sprintfs;
10773 that's simpler and more reliable.
c21721cc
PE
10774 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10775 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10776 sprintf, in case result does not fit in int.
10777
c57b67fc
PE
10778 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10779 (fontset_from_font): Print it.
10780
8a401434
PE
10781 * frame.c (tty_frame_count): Now printmax_t, not int.
10782 (make_terminal_frame, set_term_frame_name): Print it.
10783 (x_report_frame_params): In X, window IDs are unsigned long,
10784 not signed long, so print them as unsigned.
10785 (validate_x_resource_name): Check for implausibly long names,
10786 and don't assume name length fits in 'int'.
10787 (x_get_resource_string): Don't blindly alloca invocation name;
10788 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10789 not fit in int.
10790
6e1a67fb
PE
10791 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10792 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
10793 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10794
0df02bf3
PE
10795 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10796 Use esprintf, not sprintf, in case result does not fit in int.
10797
48e30793
PE
10798 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10799 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10800 it as a large positive number.
10801 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10802 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10803
a66ff6d8
PE
10804 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10805 in case result does not fit in int.
10806
aca216ff
PE
10807 * print.c (float_to_string): Detect width overflow more reliably.
10808 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10809 buffer overrun. Don't assume list length fits in 'int'. Treat
10810 print length of 0 as 0, not as infinity; to be consistent with other
10811 uses of print length in this function. Don't overflow print length
10812 index. Don't assume hash table size fits in 'long', or that
10813 vectorlike size fits in 'unsigned long'.
10814
31c286f7
PE
10815 * process.c (make_process): Use printmax_t, not int, to format
10816 process-name gensyms.
10817
55e5faa1
PE
10818 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10819
80f2e268
PE
10820 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10821 to avoid potential buffer overrun.
10822
670741ab
PE
10823 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10824 if X resource line is longer than 512 bytes.
10825
b7163a50
PE
10826 * xfns.c (x_window): Make sprintf buffer a bit bigger
10827 to avoid potential buffer overrun.
10828
ae58ff1f
PE
10829 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10830
c43c8a6a
PE
10831 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10832
3f8236f4
PE
108332011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10834
53e9fe90 10835 Integer overflow fixes for scrolling, etc.
6511acf2
PE
10836 Without these, Emacs silently mishandles large integers sometimes.
10837 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
10838 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10839
6511acf2
PE
10840 * xdisp.c (try_window_id): Check Emacs fixnum range before
10841 converting to 'int'.
806add1d 10842
6511acf2 10843 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
10844 Check that an Emacs fixnum is in range before assigning it to 'int'.
10845 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10846 values converted from Emacs fixnums.
10847 (Frecenter): Don't wrap around a line count if it is out of 'int'
10848 range; instead, treat it as an extreme value.
10849 (Fset_window_configuration, compare_window_configurations):
10850 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10851
6511acf2
PE
10852 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10853 that can exceed INT_MAX. Check that EMACS_INT value is in range
10854 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
10855 (match_limit): Don't assume that a fixnum can fit in 'int'.
10856
6511acf2 10857 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
10858 exceed INT_MAX.
10859
6511acf2 10860 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
10861 (Fvertical_motion): Don't wrap around LINES values that don't fit
10862 in 'int'. Instead, treat them as extreme values. This is good
10863 enough for windows, which can't have more than INT_MAX lines anyway.
10864
fcb901a7
LMI
108652011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10866
0f2f6b6d
LMI
10867 * Require libxml/parser.h to avoid compilation warning.
10868
fcb901a7
LMI
10869 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10870
10871 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10872 since this reportedly can destroy thread storage.
10873
6e20a0d4
CY
108742011-08-30 Chong Yidong <cyd@stupidchicken.com>
10875
10876 * syntax.c (find_defun_start): Update all cache variables if
10877 exiting early (Bug#9401).
10878
148ae00e
EZ
108792011-08-30 Eli Zaretskii <eliz@gnu.org>
10880
f6cfbd8f
EZ
10881 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10882
148ae00e
EZ
10883 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10884 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10885 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10886
10887 * term.c (tty_append_glyph): New function.
10888 (produce_stretch_glyph): Static function and its prototype deleted.
10889
a66cfb1c
SM
10890 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10891 Add prototypes.
148ae00e 10892
c4a07a4c
PE
108932011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10894
10895 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10896 when checking :margin (Bug#9390).
10897 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 10898 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
10899 so that the name doesn't mislead. All uses changed.
10900
6bc8cd65
JB
109012011-08-28 Johan Bockgård <bojohan@gnu.org>
10902
10903 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10904 set_tty_hooks.
10905
dca4927e
EZ
109062011-08-27 Eli Zaretskii <eliz@gnu.org>
10907
10908 * xdisp.c (move_it_to): Don't bail out early when reaching
10909 position beyond to_charpos, if we are scanning backwards.
10910 (move_it_vertically_backward): When DY == 0, make sure we get to
10911 the first character in the line after the newline.
10912
f2cad773
PE
109132011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10914
10915 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10916 (ccl_driver): Do not generate an out-of-range pointer.
10917 (Fccl_execute_on_string): Remove unnecessary check for
10918 integer overflow, noted by Stefan Monnier in
10919 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10920 Remove a FIXME that didn't need fixing.
10921 Simplify the newly-introduced buffer reallocation code.
10922
0cae2cdb
JB
109232011-08-27 Juanma Barranquero <lekktu@gmail.com>
10924
10925 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10926
5fc295a4 109272011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 10928
70c60eb2 10929 Integer and memory overflow issues (Bug#9196).
726e0ab1 10930
d31850da
PE
10931 * doc.c (get_doc_string): Rework so that
10932 get_doc_string_buffer_size is the actual buffer size, rather than
10933 being 1 less than the actual buffer size; this makes xpalloc more
10934 convenient.
10935
a69fbedb
PE
10936 * image.c (x_allocate_bitmap_record, cache_image):
10937 * xselect.c (Fx_register_dnd_atom):
10938 Simplify previous changes by using xpalloc.
10939
fe5c5d37
PE
10940 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10941 since either will do and ptrdiff_t is convenient with xpalloc.
10942
0065d054
PE
10943 * charset.c (charset_table_size)
10944 (struct charset_sort_data.priority): Now ptrdiff_t.
10945 (charset_compare): Don't overflow if priorities differ greatly.
10946 (Fsort_charsets): Don't assume list length fits in int.
10947 Check for size-calculation overflow when allocating sort data.
10948 (syms_of_charset): Allocate an initial charset table that is
10949 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10950
10951 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10952
10953 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10954 The actual value is always <= INT_MAX, and leaving it unsigned made
10955 overflow checking harder.
10956
10957 * dispextern.h (struct glyph_matrix.rows_allocated)
10958 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10959 with xpalloc. The values are still always <= INT_MAX.
10960
10961 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10962
10963 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10964 (SAFE_NALLOCA): New macro.
10965
10966 * region-cache.c (struct boundary.pos, find_cache_boundary)
10967 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10968 (set_cache_region, invalidate_region_cache)
10969 (revalidate_region_cache, know_region_cache, region_cache_forward)
10970 (region_cache_backward, pp_cache):
10971 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10972 so that ptrdiff_t * can be passed to xpalloc.
10973 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10974 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10975 (pp_cache): Don't assume cache_len fits in int.
10976 * region-cache.h: Adjust extern decls to match.
10977
10978 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10979 EMACS_INT, since either will do, for xpalloc.
10980
10981 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10982 (xnmalloc, xnrealloc, xpalloc): New functions.
10983
726e0ab1
PE
10984 * bidi.c (bidi_shelve_header_size): New constant.
10985 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10986 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10987
51f30bc5 10988 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
10989 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10990 (overlay_strings):
10991 Don't update size of array until after memory allocation succeeds,
10992 because xmalloc/xrealloc may not return.
0065d054
PE
10993 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10994 now that we have proper integer overflow checking.
10995 (record_overlay_string, overlay_strings): Catch overflows when
10996 calculating size of overlay_str_buf.
726e0ab1 10997
0065d054
PE
10998 * callproc.c (Fcall_process): Check for size overflow when
10999 calculating size of args2.
11000 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11001 Normally we prefer signed values, but sticking with ptrdiff_t would
11002 require adding more-complicated checks.
726e0ab1
PE
11003
11004 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11005 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11006 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 11007 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
11008
11009 * character.c (Fstring): Check for size-calculation overflow.
11010
11011 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11012 unnecessary integer overflow. Check for size overflow.
11013 (encode_coding_object): Don't update size until xmalloc succeeds.
11014
11015 * composite.c (get_composition_id): Check for overflow in glyph
11016 length calculations.
11017
11018 Integer and memory overflow fixes for display code.
11019 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11020 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11021 (scrolling_window): Check for overflow in size calculations.
11022 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11023 Don't assume glyph table len fits in int.
11024 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11025 (row_table_size): Now ptrdiff_t, not int.
11026 (scrolling_window): Avoid overflow in size calculations.
11027 Don't update size until allocation succeeds.
11028 * fns.c (concat): Check for overflow in size calculations.
11029 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11030 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11031 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11032
11033 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11034 (get_doc_string): Check for size calculation overflow.
11035 Don't update size until allocation succeeds.
11036 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11037 EMACS_INT, where ptrdiff_t will do.
11038 (Fsubstitute_command_keys): Check for string overflow.
11039
11040 * editfns.c (set_time_zone_rule): Don't assume environment length
11041 fits in int.
11042 (message_length): Now ptrdiff_t, not int.
11043 (Fmessage_box): Don't update size until allocation succeeds.
11044 Don't assume message length fits in int.
11045 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11046
0065d054
PE
11047 * emacs.c (main): Do not reallocate argv, since there is a null at
11048 the end that can be overwritten, and this way there's no need to
11049 worry about size-calculation overflow.
11050 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
11051
11052 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11053 alloc succeeds.
11054 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11055
11056 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11057 (x_set_scroll_bar_width, x_figure_window_size):
11058 Check for integer overflow.
11059 (x_set_alpha): Do not assume XINT fits in int.
11060
11061 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11062 This is for the members text_lines, text_cols, total_lines, total_cols,
11063 where the system imposes an 'int' limit.
11064
11065 * fringe.c (Fdefine_fringe_bitmap):
11066 Don't update size until alloc works.
11067
11068 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11069 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11070
11071 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11072 Check for size-calculation overflow.
11073 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11074 do, as we prefer signed integers.
11075 (id_to_widget.max_size, id_to_widget.used)
11076 (xg_store_widget_in_map, xg_remove_widget_from_map)
11077 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11078 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11079 Use and return ptrdiff_t, not int.
11080 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11081 * gtkutil.h: Change prototypes to match the above.
11082
11083 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11084 are duplicate now that they've been promoted to lisp.h.
11085 (x_allocate_bitmap_record, x_alloc_image_color)
11086 (make_image_cache, cache_image, xpm_load):
11087 Don't update size until alloc is done.
11088 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11089 (x_detect_edges):
3256efce 11090 Check for size calculation overflow.
726e0ab1
PE
11091 (ct_colors_allocated_max): New constant.
11092 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11093 overflow.
3256efce 11094
726e0ab1
PE
11095 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11096 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11097 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11098 Use ptrdiff_t, not int, to count maps.
11099 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
11100 calculations. Don't update size until allocation succeeds.
11101 Redo calculations to avoid overflow.
726e0ab1
PE
11102 * keyboard.h: Change prototypes to match the above.
11103
11104 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11105 to count maps.
11106 (current_minor_maps): Check for size calculation overflow.
11107 * keymap.h: Change prototypes to match the above.
11108
11109 * lread.c (read1, init_obarray): Don't update size until alloc done.
11110
11111 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11112 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11113
726e0ab1
PE
11114 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11115 Now ptrdiff_t, not int.
11116 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11117 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11118
11119 * process.c (Fnetwork_interface_list): Check for overflow
11120 in size calculation.
11121
11122 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11123
11124 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11125 overflow. Don't bother calling xmalloc when xrealloc will do.
11126
11127 * search.c (Freplace_match): Check for size calculation overflow.
11128 (Fset_match_data): Don't assume list lengths fit in 'int'.
11129
11130 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11131 for command line length. Do not attempt to address one before the
11132 beginning of an array, as that's not portable.
11133
11134 * term.c (max_frame_lines): Remove; unused.
11135 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11136 not int.
11137 (encode_terminal_code, calculate_costs): Check for size
11138 calculation overflow.
11139 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11140 table lengths and related sizes. Don't update size until alloc
11141 done. Redo calculations to avoid overflow.
11142 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11143
11144 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11145 subtracting pointers.
11146 (gobble_line): Check for overflow more carefully. Don't update size
11147 until alloc done.
11148
11149 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11150 Don't update size until alloc done.
11151 Redo size calculations to avoid overflow.
11152 Check for size calculation overflow.
0065d054 11153 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
11154
11155 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11156 Use ptrdiff_t, not int, for sizes.
11157 (store_mode_line_noprop_char): Don't update size until alloc done.
11158
0065d054
PE
11159 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11160 Use ptrdiff_t, not int, for sizes.
11161 (Finternal_make_lisp_face, cache_face):
11162 Check for size calculation overflow.
11163 (cache_face): Treat size calculation overflows as if they were
11164 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
11165
11166 * xfns.c (x_encode_text, x_set_name_internal)
11167 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11168 sizes, since they can exceed INT_MAX in size. Check for size
11169 calculation overflow.
11170
0065d054
PE
11171 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11172 (xg_select): Check for size calculation overflow.
726e0ab1
PE
11173 Don't update size until alloc done.
11174
0065d054 11175 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 11176 as sprintf is limited to int lengths.
1d526e2f 11177
252c5ee1
PE
11178 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11179 (X_LONG_MIN): New macros.
864d7ce7
PE
11180 Use them to make the following changes clearer.
11181 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11182 This change doesn't affect the value now, but it may help remind
11183 future maintainers not to raise the value too much later.
11184 (SELECTION_QUANTUM): Remove, replacing with ...
11185 (selection_quantum): ... new function, which avoids overflow.
11186 All uses changed.
11187 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11188 assumption that selection length fits in 'int'.
11189 (x_reply_selection_request, x_handle_selection_request)
11190 (x_get_window_property, receive_incremental_selection)
11191 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11192 (lisp_data_to_selection_data, clean_local_selection_data):
11193 Use ptrdiff_t, not int, to record length of selection.
11194 (x_reply_selection_request, x_get_window_property)
11195 (receive_incremental_selection, x_property_data_to_lisp):
11196 Redo calculations to avoid overflow.
11197 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 11198 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
11199 something.
11200 (x_get_window_property, receive_incremental_selection)
11201 (lisp_data_to_selection_data, x_property_data_to_lisp):
11202 Check for size-calculation overflow.
11203 (x_get_window_property, receive_incremental_selection)
11204 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11205 Don't store size until memory allocation succeeds.
11206 (x_get_window_property): Plug memory leak on memory exhaustion.
11207 Don't double-block input; malloc is safe here. Don't assume 2**34
11208 - 4 fits in unsigned long. Add an xassert to check
11209 XGetWindowProperty overflow. Be more careful about overflow
11210 calculations, and distinguish size from memory overflow better.
11211 (receive_incremental_selection): When tracing, don't assume
11212 unsigned int is less than INT_MAX.
11213 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11214 harmful) conversions of unsigned short to int.
11215 (lisp_data_to_selection_data): Don't assume that integers
11216 in the range -65535 through -1 fit in an X unsigned short.
11217 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11218 result parameters unless successful. Rely on cons_to_unsigned
11219 to report problems with elements; the old code wasn't right anyway.
11220 (x_check_property_data): Check for int overflow; we cannot use
11221 a wider type due to X limits.
11222 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11223
726e0ab1 11224 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 11225
0065d054
PE
11226 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11227 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
11228 (x_color_cells): Don't store size until memory allocation succeeds.
11229 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 11230 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
11231 (x_term_init): Don't assume length fits in int (sprintf is limited
11232 to int size).
bc18e09d 11233
ebfa62c0
PE
11234 Use ptrdiff_t for composition IDs.
11235 * character.c (lisp_string_width):
11236 * composite.c (composition_table_size, n_compositions)
11237 (get_composition_id, composition_gstring_from_id):
11238 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11239 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11240 * window.c (Frecenter):
11241 Use ptrdiff_t, not int, for composition IDs.
11242 * composite.c (get_composition_id): Check for integer overflow.
11243 * composite.h: Adjust prototypes to match the above changes.
11244
d3411f89
PE
11245 Use ptrdiff_t for hash table indexes.
11246 * category.c (hash_get_category_set):
11247 * ccl.c (ccl_driver):
11248 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11249 * coding.c (coding_system_charset_list, detect_coding_system):
11250 * coding.h (struct coding_system.id):
11251 * composite.c (get_composition_id, gstring_lookup_cache):
11252 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11253 * image.c (xpm_get_color_table_h):
11254 * lisp.h (hash_lookup, hash_put):
11255 * minibuf.c (Ftest_completion):
11256 Use ptrdiff_t for hash table indexes, not int (which is too
11257 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11258 32-bit --with-wide-int hosts).
11259
e097a6fa
PE
11260 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11261 Add a FIXME comment about memory leaks.
11262 (syms_of_charset): Don't assume xmalloc returns.
11263
5637687f
PE
11264 Don't assume that stated character widths fit in int.
11265 * character.c (Fchar_width, c_string_width, lisp_string_width):
11266 * character.h (CHAR_WIDTH):
11267 * indent.c (MULTIBYTE_BYTES_WIDTH):
11268 Use sanitize_char_width to avoid undefined and/or bad behavior
11269 with outlandish widths.
a66cfb1c 11270 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
11271 now that we have two such functions. All uses changed.
11272 (sanitize_char_width): New inline function.
11273
a2271ba2
PE
11274 Don't assume that tab-width fits in int.
11275 * character.h (sanitize_width): New inline function.
11276 (SANE_TAB_WIDTH): New macro.
11277 (ASCII_CHAR_WIDTH): Use it.
11278 * indent.c (sane_tab_width): Remove. All uses replaced by
11279 SANE_TAB_WIDTH (current_buffer).
11280 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11281
18c52557
PE
11282 * fileio.c: Integer overflow issues with file modes.
11283 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11284
caeeedc1
PE
11285 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11286 Remove unreachable code.
11287 (read_hex, load_charset_map_from_file): Check for integer overflow.
11288
6df6ae42 11289 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
11290 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11291 (x_send_scroll_bar_event): Likewise. Check that the size does not
11292 exceed limits imposed by XClientMessageEvent, as well as the usual
11293 ptrdiff_t and size_t limits.
11294
b13995db
PE
11295 * keyboard.c: Overflow, signedness and related fixes.
11296 (make_lispy_movement): Use same integer type in forward decl
11297 that is used in the definition.
11298 (read_key_sequence, keyremap_step):
11299 Change bufsize argument back to int, undoing my 2011-03-30 change.
11300 We prefer signed types, and int is wide enough here.
11301 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11302 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11303 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11304 length, not size_t. Use ptrdiff_t for index, not int.
11305 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11306 possibility of integer overflow.
11307
13464394
PE
11308 Overflow, signedness and related fixes for images.
11309
11310 * dispextern.h (struct it.stack[0].u.image.image_id)
11311 (struct_it.image_id, struct image.id, struct image_cache.size)
11312 (struct image_cache.used, struct image_cache.ref_count):
11313 * gtkutil.c (update_frame_tool_bar):
11314 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11315 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11316 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11317 * nsmenu.m (update_frame_tool_bar):
11318 * xdisp.c (calc_pixel_width_or_height):
11319 * xfns.c (image_cache_refcount):
11320 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11321 on typical 64-bit hosts.
11322
11323 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11324 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11325 Omit unnecessary casts to int.
11326 (parse_image_spec): Check that integers fall into 'int' range
11327 when the callers expect that.
11328 (image_ascent): Redo ascent calculation to avoid int overflow.
11329 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11330 (lookup_image): Remove unnecessary tests.
11331 (xbm_image_p): Locals are now of int, not EMACS_INT,
11332 since parse_image_check makes sure they fit into int.
11333 (png_load, gif_load, svg_load_image):
11334 Prefer int to unsigned where either will do.
11335 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
11336 old tiff_error_handler and tiff_warning_handler.
11337 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
11338 stack buffer overflows. It uses only the features of vsnprintf
11339 that are common to both POSIX and native Microsoft.
11340 (tiff_error_handler, tiff_warning_handler): Use it.
11341 (tiff_load, gif_load, imagemagick_load_image):
11342 Don't assume :index value fits in 'int'.
11343 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11344 (imagemagick_load_image): Check that crop parameters fit into
11345 the integer types that MagickCropImage accepts. Don't assume
11346 Vimagemagick_render_type has a nonnegative value. Don't assume
11347 size_t fits in 'long'.
11348 (gs_load): Use printmax_t to print the widest integers possible.
11349 Check for integer overflow when computing image height and width.
11350
c11821d4
EZ
113512011-08-26 Eli Zaretskii <eliz@gnu.org>
11352
11353 * xdisp.c (redisplay_window): Don't force window start if point
11354 will be invisible in the resulting window. (Bug#9324)
11355
0c95fcf7
EZ
113562011-08-25 Eli Zaretskii <eliz@gnu.org>
11357
11358 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11359 the display spec is of the form `(space ...)'.
11360 (handle_display_spec): Return the value returned by
11361 handle_single_display_spec, not just 1 or zero.
11362 (handle_single_display_spec): If the display spec is of the form
11363 `(space ...)', and specifies display in the text area, return 2
11364 rather than 1.
fee65a97 11365 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
11366 accurately, and prefer exact match for point under bidi.
11367 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
11368
11369 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11370 into disp_prop; all users changed.
11371
11372 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11373 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11374 for the text covered by the display property.
11375
e4ed06f1
CY
113762011-08-25 Chong Yidong <cyd@stupidchicken.com>
11377
11378 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11379 Change return value to nil.
11380 (Frecord_buffer): Delete unused function.
11381
f67cdd7f
EZ
113822011-08-24 Eli Zaretskii <eliz@gnu.org>
11383
5980d4c6
EZ
11384 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11385 buffers, return left-to-right.
8610fe8b
EZ
11386 (set_cursor_from_row): Consider candidate row a win if its glyph
11387 represents a newline and point is on that newline. Fixes cursor
11388 positioning on the newline at EOL of R2L text within L2R
11389 paragraph, and vice versa.
11390 (try_cursor_movement): Check continued rows, in addition to
11391 continuation rows. Fixes unwarranted scroll when point enters a
11392 continued line of R2L text within an L2R paragraph, or vice versa.
11393 (cursor_row_p): Consider the case of point being equal to
11394 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11395 from the end of a short line to the beginning of a continued line
11396 of R2L text within L2R paragraph.
11397 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11398 composed characters.
5980d4c6 11399
f67cdd7f
EZ
11400 * bidi.c (bidi_check_type): Use xassert.
11401 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11402 members.
11403
bca633fb
EZ
114042011-08-23 Eli Zaretskii <eliz@gnu.org>
11405
11406 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11407 a character.
11408
4a5885a7
CY
114092011-08-23 Chong Yidong <cyd@stupidchicken.com>
11410
11411 * nsfont.m (ns_otf_to_script): Fix typo.
11412
0902a04e
KH
114132011-08-22 Kenichi Handa <handa@m17n.org>
11414
11415 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11416 extra slot even if the purpose is char-code-property-table.
11417
1a2e6670
EZ
114182011-08-23 Eli Zaretskii <eliz@gnu.org>
11419
8ddde651
EZ
11420 * xdisp.c (redisplay_window): When computing centering_position,
11421 account for the height of the header line. (Bug#8874)
11422
425cc014
EZ
11423 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11424 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11425 candidate is selected by the mouse, and that candidate has a
11426 composed character under the mouse.
11427
1a2e6670
EZ
11428 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11429 coordinates reported by pos-visible-in-window-p for a composed
11430 character in column zero.
11431
8b76d6f8
SM
114322011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11433
11434 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11435
dac347dd
EZ
114362011-08-22 Eli Zaretskii <eliz@gnu.org>
11437
11438 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11439 consider it a hit if to_charpos is anywhere in the range of the
11440 composed buffer positions.
11441
e013fb34
CY
114422011-08-22 Chong Yidong <cyd@stupidchicken.com>
11443
11444 * image.c (gif_load): Don't assume that each subimage has the same
11445 dimensions as the base image. Handle disposal method that is
11446 "undefined" by the gif spec (Bug#9335).
11447
bd1ba3e8
CY
114482011-08-20 Chong Yidong <cyd@stupidchicken.com>
11449
11450 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 11451 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 11452
54a1215b
EZ
114532011-08-19 Eli Zaretskii <eliz@gnu.org>
11454
823564e5
EZ
11455 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11456 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11457 from an Org mode buffer to a Speedbar frame.
11458
54a1215b
EZ
11459 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11460 a composition, take its buffer position from IT->cmp_it.charpos.
11461 Fixes cursor positioning at the beginning of a line that begins
11462 with a composed character.
11463
9778ebcc
EZ
114642011-08-18 Eli Zaretskii <eliz@gnu.org>
11465
0be6ee06
EZ
11466 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11467 character bidirectional type, use STRONG_L instead. Fixes crashes
11468 in a buffer produced by `describe-categories'.
11469
9778ebcc
EZ
11470 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11471 members before the level stack, so they would be saved and
11472 restored when copying iterator state. Fixes incorrect reordering
11473 around TABs covered by display properties.
11474
156bffbe
AS
114752011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11476
6b02f655 11477 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 11478
72ad093b
CY
114792011-08-17 Chong Yidong <cyd@stupidchicken.com>
11480
11481 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
11482 (internal_condition_case_2, internal_condition_case_n):
11483 Remove unnecessary aborts (Bug#9081).
72ad093b 11484
35774242
EZ
114852011-08-17 Eli Zaretskii <eliz@gnu.org>
11486
11487 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11488 has no `load' handler, try opening the file locally. (Bug#9311)
11489
db76dd85
KB
114902011-08-16 Ken Brown <kbrown@cornell.edu>
11491
11492 * gmalloc.c: Expand comment.
11493
b215eee5
EZ
114942011-08-16 Eli Zaretskii <eliz@gnu.org>
11495
11496 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11497 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11498
a4579d33
KB
114992011-08-16 Ken Brown <kbrown@cornell.edu>
11500
11501 Fix memory allocation problems in Cygwin build (Bug#9273).
11502
11503 * unexcw.c ( __malloc_initialized): Declare external variable.
11504 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11505
8b76d6f8
SM
11506 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11507 New variables.
a4579d33
KB
11508 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11509 dumped emacs.
11510 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11511 in the static heap.
11512 [CYGWIN] (special_realloc): New function.
11513 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11514 requests to realloc storage in the static heap.
11515
3ebec551
PE
115162011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11517
11518 * bidi.c (bidi_initialize): Remove unused local.
11519
9fd8be00
EZ
115202011-08-15 Eli Zaretskii <eliz@gnu.org>
11521
6b02f655
SM
11522 * bidimirror.h:
11523 * biditype.h: Remove file.
11524 * makefile.w32-in ($(BLD)/bidi.$(O)):
11525 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
11526
11527 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11528
11529 * chartab.c: Improve commentary for the uniprop_table API.
11530
32413314
EZ
11531 * bidi.c (bidi_paragraph_init): Support zero value of
11532 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
11533 (bidi_initialize): Use uniprop_table instead of including
11534 biditype.h and bidimirror.h.
32413314 11535
9fd8be00
EZ
11536 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11537 coordinates of the iterator when restoring from ppos_it.
11538 (Bug#9296)
11539
5cf2b69b
KH
115402011-08-14 Kenichi Handa <handa@m17n.org>
11541
11542 * process.c (create_process): Call setup_process_coding_systems
72ad093b 11543 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 11544
daf17d00
EZ
115452011-08-14 Eli Zaretskii <eliz@gnu.org>
11546
11547 * xdisp.c (move_it_in_display_line_to): Don't invoke
11548 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11549 ppos_it. Fixes vertical cursor motion when line beginning is
11550 covered by an image. (Bug#9296)
11551
08e3161a
JD
115522011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11553
11554 * nsterm.h (ns_run_ascript): Declare.
11555 (NSAPP_DATA2_RUNASSCRIPT): Define.
11556
11557 * nsfns.m (as_script, as_result, as_status): New static variables.
11558 (ns_run_ascript): New function.
5e617bc2 11559 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
11560 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11561 the event loop. Get status from as_status (Bug#7276).
11562
11563 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11564 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11565 the event loop (Bug#7276).
11566
a3720aa2
AS
115672011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11568
11569 * gnutls.c (QCgnutls_bootprop_priority)
11570 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11571 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11572 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11573 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11574 (QCgnutls_bootprop_verify_hostname_error)
11575 (QCgnutls_bootprop_callbacks_verify): Rename from
11576 Qgnutls_bootprop_..., all uses changed.
11577
11578 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11579 uses changed.
11580
0a0d27fb
PE
115812011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11582
19d5c50c
PE
11583 * xfaces.c (Qframe_set_background_mode): Now static.
11584 * dispextern.h (Qframe_set_background_mode): Remove decl.
11585
0a0d27fb
PE
11586 * process.c (Fnetwork_interface_info): Declare local only if needed.
11587
377538cb
JD
115882011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11589
11590 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11591 (Fnetwork_interface_list): Allocate in increments of bytes instead
11592 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11593 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11594 sockaddr.
11595 (struct ifflag_def): notrailers is smart on OSX.
11596 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11597 Get hardware address with getifaddrs if available.
11598
08fff70c
EZ
115992011-08-12 Eli Zaretskii <eliz@gnu.org>
11600
11601 * xdisp.c (iterate_out_of_display_property): xassert that
11602 IT->position is set to within IT->object's boundaries. Break from
11603 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
11604 when IT->position is set up wrongly due to some bug.
11605 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
11606 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11607 entry. Force push_it to save on the stack the current
11608 buffer/string position, to be restored by pop_it. Fix flags in
11609 the iterator structure wrt the object coming from a display
11610 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11611 properties. (Bug#9284)
11612
7be1c708 116132011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 11614
7be1c708
CY
11615 * fontset.c (fontset_get_font_group): Add proper type checks.
11616 (Bug#9172)
aac0c6e3 11617
7be1c708 116182011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 11619
7be1c708
CY
11620 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11621 and LC_VERSION_MIN_MACOSX.
11622 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11623 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 11624
97bb72a6
EZ
116252011-08-08 Eli Zaretskii <eliz@gnu.org>
11626
11627 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
11628 no-display-properties-and-no-overlays under bidi display.
11629 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 11630 properties and overlays.
97bb72a6 11631
d5617611
CY
116322011-08-08 Chong Yidong <cyd@stupidchicken.com>
11633
37e11a63
CY
11634 * editfns.c (Fset_time_zone_rule): Document relationship with the
11635 setenv function.
11636
d5617611
CY
11637 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11638 the font entity extracted from the cache (Bug#8109).
11639
58872834
CY
116402011-08-07 Chong Yidong <cyd@stupidchicken.com>
11641
11642 * composite.c (autocmp_chars): Don't reset point. That is done by
11643 restore_point_unwind (Bug#5984).
11644
75bfc667
JL
116452011-08-07 Juri Linkov <juri@jurta.org>
11646
11647 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11648 to show the arg `TIME' instead of `TIMEVAL'.
11649
d1410150
EZ
116502011-08-06 Eli Zaretskii <eliz@gnu.org>
11651
11652 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11653 display property strides EOL and includes a newline, as in
11654 longlines-mode. (Bug#9254)
75b771e4
EZ
11655 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11656 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
11657
11658 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11659 is non-zero, even if the data buffer is NULL. Fixes a crash in
11660 vertical-motion with longlines-mode. (Bug#9254)
11661
35928349
EZ
116622011-08-05 Eli Zaretskii <eliz@gnu.org>
11663
ec7cc85b
EZ
11664 * bidi.c <bidi_cache_total_alloc>: Now static.
11665 (bidi_initialize): Initialize bidi_cache_total_alloc.
11666
8b76d6f8 11667 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
11668 cache. (Bug#9221)
11669
11670 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11671 amount allocated this far in `bidi_cache_total_alloc'.
11672 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11673 non-zero, only free the data buffer without restoring the cache
11674 contents. All callers changed.
11675
11676 * dispextern.h (bidi_unshelve_cache): Update prototype.
11677
11678 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11679 (move_it_in_display_line, move_it_to)
11680 (move_it_vertically_backward, move_it_by_lines): Replace the call
11681 to xfree to an equivalent call to bidi_unshelve_cache.
11682 (move_it_in_display_line_to): Fix logic of returning
412b6358 11683 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 11684
e2e2423b
EZ
116852011-08-05 Eli Zaretskii <eliz@gnu.org>
11686
11687 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11688 came from a string character with a `cursor' property. (Bug#9229)
11689
ae9e757a
JD
116902011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11691
11692 * Makefile.in (LIB_PTHREAD): New variable.
11693 (LIBES): Add LIB_PTHREAD (Bug#9216).
11694
11695 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11696 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11697
213bd7f2
AS
116982011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11699
6b02f655 11700 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 11701
99aaf75f
JD
117022011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11703
11704 * xterm.c (x_find_topmost_parent): New function.
11705 (x_set_frame_alpha): Find topmost parent window with
11706 x_find_topmost_parent and set the property there also (bug#9181).
11707 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11708
c74e9d86
PE
117092011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11710
11711 * callproc.c (Fcall_process): Avoid vfork clobbering
11712 the local vars buffer, coding_systems, current_dir.
11713
640c8776
SM
117142011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11715
11716 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11717
f26d0e4c
PE
117182011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11719
8a10d76c
PE
11720 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11721 so that it is not optimized away.
11722
f26d0e4c
PE
11723 * xdisp.c (compute_display_string_pos): Remove unused local.
11724
55439c61
EZ
117252011-08-02 Eli Zaretskii <eliz@gnu.org>
11726
11727 Fix slow cursor motion and scrolling in large buffers with
11728 selective display, like Org Mode buffers. (Bug#9218)
11729
11730 * dispextern.h (struct bidi_it): New member disp_prop_p.
11731
11732 * xdisp.c: Remove one-slot cache of display string positions.
11733 (compute_display_string_pos): Accept an additional argument
5e617bc2 11734 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
11735 for a display string or property. If found, set DISP_PROP_P
11736 non-zero.
11737
11738 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
11739 DISP_PROP_P, and pass it to compute_display_string_pos.
11740 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
11741 non-zero. All callers of bidi_fetch_char changed.
11742
fb33fa43
SM
117432011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11744
11745 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11746
b099e063
DM
117472010-12-03 Don March <don@ohspite.net>
11748
11749 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11750 last character M-[char] is translated to ESC [char] (bug#7541).
11751
5cc7f7af
KH
117522011-08-02 Kenichi Handa <handa@m17n.org>
11753
d0fffa3f 11754 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
11755
11756 * chartab.c (uniprop_table): Make it non-static.
11757
525d5e6e
EZ
117582011-08-01 Eli Zaretskii <eliz@gnu.org>
11759
11760 * xdisp.c (forward_to_next_line_start): Accept additional argument
11761 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11762 on the newline.
11763 (reseat_at_next_visible_line_start): Use the bidi iterator state
11764 returned by forward_to_next_line_start to restore the state of
11765 it->bidi_it after backing up to previous newline. (Bug#9212)
11766
31011111
AS
117672011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11768
11769 * regex.c (re_comp): Protoize.
11770 (re_exec): Fix return type.
11771 (regexec): Fix type of `ret'. (Bug#9203)
11772
476371c4
PE
117732011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11774
e5d76069
PE
11775 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11776 This is needed if max-image-size is a floating-point number.
11777
9a79b20c
AS
117782011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11779
11780 * print.c (print_object): Print empty symbol as ##.
11781
11782 * lread.c (read1): Read ## as empty symbol.
11783
d8c2fa78
AA
117842011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11785
11786 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11787 setting frame foreground color (Bug#9175).
11788 (x_set_background_color): Likewise.
11789
ffe57a7a
AA
11790 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11791 contents (Bug#9176).
11792 (EmacsTooltip -init): Remove bezels and add shadows to
11793 tooltip windows.
11794
bf3492a5
AA
11795 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11796 or scroll bar (Bug#8470).
11797
d55e9c53
AA
11798 * nsfont.m (nsfont_open): Remove assignment to voffset and
11799 unnecessary vars hshink, expand, hd, full_height, min_height.
11800 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11801
11802 * nsterm.h (nsfont_info): Remove voffset field.
11803
d8c2fa78 118042011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
11805
11806 Implement strike-through and overline on NextStep (Bug#8863).
11807
11808 * nsfont.m (nsfont_open): Use underline position provided by font,
11809 instead of hard-coded value of 2.
11810 (nsfont_draw): Call ns_draw_text_decoration instead.
11811
11812 * nsterm.h: Add declaration for ns_draw_text_decoration.
11813
11814 * nsterm.m (ns_draw_text_decoration): New function for drawing
11815 underline, overline, and strike-through.
11816 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11817 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 11818 accommodate underlining, etc.
4843aac3 11819
4cc60b9b
EZ
118202011-07-28 Eli Zaretskii <eliz@gnu.org>
11821
bc7ece87
EZ
11822 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11823 default.
4cc60b9b 11824
476371c4
PE
118252011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11826
66606eea
PE
11827 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11828 Without this fix, if a signal arrives just after memory fills up,
11829 'malloc' might be invoked reentrantly.
11830
476371c4
PE
11831 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11832 In other words, assume that every image size is allowed, on non-X
11833 hosts. This assumption is probably wrong, but it lets Emacs compile.
11834
f3fcc40d
AS
118352011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11836
11837 * regex.c (re_iswctype): Convert return values to boolean.
11838
350c992f
EZ
118392011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11840
11841 * xdisp.c (compute_display_string_pos): Don't use cached display
11842 string position if the buffer had its restriction changed.
11843 (Bug#9184)
11844
5266b4bb
PE
118452011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11846
11847 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11848
2573a837 118492011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 11850
41f55ccd 11851 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 11852
39e378da
PE
11853 * bidi.c: Integer size and overflow fixes.
11854 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11855 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11856 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11857 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11858 (bidi_find_other_level_edge):
11859 Use ptrdiff_t instead of EMACS_INT where either will do.
11860 This works better on 32-bit hosts configured --with-wide-int.
11861 (bidi_cache_ensure_space): Check for size-calculation overflow.
11862 Use % rather than repeated addition, for better worst-case speed.
11863 Don't set bidi_cache_size until after xrealloc returns, because it
11864 might not return.
11865 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
11866 (bidi_cache_ensure_space): Also check that the bidi cache size
11867 does not exceed that of the largest Lisp string or buffer. See Eli
11868 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 11869
5e927815
PE
11870 * alloc.c (__malloc_size_t): Remove.
11871 All uses replaced by size_t. See Andreas Schwab's note
11872 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11873
ca4aa935
PE
11874 * image.c: Improve checking for integer overflow.
11875 (check_image_size): Assume that f is nonnull, since
11876 it is always nonnull in practice. This is one less thing to
11877 worry about when checking for integer overflow later.
11878 (x_check_image_size): New function, which checks for integer
11879 overflow issues inside X.
11880 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11881 This removes the need for a memory_full check.
11882 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11883 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11884 (xbm_read_bitmap_data): Change locals back to 'int', since
11885 their values must fit in 'int'.
11886 (xpm_load_image, png_load, tiff_load):
11887 Invoke x_create_x_image_and_pixmap earlier,
11888 to avoid much needless work if the image is too large.
11889 (tiff_load): Treat overly large images as if
11890 x_create_x_image_and_pixmap failed, not as malloc failures.
11891 (gs_load): Use x_check_image_size.
11892
5f8f9cc2
PE
11893 * gtkutil.c: Omit integer casts.
11894 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11895 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11896
5adf60bc
PE
11897 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11898
c8907a93
PE
11899 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11900 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11901 would wrongly return t on a 64-bit host.
11902
e3c25c68
PE
11903 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11904 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11905 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11906 and therefore cause GCC to emit a bogus diagnostic in some cases.
11907
3f791afe
PE
11908 * image.c: Integer signedness and overflow and related fixes.
11909 This is not an exhaustive set of fixes, but it's time to
11910 record what I've got.
11911 (lookup_pixel_color, check_image_size): Remove redundant decls.
11912 (check_image_size): Don't assume that arbitrary EMACS_INT values
11913 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11914 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11915 (tiff_load, imagemagick_load_image):
11916 Check for overflow in size calculations.
11917 (x_create_x_image_and_pixmap): Remove unnecessary test for
11918 xmalloc returning NULL; that can't happen.
11919 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11920 (xpm_color_bucket): Use better integer hashing function.
11921 (xpm_cache_color): Don't possibly over-allocate memory.
11922 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11923 (gif_memory_source):
11924 Use ptrdiff_t, not int or size_t, to record sizes.
11925 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11926 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11927 either works, as we prefer signed integers.
11928 (tiff_read_from_memory, tiff_write_from_memory):
11929 Return tsize_t, not size_t, since that's what the TIFF API wants.
11930 (tiff_read_from_memory): Don't fail simply because the read would
11931 go past EOF; instead, return a short read.
11932 (tiff_load): Omit no-longer-needed casts.
11933 (Fimagemagick_types): Don't assume size fits into 'int'.
11934
3cc5a532
PE
11935 Improve hashing quality when configured --with-wide-int.
11936 * fns.c (hash_string): New function, taken from sxhash_string.
11937 Do not discard information about ASCII character case; this
11938 discarding is no longer needed.
11939 (sxhash-string): Use it. Change sig to match it. Caller changed.
11940 * lisp.h: Declare it.
11941 * lread.c (hash_string): Remove, since we now use fns.c's version.
11942 The fns.c version returns a wider integer if --with-wide-int is
11943 specified, so this should help the quality of the hashing a bit.
11944
b312a492
PE
11945 * emacs.c: Integer overflow minor fix.
11946 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11947 Define only if GNU_LINUX.
11948 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11949
dfd153ae
PE
11950 * dispnew.c: Integer signedness and overflow fixes.
11951 Remove unnecessary forward decls, that were a maintenance hassle.
11952 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11953 All uses changed.
11954 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11955 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11956 (prepare_desired_row, line_draw_cost):
11957 Use int, not unsigned, where either works.
11958 (save_current_matrix, restore_current_matrix):
11959 Use ptrdiff_t, not size_t, where either works.
11960 (init_display): Check for overflow more accurately, and without
11961 relying on undefined behavior.
11962
a81d11a3
PE
11963 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11964 Remove, replacing with the new symbols in lisp.h. All uses changed.
11965 * fileio.c (make_temp_name):
11966 * filelock.c (lock_file_1, lock_file):
11967 * xdisp.c (message_dolog):
11968 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11969 Use pMd etc. instead.
11970 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11971 replacing the pWIDE etc. symbols removed from editfns.c.
11972
3300e6fd
PE
11973 * keyboard.h (num_input_events): Now uintmax_t.
11974 This is (very slightly) less likely to mess up due to wraparound.
11975 All uses changed.
11976
fd05c7e9
PE
11977 * buffer.c: Integer signedness fixes.
11978 (alloc_buffer_text, enlarge_buffer_text):
11979 Use ptrdiff_t rather than size_t when either will do, as we prefer
11980 signed integers.
11981
903fe15d
PE
11982 * alloc.c: Integer signedness and overflow fixes.
11983 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11984 (__malloc_size_t): Default to size_t, not to int.
11985 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11986 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11987 Prefer ptrdiff_t to size_t when either would do, as we prefer
11988 signed integers.
11989 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11990 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11991 Now const. Initialize with values that are in range even if char
11992 is signed.
11993 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11994 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11995 These functions do the right thing with sizes > 2**32.
11996 (check_depth): Now ptrdiff_t, not int.
11997 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11998 Adjust to new way of storing sizes. Check for size overflow bugs
11999 in rest of code.
12000 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12001 slightly wrong anyway, as it missed one instance of
12002 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12003 (refill_memory_reserve): Omit needless cast to size_t.
12004 (mark_object_loop_halt): Mark as externally visible.
12005
ac82cc6a
PE
12006 * xselect.c: Integer signedness and overflow fixes.
12007 (Fx_register_dnd_atom, x_handle_dnd_message):
12008 Use ptrdiff_t, not size_t, since we prefer signed.
12009 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12010 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12011 x_dnd_atoms_size and x_dnd_atoms_length.
12012
c2d1e36d
PE
12013 * doprnt.c: Prefer signed to unsigned when either works.
12014 * eval.c (verror):
12015 * doprnt.c (doprnt):
12016 * lisp.h (doprnt):
12017 * xdisp.c (vmessage):
12018 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12019 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12020 prefer signed arithmetic to avoid comparison confusion.
12021 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12022 but is a bit tricky.
12023
0e926e56
PE
12024 Assume freestanding C89 headers, string.h, stdlib.h.
12025 * data.c, doprnt.c, floatfns.c, print.c:
12026 Include float.h unconditionally.
12027 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12028 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12029 * regex.c: Likewise for stddef.h, string.h.
12030 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12031 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12032 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12033 (STDC_HEADERS): Remove obsolete defines.
12034 * sysdep.c: Include limits.h unconditionally.
12035
9cfdb3ec
PE
12036 Assume support for memcmp, memcpy, memmove, memset.
12037 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12038 * regex.c (memcmp, memcpy):
12039 Remove; we assume C89 now.
12040
12041 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12042 (__malloc_safe_bcopy): Remove; no longer needed.
12043
cf950e6b 12044 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
12045 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12046 well either way, and we prefer signed to unsigned.
12047
dbf38e02
LMI
120482011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12049
12050 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12051 closes the connection while we're reading (bug#9182).
12052
d6f0886c 120532011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 12054
d6f0886c
JD
12055 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12056 are specified (Bug#9168).
24e0f6b1 12057
2eb1f9e6
PE
120582011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12059
12060 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12061 Found by GCC static checking and --with-wide-int on a 32-bit host.
12062
22381272 120632011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
12064
12065 * xdisp.c (compute_display_string_pos): Fix logic of caching
12066 previous display string position. Initialize cached_prev_pos to
12067 -1. Fixes slow-down at the beginning of a buffer.
12068
f25e39b4
EZ
120692011-07-24 Eli Zaretskii <eliz@gnu.org>
12070
12071 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12072 for attrs[LFACE_FONTSET_INDEX].
12073
04c4b52e
PE
120742011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12075
12076 * xml.c (parse_region): Remove unused local
12077 that was recently introduced.
12078
c1734fbd
EZ
120792011-07-23 Eli Zaretskii <eliz@gnu.org>
12080
be18c5a5
EZ
12081 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12082 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12083
c1734fbd
EZ
12084 * xdisp.c (move_it_in_display_line_to): Record the best matching
12085 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
12086 exit if none of the characters scanned was an exact match.
12087 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
12088 when exact match is impossible due to invisible text, and the
12089 lines are truncated.
12090
a258d627
JD
120912011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12092
12093 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12094 for OSX >= 10.7.
12095
b6d5a689
EZ
120962011-07-22 Eli Zaretskii <eliz@gnu.org>
12097
0f74f785
EZ
12098 Fix a significant slow-down of cursor motion with C-n, C-p,
12099 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12100 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 12101 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
12102 (next_element_from_buffer): Call compute_stop_pos_backwards to
12103 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
12104 base_level_stop.
12105 (reseat): Don't look for prev_stop, as that could mean a very long
12106 run.
12107 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12108 <cached_disp_overlay_modiff>: Cache for last found display string
12109 position.
551918c1 12110 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
12111 about the same buffer in the same area of character positions, and
12112 the buffer wasn't changed since the time the display string
12113 position was cached.
551918c1 12114
b2d0c91a
EZ
121152011-07-22 Eli Zaretskii <eliz@gnu.org>
12116
12117 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12118 is an integer, which is important for empty lines. (Bug#9149)
12119
043604ee
CY
121202011-07-22 Chong Yidong <cyd@stupidchicken.com>
12121
12122 * frame.c (Fmodify_frame_parameters): In tty case, update the
12123 default face if necessary (Bug#4238).
12124
da4adb04
CY
121252011-07-21 Chong Yidong <cyd@stupidchicken.com>
12126
12127 * editfns.c (Fstring_to_char): No need to explain what a character
12128 is in the docstring (Bug#6576).
12129
9abd0532
LMI
121302011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12131
12132 * xml.c (parse_region): Make sure we always return a tree.
12133
36881d16
HK
121342011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12135
12136 * xml.c (parse_region): If a document contains only comments,
12137 return that, too.
12138
1e98674d
LMI
121392011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12140
12141 * xml.c (make_dom): Return comments, too.
12142
590bd467
PE
121432011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12144
12145 Port to OpenBSD.
12146 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12147 and the surrounding thread.
12148 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12149 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12150 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12151 timer goes off.
12152 * s/openbsd.h (BROKEN_SIGIO): Define.
12153 * unexelf.c (unexec) [__OpenBSD__]:
12154 Don't update the .mdebug section of the Alpha COFF symbol table.
12155
f41628b2
LMI
121562011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12157
12158 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12159 (bug#8460).
12160
b59b67c5
PE
121612011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12162
15e3a074
PE
12163 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12164 This fixes some race conditions on the permissions of any newly
12165 created file.
12166
41bed37d
PE
12167 * alloc.c (valid_pointer_p): Use pipe, not open.
12168 This fixes some permissions issues when debugging.
12169
b59b67c5
PE
12170 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12171 If fchown fails to set both uid and gid, try to set just gid,
12172 as that is sometimes allowed. Adjust the file's mode to eliminate
12173 setuid or setgid bits that are inappropriate if fchown fails.
12174
925a6be7
SM
121752011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12176
12177 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12178 to compare Lisp_Objects.
12179 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12180 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12181 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12182
52968808
AS
121832011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12184
0a6a104b
AS
12185 * lread.c (read_integer): Unread even EOF character.
12186 (read1): Likewise. Properly record start position of symbol.
12187
52968808
AS
12188 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12189 symbol character follows.
12190
9e381cdd
PE
121912011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12192
12193 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12194 This works around a problem with the previous change to Fcopy_file.
12195 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12196 and without this change, GCC might complain about discarding
12197 fchown's return value.
12198
b5641435
JB
121992011-07-16 Juanma Barranquero <lekktu@gmail.com>
12200
12201 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12202
a8031457
PE
122032011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12204
12205 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12206
dd889327
LMI
122072011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12208
750c33f7
LMI
12209 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12210 it's used from the C level.
12211
dd889327
LMI
12212 * process.c: Use the same condition for POLL_FOR_INPUT in both
12213 keyboard.c and process.c (bug#1858).
12214
87e86684
LM
122152011-07-09 Lawrence Mitchell <wence@gmx.li>
12216
12217 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12218 (Fgnutls_boot): Use it.
12219
64348f40
AS
122202011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12221
12222 * doc.c (Fsubstitute_command_keys): Revert last change.
12223
1d698799
LMI
122242011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12225
f863868c
LMI
12226 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12227 quotes the next character, and doesn't affect other longer
12228 sequences (bug#8935).
12229
1d698799
LMI
12230 * lread.c (syms_of_lread): Clarify that is isn't only
12231 `eval-buffer' and `eval-defun' that's affected by
12232 `lexical-binding' (bug#8460).
12233
aa4b6df6
EZ
122342011-07-15 Eli Zaretskii <eliz@gnu.org>
12235
12236 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 12237 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 12238
5d856da6
PE
122392011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12240
ad6042bb
PE
12241 Fix minor problems found by static checking.
12242 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12243 (elsz): Now a signed constant, not a size_t var. We prefer signed
12244 types to unsigned, to avoid integer comparison confusion. Without
12245 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12246 "cannot optimize loop, the loop counter may overflow", a symptom
12247 of the confusion.
f00bbb22 12248 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
12249 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12250
6468f31c
LMI
122512011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12252
49080b10
LMI
12253 * search.c (Fre_search_backward): Mention `case-fold-search' in
12254 all the re_search_* functions (bug#8138).
12255
6468f31c
LMI
12256 * keyboard.c (Fopen_dribble_file): Document when the file is
12257 closed (bug#8056).
12258
c965adc5
EZ
122592011-07-14 Eli Zaretskii <eliz@gnu.org>
12260
df9733bf
EZ
12261 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12262 bidi_cache_idx.
12263
0bb23927
EZ
12264 Support bidi reordering of display and overlay strings.
12265 * xdisp.c (compute_display_string_pos)
12266 (compute_display_string_end): Accept additional argument STRING.
12267 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12268 (reseat_to_string): Initialize bidi_it->string.s and
12269 bidi_it->string.schars.
12270 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
12271 NULL (avoids a crash in bidi_paragraph_init).
12272 Initialize itb.string.lstring.
0bb23927
EZ
12273 (init_iterator): Call bidi_init_it only of a valid
12274 buffer position was specified. Initialize paragraph_embedding to
12275 L2R.
12276 (reseat_to_string): Initialize the bidi iterator.
12277 (display_string): If we need to ignore text properties of
12278 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12279 original value of -1 will not work with bidi.)
12280 (compute_display_string_pos): First arg is now struct
12281 `text_pos *'; all callers changed. Support display properties on
12282 Lisp strings.
12283 (compute_display_string_end): Support display properties on Lisp
12284 strings.
12285 (init_iterator, reseat_1, reseat_to_string): Initialize the
12286 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12287 when iterating on a string not from display properties).
640c8776
SM
12288 (compute_display_string_pos, compute_display_string_end):
12289 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
12290 arrow keys.
12291 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
12292 base_level_stop; instead, set base_level_stop to BEGV.
12293 Fixes crashes in vertical-motion.
0bb23927
EZ
12294 (next_element_from_buffer): Improve commentary for when
12295 the iterator is before prev_stop.
12296 (init_iterator): Initialize bidi_p from the default value of
12297 bidi-display-reordering, not from buffer-local value. Use the
12298 buffer-local value only if initializing for buffer iteration.
12299 (handle_invisible_prop): Support invisible properties on strings
12300 that are being bidi-reordered.
12301 (set_iterator_to_next): Support bidi reordering of C strings and
12302 Lisp strings.
12303 (next_element_from_string): Support bidi reordering of Lisp
12304 strings.
12305 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
12306 (display_string): Support display of R2L glyph rows.
12307 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
12308 (init_iterator): Don't initialize it->bidi_p for strings
12309 here.
12310 (reseat_to_string): Initialize it->bidi_p for strings here.
12311 (next_element_from_string, next_element_from_c_string)
12312 (next_element_from_buffer): Add xassert's for correspondence
12313 between IT's object being iterated and it->bidi_it.string
12314 structure.
12315 (face_before_or_after_it_pos): Support bidi iteration.
12316 (next_element_from_c_string): Handle the case of the first string
12317 character that is not the first one in the visual order.
12318 (get_visually_first_element): New function, refactored from common
12319 parts of next_element_from_buffer, next_element_from_string, and
12320 next_element_from_c_string.
12321 (tool_bar_lines_needed, redisplay_tool_bar)
12322 (display_menu_bar): Force left-to-right direction. Add a FIXME
12323 comment for making that be controlled by a user option.
12324 (push_it, pop_it): Save and restore the state of the
12325 bidi iterator. Save and restore the bidi_p flag.
12326 (pop_it): Iterate out of display property for string iteration as
12327 well.
12328 (iterate_out_of_display_property): Support iteration over strings.
12329 (handle_single_display_spec): Set up it->bidi_it for iteration
12330 over a display string, and call bidi_init_it.
12331 (handle_single_display_spec, next_overlay_string)
12332 (get_overlay_strings_1, push_display_prop): Set up the bidi
12333 iterator for displaying display or overlay strings.
12334 (forward_to_next_line_start): Don't use the shortcut if
12335 bidi-iterating.
12336 (back_to_previous_visible_line_start): If handle_display_prop
12337 pushed the iterator stack, restore the internal state of the bidi
12338 iterator by calling bidi_pop_it same number of times.
12339 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12340 and we are bidi-iterating, don't decrement the iterator position;
12341 instead, set the first_elt flag in the bidi iterator, to produce
12342 the same effect.
12343 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12344 (push_display_prop): xassert that we are iterating a buffer.
12345 (push_it, pop_it): Save and restore paragraph_embedding member.
12346 (handle_single_display_spec, next_overlay_string)
12347 (get_overlay_strings_1, reseat_1, reseat_to_string)
12348 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12349 correctly. Don't assume unibyte strings are not bidi-reordered.
12350 (compute_display_string_pos)
12351 (compute_display_string_end): Fix handling the case of C string.
12352 (push_it, pop_it): Save and restore from_disp_prop_p.
12353 (handle_single_display_spec, push_display_prop): Set the
12354 from_disp_prop_p flag.
12355 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12356 (pop_it): Call iterate_out_of_display_property only if we are
12357 popping after iteration over a string that came from a display
12358 property. Fix a typo in popping stretch info. Add an assertion
12359 for verifying that the iterator position is in sync with the bidi
12360 iterator.
12361 (handle_single_display_spec, get_overlay_strings_1)
12362 (push_display_prop): Fix initialization of paragraph direction for
12363 string when that of the parent object is not yet determined.
12364 (reseat_1): Call bidi_init_it to resync the bidi
12365 iterator with IT's position. (Bug#7616)
12366 (find_row_edges): If ROW->start.pos gives position
12367 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12368 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12369 Reset the from_disp_prop_p flag.
12370 (SAVE_IT, RESTORE_IT): New macros.
12371 (pos_visible_p, face_before_or_after_it_pos)
12372 (back_to_previous_visible_line_start)
12373 (move_it_in_display_line_to, move_it_in_display_line)
12374 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12375 (try_scrolling, redisplay_window, display_line): Use them when
12376 saving a temporary copy of the iterator and restoring it back.
12377 (back_to_previous_visible_line_start, reseat_1)
12378 (init_iterator): Empty the bidi cache "stack".
12379 (move_it_in_display_line_to): If iterator ended up at
12380 EOL, but we never saw any buffer positions smaller than
12381 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12382 motion in bidi-reordered lines.
12383 (move_it_in_display_line_to): Record prev_method and prev_pos
12384 immediately before the call to set_iterator_to_next. Fixes cursor
12385 motion in bidi-reordered lines with stretch glyphs and strings
12386 displayed in margins. (Bug#8133) (Bug#8867)
12387 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12388 TO_CHARPOS.
640c8776
SM
12389 (pos_visible_p): Support positions in bidi-reordered lines.
12390 Save and restore bidi cache.
0bb23927
EZ
12391
12392 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12393 (bidi_paragraph_info): Delete unused struct.
12394 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12395 (bidi_cache_start): New variable.
12396 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12397 to zero.
12398 (bidi_cache_fetch_state, bidi_cache_search)
12399 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12400 (bidi_cache_find, bidi_peek_at_next_level)
12401 (bidi_level_of_next_char, bidi_find_other_level_edge)
12402 (bidi_move_to_visually_next): Compare cache index with
12403 bidi_cache_start rather than with zero.
12404 (bidi_fetch_char): Accept new argument STRING; all callers
12405 changed. Support iteration over a string. Support strings with
12406 display properties. Support unibyte strings. Fix the type of
12407 `len' according to what STRING_CHAR_AND_LENGTH expects.
12408 (bidi_paragraph_init, bidi_resolve_explicit_1)
12409 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
12410 (bidi_level_of_next_char, bidi_move_to_visually_next):
12411 Support iteration over a string.
0bb23927
EZ
12412 (bidi_set_sor_type, bidi_resolve_explicit_1)
12413 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12414 can now be zero (for strings); special values 0 and -1 were
12415 changed to -1 and -2, respectively.
12416 (bidi_char_at_pos): New function.
12417 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12418 Call it instead of FETCH_MULTIBYTE_CHAR.
12419 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12420 initialized to valid values.
12421 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12422 values.
12423 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12424 the test for valid cached positions. Fix the logic for looking up
12425 the sentinel state in the cache. GCPRO the Lisp string we are
12426 iterating.
12427 (bidi_push_it, bidi_pop_it): New functions.
12428 (bidi_initialize): Initialize the bidi cache start stack pointer.
12429 (bidi_cache_ensure_space): New function, refactored from part of
12430 bidi_cache_iterator_state. Don't assume the required size is just
12431 one BIDI_CACHE_CHUNK away.
12432 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12433 (bidi_count_bytes, bidi_char_at_pos): New functions.
12434 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12435 always valid if bidi_cache_idx is valid.
12436 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12437 is valid if it's going to be used.
12438 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12439 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
12440 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12441 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
12442 (bidi_find_other_level_edge, bidi_cache_start_stack):
12443 All variables related to cache indices are now EMACS_INT.
c965adc5 12444
0bb23927
EZ
12445 * dispextern.h (struct bidi_string_data): New structure.
12446 (struct bidi_it): New member `string'. Make flag members be 1-bit
12447 fields, and put them last in the struct.
640c8776
SM
12448 (compute_display_string_pos, compute_display_string_end):
12449 Update prototypes.
0bb23927
EZ
12450 (bidi_push_it, bidi_pop_it): Add prototypes.
12451 (struct iterator_stack_entry): New members bidi_p,
12452 paragraph_embedding, and from_disp_prop_p.
12453 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
12454 (bidi_shelve_cache, bidi_unshelve_cache):
12455 Declare prototypes.
0bb23927
EZ
12456
12457 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12458 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12459 and vector-like objects.
12460
12461 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12462 cache around display iteration.
12463
12464 * window.c (Fwindow_end, window_scroll_pixel_based)
12465 (displayed_window_lines, Frecenter): Save and restore the bidi
12466 cache around display iteration.
12467
3bbd2265
LMI
124682011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12469
12470 * editfns.c (Fdelete_region): Clarify the use of the named
12471 parameters (bug#6788).
12472
adc47434
MR
124732011-07-14 Martin Rudalics <rudalics@gmx.at>
12474
12475 * indent.c (Fvertical_motion): Set and restore w->pointm when
12476 saving and restoring the window's buffer (Bug#9006).
12477
837c31f8
LMI
124782011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12479
12480 * editfns.c (Fstring_to_char): Clarify just what is returned
12481 (bug#6576). Text by Eli Zaretskii.
12482
ac389d0c
JB
124832011-07-13 Juanma Barranquero <lekktu@gmail.com>
12484
12485 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12486
0be0ce47
EZ
124872011-07-13 Eli Zaretskii <eliz@gnu.org>
12488
12489 * buffer.c (mmap_find): Fix a typo.
12490
cd18e7e3
JB
124912011-07-13 Johan Bockgård <bojohan@gnu.org>
12492
12493 Fix execution of x selection hooks.
12494 * xselect.c (Qx_lost_selection_functions)
12495 (Qx_sent_selection_functions): New vars.
12496 (syms_of_xselect): DEFSYM them.
12497 (x_handle_selection_request): Pass Qx_sent_selection_functions
12498 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12499 (x_handle_selection_clear,x_clear_frame_selections):
12500 Pass Qx_lost_selection_functions rather than
12501 Vx_lost_selection_functions to Frun_hook_with_args.
12502
47ea7f44
PE
125032011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12504
ac389d0c 12505 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
12506 The old code sometimes used this field without initializing it.
12507
47ea7f44
PE
12508 * alloc.c (gc_sweep): Don't read past end of array.
12509 In theory, the old code could also have corrupted Emacs internals,
12510 though it'd be very unlikely.
12511
bc985c87
AS
125122011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12513
12514 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 12515 argument. (Bug#4026)
bc985c87 12516
0cf34688
LMI
125172011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12518
b3dadd76
LMI
12519 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12520 key" (bug#4257).
12521
0cf34688
LMI
12522 * window.c (Fset_window_start): Doc fix (bug#4199).
12523 (Fset_window_hscroll): Ditto.
12524
270768cd
PE
125252011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12526
077e3dda 12527 Fix minor new problems caught by GCC 4.6.1.
270768cd 12528 * term.c (init_tty): Remove unused local.
490011a6 12529 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 12530 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 12531 not used otherwise.
270768cd 12532
b1f58454
CY
125332011-07-12 Chong Yidong <cyd@stupidchicken.com>
12534
12535 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12536
22b9578d
LMI
125372011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12538
6e70ab07
LMI
12539 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12540 are the mini-buffer and the echo area (bug#3320).
12541
22b9578d
LMI
12542 * term.c (init_tty): Remove support for supdup, c10 and perq
12543 terminals, which are no longer supported (bug#1482).
12544
8974cc9f
JB
125452011-07-10 Johan Bockgård <bojohan@gnu.org>
12546
12547 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12548
a560d974
JD
125492011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12550
12551 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12552 for non-popups (Bug#3642).
12553
1dae0f0a
AS
125542011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12555
268c2c36 12556 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 12557 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
12558 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12559 * cm.c (losecursor): Likewise.
1dae0f0a
AS
12560 * data.c (fmod): Likewise.
12561 * dispnew.c (swap_glyphs_in_rows): Likewise.
12562 * emacs.c (memory_warning_signal): Likewise.
12563 * floatfns.c (float_error): Likewise.
12564 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12565 (otf_open, font_otf_capability, generate_otf_features)
12566 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12567 Likewise.
12568 * image.c (pbm_read_file): Likewise.
12569 * indent.c (string_display_width): Likewise.
12570 * intervals.c (check_for_interval, search_for_interval)
12571 (inc_interval_count, count_intervals, root_interval)
12572 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12573 * lread.c (defalias): Likewise.
268c2c36 12574 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
12575 * regex.c (set_image_of_range_1, set_image_of_range)
12576 (regex_grow_registers): Likewise.
12577 * sysdep.c (strerror): Likewise.
12578 * termcap.c (valid_filename_p, tprint, main): Likewise.
12579 * tparam.c (main): Likewise.
12580 * unexhp9k800.c (run_time_remap, save_data_space)
12581 (update_file_ptrs, read_header, write_header, calculate_checksum)
12582 (copy_file, copy_rest, display_header): Likewise.
12583 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12584 Likewise.
12585 * xdisp.c (check_it): Likewise.
12586 * xfaces.c (register_color, unregister_color, unregister_colors):
12587 Likewise.
12588 * xfns.c (print_fontset_result): Likewise.
12589 * xrdb.c (member, fatal, main): Likewise.
12590
99033785
PE
125912011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12592
12593 Fix minor problems found by static checking (Bug#9031).
12594 * chartab.c (char_table_set_range, map_sub_char_table):
12595 Remove unused locals.
12596 (uniprop_table): Now static.
12597 * composite.c (_work_char): Remove unused static var.
12598
9cb2ac56
JB
125992011-07-09 Juanma Barranquero <lekktu@gmail.com>
12600
12601 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12602
f25661f0
JD
126032011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12604
12605 * gtkutil.c (qttip_cb): Remove code without function.
12606
8278c4fe
EZ
126072011-07-09 Eli Zaretskii <eliz@gnu.org>
12608
12609 * w32.c (pthread_sigmask): New stub.
12610
1692ae2d 126112011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 12612
8a6ebd58 12613 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
12614 sigprocmask is portable only for single-threaded applications, and
12615 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
12616 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12617 (LIBES): Use it.
12618 * callproc.c (Fcall_process):
12619 * process.c (create_process):
12620 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12621 Use pthread_sigmask, not sigprocmask.
123403e4 12622
1b854618
JD
126232011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12624
12625 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12626 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12627 wrong (Bug#8591).
12628
3fe4b549
JD
126292011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12630
0ce7e563
JD
12631 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12632 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12633 (xg_hide_tooltip): Fix comment.
12634
3fe4b549
JD
12635 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12636 in registerServicesMenuSendTypes.
12637 (validRequestorForSendType): Don't check ns_return_types.
12638
12639 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12640 ns_return_type.
12641
5df75e47
JR
126422011-07-08 Jason Rumney <jasonr@gnu.org>
12643
22610910
JR
12644 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12645 SH_SHOW for hidden windows (Bug#5482).
12646
5df75e47
JR
12647 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12648 frame struct members of non-existent frames (Bug#6284).
12649
699c10bd
JD
126502011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12651
4393663b
JD
12652 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12653 variable firstTime not needed on OSX >= 10.6.
12654 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12655 >= 10.5. Use setKnobProportion, setDoubleValue.
12656
12657 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12658 (MAC_OS_X_VERSION_10_5): Define if not defined.
12659 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12660 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12661 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12662
12663 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 12664 cString and lossyCString on OSX >= 10.4.
4393663b 12665
58179cce 12666 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
12667 sizeToFit on OSX >= 10.2.
12668
12669 * nsimage.m (allocInitFromFile): Don't use deprecated method
12670 bestRepresentationForDevice on OSX >= 10.6.
12671
12672 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12673 to avoid warning.
12674
12675 * emacs.c: Declare unexec_init_emacs_zone.
12676
a63e0781
JD
12677 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12678
699c10bd
JD
12679 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12680
12681 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12682 on svcsMenu (Bug#8842).
12683
12684 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12685 ns_return_types.
12686 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12687
12688 * nsterm.m (QUTF8_STRING): Declare.
12689 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12690 (validRequestorForSendType): Return type is (id).
12691 Change indexOfObjectIdenticalTo to indexOfObject.
12692 Check if we have local selection before returning self (Bug#8842).
12693 (writeSelectionToPasteboard): Put local selection into paste board
12694 if we have a local selection (Bug#8842).
12695 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12696
12697 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12698 (ns_get_local_selection): Declare.
12699
54e10184
LMI
127002011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12701
9888ff71
LMI
12702 * keymap.c (describe_map_tree): Don't insert a double newline at
12703 the end of the buffer (bug#1169) and return whether we inserted
12704 something.
12705
54e10184
LMI
12706 * callint.c (Fcall_interactively): Change "reading args" to
12707 "providing args" to try to clarify what it does (bug#1010).
12708
15fa4783
KH
127092011-07-07 Kenichi Handa <handa@m17n.org>
12710
12711 * composite.c (composition_compute_stop_pos): Ignore a static
12712 composition starting before CHARPOS (Bug#8915).
12713
12714 * xdisp.c (handle_composition_prop): Likewise.
12715
a8815b00
EZ
127162011-07-07 Eli Zaretskii <eliz@gnu.org>
12717
12718 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12719 (Bug#9015)
12720
ef7b981d 127212011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
12722
12723 * character.h (unicode_category_t): New enum type.
12724
12725 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12726 (Qchar_code_property_table): New variable.
12727 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12728 (UNIPROP_COMPRESSED_FORM_P): New macros.
12729 (char_table_ascii): Uncompress the compressed values.
12730 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12731 Uncompress the compressed values.
ac389d0c 12732 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
12733 (char_table_ref_and_range): Uncompress the compressed values.
12734 (sub_char_table_set): New arg is_uniprop. Callers changed.
12735 Uncompress the compressed values.
12736 (sub_char_table_set_range): Args changed. Callers changed.
12737 (char_table_set_range): Adjuted for the above change.
12738 (map_sub_char_table): Delete args default_val and parent. Add arg
12739 top. Give decoded values to a Lisp function.
640c8776 12740 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
12741 values to a Lisp function. Gcpro more variables.
12742 (uniprop_table_uncompress)
12743 (uniprop_decode_value_run_length): New functions.
12744 (uniprop_decoder, uniprop_decoder_count): New variables.
12745 (uniprop_get_decoder, uniprop_encode_value_character)
12746 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12747 New functions.
12748 (uniprop_encoder, uniprop_encoder_count): New variables.
12749 (uniprop_get_encoder, uniprop_table)
12750 (Funicode_property_table_internal, Fget_unicode_property_internal)
12751 (Fput_unicode_property_internal): New functions.
12752 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12753 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 12754 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
12755 char-code-property-alist.
12756
640c8776 12757 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
12758 Vunicode_category_table.
12759
640c8776 12760 * font.c (font_range): Adjust for the change of
c805dec0
KH
12761 Vunicode_category_table.
12762
76b397fb
DN
127632011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12764
12765 * m/iris4d.h: Remove file, move contents ...
12766 * s/irix6-5.h: ... here.
12767
22b4128e
PE
127682011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12769
12770 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
12771 * alloc.c (mark_buffer):
12772 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12773 (clone_per_buffer_values): Don't assume that
22b4128e
PE
12774 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12775 This isn't true in general, and it's particularly not true
12776 if Emacs is configured with --with-wide-int.
12777 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12778 New macros, used in the buffer.c change.
12779
869795d6
JD
127802011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12781
12782 * xsettings.c: Use both GConf and GSettings if both are available.
12783 (store_config_changed_event): Add comment.
12784 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12785 (store_tool_bar_style_changed): New functions.
5e617bc2 12786 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
12787 (struct xsettings): Move font inside HAVE_XFT.
12788 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 12789 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 12790 Move inside HAVE_XFT.
640c8776 12791 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
12792 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12793 also.
12794 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 12795 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 12796 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
12797 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12798 (parse_settings): Move check for font inside HAVE_XFT.
12799 (read_settings, apply_xft_settings): Add comment.
12800 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12801 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12802 call store_font_name_changed.
12803 (xft_settings_event): Add comment.
12804 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12805 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12806 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12807 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12808 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
12809 (xsettings_get_system_font, xsettings_get_system_normal_font):
12810 Add comment.
869795d6 12811
d8ed26bd
PE
128122011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12813
12814 Random fixes. E.g., (random) never returned negative values.
12815 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12816 subseconds part to the entropy, as that's a bit more random.
12817 Prefer signed to unsigned, since the signedness doesn't matter and
12818 in general we prefer signed. When given a limit, use a
12819 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12820 latter isn't right if USE_2_TAGS_FOR_INTS.
12821 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12822 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12823
cabf1cac
SM
128242011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12825
12826 * textprop.c (text_property_stickiness):
12827 Obey Vtext_property_default_nonsticky.
12828 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12829 * w32fns.c (syms_of_w32fns):
12830 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12831
6e9b2be9
PE
128322011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12833
12834 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12835 This is more efficient than Ffile_directory_p and avoids a minor race.
12836
90186c68
LMI
128372011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12838
7c301272
LMI
12839 * buffer.c (Foverlay_put): Say what the return value is
12840 (bug#7835).
12841
c4f2d8d4
LMI
12842 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12843 is a directory before asking whether to use the file name
12844 (bug#7564).
ad637907
LMI
12845 (barf_or_query_if_file_exists): Make the "File is a directory"
12846 error be more correct.
c4f2d8d4 12847
90186c68
LMI
12848 * fns.c (Frequire): Remove the mention of the .gz files, since
12849 that's installation-specific, but keep the mention of
12850 `get-load-suffixes'.
12851
da64016e
PE
128522011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12853
12854 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12855 Report string overflow if the output is too long.
12856
7d47b580
JB
128572011-07-04 Juanma Barranquero <lekktu@gmail.com>
12858
a555cb87
JB
12859 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12860 (syms_of_gnutls): Remove duplicate DEFSYM for
12861 Qgnutls_bootprop_verify_hostname_error, an error for
12862 Qgnutls_bootprop_verify_error (which is no longer used).
12863
7d47b580
JB
12864 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12865 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12866 Also (re)move comments that are misplaced or no longer relevant.
12867
1e49bfab
LMI
128682011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12869
12870 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12871
1485f4c0
CY
128722011-07-03 Chong Yidong <cyd@stupidchicken.com>
12873
12874 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12875 and background color parameters if they have been changed.
12876
a9ab721e
LMI
128772011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12878
12879 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12880
cf7cff57
PE
128812011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12882
2e13213d
PE
12883 * xsettings.c (SYSTEM_FONT): Define only when used.
12884 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12885
cf7cff57
PE
12886 * keymap.c (access_keymap_1): Now static.
12887
7a8e04f7
CY
128882011-07-02 Chong Yidong <cyd@stupidchicken.com>
12889
12890 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12891 leave any prefix arg for the up event (Bug#1586).
12892
61352f62
LMI
128932011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12894
69bb1ef7
LMI
12895 * lread.c (syms_of_lread): Mention single symbols defined by
12896 `defvar' or `defconst' (bug#7154).
12897
61352f62 12898 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 12899 (Frequire): Mention get-load-suffixes.
61352f62 12900
28545e04
MR
129012011-07-02 Martin Rudalics <rudalics@gmx.at>
12902
12903 * window.h (window): Remove clone_number slot.
12904 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12905 Remove.
12906 (make_parent_window, make_window, saved_window)
12907 (Fset_window_configuration, save_window_save): Don't deal with
12908 clone numbers.
12909 * buffer.c (Qclone_number): Remove declaration.
12910 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12911
3349e122
SM
129122011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12913
12914 Add multiple inheritance to keymaps.
12915 * keymap.c (Fmake_composed_keymap): New function.
12916 (Fset_keymap_parent): Simplify.
12917 (fix_submap_inheritance): Remove.
12918 (access_keymap_1): New function extracted from access_keymap to handle
12919 embedded parents and handle lists of maps.
12920 (access_keymap): Use it.
12921 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12922 (Fcopy_keymap): Handle embedded parents.
12923 (Fcommand_remapping, define_as_prefix): Simplify.
12924 (Fkey_binding): Simplify.
12925 (syms_of_keymap): Move minibuffer-local-completion-map,
12926 minibuffer-local-filename-completion-map,
12927 minibuffer-local-must-match-map, and
12928 minibuffer-local-filename-must-match-map to Elisp.
12929 (syms_of_keymap): Defsubr make-composed-keymap.
12930 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12931 (parse_menu_item): Trivial simplification.
12932
3279eb87
GM
129332011-07-01 Glenn Morris <rgm@gnu.org>
12934
12935 * Makefile.in (SETTINGS_LIBS): Fix typo.
12936
39cb9e56 129372011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
12938
12939 * coding.c (Fencode_coding_string): Record the last coding system
12940 used, as the function doc string says (bug#8738).
12941
0949d2b6
JD
129422011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12943
12944 * xsettings.c (store_monospaced_changed): Take new font as arg and
12945 check for change against current_mono_font.
12946 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12947 (emacs_settings_constructor, emacs_settings_get_property)
12948 (emacs_settings_set_property, emacs_settings_class_init)
12949 (emacs_settings_init, gsettings_obj): Remove.
12950 (something_changedCB): New function for HAVE_GSETTINGS.
12951 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12952 with value as argument.
12953 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12954 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 12955 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
12956 "changed".
12957
12958 * xgselect.c: Add defined (HAVE_GSETTINGS).
12959 (xgselect_initialize): Ditto.
12960
12961 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12962 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12963 xg_select.
12964
bbc6b304
PE
129652011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12966
12967 * eval.c (struct backtrace): Simplify and port the data structure.
12968 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12969 signed bit field, as this assumption is not portable and it makes
12970 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12971 "char debug_on_exit : 1" as this is not portable either; instead,
12972 use the portable "unsigned int debug_on_exit : 1". Remove unused
12973 member evalargs. Remove obsolete comments about cc bombing out.
12974
9851bfc5
JD
129752011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12976
51bb811f 12977 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
12978 Let HAVE_GSETTINGS override HAVE_GCONF.
12979 (store_monospaced_changed): New function.
12980 (EMACS_SETTINGS): A new type derived from GObject to handle
12981 GSettings notifications.
12982 (emacs_settings_constructor, emacs_settings_get_property)
12983 (emacs_settings_set_property, emacs_settings_class_init):
12984 New functions.
12985 (gsettings_client, gsettings_obj): New variables.
12986 (GSETTINGS_SCHEMA): New define.
12987 (something_changedCB): Call store_monospaced_changed.
12988 (init_gsettings): New function.
12989 (xsettings_initialize): Call init_gsettings.
12990 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12991 to NULL.
12992
640c8776 12993 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
12994 GCONF_CFLAGS/LIBS.
12995
5386012d
MR
129962011-06-29 Martin Rudalics <rudalics@gmx.at>
12997
12998 * window.c (resize_root_window, grow_mini_window)
12999 (shrink_mini_window): Rename Qresize_root_window to
13000 Qwindow_resize_root_window and Qresize_root_window_vertically to
13001 Qwindow_resize_root_window_vertically.
13002
f13e0b08
PE
130032011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13004
13005 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13006
94515237
JB
130072011-06-27 Juanma Barranquero <lekktu@gmail.com>
13008
13009 * makefile.w32-in: Redesign dependencies so they reflect more
13010 clearly which files are directly included by each source file,
13011 and not through other includes.
13012
e43b6e43
MR
130132011-06-27 Martin Rudalics <rudalics@gmx.at>
13014
13015 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13016 (sort_overlays, overlay_strings): When an overlay's clone number
13017 matches the window's clone number process the overlay even if
13018 the overlay's window property doesn't match the current window.
13019
d68443dc
MR
13020 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13021 (Fwindow_hchild): Rename to Fwindow_left_child.
13022 (Fwindow_next): Rename to Fwindow_next_sibling.
13023 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
13024 (resize_window_check): Rename to window_resize_check.
13025 (resize_window_apply): Rename to window_resize_apply.
13026 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13027 (Fdelete_other_windows_internal, resize_frame_windows)
13028 (Fsplit_window_internal, Fdelete_window_internal)
13029 (grow_mini_window, shrink_mini_window)
13030 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 13031
c7e73be5
JD
130322011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13033
13034 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13035 (emacs_fixed_set_min_size): Remove.
13036 (emacs_fixed_new): Take frame as argument.
13037
13038 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13039 (_EmacsFixedPrivate): Remove minwidth/height.
13040 Add struct frame *f.
13041 (emacs_fixed_init): Initialize priv->f.
13042 (get_parent_class, emacs_fixed_set_min_size): Remove.
13043 (emacs_fixed_new): Set priv->f to argument.
13044 (emacs_fixed_get_preferred_width)
13045 (emacs_fixed_get_preferred_height): Use min_width/height from
13046 frames size_hint to set minimum and natural (Bug#8919).
13047 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13048 and use min_width/height from frames size_hint to set
13049 min_width/height (Bug#8919).
13050
13051 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
13052 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13053 Fix indentation.
c7e73be5 13054
cf99dcf8
EZ
130552011-06-26 Eli Zaretskii <eliz@gnu.org>
13056
13057 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13058 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13059 called at ZV.
13060
029529ac
CY
130612011-06-26 Chong Yidong <cyd@stupidchicken.com>
13062
13063 * process.c (wait_reading_process_output): Bypass select if
13064 waiting for a cell while ignoring keyboard input, and input is
13065 pending. Suggested by Jan Djärv (Bug#8869).
13066
7a7ef429
PE
130672011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13068
13069 Use gnulib's dup2 module instead of rolling our own.
13070 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13071
11fdef7d 130722011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
13073
13074 * dispnew.c (scrolling_window): Before scrolling, turn off a
13075 mouse-highlight in the window being scrolled.
13076
cd3520a4
JB
130772011-06-24 Juanma Barranquero <lekktu@gmail.com>
13078
13079 Move DEFSYM to lisp.h and use everywhere.
13080
13081 * character.h (DEFSYM): Move declaration...
13082 * lisp.h (DEFSYM): ...here.
13083
13084 * gnutls.c:
13085 * minibuf.c:
13086 * w32menu.c:
13087 * w32proc.c:
13088 * w32select.c: Don't include character.h.
13089
13090 * alloc.c (syms_of_alloc):
13091 * buffer.c (syms_of_buffer):
13092 * bytecode.c (syms_of_bytecode):
13093 * callint.c (syms_of_callint):
13094 * casefiddle.c (syms_of_casefiddle):
13095 * casetab.c (init_casetab_once):
13096 * category.c (init_category_once, syms_of_category):
13097 * ccl.c (syms_of_ccl):
13098 * cmds.c (syms_of_cmds):
13099 * composite.c (syms_of_composite):
13100 * dbusbind.c (syms_of_dbusbind):
13101 * dired.c (syms_of_dired):
13102 * dispnew.c (syms_of_display):
13103 * doc.c (syms_of_doc):
13104 * editfns.c (syms_of_editfns):
13105 * emacs.c (syms_of_emacs):
13106 * eval.c (syms_of_eval):
13107 * fileio.c (syms_of_fileio):
13108 * fns.c (syms_of_fns):
13109 * frame.c (syms_of_frame):
13110 * fringe.c (syms_of_fringe):
13111 * insdel.c (syms_of_insdel):
13112 * keymap.c (syms_of_keymap):
13113 * lread.c (init_obarray, syms_of_lread):
13114 * macros.c (syms_of_macros):
13115 * msdos.c (syms_of_msdos):
13116 * print.c (syms_of_print):
13117 * process.c (syms_of_process):
13118 * search.c (syms_of_search):
13119 * sound.c (syms_of_sound):
13120 * syntax.c (init_syntax_once, syms_of_syntax):
13121 * terminal.c (syms_of_terminal):
13122 * textprop.c (syms_of_textprop):
13123 * undo.c (syms_of_undo):
13124 * w32.c (globals_of_w32):
13125 * window.c (syms_of_window):
13126 * xdisp.c (syms_of_xdisp):
13127 * xfaces.c (syms_of_xfaces):
13128 * xfns.c (syms_of_xfns):
13129 * xmenu.c (syms_of_xmenu):
13130 * xsettings.c (syms_of_xsettings):
13131 * xterm.c (syms_of_xterm): Use DEFSYM.
13132
4228cf16
TZ
131332011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13134
cd3520a4 13135 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 13136
7fcccf1e
PE
131372011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13138
7efb4e0e
PE
13139 Integer and buffer overflow fixes (Bug#8873).
13140
ff5844ad
PE
13141 * print.c (printchar, strout): Check for string overflow.
13142 (PRINTPREPARE, printchar, strout):
13143 Don't set size unless allocation succeeds.
13144
90532f02
PE
13145 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13146 for sizes. Check for string overflow more accurately.
13147 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13148
6d84508d
PE
13149 * macros.c: Integer and buffer overflow fixes.
13150 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13151 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13152 Use ptrdiff_t, not int, for sizes.
13153 Don't increment bufsize until after realloc succeeds.
13154 Check for size-calculation overflow.
13155 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13156
437b2cb4
PE
13157 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13158
8b9ac8b4
PE
13159 * lread.c: Integer overflow fixes.
13160 (read_integer): Radix is now EMACS_INT, not int,
13161 to improve quality of diagnostics for out-of-range radices.
13162 Calculate buffer size correctly for out-of-range radices.
13163 (read1): Check for integer overflow in radices, and in
13164 read-circle numbers.
82cb60d3
PE
13165 (read_escape): Avoid int overflow.
13166 (Fload, openp, read_buffer_size, read1)
13167 (substitute_object_recurse, read_vector, read_list, map_obarray):
13168 Use ptrdiff_t, not int, for sizes.
13169 (read1): Use EMACS_INT, not int, for sizes.
20270765 13170 Check for size overflow.
8b9ac8b4 13171
7fcccf1e
PE
13172 * image.c (cache_image): Check for size arithmetic overflow.
13173
bfbbd7e7
PE
13174 * lread.c: Integer overflow issues.
13175 (saved_doc_string_size, saved_doc_string_length)
13176 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13177 Now ptrdiff_t, not int.
13178 (read1): Don't assume doc string length fits in int. Check for
13179 out-of-range doc string lengths.
13180 (read_list): Don't assume file position fits in int.
39019e54 13181 (read_escape): Check for hex character overflow.
bfbbd7e7 13182
4e323265
LL
131832011-06-22 Leo Liu <sdl.web@gmail.com>
13184
13185 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13186 Move to minibuffer.el.
13187
85fece3e
PE
131882011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13189
20b84ce9 13190 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
13191 The following patches are for when GLYPH_DEBUG && !XASSERT.
13192 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13193 * dispnew.c (flush_stdout):
13194 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13195 Mark as externally visible.
13196 * dispnew.c (check_window_matrix_pointers): Now static.
13197 * dispnew.c (window_to_frame_vpos):
13198 * xfns.c (unwind_create_frame):
13199 * xterm.c (x_check_font): Remove unused local.
13200 * scroll.c (CHECK_BOUNDS):
13201 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13202 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13203 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13204 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13205 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13206 Now static.
13207 (debug_method_add): Use va_list and vsprintf rather than relying
13208 on undefined behavior with wrong number of arguments.
13209 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13210 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13211 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13212 since we're not interested in debugging glyphs with old libraries.
13213 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13214 GCC 4.6.0's static checking.
13215
0766b489
PE
132162011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13217
31fd4b32
PE
13218 Integer overflow and signedness fixes (Bug#8873).
13219 A few related buffer overrun fixes, too.
13220
b79e8648
PE
13221 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13222
0766b489
PE
13223 * dispextern.h (struct face.stipple):
13224 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13225 (x_bitmap_mask, x_allocate_bitmap_record)
13226 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13227 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13228 (x_create_bitmap_from_xpm_data):
13229 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13230 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13231 (.bitmaps_last):
13232 * xfaces.c (load_pixmap):
13233 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13234 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13235 (.bitmaps_last, struct x_output.icon_bitmap):
13236 Use ptrdiff_t, not int, for bitmap indexes.
13237 (x_allocate_bitmap_record): Check for size overflow.
13238 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13239
b081724f
PE
13240 Use ptrdiff_t, not int, for overlay counts.
13241 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13242 * editfns.c (overlays_around, get_pos_property):
13243 * textprop.c (get_char_property_and_overlay):
13244 * xdisp.c (next_overlay_change, note_mouse_highlight):
13245 * xfaces.c (face_at_buffer_position):
21514da7
PE
13246 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13247 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13248 (Fnext_overlay_change, Fprevious_overlay_change)
13249 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 13250 Use ptrdiff_t, not int, for sizes.
21514da7 13251 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 13252
3de73e5e
PE
13253 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13254
2606c57b
PE
13255 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13256 (x_session_initialize): Do not assume string length fits in int.
13257
aaafe47a
PE
13258 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13259 This is unlikely, but can occur if DPI is outlandish.
13260
2674ddc8 13261 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
13262 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13263
28154962
PE
13264 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13265 * xrdb.c (magic_file_p, search_magic_path):
13266 Omit last arg SUFFIX; it was always 0. All callers changed.
13267 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13268
7de51af5
PE
13269 * xfont.c (xfont_match): Avoid need for strlen.
13270
25ed6cc3
PE
13271 * xfns.c: Don't assume strlen fits in int.
13272 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13273
4eab31dd
PE
13274 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13275 not unsigned long, as we prefer signed integers. All callers changed.
13276 Detect integer overflow in repeat count.
13277 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 13278 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 13279
171e2a58
PE
13280 * termcap.c: Don't assume sizes fit in int and never overflow.
13281 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13282 (gobble_line): Check for size-calculation overflow.
13283
ad39faca 13284 * minibuf.c (Fread_buffer):
6e5bb2dc 13285 * lread.c (intern, intern_c_string):
74ca2eb3
PE
13286 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13287 Don't assume string length fits in int.
13288
52c61c22 13289 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
13290 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13291
b5b8c9e5
PE
13292 * font.c: Don't assume string length fits in int.
13293 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13294 Use ptrdiff_t, not int.
ccd6111c
PE
13295 (font_intern_prop): Don't assume string length fits in int.
13296 Don't assume integer property fits in fixnum.
13297 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 13298
882f0d81 13299 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 13300 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
13301 Reformulate so as not to need the command string.
13302 Invoke gzip -cd rather than gunzip, as it's more portable.
13303 (lock_info_type, lock_file_1, lock_file):
13304 Don't assume pid_t and time_t fit in unsigned long.
13305 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13306 (current_lock_owner): Prefer signed type for sizes.
13307 Use memcpy, not strncpy, where memcpy is what is really wanted.
13308 Don't assume (via atoi) that time_t and pid_t fit in int.
13309 Check for time_t and/or pid_t out of range, e.g., via a network share.
13310 Don't alloca where an auto var works fine.
13311
93f4cf88
PE
13312 * fileio.c: Fix some integer overflow issues.
13313 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13314 Don't assume string length fits in int.
13315 (directory_file_name): Don't assume string length fits in long.
13316 (make_temp_name): Don't assume pid fits in int, or that its print
13317 length is less than 20.
13318
f3e92b69
PE
13319 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13320
1bfdaf10
PE
13321 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13322
35016e9a
PE
13323 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13324
3d1e65a1
PE
13325 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13326 We prefer signed integers, even for size calculations.
13327
0b963a93
PE
13328 * emacs.c: Don't assume string length fits in 'int'.
13329 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13330 (main): Don't invoke strlen when not needed.
13331
573f4b54
PE
13332 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13333 (XD_DEBUG_MESSAGE): Don't waste a byte.
13334
989f33ba
PE
13335 * callproc.c (getenv_internal_1, getenv_internal)
13336 (Fgetenv_internal):
965d34eb
PE
13337 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13338
e4d29b33
PE
13339 * lread.c (invalid_syntax): Omit length argument.
13340 All uses changed. This doesn't fix a bug, but it simplifies the
13341 code away from its former Hollerith-constant appearance, and it's
13342 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 13343 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 13344
eb49b136
PE
13345 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13346 This didn't break anything, but it didn't help either.
13347 It's confusing to put a bogus integer in a place where the actual
13348 value does not matter.
9f62aeb1 13349 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 13350 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 13351
15375a22
PE
13352 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13353 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13354 implementation.
b61cc01c
PE
13355 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13356 We prefer signed types, and the value cannot exceed the EMACS_INT
13357 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
13358 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13359 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13360 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 13361
53b2623d
PE
13362 * indent.c (sane_tab_width): New function.
13363 (current_column, scan_for_column, Findent_to, position_indentation)
13364 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 13365 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 13366
51cab52b 13367 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 13368
f2ed8a70
PE
13369 * lisp.h (lint_assume): New macro.
13370 * composite.c (composition_gstring_put_cache):
13371 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13372
abe80cc6
PE
13373 * editfns.c, insdel.c:
13374 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 13375
b02c740e
PE
13376 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13377
ebc96716
PE
13378 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13379
b4e50fa0 13380 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 13381 Use much-faster test for byte-length change.
311d5d7c 13382 Don't assume string byte-length fits in 'int'.
a4cf38e4 13383 Check that character arg fits in 'int'.
85461888 13384 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 13385
c0c1ee9f
PE
13386 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13387
a498d7f4
PE
13388 * fns.c (concat): Catch string overflow earlier.
13389 Do not rely on integer wraparound.
13390
51cab52b
PE
13391 * dispextern.h (struct it.overlay_strings_charpos)
13392 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
13393 * xdisp.c (forward_to_next_line_start)
13394 (back_to_previous_visible_line_start)
13395 (reseat_at_next_visible_line_start, next_element_from_buffer):
13396 Don't arbitrarily truncate the value of 'selective' to int.
13397
76031fad
PE
13398 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13399
5eb55db9
PE
13400 * composite.c: Don't truncate sizes to 'int'.
13401 (composition_gstring_p, composition_reseat_it)
13402 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
13403 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13404 not EMACS_UINT, for indexes.
5eb55db9 13405
0703a717
PE
13406 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13407
d6202519
PE
13408 * buffer.c: Include <verify.h>.
13409 (struct sortvec.priority, struct sortstr.priority):
8961a454 13410 Now EMACS_INT, not int.
c20998a7 13411 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
13412 (struct sortstr.size, record_overlay_string)
13413 (struct sortstrlist.size, struct sortlist.used):
13414 Don't truncate size to int.
13415 (record_overlay_string): Check for size-calculation overflow.
d6202519 13416 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 13417
d5a19415
JM
134182011-06-22 Jim Meyering <meyering@redhat.com>
13419
029529ac 13420 Don't leak an XBM-image-sized buffer
d5a19415
JM
13421 * image.c (xbm_load): Free the image buffer after using it.
13422
a9041e6c
PE
134232011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13424
13425 Port to Sun C.
13426 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13427 that Sun C diagnosed.
13428 * fns.c (secure_hash): Fix pointer signedness issue.
13429 * intervals.c (static_offset_intervals): New function.
13430 (offset_intervals): Use it.
13431
7f3f739f
LL
134322011-06-21 Leo Liu <sdl.web@gmail.com>
13433
13434 * deps.mk (fns.o):
13435 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13436 sha512.h.
13437
13438 * fns.c (secure_hash): Rename from crypto_hash_function and change
13439 the first arg to accept symbols.
5b66d427 13440 (Fsecure_hash): New primitive.
7f3f739f
LL
13441 (syms_of_fns): New symbols.
13442
76147d94
DD
134432011-06-20 Deniz Dogan <deniz@dogan.se>
13444
13445 * process.c (Fset_process_buffer): Clarify return value in
13446 docstring.
13447
7d7d0045
CY
134482011-06-18 Chong Yidong <cyd@stupidchicken.com>
13449
13450 * dispnew.c (add_window_display_history): Use BVAR.
13451
13452 * xdisp.c (debug_method_add): Use BVAR.
13453 (check_window_end, dump_glyph_matrix, dump_glyph)
13454 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13455
13456 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13457 Likewise.
13458
13459 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13460 check till after the cache is created in init_frame_faces.
13461
ff2bc410
SM
134622011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13463
13464 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13465
28177add
PE
134662011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13467
dd3482fe
PE
13468 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13469 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13470 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13471
393d71f3 13472 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
13473 * fileio.c (Finsert_file_contents):
13474 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13475 Remove the old (too-loose) buffer overflow checks.
13476 They weren't needed, since make_gap checks for buffer overflow.
13477 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13478 The old code merely checked for Emacs fixnum overflow, and relied
13479 on undefined (wraparound) behavior. The new code avoids undefined
13480 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13481
2e6813b0 13482 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
13483 Tune. Don't use wider integers than needed. Don't use alloca.
13484 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 13485
599a9e4f
PE
13486 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13487
99561444
PE
13488 * insdel.c, lisp.h (buffer_overflow): New function.
13489 (insert_from_buffer_1, replace_range, replace_range_2):
13490 * insdel.c (make_gap_larger):
13491 * editfns.c (Finsert_char):
13492 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13493
28177add
PE
13494 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13495
e69dafad
PE
134962011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13497
4baa020d 13498 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 13499
b1c46f02
PE
13500 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13501 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13502
e69dafad
PE
13503 * fileio.c: Don't assume EMACS_INT fits in off_t.
13504 (emacs_lseek): New static function.
13505 (Finsert_file_contents, Fwrite_region): Use it.
13506 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13507
566684ea
PE
13508 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13509
e6966cd6
PE
13510 * fns.c: Don't overflow int when computing a list length.
13511 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13512 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13513 truncation on 64-bit hosts. Check for QUIT every
13514 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13515 faster and is responsive enough.
13516 (Flength): Report an error instead of overflowing an integer.
13517 (Fsafe_length): Return a float if the value is not representable
13518 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 13519 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 13520 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 13521
dd0b0efb
PE
13522 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13523 (header_size, word_size): New constants.
13524 (allocate_vectorlike): Don't check size overflow here.
13525 (allocate_vector): Check it here instead, since this is the only
13526 caller of allocate_vectorlike that could cause overflow.
13527 Check that the new vector's length is representable as a fixnum.
13528
86fe5cfe
PE
13529 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13530 The previous code was bogus. For example, next_almost_prime (32)
13531 returned 39, which is undesirable as it is a multiple of 3; and
13532 next_almost_prime (24) returned 25, which is a multiple of 5 so
13533 why was the code bothering to check for multiples of 7?
13534
80e88859
PE
13535 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13536
4a2f0ad6
PE
13537 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13538
f66c7cf8
PE
13539 Variadic C functions now count arguments with ptrdiff_t.
13540 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13541 Back then I didn't know that the Emacs coding style prefers signed int.
13542 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
13543 were being counted with int, which may truncate counts on 64-bit
13544 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
13545 * lisp.h (struct Lisp_Subr.function.aMANY)
13546 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13547 Arg counts are now ptrdiff_t, not size_t.
13548 All variadic functions and their callers changed accordingly.
13549 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13550 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13551 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13552 * callint.c (Fcall_interactively): Check arg count for overflow,
13553 to avoid potential buffer overrun. Use signed char, not 'int',
13554 for 'varies' array, so that we needn't bother to check its size
13555 calculation for overflow.
13556 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13557 * eval.c (apply_lambda):
13558 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13559 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13560 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13561
a1759b76
PE
13562 * callint.c (Fcall_interactively): Don't use index var as event count.
13563
d96be9fc
PE
13564 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13565 * mem-limits.h (SIZE): Remove; no longer used.
13566
a690a978 13567 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 13568
578c21e6
PE
13569 Remove unnecessary casts.
13570 * xterm.c (x_term_init):
13571 * xfns.c (x_set_border_pixel):
13572 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13573 These aren't needed now that we assume ANSI C.
13574
96f53c6c
PE
13575 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13576 It's more likely to cause problems (due to unsigned overflow)
13577 than to cure them.
13578
83c77d31
PE
13579 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13580
ee2079f1
PE
13581 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13582
6da65536
PE
13583 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13584
7147c4a4
PE
13585 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13586
193e32d9
PE
13587 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13588
e5533da6
PE
13589 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13590
9910e595
PE
13591 GLYPH_CODE_FACE returns EMACS_INT, not int.
13592 * dispextern.h (merge_faces):
13593 * xfaces.c (merge_faces):
01103c44
PE
13594 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13595 Don't assume EMACS_INT fits in int.
9910e595 13596
2638320e
PE
13597 * character.h (CHAR_VALID_P): Remove unused parameter.
13598 * fontset.c, lisp.h, xdisp.c: All uses changed.
13599
045eb8d9
PE
13600 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13601
c1f134b5
PE
13602 * fns.c (concat): Minor tuning based on overflow analysis.
13603 This doesn't fix any bugs. Use int to hold character, instead
13604 of constantly refetching from Emacs object. Use XFASTINT, not
13605 XINT, for value known to be a character. Don't bother comparing
13606 a single byte to 0400, as it's always less.
13607
395fcb93 13608 * floatfns.c (Fexpt):
327eeec8
PE
13609 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13610
abbd3d23
PE
13611 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13612 for characters.
13613
684a03ef
PE
13614 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13615
0fed43f3
PE
13616 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13617 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13618 incorrectly succeed when S was a string, because 4294967386 was
13619 truncated before it was used.
13620
8fd02eb7
PE
13621 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13622 Otherwise, an out-of-range integer could cause undefined behavior
13623 on a 64-bit host.
13624
f8c86b69
PE
13625 * composite.c: Use int, not EMACS_INT, for characters.
13626 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13627 EMACS_INT, for values that are known to be in character range.
13628 This doesn't fix any bugs but is the usual style inside Emacs and
13629 may generate better code on 32-bit machines.
13630
34206dd2
PE
13631 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13632 This is for reasons similar to the recent CHAR_STRING fix.
13633 * charset.c (Fencode_char): Check that character arg is actually
13634 a character. Pass an int to ENCODE_CHAR.
13635 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13636 wider than 'int', as a compile-time check to prevent future regressions
13637 in this area.
13638
c5958d4c 13639 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
13640
13641 Make sure a 64-bit char is never passed to CHAR_STRING.
13642 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13643 by silently ignoring the top 32 bits, allowing some values
13644 that were far too large to be valid characters.
13645 * character.h: Include <verify.h>.
13646 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13647 arguments are no wider than unsigned, as a compile-time check
13648 to prevent future regressions in this area.
13649 * data.c (Faset):
01103c44 13650 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
13651 (Fsubst_char_in_region):
13652 * fns.c (concat):
13653 * xdisp.c (decode_mode_spec_coding):
13654 Adjust to CHAR_STRING's new requirement.
13655 * editfns.c (Finsert_char, Fsubst_char_in_region):
13656 * fns.c (concat): Check that character args are actually
13657 characters. Without this test, these functions did the wrong
13658 thing with wildly out-of-range values on 64-bit hosts.
13659
d37ca623
PE
13660 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13661 These casts should not be needed on 32-bit hosts, either.
13662 * keyboard.c (read_char):
13663 * lread.c (Fload): Remove casts to unsigned.
13664
ea204efb
PE
13665 * lisp.h (UNSIGNED_CMP): New macro.
13666 This fixes comparison bugs on 64-bit hosts.
13667 (ASCII_CHAR_P): Use it.
13668 * casefiddle.c (casify_object):
01103c44 13669 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
13670 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13671 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13672 * dispextern.h (FACE_FROM_ID):
13673 * keyboard.c (read_char): Use UNSIGNED_CMP.
13674
41cb286c
PE
13675 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13676 not to EMACS_INT, to avoid GCC warning.
13677
4a1b9832
PE
13678 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13679
55daad71
PE
13680 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13681 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13682 isn't needed on 32-bit machines.
8f95c75c 13683
01103c44
PE
13684 * buffer.c (Fgenerate_new_buffer_name):
13685 Use EMACS_INT for count, not int.
0ceccced 13686 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
13687
13688 * data.c (Qcompiled_function): Now static.
13689
c6f072e7
PE
13690 * window.c (window_body_lines): Now static.
13691
20ce5912
PE
13692 * image.c (gif_load): Rename local to avoid shadowing.
13693
9c4c5f81
PE
13694 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13695 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13696 * alloc.c (make_save_value): Integer argument is now of type
13697 ptrdiff_t, not int.
13698 (mark_object): Use ptrdiff_t, not int.
13699 * lisp.h (pD): New macro.
13700 * print.c (print_object): Use it.
13701
c0c5c8ae
PE
13702 * alloc.c: Use EMACS_INT, not int, to count objects.
13703 (total_conses, total_markers, total_symbols, total_vector_size)
13704 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
13705 (total_free_floats, total_floats, total_free_intervals)
13706 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
13707 Now EMACS_INT, not int. All uses changed.
13708 (Fgarbage_collect): Compute overall total using a double, so that
13709 integer overflow is less likely to be a problem. Check for overflow
13710 when converting back to an integer.
5a25e253
PE
13711 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13712 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13713 These were 'int' variables that could overflow on 64-bit hosts;
13714 they were never used, so remove them instead of repairing them.
211a0b2a 13715 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
13716 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13717 Previously, this ceilinged at INT_MAX, but that doesn't work on
13718 64-bit machines.
e46bb31a 13719 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 13720
c78baabf 13721 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 13722 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
13723 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13724 when a (possibly-narrower) signed value would do just as well.
13725 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 13726
c9d624c6
PE
13727 * alloc.c: Catch some string size overflows that we were missing.
13728 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13729 for convenience in STRING_BYTES_MAX.
13730 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13731 The definition here is exact; the one in lisp.h was approximate.
13732 (allocate_string_data): Check for string overflow. This catches
13733 some instances we weren't catching before. Also, it catches
13734 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13735 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13736 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 13737
c9d624c6
PE
13738 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13739 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 13740 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 13741
353032ce
PE
13742 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13743
2bccce07
PE
13744 * alloc.c (Fmake_string): Check for out-of-range init.
13745
0ac30604
SM
137462011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13747
13748 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13749
c195f2de
JD
137502011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13751
13752 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13753 xg_get_default_scrollbar_width.
13754
13755 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13756 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13757 (style_changed_cb): Call update_theme_scrollbar_width and call
13758 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13759 all frames (Bug#8505).
13760 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13761 Call gtk_window_set_resizable if HAVE_GTK3.
13762 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13763 and height if HAVE_GTK3 (Bug#8505).
13764 (scroll_bar_width_for_theme): New variable.
13765 (update_theme_scrollbar_width): New function.
13766 (xg_get_default_scrollbar_width): Move code to
13767 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13768 (xg_initialize): Call update_theme_scrollbar_width.
13769
13770 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13771
13772 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13773
e10ac9f1
MR
137742011-06-12 Martin Rudalics <rudalics@gmx.at>
13775
13776 * frame.c (make_frame): Call other_buffer_safely instead of
13777 other_buffer.
13778
13779 * window.c (temp_output_buffer_show): Call display_buffer with
13780 second argument Vtemp_buffer_show_specifiers and reset latter
13781 immediately after the call.
13782 (Vtemp_buffer_show_specifiers): New variable.
13783 (auto_window_vscroll_p, next_screen_context_lines)
13784 (Vscroll_preserve_screen_position): Remove leading asterisks from
13785 doc-strings.
13786
2d3c217e 137872011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 13788
7b7f97e8 13789 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
13790 * buffer.c (Qclone_number): Remove for now, as it's unused.
13791 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13792 (record_buffer): Remove unused local.
13793 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13794 (set_frame_buffer_list): Remove; unused.
13795 * frame.h (other_visible_frames): Remove decl.
13796 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13797 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13798 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13799 if HAVE_GPM.
13800 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13801 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13802 Define only if HAVE_GPM.
13803 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13804 (update_hints_inhibit): Remove; never set. All uses removed.
13805 * widgetprv.h (emacsFrameClassRec): Remove decl.
13806 * window.c (delete_deletable_window): Now returns void, since it
13807 wasn't returning anything.
13808 (compare_window_configurations): Remove unused locals.
13809 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13810 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
13811 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13812 the same widths as pointers. This follows up on the 2011-05-06 patch.
13813 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13814 * xterm.h: Likewise.
13815 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13816
1384b89e
JB
138172011-06-12 Juanma Barranquero <lekktu@gmail.com>
13818
13819 * makefile.w32-in: Update dependencies.
13820 (LISP_H): Add lib/intprops.h.
13821
1100a63c
CY
138222011-06-11 Chong Yidong <cyd@stupidchicken.com>
13823
13824 * image.c (gif_load): Add animation frame delay to the metadata.
13825 (syms_of_image): Use DEFSYM. New symbol `delay'.
13826
6198ccd0
MR
138272011-06-11 Martin Rudalics <rudalics@gmx.at>
13828
13829 * window.c (delete_deletable_window): Re-add.
13830 (Fset_window_configuration): Rewrite to handle dead buffers and
13831 consequently deletable windows.
13832 (window_tree, Fwindow_tree): Remove. Supply functionality in
13833 window.el.
13834 (compare_window_configurations): Simplify code.
13835
b6e3633c
AS
138362011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13837
1ab0dee5
AS
13838 * image.c (imagemagick_load_image): Fix type mismatch.
13839 (Fimagemagick_types): Likewise.
13840
b6e3633c
AS
13841 * window.h (replace_buffer_in_windows): Declare.
13842
9397e56f
MR
138432011-06-11 Martin Rudalics <rudalics@gmx.at>
13844
13845 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13846 Qclone_number. Remove external declaration of Qdelete_window.
13847 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13848 code.
640c8776
SM
13849 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13850 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
13851 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13852 buffer list implementation.
13853 (other_buffer_safely): New function.
13854 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13855 calls to replace_buffer_in_windows and
13856 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13857 if allowed.
13858 (record_buffer): Inhibit quitting and rewrite using quittable
13859 functions. Run Qbuffer_list_update_hook if allowed.
13860 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
13861 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13862 Move switch-to-buffer to window.el.
9397e56f
MR
13863 (bury-buffer): Move to window.el.
13864 (Vbuffer_list_update_hook): New variable.
13865
13866 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13867 section.
13868
13869 * window.h (resize_frame_windows): Move up in code.
13870 (Fwindow_frame): Remove EXFUN.
13871 (replace_buffer_in_all_windows): Remove prototype.
13872 (replace_buffer_in_windows_safely): Add prototype.
13873
13874 * window.c: Declare Qdelete_window static again. Move down
13875 declaration of select_count.
13876 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13877 (Fother_window): Move to window.el.
13878 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13879 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13880 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13881 window.el.
13882 (replace_buffer_in_windows): Implement by calling
13883 Qreplace_buffer_in_windows.
13884 (replace_buffer_in_all_windows): Remove with some functionality
13885 moved into replace_buffer_in_windows_safely.
13886 (replace_buffer_in_windows_safely): New function.
13887 (select_window_norecord, select_frame_norecord): Move in front
13888 of run_window_configuration_change_hook. Remove now obsolete
13889 declarations.
640c8776
SM
13890 (Fset_window_buffer): Rewrite doc-string.
13891 Call Qrecord_window_buffer.
9397e56f
MR
13892 (keys_of_window): Move binding for other-window to window.el.
13893
b50691aa
CY
138942011-06-11 Chong Yidong <cyd@stupidchicken.com>
13895
13896 * dispextern.h (struct image): Replace data member, whose int_val
13897 and ptr_val fields were not used by anything, with a single
13898 lisp_val object.
13899
13900 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13901 (gif_clear_image, gif_load, imagemagick_load_image)
13902 (gs_clear_image, gs_load): Callers changed.
13903
3f754b86
PE
139042011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13905
cca69397
PE
13906 * buffer.h: Include <time.h>, for time_t.
13907 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13908
109e28d0
PE
13909 Fix minor problems found by static checking.
13910
60737f02
PE
13911 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13912
4b66faf3
PE
13913 Make identifiers static if they are not used in other modules.
13914 * data.c (Qcompiled_function, Qframe, Qvector):
13915 * image.c (QimageMagick, Qsvg):
13916 * minibuf.c (Qmetadata):
13917 * window.c (resize_window_check, resize_root_window): Now static.
13918 * window.h (resize_window_check, resize_root_window): Remove decls.
13919
109e28d0
PE
13920 * window.c (window_deletion_count, delete_deletable_window):
13921 Remove; unused.
46a4ce9e
PE
13922 (window_body_lines): Now static.
13923 (Fdelete_other_windows_internal): Mark vars as initialized.
13924 Make sure 'resize_failed' is initialized.
13925 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13926 (resize_window_apply): Remove unused local.
13927 * window.h (delete_deletable_window): Remove decl.
13928
109e28d0 13929 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
13930 (imagemagick_load_image): Fix pointer signedness problem by changing
13931 last arg from unsigned char * to char *. All uses changed.
13932 Also, fix a local for similar reasons.
13933 Remove unused locals. Remove locals to avoid shadowing.
13934 (fn_rsvg_handle_free): Remove; unused.
13935 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 13936 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 13937
3f754b86
PE
13938 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13939
2547adb1
CY
139402011-06-10 Chong Yidong <cyd@stupidchicken.com>
13941
13942 * image.c (gif_load): Fix omitted cast error introduced by
13943 2011-06-06 change.
13944
2c8e37d4
MR
139452011-06-10 Martin Rudalics <rudalics@gmx.at>
13946
13947 * window.h (resize_proportionally, orig_total_lines)
13948 (orig_top_line): Remove from window structure.
13949 (set_window_height, set_window_width, change_window_heights)
13950 (Fdelete_window): Remove prototypes.
13951 (resize_frame_windows): Remove duplicate declaration.
13952
440a42e3
EZ
139532011-06-10 Eli Zaretskii <eliz@gnu.org>
13954
13955 * window.h (resize_frame_windows, resize_window_check)
13956 (delete_deletable_window, resize_root_window)
13957 (resize_frame_windows): Declare prototypes.
13958
13959 * window.c (resize_window_apply): Make definition be "static" to
13960 match the prototype.
13961
562dd5e9
MR
139622011-06-10 Martin Rudalics <rudalics@gmx.at>
13963
13964 * window.c: Remove declarations of Qwindow_size_fixed,
13965 window_min_size_1, window_min_size_2, window_min_size,
13966 size_window, window_fixed_size_p, enlarge_window, delete_window.
13967 Remove static from declaration of Qdelete_window, it's
13968 temporarily needed by Fbury_buffer.
13969 (replace_window): Don't assign orig_top_line and
13970 orig_total_lines.
13971 (Fdelete_window, delete_window): Remove. Window deletion is
13972 handled by window.el.
640c8776
SM
13973 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13974 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
13975 (Fdelete_other_windows): Remove. Deleting other windows is
13976 handled by window.el.
13977 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13978 handled in window.el.
13979 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13980 Window minimum sizes are handled in window.el.
13981 (shrink_windows, size_window, set_window_height)
13982 (set_window_width, change_window_heights, window_height)
13983 (window_width, CURBEG, CURSIZE, enlarge_window)
13984 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13985 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13986 handled in window.el.
13987 (make_dummy_parent): Rename to make_parent_window and give it a
13988 second argument horflag.
13989 (make_window): Don't set resize_proportionally any more.
13990 (Fsplit_window): Remove. Windows are split in window.el.
13991 (save_restore_action, save_restore_orig_size)
13992 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13993 Resize mini windows in window.el.
13994 (grow_mini_window, shrink_mini_window): Implement by calling
13995 Qresize_root_window_vertically, resize_window_check and
13996 resize_window_apply.
640c8776
SM
13997 (saved_window, Fset_window_configuration, save_window_save):
13998 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
13999 resize_proportionally.
14000 (window_min_height, window_min_width): Move to window.el.
14001 (keys_of_window): Move bindings for delete-other-windows,
14002 split-window, delete-window and enlarge-window to window.el.
14003
14004 * buffer.c: Temporarily extern Qdelete_window.
14005 (Fbury_buffer): Temporarily call Qdelete_window instead of
14006 Fdelete_window (Fbury_buffer will move to window.el soon).
14007
14008 * frame.c (set_menu_bar_lines_1): Remove code handling
14009 orig_top_line and orig_total_lines.
14010
14011 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14012 set_window_height but set heights directly.
14013 (change_frame_size_1): Use resize_frame_windows.
14014
14015 * xdisp.c (init_xdisp): Don't use set_window_height but set
14016 heights directly.
14017
640c8776
SM
14018 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14019 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
14020 run_window_configuration_change_hook.
14021
14022 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14023 instead of change_window_heights and run
14024 run_window_configuration_change_hook.
14025
1a13852e
MR
140262011-06-09 Martin Rudalics <rudalics@gmx.at>
14027
14028 * window.c (replace_window): Rename second argument REPLACEMENT to
14029 NEW. New third argument SETFLAG. Rewrite.
14030 (delete_window, make_dummy_parent): Call replace_window with
14031 third argument 1.
14032 (window_list_1): Move down in code.
14033 (run_window_configuration_change_hook): Move set_buffer part
14034 before select_frame_norecord part in order to unwind correctly.
14035 Rename count1 to count.
14036 (recombine_windows, delete_deletable_window, resize_root_window)
14037 (Fdelete_other_windows_internal)
14038 (Frun_window_configuration_change_hook, make_parent_window)
14039 (resize_window_check, resize_window_apply, Fresize_window_apply)
14040 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
14041 (Fdelete_window_internal, Fresize_mini_window_internal):
14042 New functions.
1a13852e
MR
14043 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14044
f3d1777e
MR
140452011-06-08 Martin Rudalics <rudalics@gmx.at>
14046
496e208e
MR
14047 * window.h (window): Add some new members to window structure -
14048 normal_lines, normal_cols, new_total, new_normal, clone_number,
14049 splits, nest, prev_buffers, next_buffers.
14050 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 14051 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 14052
f3d1777e
MR
14053 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14054 Remove.
496e208e
MR
14055 (make_dummy_parent): Set new members of windows structure.
14056 (make_window): Move down in code. Handle new members of window
14057 structure.
14058 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14059 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14060 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14061 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
14062 (Fset_window_next_buffers, Fset_window_clone_number):
14063 New functions.
496e208e
MR
14064 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14065 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14066 Doc-string fixes.
14067 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14068 Argument WINDOW can be now internal window too.
14069 (Fwindow_use_time): Move up in code.
14070 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14071 Rewrite doc-string.
14072 (Fset_window_configuration, saved_window)
14073 (Fcurrent_window_configuration, save_window_save): Handle new
14074 members of window structure.
b9e809c2
MR
14075 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14076 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14077 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14078 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14079 Qget_mru_window, Qresize_root_window,
14080 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14081 Qauto_buffer_name; staticpro them.
f3d1777e 14082
abde8f8c
MR
140832011-06-07 Martin Rudalics <rudalics@gmx.at>
14084
14085 * window.c (Fwindow_total_size, Fwindow_left_column)
14086 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14087 (Fwindow_list_1): New functions.
14088 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
14089 (Fwindow_width, Fscroll_left, Fscroll_right):
14090 Use window_body_cols instead of window_box_text_cols.
14091 (delete_window, Fset_window_configuration):
14092 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
14093 (delete_all_subwindows): Take a window as argument and not a
14094 structure. Rewrite.
190b47e6
MR
14095 (window_loop): Remove handling of GET_LRU_WINDOW and
14096 GET_LARGEST_WINDOW.
14097 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
14098
14099 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
14100 window_box_text_cols. delete_all_subwindows now takes a
14101 Lisp_Object as argument.
abde8f8c 14102
640c8776
SM
14103 * indent.c (compute_motion, Fcompute_motion):
14104 Use window_body_cols instead of window_box_text_cols.
abde8f8c 14105
fa8a67e6
MR
14106 * frame.c (delete_frame): Call delete_all_subwindows with root
14107 window as argument.
14108
a54e3482
DC
141092011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14110
14111 * fns.c (Fputhash): Document return value.
14112
60002bf5
CY
141132011-06-06 Chong Yidong <cyd@stupidchicken.com>
14114
14115 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14116
0c671da6 141172011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 14118
b862a52a 14119 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 14120
be44ca6c
PE
14121 Check for overflow when converting integer to cons and back.
14122 * charset.c (Fdefine_charset_internal, Fdecode_char):
14123 Use cons_to_unsigned to catch overflow.
14124 (Fencode_char): Use INTEGER_TO_CONS.
14125 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14126 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14127 * data.c (long_to_cons, cons_to_long): Remove.
14128 (cons_to_unsigned, cons_to_signed): New functions.
14129 These signal an error for invalid or out-of-range values.
14130 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14131 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14132 * font.c (Ffont_variation_glyphs):
14133 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14134 * lisp.h: Include <intprops.h>.
14135 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14136 (cons_to_signed, cons_to_unsigned): New decls.
14137 (long_to_cons, cons_to_long): Remove decls.
14138 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14139 (Fprimitive_undo): Use CONS_TO_INTEGER.
14140 * xfns.c (Fx_window_property): Likewise.
14141 * xselect.c: Include <limits.h>.
14142 (x_own_selection, selection_data_to_lisp_data):
14143 Use INTEGER_TO_CONS.
14144 (x_handle_selection_request, x_handle_selection_clear)
14145 (x_get_foreign_selection, Fx_disown_selection_internal)
14146 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14147 (lisp_data_to_selection_data): Use cons_to_unsigned.
14148 (x_fill_property_data): Use cons_to_signed.
14149 Report values out of range.
14150
d1f3d2af
PE
14151 Check for buffer and string overflow more precisely.
14152 * buffer.h (BUF_BYTES_MAX): New macro.
14153 * lisp.h (STRING_BYTES_MAX): New macro.
14154 * alloc.c (Fmake_string):
14155 * character.c (string_escape_byte8):
14156 * coding.c (coding_alloc_by_realloc):
14157 * doprnt.c (doprnt):
14158 * editfns.c (Fformat):
14159 * eval.c (verror):
14160 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14161 since they may not be the same number.
14162 * editfns.c (Finsert_char):
14163 * fileio.c (Finsert_file_contents):
14164 Likewise for BUF_BYTES_MAX.
14165
dd52fcea
PE
14166 * image.c: Use ptrdiff_t, not int, for sizes.
14167 (slurp_file): Switch from int to ptrdiff_t.
14168 All uses changed.
14169 (slurp_file): Check that file size fits in both size_t (for
14170 malloc) and ptrdiff_t (for sanity and safety).
14171
7f9bbdbb
PE
14172 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14173 if b->modtime has its maximal value.
14174
dfe18f82
PE
14175 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14176
84acfcf0
PE
14177 Don't assume time_t can fit into int.
14178 * buffer.h (struct buffer.modtime): Now time_t, not int.
14179 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14180 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14181
ccd9a01a
PE
14182 Minor fixes for signed vs unsigned integers.
14183 * character.h (MAYBE_UNIFY_CHAR):
14184 * charset.c (maybe_unify_char):
14185 * keyboard.c (read_char, reorder_modifiers):
14186 XINT -> XFASTINT, since the integer must be nonnegative.
14187 * ftfont.c (ftfont_spec_pattern):
14188 * keymap.c (access_keymap, silly_event_symbol_error):
14189 XUINT -> XFASTINT, since the integer must be nonnegative.
14190 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14191 since it makes no difference and we prefer signed.
14192 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14193 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14194 nonnegative.
14195
d6d100dd
SM
141962011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14197
14198 * window.h (Fwindow_frame): Declare.
14199
2b6148e4
PE
142002011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14201
14202 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14203 (SPARE_MEMORY): Always define.
14204 (LARGE_REQUEST): Remove.
14205 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14206
f230ecc9
MR
142072011-06-06 Martin Rudalics <rudalics@gmx.at>
14208
727e958e
MR
14209 * lisp.h: Move EXFUNS for Fframe_root_window,
14210 Fframe_first_window and Fset_frame_selected_window to window.h.
14211
14212 * window.h: Move EXFUNS for Fframe_root_window,
14213 Fframe_first_window and Fset_frame_selected_window here from
14214 lisp.h.
14215
14216 * frame.c (Fwindow_frame, Fframe_first_window)
14217 (Fframe_root_window, Fframe_selected_window)
14218 (Fset_frame_selected_window): Move to window.c.
14219 (Factive_minibuffer_window): Move to minibuf.c.
14220 (Fother_visible_frames_p): New function.
14221
14222 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14223
f230ecc9
MR
14224 * window.c (decode_window, decode_any_window): Move up in code.
14225 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14226 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
14227 (Fwindow_buffer): Move up and rewrite doc-string.
14228 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14229 (Fwindow_prev): New functions.
727e958e
MR
14230 (Fwindow_frame): Move here from frame.c. Accept any window as
14231 argument.
14232 (Fframe_root_window, Fframe_first_window)
14233 (Fframe_selected_window): Move here from frame.c. Accept frame
14234 or arbitrary window as argument. Update doc-strings.
14235 (Fminibuffer_window): Move up in code.
14236 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
14237 (Fset_frame_selected_window): Move here from frame.c.
14238 Marginal rewrite.
727e958e
MR
14239 (Fselected_window, select_window, Fselect_window): Move up in
14240 code. Minor doc-string fixes.
f230ecc9 14241
4d09bcf6
PE
142422011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14243
14244 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14245 Do not assume that spare memory exists; that assumption is valid
14246 only if SYSTEM_MALLOC.
14247 (LARGE_REQUEST): New macro, so that the issue of large requests
14248 is separated from the issue of spare memory.
14249
810928a2
AS
142502011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14251
172418ad
AS
14252 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14253 format. (Bug#8806)
14254
43f862f7
AS
14255 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14256
810928a2
AS
14257 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14258 before statements.
14259
a059fe24
JD
142602011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14261
14262 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14263
14264 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14265
14266 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14267 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14268
989bf368
JB
142692011-06-05 Juanma Barranquero <lekktu@gmail.com>
14270
14271 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14272
4b80f674
CY
142732011-06-04 Chong Yidong <cyd@stupidchicken.com>
14274
14275 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14276 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
14277 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14278 New error handlers.
4b80f674
CY
14279 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14280 Obey Vx_select_enable_clipboard_manager. Catch errors in
14281 x_clipboard_manager_save (Bug#8779).
14282 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 14283 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 14284
99a33b77 142852011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
14286
14287 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14288
99a33b77 142892011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
14290
14291 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14292 in the current matrix if keep_current_p is non-zero.
14293
8264569d
EZ
142942011-06-04 Eli Zaretskii <eliz@gnu.org>
14295
14296 * bidi.c (bidi_level_of_next_char): Fix last change.
14297
57f97249
EZ
142982011-06-03 Eli Zaretskii <eliz@gnu.org>
14299
fec2107c 14300 Support bidi reordering of text covered by display properties.
57f97249 14301
fec2107c
EZ
14302 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14303 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14304 (bidi_cache_search, bidi_cache_iterator_state)
14305 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
14306 (bidi_level_of_next_char, bidi_move_to_visually_next):
14307 Support character positions inside a run of characters covered by a
fec2107c
EZ
14308 display string.
14309 (bidi_paragraph_init, bidi_resolve_explicit_1)
14310 (bidi_level_of_next_char): Call bidi_fetch_char and
14311 bidi_fetch_char_advance instead of FETCH_CHAR and
14312 FETCH_CHAR_ADVANCE.
14313 (bidi_init_it): Initialize new members.
14314 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14315 definitions.
14316 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14317 instead of using explicit *_CHAR codes.
d6d100dd
SM
14318 (bidi_resolve_explicit, bidi_resolve_weak):
14319 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
14320 bidirectional text is supported only in multibyte buffers.
14321 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14322 it to initialize the frame_window_p member of struct bidi_it.
14323 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14324 (bidi_resolve_explicit, bidi_resolve_weak)
14325 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14326 bidi_it->nchars is non-positive.
14327 (bidi_level_of_next_char): Don't try to lookup the cache for the
14328 next/previous character if nothing is cached there yet, or if we
14329 were just reseat()'ed to a new position.
c40e2fb2 14330
0e14fe90
EZ
14331 * xdisp.c (set_cursor_from_row): Set start and stop points
14332 according to the row's direction when priming the loop that looks
14333 for the glyph on which to display cursor.
14334 (single_display_spec_intangible_p): Function deleted.
14335 (display_prop_intangible_p): Reimplement to call
14336 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
14337 Accept 3 additional arguments needed by handle_display_spec.
14338 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
14339 values: lists, `(when COND...)' forms, etc.
14340 (single_display_spec_string_p): Support property values that are
14341 lists with the argument STRING its top-level element.
14342 (display_prop_string_p): Fix the condition for processing a
14343 property that is a list to be consistent with handle_display_spec.
fec2107c 14344 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
14345 last portion of handle_display_prop.
14346 (compute_display_string_pos): Accept additional argument
14347 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14348 value of a `display' property is a "replacing spec".
14349 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14350 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14351 the display property, but just return a value indicating whether
14352 the display property will replace the characters it covers.
14353 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14354 frame_window_p members of struct bidi_it.
d6d100dd
SM
14355 (compute_display_string_pos, compute_display_string_end):
14356 New functions.
fec2107c
EZ
14357 (push_it): Accept second argument POSITION, where pop_it should
14358 jump to continue iteration.
14359 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 14360
fec2107c
EZ
14361 * keyboard.c (adjust_point_for_property): Adjust the call to
14362 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
14363
14364 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
14365 (bidi_init_it): Update prototypes.
14366 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
14367 (compute_display_string_pos, compute_display_string_end):
14368 Declare prototypes.
fec2107c
EZ
14369 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14370 EMACS_INT.
fc6f18ce 14371
40087514 143722011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 14373
57f53182
PE
14374 Malloc failure behavior now depends on size of allocation.
14375 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14376 * lisp.h: Change signatures accordingly.
14377 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14378 All callers changed. (Bug#8762)
14379
14380 * gnutls.c: Use Emacs's memory allocators.
14381 Without this change, the gnutls library would invoke malloc etc.
14382 directly, which causes problems on non-SYNC_INPUT hosts, and which
14383 runs afoul of improving memory_full behavior. (Bug#8761)
14384 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14385 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14386 xfree instead of the default malloc, realloc, free.
14387 (Fgnutls_boot): No need to check for memory allocation failure,
14388 since xmalloc does that for us.
14389
ac32cd99 14390 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
14391 * category.c (hash_get_category_set):
14392 * ccl.c (ccl_driver):
14393 * charset.c (Fdefine_charset_internal):
14394 * charset.h (struct charset.hash_index):
14395 * composite.c (get_composition_id, gstring_lookup_cache)
14396 (composition_gstring_put_cache):
14397 * composite.h (struct composition.hash_index):
14398 * dispextern.h (struct image.hash):
14399 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14400 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14401 (hashfn_equal, hashfn_user_defined, make_hash_table)
14402 (maybe_resize_hash_table, hash_lookup, hash_put)
14403 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14404 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14405 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14406 * image.c (make_image, search_image_cache, lookup_image)
14407 (xpm_put_color_table_h):
14408 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 14409 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 14410 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 14411 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
14412 * alloc.c (allocate_vectorlike):
14413 Check for overflow in vector size calculations.
14414 * ccl.c (ccl_driver):
14415 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
14416 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14417 need to be updated by these changes.
40087514
PE
14418 * fns.c (make_hash_table, maybe_resize_hash_table):
14419 Check for integer overflow with large hash tables.
0de4bb68
PE
14420 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14421 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14422 (SXHASH_REDUCE): New macro.
14423 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14424 Use it instead of discarding useful hash info with large hash values.
14425 (sxhash_float): New function.
14426 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14427 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
14428 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14429 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
14430 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14431 Adjust signatures to match updated version of code.
14432 (consing_since_gc): Now EMACS_INT, since a single hash table can
14433 use more than INT_MAX bytes.
14434
698d32e2
DN
144352011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14436
14437 Make it possible to build with GCC-4.6+ -O2 -flto.
14438
14439 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14440
fd6fa53f
SM
144412011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14442
14443 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14444 Call minibuffer-inactive-mode.
14445
864db017
JB
144462011-05-31 Juanma Barranquero <lekktu@gmail.com>
14447
14448 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14449 Update dependencies.
14450
2ad0baf4
DN
144512011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14452
14453 * data.c (init_data): Remove code for UTS, this system is not
14454 supported anymore.
14455
4fcc2638
DN
144562011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14457
14458 Don't force ./temacs to start in terminal mode.
14459
14460 * frame.c (make_initial_frame): Initialize faces in all cases, not
14461 only when CANNOT_DUMP is defined.
14462 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14463
c56e0fd5
DN
144642011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14465
14466 * dispnew.c (add_window_display_history): Use const for the string
14467 pointer. Remove declaration, not needed.
14468
333d54da 144692011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 14470
55d4c1b2 14471 Use 'inline', not 'INLINE'.
333d54da 14472 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
14473 * alloc.c, fontset.c (INLINE): Remove.
14474 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14475 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14476 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14477 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14478 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14479
738db178
DN
144802011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14481
14482 Make it possible to run ./temacs.
14483
14484 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14485 syms_of_callproc does the same thing. Remove test for
14486 "initialized", do it in the caller.
14487 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14488
620c53a6
SM
144892011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14490
14491 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14492 (read_minibuf): Use get_minibuffer.
14493 (syms_of_minibuf): Use DEFSYM.
14494 (Qmetadata): New var.
14495 * data.c (Qbuffer): Don't make it static.
14496 (syms_of_data): Use DEFSYM.
14497
e003a292
PE
144982011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14499
14500 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14501 (CCL_CODE_MIN): New macro.
14502
ed008a6d
PE
145032011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14504
3687c2ef
PE
14505 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14506
ed008a6d
PE
14507 * eval.c (Qdebug): Now static.
14508 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14509 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14510 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14511
d66c4c7c
CY
145122011-05-29 Chong Yidong <cyd@stupidchicken.com>
14513
14514 * image.c: Various fixes to ImageMagick code comments.
14515 (Fimagemagick_types): Doc fix.
14516
5fbc2025
PE
145172011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14518
0196f88a
PE
14519 Minor fixes prompted by GCC 4.6.0 warnings.
14520
14521 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14522
5fbc2025
PE
14523 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14524 (x_clipboard_manager_save_all): Move extern decl to ...
14525 * xterm.h: ... here, so that it can be checked for consistency.
14526
1dd3c2d9
CY
145272011-05-29 Chong Yidong <cyd@stupidchicken.com>
14528
14529 * xselect.c (x_clipboard_manager_save_frame)
14530 (x_clipboard_manager_save_all): New functions.
14531 (Fx_clipboard_manager_save): Lisp function deleted.
14532
14533 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14534 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14535
14536 * xterm.h: Update prototype.
14537
5ba6571d
WX
145382011-05-28 William Xu <william.xwl@gmail.com>
14539
14540 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14541 exiting (Bug#8239).
14542
3eaff834
JM
145432011-05-28 Jim Meyering <meyering@redhat.com>
14544
e1900994 14545 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
14546 * fns.c (to_uchar): Define.
14547 (crypto_hash_function): Use it to convert some newly-signed
14548 variables to unsigned, to avoid sign-extension bugs. For example,
14549 without this change, (md5 "truc") would evaluate to
14550 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14551 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 14552 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 14553
0f6990a7
PE
145542011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14555
14556 Integer overflow fixes.
c8a9ca5a 14557
08686060
PE
14558 * dbusbind.c: Serial number integer overflow fixes.
14559 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
14560 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14561 to hold a serial number that is too large for a fixnum.
14562 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14563 Check for serial numbers out of range. Decode any serial number
59568bf0 14564 that was so large that it became a float. (Bug#8722)
08686060 14565
2d1fc3c7
PE
14566 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14567 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14568 Use XFASTINT rather than XUINT when numbers are nonnegative.
14569 (xd_append_arg, Fdbus_method_return_internal):
14570 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14571 arguments, check that Lisp number is nonnegative, rather than
59568bf0 14572 silently wrapping negative numbers around. (Bug#8722)
30217ff0 14573 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 14574 (Bug#8722)
2d1fc3c7 14575
c8a9ca5a
PE
14576 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14577
519e1d69
PE
14578 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14579
6df6ae42 14580 ccl: Add integer overflow checks.
30569699
PE
14581 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14582 (IN_INT_RANGE): New macros.
14583 (ccl_driver): Use them to check for integer overflow when
14584 decoding a CCL program. Many of the new checks are whether XINT (x)
14585 fits in int; it doesn't always, on 64-bit hosts. The new version
14586 doesn't catch all possible integer overflows, but it's an
847044ea 14587 improvement. (Bug#8719)
30569699 14588
c11285dc
PE
14589 * alloc.c (make_event_array): Use XINT, not XUINT.
14590 There's no need for unsigned here.
14591
fdccd48e
PE
14592 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14593 This follows up to the 2011-05-06 change that substituted uintptr_t
14594 for EMACS_INT. This case wasn't caught back then.
14595
37910ab2
PE
14596 Rework Fformat to avoid integer overflow issues.
14597 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14598 now (part of C89). Include <verify.h>.
14599 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14600 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14601 (Fformat): Avoid the prepass trying to compute sizes; it was only
14602 approximate and thus did not catch overflow reliably. Instead, walk
14603 through the format just once, formatting and computing sizes as we go,
14604 checking for integer overflow at every step, and allocating a larger
14605 buffer as needed. Keep track separately whether the format is
14606 multibyte. Keep only the most-recently calculated precision, rather
14607 than them all. Record whether each argument has been converted to
14608 string. Use EMACS_INT, not int, for byte and char and arg counts.
14609 Support field widths and precisions larger than INT_MAX. Avoid
14610 sprintf's undefined behavior with conversion specifications such as %#d
14611 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14612 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14613 formatting out-of-range floating point numbers with int
9173deec 14614 formats. (Bug#8668)
37910ab2 14615
2e6578fb
PE
14616 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14617
0ae6bdee
PE
14618 * data.c: Avoid integer truncation in expressions involving floats.
14619 * data.c: Include <intprops.h>.
14620 (arith_driver): When there's an integer overflow in an expression
14621 involving floating point, convert the integers to floating point
14622 so that the resulting value does not suffer from catastrophic
14623 integer truncation. For example, on a 64-bit host (* 4
14624 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14625 Do not rely on undefined behavior after integer overflow.
14626
de883a70
PE
14627 merge count_size_as_multibyte, parse_str_to_multibyte
14628 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 14629 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
14630 Check for integer overflow.
14631 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14632 since it's now a duplicate of the other. This is more of
14633 a character than a buffer op, so better that it's in character.c.
14634 * fns.c, print.c: Adjust to above changes.
14635
2ff916cb
PE
146362011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14637
14638 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14639
f1b54466
PE
146402011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14641
fb1ac845
PE
14642 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14643 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14644 (x_clipboard_manager_save): Now static.
14645 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14646
f1b54466
PE
14647 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14648 (crypto_hash_function): Now static.
14649 Fix pointer signedness problems. Avoid unnecessary initializations.
14650
a9f737ee
CY
146512011-05-27 Chong Yidong <cyd@stupidchicken.com>
14652
14653 * termhooks.h (Vselection_alist): Make it terminal-local.
14654
14655 * terminal.c (create_terminal): Initialize it.
14656
14657 * xselect.c: Support for clipboard managers.
14658 (Vselection_alist): Move to termhooks.h as terminal-local var.
14659 (LOCAL_SELECTION): New macro.
14660 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14661 (symbol_to_x_atom): Remove gratuitous arg.
14662 (x_handle_selection_request, lisp_data_to_selection_data)
14663 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
14664 (x_own_selection, x_get_local_selection, x_convert_selection):
14665 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
14666 (some_frame_on_display): Delete unused function.
14667 (Fx_own_selection_internal, Fx_get_selection_internal)
14668 (Fx_disown_selection_internal, Fx_selection_owner_p)
14669 (Fx_selection_exists_p): New optional frame arg.
14670 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14671 (x_handle_selection_clear): Don't treat other terminals with the
14672 same keyboard specially. Use the terminal-local Vselection_alist.
14673 (x_clear_frame_selections): Use Frun_hook_with_args.
14674
14675 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14676
14677 * xterm.h: Add support for those atoms.
14678
e067f0c1
CY
146792011-05-26 Chong Yidong <cyd@stupidchicken.com>
14680
14681 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14682 (converted_selections, conversion_fail_tag): New global variables.
14683 (x_selection_request_lisp_error): Free the above.
14684 (x_get_local_selection): Remove unnecessary code.
14685 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
14686 of converted selections stored in converted_selections.
14687 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
14688 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14689 (x_convert_selection): New function.
14690 (x_handle_selection_event): Simplify.
14691 (x_get_foreign_selection): Don't ignore incoming requests while
14692 waiting for an answer; this will fail when we implement
14693 SAVE_TARGETS, and seems unnecessary anyway.
14694 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14695 (Vx_sent_selection_functions): Doc fix.
14696
0f4aebc0
LL
146972011-05-26 Leo Liu <sdl.web@gmail.com>
14698
14699 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14700
e61124cd
YM
147012011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14702
14703 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14704
14705 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14706 for fringe update if it has periodic bitmap.
ac389d0c 14707 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
14708 and fringe_bitmap_periodic_p.
14709
14710 * fringe.c (get_fringe_bitmap_data): New function.
14711 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14712 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14713 row. Mark glyph row for fringe update if periodicity changed.
14714
14715 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14716 for fringe update unless it has periodic bitmap.
14717
f16d9837
KH
147182011-05-25 Kenichi Handa <handa@m17n.org>
14719
14720 * xdisp.c (get_next_display_element): Set correct it->face_id for
14721 a static composition.
14722
e1b90ef6
LL
147232011-05-24 Leo Liu <sdl.web@gmail.com>
14724
14725 * deps.mk (fns.o):
14726 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14727
14728 * fns.c (crypto_hash_function, Fsha1): New function.
14729 (Fmd5): Use crypto_hash_function.
14730 (syms_of_fns): Add Ssha1.
14731
7400048f
PE
147322011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14733
14734 * gnutls.c: Remove unused macros.
14735 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14736 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14737 Remove macros that are defined and never used.
14738 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14739
abb71cf4
CY
147402011-05-22 Chong Yidong <cyd@stupidchicken.com>
14741
14742 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14743 (Fx_get_selection_internal): Minor cleanup.
14744 (Fx_own_selection_internal): Rename arguments for consistency with
14745 select.el.
14746
6307db39
PE
147472011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14748
14749 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14750
f3d4e0a4
CY
147512011-05-22 Chong Yidong <cyd@stupidchicken.com>
14752
14753 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14754
4d8ade89
YM
147552011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14756
14757 * dispnew.c (scrolling_window): Don't exclude the case that the
14758 last enabled row in the desired matrix touches the bottom boundary.
14759
32078c8d
GM
147602011-05-21 Glenn Morris <rgm@gnu.org>
14761
14762 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
14763 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14764 and add some more files.
32078c8d 14765
7285dc67
EZ
147662011-05-20 Eli Zaretskii <eliz@gnu.org>
14767
14768 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14769 report_file_error introduced by the change from 2011-05-07.
14770
89d1bd22
PE
147712011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14772
14773 * systime.h (Time): Define only if emacs is defined.
14774 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14775 where the include path doesn't have X11/X.h by default. See
14776 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14777
cd394be1 147782011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
14779
14780 * composite.c (find_automatic_composition): Fix previous change.
14781
b9704ad9
GM
147822011-05-20 Glenn Morris <rgm@gnu.org>
14783
14784 * lisp.mk: New file, split from Makefile.in.
14785 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14786 (shortlisp): Remove.
14787 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14788
4a720484
GM
147892011-05-19 Glenn Morris <rgm@gnu.org>
14790
14791 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14792 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14793 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14794 (lisp): Set the order to that of loadup.el.
14795 (shortlisp): Make it a copy of $lisp.
14796 (SOME_MACHINE_LISP): Remove.
14797 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14798 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14799
a28d4396
KH
148002011-05-18 Kenichi Handa <handa@m17n.org>
14801
14802 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14803 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14804 (find_automatic_composition): Mostly rewrite for efficiency.
14805
a2b1fa8e
JB
148062011-05-18 Juanma Barranquero <lekktu@gmail.com>
14807
14808 * makefile.w32-in: Update dependencies.
14809
8e1f5610
CS
148102011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14811
14812 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 14813 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 14814
7025ee00 148152011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 14816
cdfa6eab
PE
14817 Fix some integer overflow issues, such as string length overflow.
14818
06d6db33
PE
14819 * insdel.c (count_size_as_multibyte): Check for string overflow.
14820
2b4560a8
PE
14821 * character.c (lisp_string_width): Check for string overflow.
14822 Use EMACS_INT, not int, for string indexes and lengths; in
14823 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14824 the resulting string length overflows an EMACS_INT; instead,
14825 report a string overflow if no precision given. When checking for
14826 precision exhaustion, use a check that cannot possibly have
14827 integer overflow. (Bug#8675)
14828 * character.h (lisp_string_width): Adjust to new signature.
14829
cb93f9be
PE
14830 * alloc.c (string_overflow): New function.
14831 (Fmake_string): Use it. This doesn't change behavior, but saves
14832 a few bytes and will simplify future changes.
14833 * character.c (string_escape_byte8): Likewise.
14834 * lisp.h (string_overflow): New decl.
14835
1a1f3366
PE
14836 Fixups, following up to the user-interface timestamp change.
14837 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14838 for UI timestamps, instead of unsigned long.
9fbd6841
PE
14839 * msdos.c (mouse_get_pos): Likewise.
14840 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
14841 * w32gui.h (Time): Define by including "systime.h" rather than by
14842 declaring it ourselves. (Bug#8664)
14843
d4e3e4d3
PE
14844 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14845 * image.c (clear_image_cache): Likewise.
14846
f6a24d19
PE
14847 * term.c (term_mouse_position): Don't assume time_t wraparound.
14848
08dc5ae6
PE
14849 Be more systematic about user-interface timestamps.
14850 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
14851 and sometimes 'EMACS_UINT', to represent these timestamps.
14852 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
14853 This makes the code easier to follow, and makes it easier to catch
14854 integer overflow bugs such as Bug#8664.
14855 * frame.c (Fmouse_position, Fmouse_pixel_position):
14856 Use Time, not unsigned long, for user-interface timestamps.
14857 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14858 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14859 * keyboard.h (last_event_timestamp): Likewise.
14860 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14861 * menu.h (xmenu_show): Likewise.
14862 * term.c (term_mouse_position): Likewise.
14863 * termhooks.h (struct input_event.timestamp): Likewise.
14864 (struct terminal.mouse_position_hook): Likewise.
14865 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14866 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14867 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14868 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14869 what it was before.
14870 * menu.h, termhooks.h: Include "systime.h", for Time.
14871
8e55734a
PE
14872 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14873 Don't assume that the difference between two unsigned long values
14874 can fit into an integer. At this point, we know button_down_time
14875 <= event->timestamp, so the difference must be nonnegative, so
14876 there's no need to cast the result if double-click-time is
14877 nonnegative, as it should be; check that it's nonnegative, just in
14878 case. This bug is triggered when events are more than 2**31 ms
86db42d2 14879 apart (about 25 days). (Bug#8664)
8e55734a 14880
841f1b75 14881 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 14882 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 14883
3e26f69c
PE
14884 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14885 that always fit in int. Use a sentinel instead of a counter, to
14886 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
14887 * frame.h (struct frame): Use int for menu_bar_items_used
14888 instead of EMACS_INT, since it always fits in int.
3e26f69c 14889
5cc152c0
PE
14890 * menu.c (grow_menu_items): Check for int overflow.
14891
d89eb65e
PE
14892 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14893
5235bd3e
PE
14894 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14895 Before, the code was not consistent. These values cannot exceed
14896 2**31 - 1 so there's no need to make them unsigned.
14897 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14898 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14899 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14900 as modifiers.
14901 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14902
bc827e23
PE
14903 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14904 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14905 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14906 presumably because the widths might not match.
14907
78eb494e
PE
14908 * window.c (size_window): Avoid needless test at loop start.
14909
04f2d78b
CB
149102011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14911
14912 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14913
d2fc7e3d 149142011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
14915
14916 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14917
d2fc7e3d 149182011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
14919
14920 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14921 `width' to `bar_area_x' and `bar_area_width', respectively.
14922 (x_scroll_run): Take account of fringe background extension.
14923
04f2d78b
CB
14924 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14925 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
14926 `bar_area_width', respectively.
14927 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14928 background extension.
14929
79b70037
GM
149302011-05-10 Jim Meyering <meyering@redhat.com>
14931
14932 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14933
2f142cc5
JB
149342011-05-10 Juanma Barranquero <lekktu@gmail.com>
14935
14936 * image.c (Finit_image_library): Return t for built-in image types,
14937 like pbm and xbm. (Bug#8640)
14938
57679c86
AS
149392011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14940
14941 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14942
888c9e86
EZ
149432011-05-07 Eli Zaretskii <eliz@gnu.org>
14944
b0512a1d
EZ
14945 * w32console.c (Fset_screen_color): Doc fix.
14946 (Fget_screen_color): New function.
14947 (syms_of_ntterm): Defsubr it.
14948
7285dc67
EZ
14949 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14950 unlink the temporary file if Fcall_process didn't create it in the
14951 first place.
14952 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14953 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
14954 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14955 cue to call_process_cleanup not to close that handle.
14956
4d3fcc8e
BK
149572011-05-07 Ben Key <bkey76@gmail.com>
14958
14959 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14960 one of two shell specific rules, either bootstrap-temacs-CMD or
14961 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14962 to the previous implementation of the bootstrap-temacs rule.
14963 The bootstrap-temacs-CMD rule is similar to the previous
14964 implementation of the bootstrap-temacs rule except that it
14965 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14966 variable.
14967
14968 These changes, along with some changes to nt/configure.bat,
14969 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14970 earlier fix to add support for --cflags and --ldflags options
14971 that include quotes so that it works whether make uses cmd or
14972 sh as the shell.
14973
b4289b64
MA
149742011-05-06 Michael Albinus <michael.albinus@gmx.de>
14975
14976 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14977 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14978 is a constant.
14979 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14980 a string. Handle both cases.
14981 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14982 (Fdbus_register_method): Use Qinvalid_function.
14983
af4c0e28
JB
149842011-05-06 Juanma Barranquero <lekktu@gmail.com>
14985
14986 * makefile.w32-in: Update dependencies.
14987 (LISP_H): Add inttypes.h and stdin.h.
14988 (PROCESS_H): Add unistd.h.
14989
c51453d9
EZ
149902011-05-06 Eli Zaretskii <eliz@gnu.org>
14991
14992 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14993 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14994
8ff0ac3c 149952011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 14996
4c4b566b
PE
14997 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14998
aab2b9b5
PE
14999 * term.c (vfatal): Remove stray call to va_end.
15000 It's not needed and the C Standard doesn't allow it here anyway.
15001
c378da0b
PE
15002 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15003 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15004
288b08c7
PE
15005 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15006 bytes.
15007
e3601888
PE
15008 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15009
db6c0e74
PE
15010 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15011
dd5963ea
PE
15012 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15013
88c9450f
PE
15014 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15015
2f9442b8
PE
15016 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15017
c032b5f8
PE
15018 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15019 * charset.c (Fdefine_charset_internal): Don't initialize
15020 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 15021 32-bit int (Bug#8600).
a108c10b
PE
15022
15023 * lread.c (read_integer): Be more consistent with string-to-number.
15024 Use string_to_number to do the actual conversion; this avoids
15025 rounding errors and fixes some other screwups. Without this fix,
15026 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15027 (digit_to_number): Move earlier, for benefit of read_integer.
15028 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 15029 not a digit in any supported base. (Bug#8602)
a108c10b 15030
ad5f9eea
PE
15031 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15032
aec1708a
PE
15033 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15034 to match comment at start of function. This also removes a
15035 GCC warning about overflow in a 32+64-bit port.
15036
47be4ab5
PE
15037 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15038
371cac43
PE
15039 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15040 Reported by Stefan Monnier in
15041 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
15042 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15043 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 15044
d01a7826
PE
15045 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15046 (EMACS_UINTPTR): Likewise, with uintptr_t.
15047
7fd47d5c
PE
15048 * lisp.h: Prefer 64-bit EMACS_INT if available.
15049 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15050 on 32-bit hosts that have 64-bit int, so that they can access
15051 large files.
122b0c86
PE
15052 However, temporarily disable this change unless the temporary
15053 symbol WIDE_EMACS_INT is defined.
7fd47d5c 15054
8727937b
PE
15055 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15056
8ac068ac
PE
15057 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15058 This removes an assumption that EMACS_INT and long are the same
15059 width as pointers. The assumption is true for Emacs porting targets
15060 now, but we want to make other targets possible.
15061 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15062 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15063 In the rest of the code, change types of integers that hold casted
15064 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15065 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15066 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15067 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15068 No need to cast type when ORing.
15069 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15070 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15071 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15072 assume EMACS_INT is the same width as char *.
15073 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15074 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15075 Remove no-longer-needed casts.
15076 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15077 (xg_tool_bar_help_callback, xg_make_tool_item):
15078 Use EMACS_INTPTR to hold an integer
15079 that will be cast to void *; this can avoid a GCC warning
15080 if EMACS_INT is not the same width as void *.
15081 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15082 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15083 (current_message_1, set_message_1):
15084 Use a local to convert to proper width without a cast.
15085 * xmenu.c (dialog_selection_callback): Likewise.
15086
ede49d71
PE
15087 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15088 Also, don't assume VALBITS / RAND_BITS is less than 5,
15089 and don't rely on undefined behavior when shifting a 1 left into
15090 the sign bit.
15091 * lisp.h (get_random): Change signature to match.
15092
2f30ecd0
PE
15093 * lread.c (hash_string): Use size_t, not int, for hash computation.
15094 Normally we prefer signed values; but hashing is special, because
15095 it's better to use unsigned division on hash table sizes so that
15096 the remainder is nonnegative. Also, size_t is the natural width
15097 for hashing into memory. The previous code used 'int', which doesn't
15098 retain enough info to hash well into very large tables.
15099 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15100
2a866e7b
PE
15101 * dbusbind.c: Don't possibly lose pointer info when converting.
15102 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15103 Use XPNTR rather than XHASH, so that the high-order bits of
15104 the pointer aren't lost when converting through void *.
15105
51639eac
PE
15106 * eval.c (Fautoload): Don't double-shift a pointer.
15107
92394119
PE
15108 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15109
dbdb9a7c
JB
151102011-05-06 Juanma Barranquero <lekktu@gmail.com>
15111
15112 * gnutls.c (DEF_GNUTLS_FN):
15113 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15114
db7a0b4f
AS
151152011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15116
15117 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15118 marker. (Bug#8610)
15119
cd394be1 151202011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
15121
15122 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15123 New version that can reserve upto 2GB of heap space.
15124
f7ff1b0f 151252011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
15126
15127 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15128
639c109b
TZ
151292011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15130
15131 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15132 `gnutls_certificate_set_x509_key_file'.
15133
d2127135
JB
151342011-05-05 Juanma Barranquero <lekktu@gmail.com>
15135
15136 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15137 Update dependencies.
15138
e968f4f3
JB
151392011-05-04 Juanma Barranquero <lekktu@gmail.com>
15140
15141 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15142 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15143 Remove unused parameter `fildes'.
15144 * process.c (read_process_output, send_process): Don't pass it.
15145
84d358f0
JB
151462011-05-04 Juanma Barranquero <lekktu@gmail.com>
15147
15148 Fix previous change: the library cache is defined in w32.c.
15149 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15150 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15151
0898ca10
JB
151522011-05-04 Juanma Barranquero <lekktu@gmail.com>
15153
15154 Implement dynamic loading of GnuTLS on Windows.
15155
15156 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15157 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15158 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15159 Declare.
15160
15161 * gnutls.c (Qgnutls_dll): Define.
15162 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15163 (gnutls_*): Declare function pointers.
15164 (init_gnutls_functions): New function to initialize function pointers.
15165 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15166 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15167 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15168 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15169 (emacs_gnutls_write, emacs_gnutls_read)
15170 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15171 (Fgnutls_available_p): New function.
15172 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15173 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15174 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15175
15176 * image.c: Include w32.h.
15177 (Vimage_type_cache): Delete.
15178 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15179 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15180 (w32_delayed_load): Move to w32.c.
15181
15182 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15183
15184 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15185 (w32_delayed_load): Move from image.c. When loading a library, record
15186 its filename in the :loaded-from property of the library id.
15187 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15188 Initialize and staticpro them.
15189 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15190
15191 * process.c: Include lisp.h before w32.h, not after.
15192 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15193 instead of gnutls_record_check_pending.
15194
15195 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15196
ff4de4aa
TZ
151972011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15198
15199 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15200 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15201 as passed in.
15202
abe95abb
JD
152032011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15204
15205 * xterm.c (x_set_frame_alpha): Do not set property on anything
15206 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15207
e16e55d4
JB
152082011-05-02 Juanma Barranquero <lekktu@gmail.com>
15209
15210 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15211
bafcf6a5
JB
152122011-05-02 Juanma Barranquero <lekktu@gmail.com>
15213
15214 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15215 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15216 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15217 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15218 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15219 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15220 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15221 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15222 (Qgnutls_bootprop_callbacks_verify): Make static.
15223
e7a6747f
AS
152242011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15225
19ed11ba
AS
15226 * callproc.c: Indentation fixup.
15227
e7a6747f 15228 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
15229 (wait_for_termination, interruptible_wait_for_termination):
15230 Move after wait_for_termination_1.
e7a6747f 15231
1ef14cb4
LMI
152322011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15233
15234 * sysdep.c (interruptible_wait_for_termination): New function
15235 which is like wait_for_termination, but allows keyboard
15236 interruptions.
15237
15238 * callproc.c (Fcall_process): Add (:file "file") as an option for
15239 the STDOUT buffer.
15240 (Fcall_process_region): Ditto.
15241
330d880c
EZ
152422011-04-30 Eli Zaretskii <eliz@gnu.org>
15243
8db90b73
EZ
15244 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15245 rather than `XVECTOR (FOO)->size'.
15246
330d880c
EZ
15247 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15248 inttypes.h, as a gnulib replacement is used if it not available in
15249 system headers.
15250
15cbd324
EZ
152512011-04-21 Eli Zaretskii <eliz@gnu.org>
15252
15253 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15254 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15255 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15256
15257 * coding.c (coding_alloc_by_realloc): Error out if destination
15258 will grow beyond MOST_POSITIVE_FIXNUM.
15259 (decode_coding_emacs_mule): Abort if there isn't enough place in
15260 charbuf for the composition carryover bytes. Reserve an extra
15261 space for up to 2 characters produced in a loop.
15262 (decode_coding_iso_2022): Abort if there isn't enough place in
15263 charbuf for the composition carryover bytes.
15264
152652011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 15266
ae940cca
EZ
15267 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15268 aborting when %lld or %lll format is passed.
15269 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15270 %llo or %llx format is passed. (Bug#8545)
15271
03ab8921
EZ
15272 * window.c (window_scroll_line_based): Use a marker instead of
15273 simple variables to record original value of point. (Bug#7952)
15274
afda1437
EZ
15275 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15276 produced by %s or %c overflows available buffer space. (Bug#8545)
15277
f76dee0c
PE
152782011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15279
15280 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 15281 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 15282
fdc5744d
JB
152832011-04-28 Juanma Barranquero <lekktu@gmail.com>
15284
15285 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15286
638f053a
JB
152872011-04-28 Juanma Barranquero <lekktu@gmail.com>
15288
15289 * keyboard.c (Qdelayed_warnings_hook): Define.
15290 (command_loop_1): Run `delayed-warnings-hook'
15291 if Vdelayed_warnings_list is non-nil.
15292 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15293 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15294
d178f871
EZ
152952011-04-28 Eli Zaretskii <eliz@gnu.org>
15296
15297 * doprnt.c (doprnt): Don't return value smaller than the buffer
15298 size if the message was truncated. (Bug#8545).
15299
b124fd93
JB
153002011-04-28 Juanma Barranquero <lekktu@gmail.com>
15301
15302 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15303 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15304
e810457d
PE
153052011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15306
15307 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15308
ea51cceb
JB
153092011-04-27 Juanma Barranquero <lekktu@gmail.com>
15310
15311 * makefile.w32-in: Update dependencies.
15312
94dcfacf
EZ
153132011-04-27 Eli Zaretskii <eliz@gnu.org>
15314
15315 Improve `doprnt' and its usage. (Bug#8545)
15316 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15317 `format_end'. Remove support for %l as a conversion specifier.
15318 Don't use xrealloc. Improve diagnostics when the %l size modifier
15319 is used. Update the commentary.
15320
15321 * eval.c (verror): Simplify calculation of size_t.
15322
15323 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15324 messages.
15325
f61f41d7
PE
153262011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15327
15328 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15329 change.
15330
96fb4434
PE
153312011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15332
15333 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15334 This makes this file independent of the recent pseudovector change.
15335
671875da 153362011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 15337
69e9b5a3
PE
15338 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15339
b5f869a7 15340 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 15341 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 15342 Remove unused local.
c8926152 15343 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 15344
841a1577 15345 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
15346 GCC 4.6.0 optimizes based on type-based alias analysis.
15347 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
15348 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15349 != &v->size, and therefore "v->size = 1; b->size = 2; return
15350 v->size;" must therefore return 1. This assumption is incorrect
15351 for Emacs, since it type-puns struct Lisp_Vector * with many other
15352 types. To fix this problem, this patch adds a new type struct
f904488f 15353 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
15354 and pseudovectors, and helps optimizing compilers not get fooled
15355 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15356 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
15357 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15358 the size member.
eab3844f
PE
15359 (XSETPVECTYPE): Rewrite in terms of new macro.
15360 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15361 This is a bit clearer, and further avoids the possibility of
15362 undesirable aliasing.
15363 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 15364 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
15365 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15366 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
15367 (ASIZE): Now uses header.size rather than size.
15368 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
15369 to avoid the hassle of writing XVECTOR (foo)->header.size.
15370 (struct vectorlike_header): New type.
eab3844f
PE
15371 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15372 object, to help avoid aliasing.
15373 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15374 (SUBRP): Likewise, since Lisp_Subr is a special case.
15375 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15376 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15377 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 15378 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
15379 changed to be "header.size" and "header.next".
15380 * buffer.h (struct buffer): Likewise.
15381 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15382 * frame.h (struct frame): Likewise.
15383 * process.h (struct Lisp_Process): Likewise.
15384 * termhooks.h (struct terminal): Likewise.
15385 * window.c (struct save_window_data, struct saved_window): Likewise.
15386 * window.h (struct window): Likewise.
15387 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15388 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15389 * buffer.c (init_buffer_once): Likewise.
15390 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15391 special case.
15392 * process.c (Fformat_network_address): Use local var for size,
15393 for brevity.
15394
0df1eac5
PE
15395 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15396
847ab9d1 15397 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
15398 * data.c (atof): Remove decl; no longer used or needed.
15399 (digit_to_number): Move to lread.c.
15400 (Fstring_to_number): Use new string_to_number function, to be
15401 consistent with how the Lisp reader treats infinities and NaNs.
15402 Do not assume that floating-point numbers represent EMACS_INT
15403 without losing information; this is not true on most 64-bit hosts.
15404 Avoid double-rounding errors, by insisting on integers when
15405 parsing non-base-10 numbers, as the documentation specifies.
15406 * lisp.h (string_to_number): New decl, replacing ...
15407 (isfloat_string): Remove.
bc0a5c13 15408 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 15409 (read1): Do not accept +. and -. as integers; this
452f4150
PE
15410 appears to have been a coding error. Similarly, do not accept
15411 strings like +-1e0 as floating point numbers. Do not report
15412 overflow for integer overflows unless the base is not 10 which
15413 means we have no simple and reliable way to continue.
15414 Break out the floating-point parsing into a new
15415 function string_to_number, so that Fstring_to_number parses
15416 floating point numbers consistently with the Lisp reader.
04f2d78b 15417 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
15418 (E_CHAR, EXP_INT): Remove, replacing with ...
15419 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15420 (string_to_number): New function, replacing isfloat_string.
15421 This function checks for valid syntax and produces the resulting
15422 Lisp float number too. Rework it so that string-to-number
bc0a5c13 15423 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
15424 so that overflow for non-base-10 numbers is reported only when
15425 there's no portable and simple way to convert to floating point.
452f4150 15426
67769ffc
PE
15427 * textprop.c (set_text_properties_1): Rewrite for clarity,
15428 and to avoid GCC warning about integer overflow.
15429
c20db43f
PE
15430 * intervals.h (struct interval): Use EMACS_INT for members
15431 where EMACS_UINT might cause problems. See
15432 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15433 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15434 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15435 All uses changed.
37aa2f85
PE
15436 (offset_intervals): Tell GCC not to worry about length overflow
15437 when negating a negative length.
c20db43f 15438
2538aa2f
PE
15439 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15440 (overrun_check_free): Likewise.
15441
f2d3008d
PE
15442 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15443 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15444 word size.
15445
ec8df744
PE
15446 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15447 (gnutls_make_error): Rename local to avoid shadowing.
15448 (gnutls_emacs_global_deinit): ifdef out; not used.
15449 (Fgnutls_boot): Use const for pointer to readonly storage.
15450 Comment out unused local. Fix pointer signedness problems.
15451
640ee02d
PE
15452 * lread.c (openp): Don't stuff size_t into an 'int'.
15453 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15454 about possible signed overflow.
15455
6048fb2a
PE
15456 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15457 (GDK_KEY_g): Don't define if already defined.
15458 (xg_prepare_tooltip): Avoid pointer signedness problem.
15459 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15460
fa3c87e1
PE
15461 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15462 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15463
2172544b
PE
15464 * xfns.c (Fx_window_property): Simplify a bit,
15465 to make a bit faster and to avoid GCC 4.6.0 warning.
15466 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15467
9b821a21
PE
15468 * fns.c (internal_equal): Don't assume size_t fits in int.
15469
3c616cfa
PE
15470 * alloc.c (compact_small_strings): Tighten assertion a little.
15471
c2982e87
PE
15472 Replace pEd with more-general pI, and fix some printf arg casts.
15473 * lisp.h (pI): New macro, generalizing old pEd macro to other
15474 conversion specifiers. For example, use "...%"pI"d..." rather
15475 than "...%"pEd"...".
15476 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 15477 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
15478 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15479 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15480 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15481 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15482 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15483 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15484 64-bit hosts.
15485 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15486 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15487 * print.c (safe_debug_print, print_object): Likewise.
15488 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15489 to int.
6f04d126
PE
15490 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15491 avoiding the 0 flag, which is not portable.
c2982e87
PE
15492 * process.c (Fmake_network_process): Use pI to avoid cast.
15493 * region-cache.c (pp_cache): Likewise.
15494 * xdisp.c (decode_mode_spec): Likewise.
15495 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15496 behavior on 64-bit hosts with printf arg.
6f04d126 15497 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
15498 (x_stop_queuing_selection_requests): Likewise.
15499 (x_get_window_property): Don't truncate byte count to an 'int'
15500 when tracing.
0b432f21 15501
5e073ec7
PE
15502 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15503 here, since it parses constructs like leading '-' and spaces,
15504 which are not wanted; and it overflows with large numbers.
15505 Instead, simply match F[0-9]+, which is what is wanted anyway.
15506
36372bf9
PE
15507 * alloc.c: Remove unportable assumptions about struct layout.
15508 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15509 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15510 (allocate_vectorlike, make_pure_vector): Use the new macros,
15511 plus offsetof, to remove unportable assumptions about struct layout.
15512 These assumptions hold on all porting targets that I know of, but
15513 they are not guaranteed, they're easy to remove, and removing them
15514 makes further changes easier.
15515
0b432f21
PE
15516 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15517 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
15518 (string_overrun_cookie): Now const. Use initializers that
15519 don't formally overflow signed char, to avoid warnings.
000098c1
PE
15520 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15521 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
15522 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15523 multiple of sizeof (EMACS_INT); it need not be, if
15524 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 15525 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 15526
895009e1
JB
155272011-04-26 Juanma Barranquero <lekktu@gmail.com>
15528
15529 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15530
6a7a1b0b
TZ
155312011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15532
15533 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 15534 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
15535 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15536
841a1577 155372011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
15538
15539 * lisp.h (Qdebug): List symbol.
895009e1 15540 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
15541 * keyboard.c (debug-on-event): New variable.
15542 (handle_user_signal): Break into debugger when debug-on-event
15543 matches the current signal symbol.
15544
f2d3ba6f
DN
155452011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15546
15547 * alloc.c (check_sblock, check_string_bytes)
15548 (check_string_free_list): Convert to standard C.
15549
42ce4c63
TZ
155502011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15551
15552 * w32.c (emacs_gnutls_push): Fix typo.
15553
825cd63c
EZ
155542011-04-25 Eli Zaretskii <eliz@gnu.org>
15555
fb11d64d
EZ
15556 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15557 "cast to pointer from integer of different size".
15558
825cd63c
EZ
15559 Improve doprnt and its use in verror. (Bug#8545)
15560 * doprnt.c (doprnt): Document the set of format control sequences
15561 supported by the function. Use SAFE_ALLOCA instead of always
15562 using `alloca'.
15563
15564 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15565 is one byte too soon. Don't use xrealloc; instead xfree and
15566 xmalloc anew.
15567
e061a11b
TZ
155682011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15569
15570 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15571 callbacks stage.
15572
15573 * gnutls.c: Renamed global_initialized to
15574 gnutls_global_initialized. Added internals for the
15575 :verify-hostname-error, :verify-error, and :verify-flags
15576 parameters of `gnutls-boot' and documented those parameters in the
15577 docstring. Start callback support.
9173deec
JB
15578 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15579 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15580 on error. Return error code.
e061a11b
TZ
15581 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15582 (emacs_gnutls_read): Likewise.
15583 (Fgnutls_boot): Return handshake error code.
15584 (emacs_gnutls_handle_error): New function.
15585 (wsaerror_to_errno): Likewise.
15586
15587 * w32.h (emacs_gnutls_pull): Add prototype.
15588 (emacs_gnutls_push): Likewise.
15589
15590 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15591 (emacs_gnutls_push): Likewise.
15592
155932011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15594
15595 * process.c (wait_reading_process_output): Check if GnuTLS
15596 buffered some data internally if no FDs are set for TLS
15597 connections.
15598
15599 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15600 (LIBS): Link to USER_LIBS.
15601 ($(BLD)/gnutls.$(0)): New target.
15602
fa6996bc
EZ
156032011-04-24 Eli Zaretskii <eliz@gnu.org>
15604
eb35682e
EZ
15605 * xdisp.c (handle_single_display_spec): Rename the
15606 display_replaced_before_p argument into display_replaced_p, to
15607 make it consistent with the commentary. Fix typos in the
15608 commentary.
15609
e2ad650c
EZ
15610 * textprop.c (syms_of_textprop): Remove dead code.
15611 (copy_text_properties): Delete obsolete commentary about an
15612 interface that was deleted long ago. Fix typos in the description
15613 of arguments.
15614
1b2de274
EZ
15615 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15616 to changes in oldXMenu/XMenu.h from 2011-04-16.
15617 <menu_help_message, prev_menu_help_message>: Constify.
15618 (IT_menu_make_room): menu->help_text is now `const char **';
15619 adjust.
15620
15621 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15622 to changes in oldXMenu/XMenu.h from 2011-04-16.
15623 (struct XMenu): Declare `help_text' `const char **'.
15624
15625 * xfaces.c <Qunspecified>: Make extern again.
15626
15627 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 15628 required by POSIX.
1b2de274 15629
762b15be
EZ
15630 * doc.c (get_doc_string): Improve the format passed to `error'.
15631
15632 * doprnt.c (doprnt): Improve commentary.
15633
15634 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15635
15636 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15637 them with etags.
15638
f1052e5d
EZ
15639 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15640 changes in globals.h immediately force recompilation.
762b15be
EZ
15641 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15642 $(CURDIR)/s/ms-w32.h.
15643 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 15644
fa6996bc
EZ
15645 * character.c (Fchar_direction): Function deleted.
15646 (syms_of_character): Don't defsubr it.
15647 <char-direction-table>: Deleted.
15648
e6c3da20
EZ
156492011-04-23 Eli Zaretskii <eliz@gnu.org>
15650
15651 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15652 * doprnt.c: Include limits.h.
15653 (SIZE_MAX): New macro.
04f2d78b
CB
15654 (doprnt): Return a size_t value. 2nd arg is now size_t.
15655 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
15656 Improve overflow protection. Support `l' modifier for integer
15657 conversions. Support %l conversion. Don't assume an EMACS_INT
15658 argument for integer conversions and for %c.
15659
15660 * lisp.h (doprnt): Restore prototype.
15661
15662 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15663 $(SRC)/character.h.
15664
15665 * Makefile.in (base_obj): Add back doprnt.o.
15666
15667 * deps.mk (doprnt.o): Add back prerequisites.
15668 (callint.o): Depend on character.h.
15669
15670 * eval.c (internal_lisp_condition_case): Include the handler
15671 representation in the error message.
15672 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15673 when breaking from the loop.
15674
15675 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15676
15677 * callint.c (Fcall_interactively): When displaying error message
15678 about invalid control letter, pass the character's codepoint, not
15679 a pointer to its multibyte form. Improve display of the character
15680 in octal and display also its hex code.
15681
15682 * character.c (char_string): Use %x to display the (unsigned)
15683 codepoint of an invalid character, to avoid displaying a bogus
15684 negative value.
15685
15686 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15687 `error', not SYMBOL_NAME itself.
15688
15689 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15690 character arguments to `error'.
15691
15692 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15693 to `error' in error message about FINAL_CHAR argument. Make sure
15694 FINAL_CHAR is a character, and use %c when it is passed as
15695 argument to `error'.
15696
4ffd0d6b 156972011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
15698
15699 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15700
15701 * w32.c: Include <time.h>.
15702 (sys_localtime): New function.
15703
4ffd0d6b 157042011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
15705
15706 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15707
4ffd0d6b 15708 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 15709
4ffd0d6b 157102011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 15711
4ffd0d6b
GM
15712 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15713 zombies (Bug#8467).
aac0c6e3 15714
04c56954
EZ
157152011-04-19 Eli Zaretskii <eliz@gnu.org>
15716
15717 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15718 gl_state.e_property when gl_state.object is Qt.
15719
15720 * insdel.c (make_gap_larger): Remove limitation of buffer size
15721 to <= INT_MAX.
15722
16a43933
CY
157232011-04-18 Chong Yidong <cyd@stupidchicken.com>
15724
15725 * xdisp.c (lookup_glyphless_char_display)
15726 (produce_glyphless_glyph): Handle cons cell entry in
15727 glyphless-char-display.
15728 (Vglyphless_char_display): Document it.
15729
15730 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15731 glyphless-char-display.
15732
4581706e
CY
157332011-04-17 Chong Yidong <cyd@stupidchicken.com>
15734
15735 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15736
15737 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15738
15739 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15740 definition for no-X builds.
15741
4887c6e2 157422011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 15743
fd35b6f9
PE
15744 Static checks with GCC 4.6.0 and non-default toolkits.
15745
5c1ccb01
PE
15746 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15747
006c5daa
PE
15748 * process.c (keyboard_bit_set): Define only if SIGIO.
15749 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15750 (send_process): Repair possible setjmp clobbering.
15751
efc736d3
PE
15752 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15753
4e2fe2e6
PE
15754 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15755
f97334a2
PE
15756 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15757
4e75f29d
PE
15758 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15759 Define only if needed.
15760
90efadd1
PE
15761 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15762 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 15763 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 15764
3c647824
PE
15765 * dispextern.h (struct redisplay_interface): Rename param
15766 to avoid shadowing.
e264f262 15767 * termhooks.h (struct terminal): Likewise.
761383f4 15768 * xterm.c (xembed_send_message): Likewise.
3c647824 15769
b58c5c4a
PE
15770 * insdel.c (make_gap_smaller): Define only if
15771 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15772
cad59032
PE
15773 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15774 it.
15775
c339dc2e
PE
15776 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15777 so that we aren't warned about unused symbols.
15778
91a3e27b
PE
15779 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15780
399c71d3 15781 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 15782
8ffc96f5
PE
15783 * xfns.c (x_real_positions): Mark locals as initialized.
15784
eef9bc79
PE
15785 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15786
098db9dd
PE
15787 * xterm.c: Fix problems found by static analysis with other toolkits.
15788 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
15789 (x_dispatch_event): Declare static if USE_GTK, and
15790 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 15791 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 15792 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
15793 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15794 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 15795
eb18f6cc
PE
15796 * xmenu.c (menu_help_callback): Pointer type fixes.
15797 Use const pointers when pointing at readonly data. Avoid pointer
15798 signedness clashes.
15799 (FALSE): Remove unused macro.
15800 (update_frame_menubar): Remove unused decl.
15801
1fe72bf8
PE
15802 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15803
60d9e1db
PE
15804 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15805 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15806 (single_menu_item): Rename local to avoid shadowing.
15807
39261c26
PE
15808 * keyboard.c (make_lispy_event): Remove unused local var.
15809
018c5e19
PE
15810 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15811 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15812
63d2b86e
PE
15813 * bitmaps: Change bitmaps from unsigned char back to the X11
15814 compatible char. Avoid the old compiler warnings about
15815 out-of-range initializers by using, for example, '\xab' rather
15816 than 0xab.
15817
aefd87e1
PE
15818 * xgselect.c (xgselect_initialize): Check vs interface
15819 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15820
bf501fb9
PE
15821 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15822
e9829fdf
PE
15823 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15824 to read-only memory.
15825
1086c095
PE
15826 * fns.c (vector): Remove; this old hack is no longer needed.
15827
2baccd04 15828 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 15829 Remove unused var.
dde42981 15830 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 15831
72391843 15832 * xrdb.c (x_load_resources): Omit unused local.
3565b346 15833
436c16df 15834 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 15835 (x_window): Rename locals to avoid shadowing.
dc5ddd85 15836 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 15837
92bb796d 15838 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 15839 (x_term_init): Remove local to avoid shadowing.
92bb796d 15840
764430a3 15841 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
15842
15843 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15844 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15845
d1dfb56c
EZ
158462011-04-16 Eli Zaretskii <eliz@gnu.org>
15847
c4354cb4
EZ
15848 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15849
d1dfb56c
EZ
15850 Fix regex.c, syntax.c and friends for buffers > 2GB.
15851 * syntax.h (struct gl_state_s): Declare character position members
15852 EMACS_INT.
15853
15854 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15855
04f2d78b
CB
15856 * textprop.c (verify_interval_modification, interval_of):
15857 Declare arguments EMACS_INT.
d1dfb56c
EZ
15858
15859 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15860 EMACS_INT.
15861
15862 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15863
15864 * indent.c (Fvertical_motion): Local variable it_start is now
15865 EMACS_INT.
15866
15867 * regex.c (re_match, re_match_2, re_match_2_internal)
15868 (bcmp_translate, regcomp, regexec, print_double_string)
15869 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15870 (re_compile_pattern, re_exec): Declare arguments and local
15871 variables `size_t' and `ssize_t' and return values `regoff_t', as
15872 appropriate.
15873 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15874 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15875 <compile_stack_type>: `size' and `avail' are now `size_t'.
15876
15877 * regex.h <regoff_t>: Use ssize_t, not int.
15878 (re_search, re_search_2, re_match, re_match_2): Arguments that
15879 specify buffer/string position and length are now ssize_t and
15880 size_t. Return type is regoff_t.
15881
613052cd
BK
158822011-04-16 Ben Key <bkey76@gmail.com>
15883
15884 * nsfont.m: Fixed bugs in ns_get_family and
15885 ns_descriptor_to_entity that were caused by using free to
15886 deallocate memory blocks that were allocated by xmalloc (via
15887 xstrdup). This caused Emacs to crash when compiled with
15888 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15889 --enable-checking=xmallocoverrun). xfree is now used to
15890 deallocate these memory blocks.
15891
4170f62f 158922011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 15893
71b41406
PE
15894 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15895
9587a89d
PE
15896 emacs_write: Accept and return EMACS_INT for sizes.
15897 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15898 et seq.
15899 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15900 Accept and return EMACS_INT.
15901 (emacs_gnutls_write): Return the number of bytes written on
15902 partial writes.
15903 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
15904 (emacs_read, emacs_write): Remove check for negative size, as the
15905 Emacs source code has been audited now.
9587a89d
PE
15906 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15907 (emacs_read, emacs_write): Use it.
273a5f82
PE
15908 * process.c (send_process): Adjust to the new signatures of
15909 emacs_write and emacs_gnutls_write. Do not attempt to store
15910 a byte offset into an 'int'; it might overflow.
9587a89d 15911 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 15912
3e047f51
PE
15913 * sound.c: Don't assume sizes fit in 'int'.
15914 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 15915 Return EMACS_INT, not int.
3e047f51 15916 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
15917 Accept EMACS_INT, not int.
15918 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
15919 record read return values.
15920
cc39a9db
BK
159212011-04-15 Ben Key <bkey76@gmail.com>
15922
c9d0ec6d
JB
15923 * keyboard.c (Qundefined): Don't declare static since it is used
15924 in nsfns.m.
15925 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15926 static since they are used in nsfont.m.
cc39a9db 15927
6c60eb9f
SM
159282011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15929
15930 * process.c (Qprocessp): Don't declare static.
15931 * lisp.h (Qprocessp): Declare again.
15932
7990b61a
JB
159332011-04-15 Juanma Barranquero <lekktu@gmail.com>
15934
15935 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15936
5d4cb038
PE
159372011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15938
8bd7b830 15939 Improve C-level modularity by making more things 'static'.
cd64ea1d 15940
e3b27b31
PE
15941 Don't publish debugger-only interfaces to other modules.
15942 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15943 (verify_bytepos, count_markers): Move decls to the only modules
15944 that need them.
15945 * region-cache.h (pp_cache): Likewise.
15946 * window.h (check_all_windows): Likewise.
15947 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15948
5d4cb038
PE
15949 * sysdep.c (croak): Now static, if
15950 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15951 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
15952
15953 * alloc.c (refill_memory_reserve): Now static if
15954 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15955 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 15956
e87b6180
PE
15957 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15958 Define only if USE_LUCID.
15959
ac64929e
PE
15960 * xrdb.c (x_customization_string, x_rm_string): Now static.
15961
6f37259d
PE
15962 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15963 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15964
1683e3ab
PE
15965 * xdisp.c (draw_row_with_mouse_face): Now static.
15966 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15967
de9c2632
PE
15968 * window.h (check_all_windows): Mark externally visible.
15969
2b96acb7
PE
15970 * window.c (window_deletion_count): Now static.
15971
15972 * undo.c: Make symbols static if they're not exported.
15973 (last_undo_buffer, last_boundary_position, pending_boundary):
15974 Now static.
15975
50436f33
PE
15976 * textprop.c (interval_insert_behind_hooks): Now static.
15977 (interval_insert_in_front_hooks): Likewise.
15978
64520e5c
PE
15979 * term.c: Make symbols static if they're not exported.
15980 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15981 (max_frame_lines, tty_set_terminal_modes):
15982 (tty_reset_terminal_modes, tty_turn_off_highlight):
15983 (get_tty_terminal): Now static.
15984 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15985 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 15986 HAVE_WINDOW_SYSTEM.
64520e5c
PE
15987 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15988 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15989
1fa53021
PE
15990 * sysdep.c: Make symbols static if they're not exported.
15991 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15992 Now static.
15993 (sigprocmask_set, full_mask): Remove; unused.
15994 (wait_debugging): Mark as visible.
15995 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15996 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15997
d4b43b22
PE
15998 * syntax.c (syntax_temp): Define only if !__GNUC__.
15999
b7c513d0
PE
16000 * sound.c (current_sound_device, current_sound): Now static.
16001
989b29ad
PE
16002 * search.c (searchbufs, searchbuf_head): Now static.
16003
13a55a78
PE
16004 * scroll.c (scroll_cost): Remove; unused.
16005 * dispextern.h (scroll_cost): Remove decl.
16006
de68a1fc
PE
16007 * region-cache.h (pp_cache): Mark as externally visible.
16008
40ccffa6
PE
16009 * process.c: Make symbols static if they're not exported.
16010 (process_tick, update_tick, create_process, chan_process):
16011 (Vprocess_alist, proc_buffered_char, datagram_access):
16012 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16013 (deactivate_process): Mark defn as static, as well as decl.
16014 * lisp.h (create_process): Remove decl.
16015 * process.h (chan_process, Vprocess_alist): Remove decls.
16016
ad64fc97
PE
16017 * print.c: Make symbols static if they're not exported.
16018 (print_depth, new_backquote_output, being_printed, print_buffer):
16019 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16020 (print_interval, print_number_index, initial_stderr_stream):
16021 Now static.
16022 * lisp.h (Fprinc): Remove decl.
16023 (debug_output_compilation_hack): Mark as externally visible.
16024
adddb265
PE
16025 * sysdep.c (croak): Move decl from here to syssignal.h.
16026 * syssignal.h (croak): Put it here, so the API can be checked when
16027 'croak' is called from dissociate_if_controlling_tty.
16028
1717ede2
PE
16029 * minibuf.c: Make symbols static if they're not exported.
16030 (minibuf_save_list, choose_minibuf_frame): Now static.
16031 * lisp.h (choose_minibuf_frame): Remove decl.
16032
fa5fb2bc
PE
16033 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16034
1e3890d1
PE
16035 * lread.c: Make symbols static if they're not exported.
16036 (read_objects, initial_obarray, oblookup_last_bucket_number):
16037 Now static.
16038 (make_symbol): Remove; unused.
16039 * lisp.h (initial_obarray, make_symbol): Remove decls.
16040
8a1414fa
PE
16041 * keyboard.c: Make symbols static if they're not exported.
16042 (single_kboard, recent_keys_index, total_keys, recent_keys):
16043 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16044 (this_single_command_key_start, echoing, last_auto_save):
16045 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16046 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16047 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16048 (Vlispy_mouse_stem, double_click_count):
16049 Now static.
16050 (force_auto_save_soon): Define only if SIGDANGER.
16051 (ignore_mouse_drag_p): Now static if
16052 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16053 (print_help): Remove; unused.
16054 (stop_character, last_timer_event): Mark as externally visible.
16055 * keyboard.h (ignore_mouse_drag_p): Declare only if
16056 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16057 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16058 * lisp.h (echoing): Remove decl.
16059 (force_auto_save_soon): Declare only if SIGDANGER.
16060 * xdisp.c (redisplay_window): Simplify code, to make it more
16061 obvious that ignore_mouse_drag_p is not accessed if !defined
16062 USE_GTK && !defined HAVE_NS.
16063
93ea6e8f
PE
16064 * intervals.c: Make symbols static if they're not exported.
16065 (merge_properties_sticky, merge_interval_right, delete_interval):
16066 Now static.
16067 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16068
77382fcc
PE
16069 * insdel.c: Make symbols static if they're not exported.
16070 However, leave prepare_to_modify_buffer alone. It's never
16071 called from outside this function, but that appears to be a bug.
16072 (combine_after_change_list, combine_after_change_buffer):
4889fc82 16073 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
16074 (adjust_after_replace_noundo): Remove; unused.
16075 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 16076 (signal_before_change): Remove decls.
77382fcc 16077
9306c32e
PE
16078 * indent.c (val_compute_motion, val_vmotion): Now static.
16079
cd44d2eb
PE
16080 * image.c: Make symbols static if they're not exported.
16081 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16082 if USE_GTK.
16083 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16084 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16085
ad9a7a06
PE
16086 * fringe.c (standard_bitmaps): Now static.
16087 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16088
81626931
PE
16089 * frame.c: Make symbols static if they're not exported.
16090 (x_report_frame_params, make_terminal_frame): Now static.
16091 (get_frame_param): Now static, unless HAVE_NS.
16092 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16093 (x_get_resource_string): Remove; not used.
16094 * frame.h (make_terminal_frame, x_report_frame_params):
16095 (x_get_resource_string); Remove decls.
16096 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16097 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16098
239f9db9
PE
16099 * font.c, fontset.c: Make symbols static if they're not exported.
16100 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16101 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16102 * font.c (font_close_object): Now static.
16103 * font.h (font_close_object): Remove.
16104 * fontset.c (FONTSET_OBJLIST): Remove.
16105 (free_realized_fontset) #if-0 the body, which does nothing.
16106 (face_suitable_for_char_p): #if-0, as it's never called.
16107 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
16108 * xfaces.c (face_at_string_position):
16109 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
16110 since 0 is always ASCII.
16111
dfcf3579
PE
16112 * fns.c (weak_hash_tables): Now static.
16113
5045092b
PE
16114 * fileio.c: Make symbols static if they're not exported.
16115 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16116 (Vwrite_region_annotation_buffers): Now static.
16117
57a96f5c
PE
16118 * eval.c: Make symbols static if they're not exported.
16119 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16120 * lisp.h (backtrace_list): Remove decl.
16121
35f08c38
PE
16122 * emacs.c: Make symbols static if they're not exported.
16123 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16124 (fatal_error_code, fatal_error_signal_hook, standard_args):
16125 Now static.
16126 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16127 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16128 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16129 * lisp.h (fatal_error_signal_hook): Remove decl.
16130 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16131
f44bd759
PE
16132 * editfns.c: Move a (normally-unused) function to its only use.
16133 * editfns.c, lisp.h (get_operating_system_release): Remove.
16134 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16135 worth the hassle of breaking this out.
16136
b532497d
PE
16137 * xterm.c: Make symbols static if they're not exported.
16138 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16139 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16140 (x_destroy_window, x_delete_display):
16141 Now static.
16142 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16143 (x_mouse_leave): Remove; unused.
16144 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16145 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16146 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16147 Remove decls.
16148 (x_mouse_leave): Declare only if WINDOWSNT.
16149 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16150 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16151 USE_X_TOOLKIT.
16152
1675728f
PE
16153 * ftxfont.c: Make symbols static if they're not exported.
16154 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16155 HAVE_FREETYPE.
16156 * font.h (ftxfont_driver): Likewise.
16157
e4cebfca
PE
16158 * xfns.c: Make symbols static if they're not exported.
16159 (x_last_font_name, x_display_info_for_name):
16160 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16161 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16162 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16163 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16164 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16165 (last_show_tip_args): Now static.
16166 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16167 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16168 (x_screen_planes): Remove; unused.
16169 * dispextern.h (x_screen_planes): Remove decl.
16170
5bf46f05
PE
16171 * dispnew.c: Make symbols static if they're not exported.
16172 * dispextern.h (redraw_garbaged_frames, scrolling):
16173 (increment_row_positions): Remove.
16174 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16175 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16176 Now static.
16177 (redraw_garbaged_frames): Remove; unused.
16178
435f4c28
PE
16179 * xfaces.c: Make symbols static if they're not exported.
16180 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16181 Remove decls.
16182 * xterm.h (defined_color): Remove decls.
16183 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16184 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16185 (menu_face_changed_default, defined_color, free_realized_face):
16186 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16187 (ascii_face_of_lisp_face): Remove; unused.
16188
8524aef3
PE
16189 * xdisp.c: Make symbols static if they're not exported.
16190 * dispextern.h (scratch_glyph_row, window_box_edges):
16191 (glyph_to_pixel_coords, set_cursor_from_row):
16192 (get_next_display_element, set_iterator_to_next):
16193 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16194 (show_mouse_face): Remove decls
16195 * frame.h (message_buf_print): Likewise.
16196 * lisp.h (pop_message, set_message, check_point_in_composition):
16197 Likewise.
16198 * xterm.h (set_vertical_scroll_bar): Likewise.
16199 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16200 (message_buf_print, scratch_glyph_row, displayed_buffer):
16201 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16202 (get_next_display_element, show_mouse_face, window_box_edges):
16203 (frame_to_window_pixel_xy, check_point_in_composition):
16204 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16205 (glyph_to_pixel_coords): Remove; unused.
16206
16390cd2
PE
16207 * dired.c (file_name_completion): Now static.
16208
16209 * dbusbind.c (xd_in_read_queued_messages): Now static.
16210
a25f4dfa
PE
16211 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16212 * data.c (circular_list_error): Remove.
16213
14a9c8df
PE
16214 * commands.h (last_point_position, last_point_position_buffer):
16215 (last_point_position_window): Remove decls.
16216 * keyboard.c: Make these variables static.
16217
04f2d78b
CB
16218 * coding.h (coding, code_convert_region, encode_coding_gap):
16219 Remove decls.
74ab6df5
PE
16220 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16221 (iso_code_class, detect_coding, code_convert_region): Now static.
16222 (encode_coding_gap): Remove; unused.
16223
38dfbee1
PE
16224 * chartab.c (chartab_chars, chartab_bits): Now static.
16225
a2cb4e63
PE
16226 * charset.h (charset_iso_8859_1): Remove decl.
16227 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16228 Now static.
16229
127198fd
PE
16230 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16231 * ccl.c (Vccl_program_table): Now static.
16232 (check_ccl_update): Remove; unused.
16233
d85b608f
PE
16234 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16235 * category.h: ... from here.
16236 * category.c (check_category_table, set_category_set): Now static.
16237
31cd66f3
PE
16238 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16239 * lisp.h: Remove these decls.
16240
c358e587
PE
16241 * buffer.c (buffer_count): Remove unused var.
16242
e78aecca
PE
16243 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16244 so that it's not optimized away.
16245 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16246 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16247 exported only to the debugger.
16248
e192d7d3 16249 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 16250 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 16251
92470028
PE
16252 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16253 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16254 was inaccessible from Lisp.
16255 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16256 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16257
244ed907
PE
16258 alloc.c: Import and export fewer symbols, and remove unused items.
16259 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16260 is defined.
16261 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16262 it's not optimized away by whole-program optimization.
16263 (message_enable_multibyte, free_misc): Remove.
16264 (catchlist, handlerlist, mark_backtrace):
16265 Declare only if BYTE_MARK_STACK.
16266 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16267 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16268 (message_enable_multibyte): Remove decl.
16269 (free_misc, interval_free_list, float_block, float_block_index):
16270 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16271 (cons_free_list, last_marked_index):
16272 Now static.
16273 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16274 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16275 (mark_backtrace): Define only if BYTE_MARK_STACK.
16276 * xdisp.c (message_enable_multibyte): Now static.
16277
61c2b50e 16278 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
16279 This makes it easier for human readers (and static analyzers)
16280 to see whether these variables are used from other modules.
16281 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16282 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16283 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16284 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16285 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16286 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16287 * xmenu.c, xselect.c:
16288 Declare Q* vars static if they are not used in other modules.
16289 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16290 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16291 Remove decls of unexported vars.
16292 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16293
95c82688
PE
16294 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16295
16a97296
PE
16296 Make Emacs functions such as Fatom 'static' by default.
16297 This makes it easier for human readers (and static analyzers)
16298 to see whether these functions can be called from other modules.
16299 DEFUN now defines a static function. To make the function external
16300 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
16301 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16302 (Finit_image_library):
16a97296
PE
16303 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16304 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16305 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16306 Remove decls, since these functions are now static.
16307 (Funintern, Fget_internal_run_time): New decls, since these functions
16308 were already external.
95c82688 16309
16a97296
PE
16310 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16311 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16312 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16313 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16314 * keyboard.c, keymap.c, lread.c:
16315 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16316 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16317 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16318 Mark functions with DEFUE instead of DEFUN,
16319 if they are used in other modules.
16320 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16321 decls for now-static functions.
16322 * buffer.h (Fdelete_overlay): Remove decl.
16323 * callproc.c (Fgetenv_internal): Mark as internal.
16324 * composite.c (Fremove_list_of_text_properties): Remove decl.
16325 (Fcomposition_get_gstring): New forward static decl.
16326 * composite.h (Fcomposite_get_gstring): Remove decl.
16327 * dired.c (Ffile_attributes): New forward static decl.
16328 * doc.c (Fdocumntation_property): New forward static decl.
16329 * eval.c (Ffetch_bytecode): New forward static decl.
16330 (Funintern): Remove extern decl; now in .h file where it belongs.
16331 * fileio.c (Fmake_symbolic_link): New forward static decl.
16332 * image.c (Finit_image_library): New forward static decl.
16333 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16334 * intervals.h (Fprevious_property_change):
16335 (Fremove_list_of_text_properties): Remove decls.
16336 * keyboard.c (Fthis_command_keys): Remove decl.
16337 (Fcommand_execute): New forward static decl.
16338 * keymap.c (Flookup_key): New forward static decl.
16339 (Fcopy_keymap): Now static.
16340 * keymap.h (Flookup_key): Remove decl.
16341 * process.c (Fget_process): New forward static decl.
16342 (Fprocess_datagram_address): Mark as internal.
16343 * syntax.c (Fsyntax_table_p): New forward static decl.
16344 (skip_chars): Remove duplicate decl.
16345 * textprop.c (Fprevious_property_change): New forward static decl.
16346 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16347 Now internal.
16348 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16349 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16350
785bbd42
PE
16351 * editfns.c (Fformat): Remove unreachable code.
16352
8b913b57
AS
163532011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16354
16355 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16356 change. (Bug#8496)
16357
a6744a35
EZ
163582011-04-13 Eli Zaretskii <eliz@gnu.org>
16359
16360 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16361 when at ZV. (Bug#8487)
16362
e7974947
AS
163632011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16364
baad03f0
AS
16365 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16366 (Bug#8437)
16367 * keyboard.c (parse_tool_bar_item): Likewise.
16368 * sound.c (sound_cleanup, alsa_close): Likewise.
16369 * termcap.c (tgetent): Likewise.
16370 * xfns.c (x_default_font_parameter): Likewise.
16371 * xsettings.c (read_and_apply_settings): Likewise.
16372
e7974947
AS
16373 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16374 (overrun_check_free): Protoize.
16375
28272684
PE
163762011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16377
16378 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16379 since callers should never pass a negative size.
16380 Change the signature to match that of plain 'read' and 'write'; see
16381 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16382 * lisp.h: Update prototypes of emacs_write and emacs_read.
16383
11997c76
EZ
163842011-04-11 Eli Zaretskii <eliz@gnu.org>
16385
16386 * xdisp.c (redisplay_window): Don't try to determine the character
16387 position of the scroll margin if the window start point w->startp
e896f03c 16388 is outside the buffer's accessible region. (Bug#8468)
11997c76 16389
8a2cbd72
EZ
163902011-04-10 Eli Zaretskii <eliz@gnu.org>
16391
16392 Fix write-region and its subroutines for buffers > 2GB.
16393 * fileio.c (a_write, e_write): Modify declaration of arguments and
16394 local variables to support buffers larger than 2GB.
16395 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16396
16397 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16398 argument, local variables, and return value.
16399
16400 * lisp.h: Update prototypes of emacs_write and emacs_read.
16401
16402 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16403
4073e537 164042011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 16405
1ebfdcb6
PE
16406 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16407
b2ded58d
PE
16408 Fix more problems found by GCC 4.6.0's static checks.
16409
7d66342c
PE
16410 * xdisp.c (vmessage): Use a better test for character truncation.
16411
bbf47d44
PE
16412 * charset.c (load_charset_map): <, not <=, for optimization,
16413 and to avoid potential problems with integer overflow.
9248994d 16414 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 16415 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 16416 * editfns.c (Fformat): Likewise.
1e69125e 16417 * syntax.c (skip_chars): Likewise.
3befa583 16418
e3019616
PE
16419 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16420 This also lets GCC 4.6.0 generate slightly better loop code.
16421
becfa255
PE
16422 * callint.c (Fcall_interactively): <, not <=, for optimization.
16423 (Fcall_interactively): Count the number of arguments produced,
16424 not the number of arguments given. This is simpler and lets GCC
16425 4.6.0 generate slightly better code.
16426
dae0cd48
PE
16427 * ftfont.c: Distingish more carefully between FcChar8 and char.
16428 The previous code passed unsigned char * to a functions like
16429 strlen and xstrcasecmp that expect char *, which does not
16430 conform to the C standard.
16431 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16432 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16433 char * when the C standard requires it.
16434
76032d70
PE
16435 * keyboard.c (read_char): Remove unused var.
16436
eb3f1cc8
PE
16437 * eval.c: Port to Windows vsnprintf (Bug#8435).
16438 Include <limits.h>.
16439 (SIZE_MAX): Define if the headers do not.
16440 (verror): Do not give up if vsnprintf returns a negative count.
16441 Instead, grow the buffer. This ports to Windows vsnprintf, which
16442 does not conform to C99. Problem reported by Eli Zaretskii.
16443 Also, simplify the allocation scheme, by avoiding the need for
16444 calling realloc, and removing the ALLOCATED variable.
16445
70476b54
PE
16446 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16447
12020a9e
PE
16448 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16449 But keep the doprint source code for now, as we might revamp it
16450 and use it again (Bug#8435).
ea6c7ae6
PE
16451 * lisp.h (doprnt): Remove.
16452 * Makefile.in (base_obj): Remove doprnt.o.
16453 * deps.mk (doprnt.o): Remove.
16454
5fdb398c
PE
16455 error: Print 32- and 64-bit integers portably (Bug#8435).
16456 Without this change, on typical 64-bit hosts error ("...%d...", N)
16457 was used to print both 32- and 64-bit integers N, which relied on
16458 undefined behavior.
61bdb816 16459 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
16460 * lisp.h (error, verror): Mark as printf-like functions.
16461 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16462 Report overflow in size calculations when allocating printf buffer.
16463 Do not truncate output string at its first null byte.
16464 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16465 Truncate the output at a character boundary, since vsnprintf does not
16466 do that.
16467 * charset.c (check_iso_charset_parameter): Convert internal
16468 character to string before calling 'error', since %c now has the
16469 printf meaning.
16470 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16471 overflow when computing char to be passed to 'error'. Do not
16472 pass Lisp_Object to 'error'; pass the integer instead.
16473 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16474 formatted with plain %d.
16475
b189fa66
PE
16476 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16477
bff87ef0
PE
16478 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16479
7e2cac20
PE
16480 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16481
ce4d90b5
PE
16482 * xterm.c (x_catch_errors): Remove duplicate declaration.
16483
266c9547
PE
16484 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16485
79c49ad2
PE
16486 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16487
368f4090
JM
164882011-04-10 Jim Meyering <meyering@redhat.com>
16489
16490 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16491 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16492 return ssize_t not "int", and use size_t as the buffer length.
16493 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16494 * gnutls.h: Update declarations.
16495 * process.c (read_process_output): Use ssize_t, to match.
16496 (send_process): Likewise.
16497
a32d4040
CY
164982011-04-09 Chong Yidong <cyd@stupidchicken.com>
16499
16500 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16501
8546720e 165022011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 16503
04f2d78b
CB
16504 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16505 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 16506
8546720e
GM
16507 * xterm.c (handle_one_xevent):
16508 * xmenu.c (create_and_show_popup_menu):
16509 * xselect.c (x_decline_selection_request)
16510 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 16511
0a2f5c1a 165122011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
16513
16514 Fix some uses of `int' instead of EMACS_INT.
16515 * search.c (string_match_1, fast_string_match)
16516 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16517 (scan_buffer, find_next_newline_no_quit)
16518 (find_before_next_newline, search_command, Freplace_match)
16519 (Fmatch_data): Make some `int' variables be EMACS_INT.
16520
16521 * xdisp.c (display_count_lines): 3rd argument and return value now
16522 EMACS_INT. All callers changed.
16523 (pint2hrstr): Last argument is now EMACS_INT.
16524
16525 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16526 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16527 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16528 (decode_coding_utf_16, decode_coding_emacs_mule)
16529 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16530 (decode_coding_ccl, decode_coding_charset)
16531 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16532 (decode_coding_iso_2022, decode_coding_emacs_mule)
16533 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16534 <char_offset, last_offset>: Declare EMACS_INT.
16535 (encode_coding_utf_8, encode_coding_utf_16)
16536 (encode_coding_emacs_mule, encode_invocation_designation)
16537 (encode_designation_at_bol, encode_coding_iso_2022)
16538 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16539 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16540 Declare EMACS_INT.
16541 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16542 (encode_invocation_designation): Last argument P_NCHARS is now
16543 EMACS_INT.
16544 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16545 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16546
16547 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16548 All users changed.
16549
16550 * ccl.c (Fccl_execute_on_string): Declare some variables
16551 EMACS_INT.
16552
8546720e 165532011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
16554
16555 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16556
4e19a977
CS
165572011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16558
16559 * process.c (Fformat_network_address): Doc fix.
16560
87302331
R
165612011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16562
ee7683eb 16563 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 16564
cbb59342
CY
165652011-04-08 Chong Yidong <cyd@stupidchicken.com>
16566
16567 * keyboard.c (read_char): Call Lisp function help-form-show,
16568 instead of using internal_with_output_to_temp_buffer.
16569 (Qhelp_form_show): New var.
e0d38eeb 16570 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
16571
16572 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16573
16574 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16575
e67a13ab
CY
165762011-04-06 Chong Yidong <cyd@stupidchicken.com>
16577
04f2d78b
CB
16578 * process.c (Flist_processes): Remove to Lisp.
16579 (list_processes_1): Delete.
e67a13ab 16580
973f782d
EZ
165812011-04-06 Eli Zaretskii <eliz@gnu.org>
16582
7c106b1e
EZ
16583 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16584
973f782d
EZ
16585 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16586
41cf7d1a 165872011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 16588
ca23cc88
PE
16589 Fix more problems found by GCC 4.6.0's static checks.
16590
f390e2d5
PE
16591 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16592
42eea0d0
PE
16593 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16594
b69769da 16595 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 16596
f9541e84
PE
16597 * xdisp.c (vmessage): Mark as a printf-like function.
16598
13841b55
PE
16599 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16600
c136c10f
PE
16601 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16602
5e2d4a30
PE
16603 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16604 printf-like functions.
16605 (tiff_load): Add casts to remove these marks before passing them
16606 to system-supplied API.
16607
583f48b9
PE
16608 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16609
b25d760e
PE
16610 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16611 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
16612 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16613 directly, rather than having caller test rule sign. This avoids
16614 some unnecessary tests.
16615 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16616 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16617 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 16618
bc7b6697 16619 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 16620 (xfont_open): Avoid unnecessary tests.
bc7b6697 16621
27ccc379
PE
16622 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16623
dcd5c89a
PE
16624 * composite.h, composite.c (composition_gstring_put_cache):
16625 Use EMACS_INT, not int, for length.
16626
b13a45c6
PE
16627 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16628 breaking out part of COMPOSITION_DECODE_RULE.
16629 (COMPOSITION_DECODE_RULE): Use it.
16630 * composite.c (get_composition_id): Remove unused local vars,
16631 by using the new macro.
16632
1e792e4d
PE
16633 * textprop.c (set_text_properties_1): Change while to do-while,
16634 since the condition is always true at first.
16635
dc6c6455 16636 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
16637 (interval_deletion_adjustment): Return unsigned value.
16638 All uses changed.
dc6c6455 16639
aba7731a
PE
16640 * process.c (list_processes_1, create_pty, read_process_output):
16641 (exec_sentinel): Remove vars that were set but not used.
afd4052b 16642 (create_pty): Remove unnecessary "volatile"s.
bc57d757 16643 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 16644 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 16645 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 16646
fdfc4bf3
PE
16647 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16648
fca8fe46 16649 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 16650 (update_syntax_table): Use unsigned instead of int.
fca8fe46 16651
06a0259a 16652 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 16653 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 16654 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 16655
e7b9e80f
PE
16656 * print.c (print_error_message): Avoid int overflow.
16657
56201685
PE
16658 * font.c (font_list_entities): Redo for clarity,
16659 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16660
78834453 16661 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 16662 (font_score): Avoid potential overflow in diff calculation.
78834453 16663
0bc0b309 16664 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 16665 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 16666
e610eaca
PE
16667 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16668
b895abce
PE
16669 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16670 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16671 can always succeed if overflow has undefined behavior.
16672
1f1d9321 16673 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 16674 (wordify): Omit three unnecessary tests.
1f1d9321 16675
c59478bc
PE
16676 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16677 All callers changed. This avoids the need for an unused var.
16678
79b73827
PE
16679 * casefiddle.c (casify_region): Remove var that is set but not used.
16680
a4db5dfe
PE
16681 * dired.c (file_name_completion): Remove var that is set but not used.
16682
43aae36e
PE
16683 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16684
2a47c44d 16685 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 16686 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 16687
a37c69bf
PE
16688 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16689 Check for integer overflow on size calculations.
16690
328ab8e7
PE
16691 * buffer.c (Fprevious_overlay_change): Remove var that is set
16692 but not used.
16693
e5a2a5cb
PE
16694 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16695 Remove vars that are set but not used.
8d84a6eb 16696 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 16697 (timer_check_2): Mark vars as initialized.
e5a2a5cb 16698
a60e5f68
PE
16699 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16700
f661cb61 16701 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 16702 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 16703
f0397f5a
PE
16704 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16705 that are set but not used.
16706
8664db06 16707 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 16708 if XCreateBitmapFromData fails (Bug#8410).
8664db06 16709
6abdaa4a
PE
16710 * xselect.c (x_get_local_selection, x_handle_property_notify):
16711 Remove vars that are set but not used.
16712
0ce7538d 16713 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 16714 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 16715
9ae848fc
PE
16716 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16717 Remove var that is set but not used.
0b918413
PE
16718 (scroll_bar_windows_size): Now size_t, not int.
16719 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16720 Check for overflow.
9ae848fc 16721
a5a62657
PE
16722 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16723 (map_tty_color) [!defined MSDOS]: Likewise.
16724
5c5cdd39
PE
16725 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16726
66ebf983
PE
16727 * coding.c: Remove vars that are set but not used.
16728 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16729 All callers changed.
16730 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16731 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16732 (decode_coding_charset): Remove vars that are set but not used.
16733
1be4d761
PE
16734 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16735 that is set but not used.
16736
47553fa8
PE
16737 * print.c (print_object): Remove var that is set but not used.
16738
1f7196bf 16739 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
16740 The gnulib version avoids calling malloc in the usual case,
16741 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16742 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16743 * filelock.c (current_lock_owner): Likewise.
16744 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16745 * sysdep.c: Include allocator.h, careadlinkat.h.
16746 (emacs_no_realloc_allocator): New static constant.
16747 (emacs_readlink): New function.
fdb61804
PE
16748 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16749 ../lib/careadlinkat.h.
d1fdcab7 16750
f84c17c7
SM
167512011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16752
16753 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16754 first non-nil return value).
16755
ef3862ad
JD
167562011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16757
16758 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16759 if not defined (Bug#8403).
16760
376a7006
JB
167612011-04-02 Juanma Barranquero <lekktu@gmail.com>
16762
16763 * xdisp.c (display_count_lines): Remove parameter `start',
16764 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16765 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16766 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16767 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16768 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16769 and thereabouts. All callers changed.
16770 (get_per_char_metric): Remove parameter `f', unused since
16771 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16772
6ca3801d
JM
167732011-04-02 Jim Meyering <meyering@redhat.com>
16774
16775 do not dereference NULL upon failed strdup
16776 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16777 (ns_get_family): Likewise.
16778
d8e2b5ba
JB
167792011-04-02 Juanma Barranquero <lekktu@gmail.com>
16780
16781 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16782
8c74fcbd
JD
167832011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16784
16785 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16786 later (Bug#8403).
16787
7200d79c
SM
167882011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16789
03408648 16790 Add lexical binding.
7200d79c 16791
03408648
SM
16792 * window.c (Ftemp_output_buffer_show): New fun.
16793 (Fsave_window_excursion):
16794 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16795
16796 * lread.c (lisp_file_lexically_bound_p): New function.
16797 (Fload): Bind Qlexical_binding.
16798 (readevalloop): Remove `evalfun' arg.
16799 Bind Qinternal_interpreter_environment.
16800 (Feval_buffer): Bind Qlexical_binding.
16801 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16802 Mark as dynamic.
16803 (syms_of_lread): Declare `lexical-binding'.
16804
16805 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16806
16807 * keyboard.c (eval_dyn): New fun.
16808 (menu_item_eval_property): Use it.
ca105506
SM
16809
16810 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 16811
03408648
SM
16812 * fns.c (concat, mapcar1): Accept byte-code-functions.
16813
16814 * eval.c (Fsetq): Handle lexical vars.
16815 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16816 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16817 (FletX, Flet): Obey lexical binding.
16818 (Fcommandp): Handle closures.
16819 (Feval): New `lexical' arg.
16820 (eval_sub): New function extracted from Feval. Use it almost
16821 everywhere where Feval was used. Look up vars in lexical env.
16822 Handle closures.
16823 (Ffunctionp): Move from subr.el.
16824 (Ffuncall): Handle closures.
16825 (apply_lambda): Remove `eval_flags'.
16826 (funcall_lambda): Handle closures and new byte-code-functions.
16827 (Fspecial_variable_p): New function.
16828 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16829 but without exporting it to Lisp.
23aba0ea 16830
23aba0ea 16831 * doc.c (Fdocumentation, store_function_docstring):
03408648 16832 * data.c (Finteractive_form): Handle closures.
23aba0ea 16833
03408648
SM
16834 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16835 interactive spec.
ba83908c 16836
04f2d78b
CB
16837 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16838 New byte-codes.
03408648
SM
16839 (exec_byte_code): New function extracted from Fbyte_code to handle new
16840 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 16841
03408648 16842 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 16843
03408648 16844 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 16845
e2abce01
JB
168462011-03-31 Juanma Barranquero <lekktu@gmail.com>
16847
16848 * xdisp.c (redisplay_internal): Fix prototype.
16849
63696a73 168502011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 16851
63696a73 16852 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
16853 (try_scrolling): Use it when setting scroll_limit.
16854 Limit scrolling to 100 screen lines.
63696a73
EZ
16855 (redisplay_window): Even when falling back on "recentering",
16856 position point in the window according to scroll-conservatively,
16857 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16858
16859 (try_scrolling): When point is above the window, allow searching
16860 as far as scroll_max, or one screenful, to compute vertical
16861 distance from PT to the scroll margin position. This prevents
16862 try_scrolling from unnecessarily failing when
16863 scroll-conservatively is set to a value slightly larger than the
16864 window height. Clean up the case of PT below the margin at bottom
16865 of window: scroll_max can no longer be INT_MAX. When aggressive
16866 scrolling is in use, don't let point enter the opposite scroll
16867 margin as result of the scroll.
16868 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
16869 threshold of 100 lines for never-recentering scrolling.
16870
e4cc2dfc
JB
168712011-03-31 Juanma Barranquero <lekktu@gmail.com>
16872
16873 * dispextern.h (move_it_by_lines):
16874 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16875 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16876 (message_log_check_duplicate): Remove parameters `prev_bol' and
16877 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16878 (redisplay_internal): Remove parameter `preserve_echo_area',
16879 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16880
16881 * indent.c (Fvertical_motion):
16882 * window.c (window_scroll_pixel_based, Frecenter):
16883 Don't pass `need_y_p' to `move_it_by_lines'.
16884
1c470562
SM
168852011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16886
44f230aa
SM
16887 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16888 steal a few bits to be more compact.
16889 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16890 Remove unneeded casts.
16891
1c470562
SM
16892 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16893
888adce9
ZK
168942011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16895
16896 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16897 binding" message (bug#7967).
16898
f838ed7b
PE
168992011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16900
77861b95
PE
16901 Fix more problems found by GCC 4.6.0's static checks.
16902
de6dbc14
PE
16903 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16904 Remove unused local var.
16905
f838ed7b
PE
16906 * editfns.c (Fmessage_box): Remove unused local var.
16907
792c7b2b
PE
16908 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16909 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16910 Omit unused local vars.
c499e557 16911 * window.c (shrink_windows): Omit unused local var.
b01a1c29 16912 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
16913 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16914 Omit unused local var.
16915
ba0165e1
PE
16916 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16917 Don't assume string length fits in int.
32ad8845 16918 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 16919 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 16920
3c59b4c9
PE
16921 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16922 instead of alloca (Bug#8344).
16923
a3eed478 16924 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 16925 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 16926
eb4d412d
PE
16927 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16928
1658b401
PE
16929 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16930 concerns.
16931
16932 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16933
16934 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 16935
9a2c6e05
PE
16936 * keyboard.c (syms_of_keyboard): Use the same style as later
16937 in this function when indexing through an array. This also
16938 works around GCC bug 48267.
16939
03d0a109
PE
16940 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16941
44f730c8
PE
16942 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16943
fe75f926
PE
16944 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16945 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16946
ffa8c828
PE
16947 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16948 This avoids undefined behavior on integer overflow, and is a bit
16949 more convenient anyway since it is compared to a size_t variable.
16950
c5101a77
PE
16951 Variadic C functions now count arguments with size_t, not int.
16952 This avoids an unnecessary limitation on 64-bit machines, which
16953 caused (substring ...) to crash on large vectors (Bug#8344).
16954 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16955 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 16956 All variadic functions and their callers changed accordingly.
c5101a77
PE
16957 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16958 * data.c (arith_driver, float_arith_driver): Likewise.
16959 * editfns.c (general_insert_function): Likewise.
16960 * eval.c (struct backtrace.nargs, interactive_p)
16961 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16962 (funcall_lambda, mark_backtrace): Likewise.
16963 * fns.c (concat): Likewise.
16964 * frame.c (x_set_frame_parameters): Likewise.
16965 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16966 0 if not found, not -1. All callers changed.
16967
dd3f25f7
PE
16968 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16969 (stack_copy_size): Now size_t, not int.
16970 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16971
461c2ab9
JB
169722011-03-28 Juanma Barranquero <lekktu@gmail.com>
16973
16974 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16975 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16976 All callers changed.
16977
16978 * lisp.h (multibyte_char_to_unibyte):
16979 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16980 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16981 * character.h (CHAR_TO_BYTE8):
16982 * cmds.c (internal_self_insert):
16983 * editfns.c (general_insert_function):
16984 * keymap.c (push_key_description):
16985 * search.c (Freplace_match):
16986 * xdisp.c (message_dolog, set_message_1): All callers changed.
16987
f6d62986
SM
169882011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16989
16990 * keyboard.c (safe_run_hook_funcall): New function.
16991 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16992 don't set the hook to nil, but remove the offending function instead.
16993 (Qcommand_hook_internal): Remove, unused.
16994 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16995 Vcommand_hook_internal.
16996
16997 * eval.c (enum run_hooks_condition): Remove.
16998 (funcall_nil, funcall_not): New functions.
16999 (run_hook_with_args): Call each function through a `funcall' argument.
17000 Remove `cond' argument, now redundant.
17001 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17002 (Frun_hook_with_args_until_failure): Adjust accordingly.
17003 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17004
1db5b1ad
JB
170052011-03-28 Juanma Barranquero <lekktu@gmail.com>
17006
17007 * dispextern.h (string_buffer_position): Remove declaration.
17008
17009 * print.c (strout): Remove parameter `multibyte', unused since
17010 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17011
17012 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17013 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17014 All callers changed.
17015
17016 * w32.c (_wsa_errlist): Use braces for struct initializers.
17017
17018 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17019 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17020 All callers changed.
17021 (string_buffer_position): Likewise. Also, make static (it's never
17022 used outside xdisp.c).
17023 (cursor_row_p): Remove parameter `w', unused since
17024 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17025 (decode_mode_spec): Remove parameter `precision', introduced during
17026 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17027 All callers changed.
17028
5ffb62aa
JD
170292011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17030
17031 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17032
461c2ab9 170332011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
17034
17035 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17036 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17037 (ns_update_auto_hide_menu_bar): New functions.
17038 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17039 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17040 ns_constrain_all_frames.
17041 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17042 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17043
5c380ffb
JD
170442011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17045
17046 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17047
9af30bdf
GM
170482011-03-27 Glenn Morris <rgm@gnu.org>
17049
17050 * syssignal.h: Replace RETSIGTYPE with void.
17051 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17052 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17053 Replace SIGTYPE with void everywhere.
17054 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17055 * s/template.h (SIGTYPE): Remove commented out definition.
17056
e2abce01
JB
170572011-03-26 Eli Zaretskii <eliz@gnu.org>
17058
17059 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17060 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17061
f868cd8a
JB
170622011-03-26 Juanma Barranquero <lekktu@gmail.com>
17063
59eb0929
JB
17064 * w32.c (read_unc_volume): Use parameter `henum', instead of
17065 global variable `wget_enum_handle'.
17066
17067 * keymap.c (describe_vector): Remove parameters `indices' and
17068 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17069 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17070
f868cd8a
JB
17071 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17072
17073 * keyboard.c (timer_check): Remove parameter `do_it_now',
17074 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17075 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17076 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17077
17078 * keyboard.c (read_char):
17079 * w32menu.c (w32_menu_display_help):
17080 * xmenu.c (show_help_event, menu_help_callback):
17081 Adjust calls to `show_help_echo'.
17082
17083 * gtkutil.c (xg_maybe_add_timer):
17084 * keyboard.c (readable_events):
17085 * process.c (wait_reading_process_output):
17086 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17087
17088 * insdel.c (adjust_markers_gap_motion):
17089 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17090 (gap_left, gap_right): Don't call it.
17091
2ecf6fdb
CY
170922011-03-25 Chong Yidong <cyd@stupidchicken.com>
17093
17094 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17095 incurred during fontification.
17096
6b1f9ba4
JB
170972011-03-25 Juanma Barranquero <lekktu@gmail.com>
17098
17099 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17100 (DEFVAR_PER_BUFFER): Don't pass it.
17101
17102 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17103 (scrolling_window): Don't pass it.
17104
0f4a96b5
JB
171052011-03-25 Juanma Barranquero <lekktu@gmail.com>
17106
17107 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17108
17109 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17110 and `suffix'.
17111 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17112 of variables specific to SELinux and computation of `encoded_absname'.
17113
17114 * image.c (XPutPixel): Remove unused variable `height'.
17115
17116 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17117
17118 * unexw32.c (get_section_info): Remove unused variable `section'.
17119
17120 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17121 (system_process_attributes): Remove unused variable `sess'.
17122 (sys_read): Remove unused variable `err'.
17123
17124 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17125 (w32_wnd_proc): Remove unused variable `isdead'.
17126 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17127 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17128 (x_create_tip_frame): Remove unused variable `tem'.
17129
17130 * w32inevt.c (w32_console_read_socket):
17131 Remove unused variable `no_events'.
17132
17133 * w32term.c (x_draw_composite_glyph_string_foreground):
17134 Remove unused variable `width'.
17135
1149507c
JB
171362011-03-24 Juanma Barranquero <lekktu@gmail.com>
17137
17138 * w32term.c (x_set_glyph_string_clipping):
17139 Don't pass uninitialized region to CombineRgn.
17140
9c88f339
JB
171412011-03-23 Juanma Barranquero <lekktu@gmail.com>
17142
17143 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17144 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17145 (Fx_close_connection): Remove unused variable `i'.
17146
17147 * w32font.c (w32font_draw): Return number of glyphs.
17148 (w32font_open_internal): Remove unused variable `i'.
17149 (w32font_driver): Add missing initializer.
17150
17151 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17152 (fill_in_menu): Remove unused variable `items_added'.
17153
17154 * w32term.c (last_mouse_press_frame): Remove static global variable.
17155 (w32_clip_to_row): Remove unused variable `f'.
17156 (x_delete_terminal): Remove unused variable `i'.
17157
17158 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17159 (NOTHING): Remove unused static global variable.
17160 (uniscribe_check_otf): Remove unused variable `table'.
17161 (uniscribe_font_driver): Add missing initializers.
17162
dee091a3
JD
171632011-03-23 Julien Danjou <julien@danjou.info>
17164
17165 * term.c (Fsuspend_tty, Fresume_tty):
17166 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17167 * window.c (temp_output_buffer_show):
17168 * insdel.c (signal_before_change):
17169 * frame.c (Fhandle_switch_frame):
17170 * fileio.c (Fdo_auto_save):
17171 * emacs.c (Fkill_emacs):
17172 * editfns.c (save_excursion_restore):
17173 * cmds.c (internal_self_insert):
17174 * callint.c (Fcall_interactively):
17175 * buffer.c (Fkill_all_local_variables):
17176 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17177 Use Frun_hooks.
0f4a96b5 17178 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 17179 unconditionally since it does the check itself.
dee091a3 17180
2c520ab5 171812011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 17182
c9c49752
PE
17183 Fix more problems found by GCC 4.5.2's static checks.
17184
8abc3f12
PE
17185 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17186 the first time through the loop, since we know p0 < p1 then.
17187 This also avoids a gcc -Wstrict-overflow warning.
17188
a2d26660
PE
17189 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17190 leading to a memory leak, possible in functions like
17191 load_charset_map_from_file that can allocate an unbounded number
b12ef411 17192 of objects (Bug#8318).
a2d26660 17193
916c72e9
PE
17194 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17195 that could (at least in theory) be that large.
17196
19ab8a18
PE
17197 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17198 This is less likely to overflow, and avoids undefined behavior if
17199 overflow does occur. All callers changed. Use strtoul to scan
17200 for the unsigned long integer.
b7cbbd6f
PE
17201 (pint2hrstr): Simplify and tune code slightly.
17202 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 17203
f0641eff
PE
17204 * scroll.c (do_scrolling): Work around GCC bug 48228.
17205 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17206
7f650bb9
PE
17207 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17208 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
17209 (validate_x_resource_name): Simplify count usage.
17210 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 17211
37dd57d1
PE
17212 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17213 fail (Bug#8306).
81e56e61 17214
699979fc 17215 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 17216
401bf9b4
PE
17217 * process.c (Fmake_network_process): Use socklen_t, not int,
17218 where POSIX says socklen_t is required in portable programs.
17219 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 17220 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
17221 (Fmake_network_process, server_accept_connection):
17222 (wait_reading_process_output, read_process_output):
17223 Likewise.
17224
b93aacde
PE
17225 * process.c: Rename or move locals to avoid shadowing.
17226 (list_processes_1, Fmake_network_process):
17227 (read_process_output_error_handler, exec_sentinel_error_handler):
17228 Rename or move locals.
4dc343ee 17229 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 17230 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 17231 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 17232 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 17233 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 17234
af8a867c 17235 Make tparam.h and terminfo.c consistent.
44f230aa
SM
17236 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17237 Include tparam.h instead, since it declares them.
af8a867c
PE
17238 * cm.h (PC): Remove extern decl; tparam.h now does this.
17239 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17240 * terminfo.c: Include tparam.h, to check interfaces.
17241 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17242 (tparam): Adjust signature to match interface in tparam.h;
17243 this removes some undefined behavior. Check that outstring and len
17244 are zero, which they always are with Emacs.
17245 * tparam.h (PC, BC, UP): New extern decls.
17246
0248044d 17247 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 17248 (xftfont_open): Rename locals to avoid shadowing.
0248044d 17249
8ff096c1 17250 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
17251 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17252 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 17253 (ftfont_list): Remove unused local.
49eaafba
PE
17254 (get_adstyle_property, ftfont_pattern_entity):
17255 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17256 Rename locals to avoid shadowing.
8ff096c1 17257
e2be39f6
PE
17258 * xfont.c (xfont_list_family): Mark var as initialized.
17259
c9735e30
PE
17260 * xml.c (make_dom): Now static.
17261
8f5201ae
PE
17262 * composite.c (composition_compute_stop_pos): Rename local to
17263 avoid shadowing.
b246f932
PE
17264 (composition_reseat_it): Remove unused locals.
17265 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 17266 (composition_update_it): Mark var as initialized.
11b61122
PE
17267 (find_automatic_composition): Mark vars as initialized,
17268 with a FIXME (Bug#8290).
8f5201ae 17269
760fbc2c
PE
17270 character.h: Rename locals to avoid shadowing.
17271 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17272 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17273 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17274 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17275 to avoid shadowing.
17276
ff08eb85
PE
17277 * textprop.c (property_change_between_p): Remove; unused.
17278
fc7bf025
PE
17279 * intervals.c (interval_start_pos): Now static.
17280
235d7abc
PE
17281 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17282
44f230aa
SM
17283 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17284 Rename locals to avoid shadowing.
3e7d6594 17285
50060332
PE
17286 * sound.c (wav_play, au_play, Fplay_sound_internal):
17287 Fix pointer signedness.
d01f234b 17288 (alsa_choose_format): Remove unused local var.
c83b8872
PE
17289 (wav_play): Initialize a variable to 0, to prevent undefined
17290 behavior (Bug#8278).
50060332 17291
c4fc4e30
PE
17292 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17293
918436ed
PE
17294 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17295
c939f91b
PE
17296 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17297 clobbering (Bug#8298).
b9c7f648
PE
17298 * sysdep.c (sys_subshell): Likewise.
17299 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 17300
6bd8c144
PE
17301 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17302 This should get cleaned up, so that child_setup has the
17303 same signature on all platforms.
17304
7710357c 17305 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 17306 (relocate_fd): Rename locals to avoid shadowing.
7710357c 17307
c59da222
CY
173082011-03-22 Chong Yidong <cyd@stupidchicken.com>
17309
17310 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17311 not to be necessary, and produces flickering.
17312
66b87493
GM
173132011-03-20 Glenn Morris <rgm@gnu.org>
17314
17315 * config.in: Remove file.
17316
45b6f6d5
JB
173172011-03-20 Juanma Barranquero <lekktu@gmail.com>
17318
17319 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17320 are now in src/globals.h.
17321 (syms_of_minibuf): Remove spurious & from previous change.
17322
cd394be1 173232011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
17324
17325 * minibuf.c (completing-read-function): New variable.
17326 (completing-read-default): Rename from completing-read.
17327 (completing-read): Call completing-read-function.
17328
b14e3e21
CY
173292011-03-19 Juanma Barranquero <lekktu@gmail.com>
17330
17331 * xfaces.c (Fx_load_color_file):
17332 Read color file from absolute filename (bug#8250).
17333
f2b726e6
JB
173342011-03-19 Juanma Barranquero <lekktu@gmail.com>
17335
17336 * makefile.w32-in: Update dependencies.
17337
09f6ff02
EZ
173382011-03-17 Eli Zaretskii <eliz@gnu.org>
17339
17340 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17341
29a6015a
PE
173422011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17343
a3a6c54e
PE
17344 Fix more problems found by GCC 4.5.2's static checks.
17345
b766f867
PE
17346 * process.c (make_serial_process_unwind, send_process_trap):
17347 (sigchld_handler): Now static.
17348
be02381c
PE
17349 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17350 That way, the code declares only the vars that it needs.
17351 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17352 * s/cygwin.h (PTY_ITERATION): Likewise.
17353 * s/darwin.h (PTY_ITERATION): Likewise.
17354 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17355
57048744
PE
17356 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17357 * process.c (allocate_pty): Don't declare stb unless it's needed.
17358
7914961c 17359 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
17360 (CONSTANTLIM): Remove; unused.
17361 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17362 Define only if needed.
7914961c 17363
b3967b18
PE
17364 * unexelf.c (unexec): Name an expression,
17365 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
17366 Use a different way to cause a compilation error if anyone uses
17367 n rather than nn, a way that does not involve shadowing.
73366a00 17368 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 17369
29a6015a
PE
17370 * deps.mk (unexalpha.o): Remove; unused.
17371
43cfc33e 17372 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 17373 * unexec.h: New file.
ce701a33
PE
17374 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17375 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17376 Depend on unexec.h.
17377 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17378 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17379 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 17380 Change as necessary to match prototype in unexec.h.
ce701a33 17381
01f44d5a
PE
17382 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17383 shadowing.
4f63c6bb 17384 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 17385
a6670b0b
PE
17386 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17387 Rename locals to avoid shadowing.
17388
cef2010d 17389 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 17390 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 17391
d4d7173a
PE
17392 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17393
f08b802a
PE
17394 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17395 warning when compiling print.c.
17396
3ddb0639
PE
17397 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17398 instead of using an uninitialized var.
5ad03b97 17399 (font_sort_entities): Mark var as initialized.
3ddb0639 17400
170a2692
PE
17401 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17402
e663c700
PE
17403 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17404 pointers to constants.
89bc529a 17405 (font_parse_fcname): Remove unused vars.
7b81e2d0 17406 (font_delete_unmatched): Now static.
ea838e10 17407 (font_get_spec): Remove; unused.
13a547c6
PE
17408 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17409 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17410 Rename or move locals to avoid shadowing.
e663c700 17411
2a80c887 17412 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 17413 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 17414
1384fa33 17415 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 17416 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 17417
8b2c52e9
PE
17418 * alloc.c (mark_backtrace): Move decl from here ...
17419 * lisp.h: ... to here, so that it can be checked.
17420
475545b5 17421 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 17422 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
17423 (lisp_indirect_variable): Name an expression,
17424 to avoid gcc -Wbad-function-cast warning.
1faed8ae 17425 (Fdefvar): Rename locals to avoid shadowing.
475545b5 17426
b1349114 17427 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 17428 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 17429 Use const pointer when appropriate.
b1349114 17430
a2928364
PE
17431 * lisp.h (get_system_name, get_operating_system_release):
17432 Move decls here, to check interfaces.
17433 * process.c (get_operating_system_release): Move decl to lisp.h.
17434 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
17435 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17436 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17437 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
17438 (Fformat_time_string, Fencode_time, Finsert_char):
17439 (Ftranslate_region_internal, Fformat):
17440 Rename or remove local vars to avoid shadowing.
9710023e 17441 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 17442
a415e694
PE
17443 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17444 avoid shadowing.
17445
8ef4622d
PE
17446 * lisp.h (eassert): Check that the argument compiles, even if
17447 ENABLE_CHECKING is not defined.
17448
946f9a5b
PE
17449 * data.c (Findirect_variable): Name an expression, to avoid
17450 gcc -Wbad-function-cast warning.
112396d6 17451 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 17452 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
17453 (Fmake_variable_buffer_local, Fmake_local_variable):
17454 Mark variables as initialized.
52746918 17455 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 17456
e5aab7e7 17457 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
17458 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17459 Rename locals to avoid shadowing.
dff45157
PE
17460 (mark_stack): Move local variables into the #ifdef region where
17461 they're used.
7bc26fdb
PE
17462 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17463 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17464 needed otherwise.
17465 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17466 (GC_STRING_CHARS): Remove; not used.
d40d4be1 17467 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 17468
e5aab7e7
PE
17469 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17470 avoids undefined behavior in theory.
17471
4da60324
PE
17472 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17473
88043301
PE
17474 Use functions, not macros, for up- and down-casing (Bug#8254).
17475 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17476 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17477 to use the following functions instead of these macros.
17478 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17479 EMACS_INT, since callers assume the returned value fits in int.
17480 (upcase1): Likewise, for UPCASE_TABLE.
17481 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 17482 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 17483 the race-condition problem in the old DOWNCASE.
88043301 17484
19ed5445
PE
17485 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17486 Rename locals to avoid shadowing.
17487 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
17488 (regex_compile, re_search_2, re_match_2_internal):
17489 Remove unused local vars.
952db0d7
PE
17490 (FREE_VAR): Rewrite so as not to use empty "else",
17491 which gcc can warn about.
da053e48 17492 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
17493 (RETALLOC_IF): Define only if needed.
17494 (WORDCHAR_P): Likewise. This one is never needed, but is used
17495 only in a comment talking about a compiler bug, so put inside
17496 the #if 0 of that comment.
17497 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17498 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17499 Remove; unused.
19ed5445 17500
1f3561e4 17501 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
17502 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17503 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 17504
ded6f8f7
PE
17505 * search.c (simple_search): Remove unused var.
17506
dbd37a95
PE
17507 * dired.c (compile_pattern): Move decl from here ...
17508 * lisp.h: ... to here, so that it can be checked.
17509 (struct re_registers): New forward decl.
17510
7e47afad
PE
17511 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17512
85f24f61
PE
17513 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17514 All uses changed.
17515 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17516 Rename locals to avoid shadowing.
5671df8f 17517 (Fvertical_motion): Mark locals as initialized.
85f24f61 17518
181aa2be 17519 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 17520 (casify_region): Mark local as initialized.
181aa2be 17521
930d429c
PE
17522 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17523
7082eac6
PE
17524 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17525 New macros, so that the caller can use some names other than
17526 gcpro1, gcpro2, etc.
17527 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17528 of the new macros.
17529 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17530 argument, for consistency with GCPRO2_VAR, etc: it is now the
17531 prefix of the variable, not the variable itself. All uses
17532 changed.
38b2c076
PE
17533 * dired.c (directory_files_internal, file_name_completion):
17534 Rename locals to avoid shadowing.
17535
15206ed9
PE
17536 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17537 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17538 dired.c's scmp function, had undefined behavior.
17539 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17540 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17541 * buffer.h: ... to here, because these macros use current_buffer,
17542 and the new implementation with inline functions needs to have
17543 current_buffer in scope now, rather than later when the macros
17544 are used.
17545 (downcase, upcase1): New static inline functions.
17546 (DOWNCASE, UPCASE1): Reimplement using these functions.
17547 This avoids undefined behavior in expressions like
17548 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17549 from race conditions in accessing the global variables
17550 case_temp1 and case_temp2.
17551 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17552 * lisp.h (case_temp1, case_temp2): Remove their decls.
17553 * character.h (ASCII_CHAR_P): Move from here ...
17554 * lisp.h: ... to here, so that the inline functions mentioned
17555 above can use them.
17556
4a6bea26
PE
17557 * dired.c (directory_files_internal_unwind): Now static.
17558
f14b7e14
PE
17559 * fileio.c (file_name_as_directory, directory_file_name):
17560 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17561 Now static.
2893f146
PE
17562 (file_name_as_directory): Use const pointers when appropriate.
17563 (Fexpand_file_name): Likewise. In particular, newdir might
17564 point at constant storage, so make it a const pointer.
fd4ead52 17565 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
17566 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17567 signedness issues.
f839df0c
PE
17568 (Fset_file_times, Finsert_file_contents, auto_save_error):
17569 Rename locals to avoid shadowing.
f14b7e14 17570
5716756e 17571 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
17572 (Ftry_completion, Fall_completions): Rename or remove locals
17573 to avoid shadowing.
5716756e 17574
b4c3046a
PE
17575 * marker.c (bytepos_to_charpos): Remove; unused.
17576
b45db522
PE
17577 * lisp.h (verify_bytepos, count_markers): New decls,
17578 so that gcc does not warn that these functions aren't declared.
17579
85876d07
PE
17580 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17581 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 17582 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 17583 (copy_text): Remove unused local var.
85876d07 17584
03d78a21 17585 * filelock.c (within_one_second): Now static.
b3dd38ab 17586 (lock_file_1): Rename local to avoid shadowing.
03d78a21 17587
5df8f01b
PE
17588 * buffer.c (fix_overlays_before): Mark locals as initialized.
17589 (fix_start_end_in_overlays): Likewise. This function should be
17590 simplified by using pointers-to-pointers, but that's a different
17591 matter.
b1d876f1 17592 (switch_to_buffer_1): Now static.
8f54f30a
PE
17593 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17594 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 17595
a70072c9 17596 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 17597 Fix pointer signedness issue.
edced198
PE
17598 (sys_subshell): Mark local as volatile if checking for lint,
17599 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 17600 (MAXPATHLEN): Define only if needed.
a70072c9 17601
a0977c44
PE
17602 * process.c (serial_open, serial_configure): Move decls from here ...
17603 * systty.h: ... to here, so that they can be checked.
17604
a884fdcc
PE
17605 * fns.c (get_random, seed_random): Move extern decls from here ...
17606 * lisp.h: ... to here, so that they can be checked.
17607
604efe86 17608 * sysdep.c (reset_io): Now static.
b8950c94 17609 (wait_for_termination_signal): Remove; unused.
604efe86 17610
38fc62d9
PE
17611 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17612 (copy_keymap_item, append_key, push_text_char_description):
17613 Now static.
1004a21a 17614 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 17615 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
17616 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17617 (describe_map_tree):
17618 Rename locals to avoid shadowing.
38fc62d9 17619
2f2650da
PE
17620 * keyboard.c: Declare functions static if they are not used elsewhere.
17621 (echo_char, echo_dash, cmd_error, top_level_2):
17622 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
17623 (read_char, kbd_buffer_get_event, make_lispy_position):
17624 (make_lispy_event, make_lispy_movement, apply_modifiers):
17625 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17626 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17627 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 17628 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 17629 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 17630
a053e86c 17631 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
17632 (mark_kboards): Move decl here ...
17633 * alloc.c (mark_kboards): ... from here.
a053e86c 17634
4752793e
PE
17635 * lisp.h (force_auto_save_soon): New decl.
17636
74f10ca7 17637 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
17638 (DEFINE_DUMMY_FUNCTION): New macro.
17639 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17640 Use it.
c03cd23f
PE
17641 (main): Add casts to avoid warnings
17642 if GCC considers string literals to be constants.
74f10ca7 17643
022e70d4
PE
17644 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17645
59d6fe83
PE
17646 * dbusbind.c: Pointer signedness fixes.
17647 (xd_signature, xd_append_arg, xd_initialize):
17648 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17649 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17650 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17651 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17652
78320123
PE
17653 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17654 if GCC considers string literals to be constants.
49cebcca 17655 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 17656
35ac2a97
SM
176572011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17658
fb103ca9
SM
17659 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17660 (print_preprocess, print_object): New macro to fix last change.
17661
35ac2a97
SM
17662 * print.c (print_preprocess): Don't forget font objects.
17663
62973b41
JB
176642011-03-16 Juanma Barranquero <lekktu@gmail.com>
17665
17666 * emacs.c (USAGE3): Doc fixes.
17667
0e48bb22
AS
176682011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17669
17670 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17671 structure.
17672
7684e57b
JB
176732011-03-14 Juanma Barranquero <lekktu@gmail.com>
17674
17675 * lisp.h (VWindow_system, Qfile_name_history):
17676 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17677 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17678 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17679
17680 * w32select.c: Don't #include "keyboard.h".
c96bbc66 17681 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
17682
17683 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17684 * w32console.c (detect_input_pending, read_input_pending)
17685 (encode_terminal_code):
17686 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17687 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17688 (w32_system_caret_y, Qfile_name_history):
17689 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17690 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17691 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17692 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17693 * w32proc.c (Qlocal, report_file_error):
17694 * w32term.c (Vwindow_system, updating_frame):
17695 * w32uniscribe.c (initialized, uniscribe_font_driver):
17696 Remove unneeded extern declarations.
17697
2aa46d6c
CY
176982011-03-14 Chong Yidong <cyd@stupidchicken.com>
17699
c96bbc66 17700 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 17701
cffc6f3b
CY
177022011-03-13 Chong Yidong <cyd@stupidchicken.com>
17703
17704 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17705 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17706 These macros can no longer be used for assignment.
17707
44f230aa
SM
17708 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17709 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
17710 (record_buffer_markers, fetch_buffer_markers): New functions for
17711 recording and fetching special buffer markers.
17712 (set_buffer_internal_1, set_buffer_temp): Use them.
17713
17714 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17715
17716 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17717
17718 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17719 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17720
17721 * xdisp.c (hscroll_window_tree):
17722 (reconsider_clip_changes): Use PT instead of BUF_PT.
17723
d251f04b
EZ
177242011-03-13 Eli Zaretskii <eliz@gnu.org>
17725
17726 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17727 $(EMACS_ROOT)/lib/intprops.h.
17728
f0c77cd1
PE
177292011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17730
3eca4629
PE
17731 Fix more problems found by GCC 4.5.2's static checks.
17732
7c86ee98
PE
17733 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17734 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
17735 (xg_free_frame_widgets): Make it clear that a local variable is
17736 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
17737 (gdk_window_get_screen): Make it clear that this macro is needed
17738 only if USE_GTK_TOOLTIP.
1e5524e7
PE
17739 (int_gtk_range_get_value): New function, which avoids a diagnostic
17740 from gcc -Wbad-function-cast.
17741 (xg_set_toolkit_scroll_bar_thumb): Use it.
17742 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17743 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
17744 (get_utf8_string, xg_get_file_with_chooser):
17745 Rename locals to avoid shadowing.
17746 (create_dialog): Move locals to avoid shadowing.
7c86ee98 17747
41729b81
PE
17748 * xgselect.c (xg_select): Remove unused var.
17749
f0c77cd1
PE
17750 * image.c (four_corners_best): Mark locals as initialized.
17751 (gif_load): Initialize transparent_p to zero (Bug#8238).
17752 Mark another local as initialized.
ec6cf4c6 17753 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 17754
ce0ad53d 17755 * image.c (clear_image_cache): Now static.
d5d5a617 17756 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 17757 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
17758 (x_edge_detection): Remove unnecessary cast that
17759 gcc -Wbad-function-cast diagnoses.
2037898d 17760 (gif_load): Fix pointer signedness.
6ae141d6
PE
17761 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17762 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 17763
33383987 177642011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 17765
d32df629
PE
17766 Improve quality of tests for time stamp overflow.
17767 For example, without this patch (encode-time 0 0 0 1 1
17768 1152921504606846976) returns the obviously-bogus value (-948597
17769 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17770 reports time overflow. See
17771 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
17772 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17773 * editfns.c: Include limits.h and intprops.h.
17774 (TIME_T_MIN, TIME_T_MAX): New macros.
17775 (time_overflow): Move earlier, to before first use.
17776 (hi_time, lo_time): New functions, for an accurate test for
17777 out-of-range times.
17778 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17779 (Fget_internal_run_time): Don't assume time_t fits in int.
17780 (make_time): Use list2 instead of Fcons twice.
17781 (Fdecode_time): More accurate test for out-of-range times.
17782 (check_tm_member): New function.
17783 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
17784 (lisp_time_argument): Don't rely on undefined left-shift and
17785 right-shift behavior when checking for time stamp overflow.
8be6f318 17786
fe31d94c
PE
17787 * editfns.c (time_overflow): New function, refactoring common code.
17788 (Fformat_time_string, Fdecode_time, Fencode_time):
17789 (Fcurrent_time_string): Use it.
17790
8be6f318
PE
17791 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17792 * dired.c (make_time): Move to ...
17793 * editfns.c (make_time): ... here.
17794 * systime.h: Note the move.
17795
09d9db2c 177962011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 17797
126bc0dc
YM
17798 * fringe.c (update_window_fringes): Remove unused variables.
17799
c47cbdfd
YM
17800 * unexmacosx.c (copy_data_segment): Also copy __got section.
17801 (Bug#8223)
17802
7ac80be9
EZ
178032011-03-12 Eli Zaretskii <eliz@gnu.org>
17804
c96bbc66 17805 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
17806 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17807 Constify `char *' arguments and their references according to
17808 prototypes in tparam.h.
17809
ecb0f94d 17810 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 17811
7ac80be9
EZ
17812 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17813 Adapt all references accordingly.
17814
17815 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17816
ef1fd07e
TT
178172011-03-11 Tom Tromey <tromey@redhat.com>
17818
17819 * buffer.c (syms_of_buffer): Remove obsolete comment.
17820
7ef4b50c
EZ
178212011-03-11 Eli Zaretskii <eliz@gnu.org>
17822
17823 * termhooks.h (encode_terminal_code): Declare prototype.
17824
17825 * msdos.c (encode_terminal_code): Don't declare prototype.
17826
17827 * term.c (encode_terminal_code): Now external again, used by
17828 w32console.c and msdos.c.
17829
44f230aa
SM
17830 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17831 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 17832
4b1ec863 178332011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 17834
1714f52b 17835 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 17836
4b1ec863
PE
17837 * fringe.c (update_window_fringes): Mark locals as initialized
17838 (Bug#8227).
17839 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 17840
524c7aa6
PE
17841 * alloc.c (mark_fringe_data): Move decl from here ...
17842 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17843 to check its interface.
17844 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17845
a5c0af81 17846 * fontset.c (free_realized_fontset): Now static.
7519b8cd 17847 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 17848 (fontset_font): Mark local as initialized.
a9a06e0b 17849 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 17850
b4716021
PE
17851 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17852
811e9bac 17853 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 17854 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
17855 (x_own_selection, Fx_disown_selection_internal): Rename locals
17856 to avoid shadowing.
17857 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 17858
7e3ab302
PE
17859 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17860 so that the caller can use some name other than gcpro1.
17861 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
17862 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17863 (Fx_backspace_delete_keys_p):
17864 Use them to avoid shadowing, and rename vars to avoid shadowing.
17865 (x_decode_color, x_set_name, x_window): Now static.
6b437900 17866 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 17867 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
17868 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17869 Remove unused locals.
7e3ab302
PE
17870 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17871 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17872 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17873 macros.
f78faa98 17874
e2b13473
PE
17875 * xterm.h (x_mouse_leave): New decl.
17876
77f23912
PE
17877 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17878 Remove unused functions.
cdf4ba58
PE
17879 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17880 (x_calc_absolute_position): Now static.
7411c686 17881 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 17882 Don't declare local "event" unless it's used.
ed7bf3a5
PE
17883 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17884 unless they are used.
38d0b34a
PE
17885 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17886 (x_fatal_error_signal): Remove; not used.
a6067996
PE
17887 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17888 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17889 (x_error_catcher, x_connection_closed, x_error_handler):
17890 (x_error_quitter, xembed_send_message, x_iconify_frame):
17891 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 17892 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 17893 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 17894
44f230aa
SM
17895 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17896 Rename or move locals to avoid shadowing.
6b463e58 17897 (tty_defined_color, merge_face_heights): Now static.
5967d051 17898 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
17899 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17900 does not deduce is never used uninitialized.
73719eba
PE
17901 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17902 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 17903
426994c3 17904 * terminal.c (store_terminal_param): Now static.
5489860b 17905
032f1620 17906 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 17907 (set_frame_menubar): Remove unused local.
d4323972 17908 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
17909 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17910 since they might point to immutable storage.
281585b0
PE
17911 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17912 since it's unused otherwise.
032f1620 17913
367c19e5 17914 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 17915 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
17916 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17917 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 17918 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
17919 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17920 does not deduce are never used uninitialized.
70739cbe 17921
07b48fa9
PE
17922 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17923
8868a238 17924 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
17925 * window.c (window_loop, size_window):
17926 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 17927
7e5cf297 17928 * window.c (display_buffer): Now static.
d6550a9f
PE
17929 (size_window): Mark variables that gcc -Wuninitialized
17930 does not deduce are never used uninitialized.
a586633d
PE
17931 * window.h (check_all_windows): New decl, to forestall
17932 gcc -Wmissing-prototypes diagnostic.
5b555da1 17933 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 17934
f6095868
PE
17935 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17936 shadowing.
17937 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
17938 Include <limits.h>.
17939 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17940 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
17941 (load_charset_map): Mark variables that gcc -Wuninitialized
17942 does not deduce are never used uninitialized.
53df7c11 17943 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 17944
f38b440c
PE
17945 * coding.c (coding_set_source, coding_set_destination):
17946 Use "else { /* comment */ }" rather than "else /* comment */;"
17947 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
17948 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17949 a block, when the outer 'i' will do.
17950 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17951 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17952 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17953 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17954 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17955 Rename locals to avoid shadowing.
17956 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
17957 * coding.c (emacs_mule_char, encode_invocation_designation):
17958 Now static, since they're not used elsewhere.
413bb2db 17959 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 17960 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
17961 (decode_coding_emacs_mule): Mark variables that gcc
17962 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
17963 (detect_coding_iso_2022): Initialize a local variable that might
17964 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 17965 this initialization is needed. (Bug#8211)
5f58e762
PE
17966 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17967 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17968 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17969 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17970 Remove unused macros.
f38b440c 17971
232b38b9 17972 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 17973 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 17974 * character.c (string_count_byte8): Likewise.
232b38b9 17975
fb90da1b
PE
17976 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17977 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17978
fb93dbc2
PE
17979 * chartab.c (copy_sub_char_table): Now static, since it's not used
17980 elsewhere.
5c156ace
PE
17981 (sub_char_table_ref_and_range, char_table_ref_and_range):
17982 Rename locals to avoid shadowing.
bbcd0949 17983 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 17984
7d3b3862 17985 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 17986 (BIDI_BOB): Remove unused macro.
7d3b3862 17987
6be7d3da
PE
17988 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17989 deduce are never used uninitialized.
c2ed9c8b 17990 * term.c (encode_terminal_code): Likewise.
6be7d3da 17991
75f8807f 17992 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 17993
50938595
PE
17994 * tparam.h: New file.
17995 * term.c, tparam.h: Include it.
17996 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17997 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17998 Move these decls to tparam.h, and make them agree with what
17999 is actually in tparam.c. The previous trick of using incompatible
18000 decls in different modules does not conform to the C standard.
18001 All callers of tparam changed to use tparam's actual API.
18002 * tparam.c (tparam1, tparam, tgoto):
18003 Use const pointers where appropriate.
18004
fbceeba2
PE
18005 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18006 * cm.h (struct cm): Likewise.
18007 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18008 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18009 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18010 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18011 (turn_on_face, init_tty): Likewise.
18012 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 18013
7f3f1250
PE
18014 * term.c (term_mouse_position): Rename local to avoid shadowing.
18015
e6ca6543
PE
18016 * alloc.c (mark_ttys): Move decl from here ...
18017 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18018
c40f8d15
AS
180192011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18020
18021 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18022
cfe0661d
JB
180232011-03-09 Juanma Barranquero <lekktu@gmail.com>
18024
18025 * search.c (compile_pattern_1): Remove argument regp, unused since
18026 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18027 (compile_pattern): Don't pass it.
18028
0afb4571
J
180292011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18030
18031 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18032 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18033 for ! HAVE_GTK3.
18034 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18035
18036 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18037
18038 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18039 gdk_window_get_screen, gdk_window_get_geometry,
18040 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18041 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18042 (xg_get_pixbuf_from_pixmap): New function.
18043 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18044 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18045 Call xg_get_pixbuf_from_pixmap instead of
18046 gdk_pixbuf_get_from_drawable.
18047 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18048 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18049 (xg_check_special_colors): Use GtkStyleContext and its functions
18050 for HAVE_GTK3.
18051 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18052 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18053 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
18054 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18055 Call gtk_widget_get_preferred_size.
0afb4571
J
18056 (xg_frame_resized): gdk_window_get_geometry only takes 5
18057 parameters.
44f230aa
SM
18058 (xg_win_to_widget, xg_event_is_for_menubar):
18059 Call gdk_x11_window_lookup_for_display.
0afb4571
J
18060 (xg_set_widget_bg): New function.
18061 (delete_cb): New function.
895009e1 18062 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 18063 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
18064 (xg_set_background_color): Call xg_set_widget_bg.
18065 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18066 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18067 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18068 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18069 if ! HAVE_GTK3.
18070 (update_frame_tool_bar): Call gtk_widget_hide.
18071 (xg_initialize): Use GDK_KEY_g.
18072
18073 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18074 if ! HAVE_GTK3
18075 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18076
18077 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18078 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18079 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18080
1c2cc4ef
JB
180812011-03-08 Juanma Barranquero <lekktu@gmail.com>
18082
18083 * w32xfns.c (select_palette): Check success of RealizePalette against
18084 GDI_ERROR, not zero.
18085
33383987 18086See ChangeLog.11 for earlier changes.
aac0c6e3
MR
18087
18088;; Local Variables:
18089;; coding: utf-8
aac0c6e3
MR
18090;; End:
18091
2f097256 18092 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
18093
18094 This file is part of GNU Emacs.
18095
18096 GNU Emacs is free software: you can redistribute it and/or modify
18097 it under the terms of the GNU General Public License as published by
18098 the Free Software Foundation, either version 3 of the License, or
18099 (at your option) any later version.
18100
18101 GNU Emacs is distributed in the hope that it will be useful,
18102 but WITHOUT ANY WARRANTY; without even the implied warranty of
18103 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18104 GNU General Public License for more details.
18105
18106 You should have received a copy of the GNU General Public License
18107 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.