Minor code tweak for delete-trailing-whitespace.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
cb5b0266
PE
12012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2
3 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
4 Suggested by Eli Zaretskii in
5 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
6
84f72efd
EZ
72012-09-30 Eli Zaretskii <eliz@gnu.org>
8
9 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
10 HAVE_TIMER_SETTIME is defined.
11
9d4dcdc9
PE
122012-09-30 Paul Eggert <eggert@cs.ucla.edu>
13
d89460ed
PE
14 Profiler improvements: more-accurate timers, overflow checks.
15 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
16 signal.h, setjmp.h. Include systime.h instead.
17 (saturated_add): New function.
18 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
19 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
20 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
21 New static vars.
84f72efd 22 (enum profiler_cpu_running): New enum.
d89460ed
PE
23 (profiler_cpu_running): Now of that enum type, not bool.
24 All uses changed to store the new value.
25 (handle_profiler_signal): Rename from sigprof_handler_1,
26 for consistency with other handlers. Do not check whether
27 cpu_log is a hash-table if garbage collecting, since it
28 doesn't matter in that case.
29 (deliver_profiler_signal): Rename from sigprof_handler,
30 for consistency with other handlers.
31 (setup_cpu_timer): New function, with much of what used to be in
32 Fprofiler_cpu_start. Check for out-of-range argument.
33 Prefer timer_settime if available, and prefer
34 thread cputime clocks, then process cputime clocks, then
35 monotonic clocks, to the old realtime clock. Use make_timeval
36 to round more-correctly when falling back to setitimer.
37 (Fprofiler_cpu_start): Use it.
38 (Fprofiler_cpu_stop): Prefer timer_settime if available.
39 Don't assume that passing NULL as the 2nd argument of setitimer
40 is the same as passing a pointer to all-zero storage.
41 Ignore SIGPROF afterwards.
42 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
43 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
44 non-fatal signal handlers. Ignore SIGPROF on startup.
45 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
46 in profiler.c, since sysdep.c now uses it.
47
9d4dcdc9
PE
48 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
49 Suggested by Eli Zaretskii in
50 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
51
8e5691a0
JB
522012-09-29 Juanma Barranquero <lekktu@gmail.com>
53
54 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
55
e7c1b6ef
SM
562012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
57
58 * lisp.h (struct backtrace): Remove indirection for `function' field.
59 * xdisp.c (redisplay_internal):
60 * profiler.c (record_backtrace, sigprof_handler_1):
61 * alloc.c (Fgarbage_collect):
62 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
63 (Fbacktrace_frame): Adjust accordingly.
64
e61d39cd 652012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
66
67 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
68 (Frun_hook_with_args_until_failure): Doc fixes.
69
404043ea
EZ
702012-09-28 Eli Zaretskii <eliz@gnu.org>
71
72 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
73 Qautomatic_redisplay and change the symbol name. All users changed.
74
704d3f45
TM
752012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
76
77 * profiler.c (sigprof_handler): Fix race condition.
78
757140ff
GM
792012-09-28 Glenn Morris <rgm@gnu.org>
80
81 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
82
a615a3ae
PE
832012-09-27 Paul Eggert <eggert@cs.ucla.edu>
84
85 Check more robustly for timer_settime.
89d17fd0
PE
86 * Makefile.in (LIB_TIMER_TIME): New macro.
87 (LIBES): Add it.
a615a3ae
PE
88 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
89 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
90 call timer_settime.
91
3670daf7
TM
922012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
93
94 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
95
6a586b7f
JB
962012-09-26 Juanma Barranquero <lekktu@gmail.com>
97
98 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
99
41c8bfcf
PE
1002012-09-26 Paul Eggert <eggert@cs.ucla.edu>
101
102 * character.h (MAYBE_UNIFY_CHAR): Remove.
103 * charset.c, charset.h (maybe_unify_char): Now static.
104 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
105 Since this stuff is now private to charset.c, there's no need for
106 a public macro and no need to inline by hand.
107
3a880af4
SM
1082012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
109 Stefan Monnier <monnier@iro.umontreal.ca>
110 Juanma Barranquero <lekktu@gmail.com>
611b7507 111
3a880af4
SM
112 * profiler.c: New file.
113 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
114 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
115 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
116 * emacs.c (main): Call syms_of_profiler.
117 * alloc.c (Qautomatic_gc): New constant.
118 (MALLOC_PROBE): New macro.
119 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
120 (total_bytes_of_live_objects): New function.
121 (Fgarbage_collect): Use it. Record itself in backtrace_list.
122 Call malloc_probe for the memory profiler.
123 (syms_of_alloc): Define Qautomatic_gc.
124 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
125 race condition.
126 (struct backtrace): Move definition...
127 * lisp.h (struct backtrace): ..here.
128 (Qautomatic_gc, profiler_memory_running): Declare vars.
129 (malloc_probe, syms_of_profiler): Declare functions.
130 * xdisp.c (Qautomatic_redisplay): New constant.
131 (redisplay_internal): Record itself in backtrace_list.
132 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 133
b67238c2
JB
1342012-09-25 Juanma Barranquero <lekktu@gmail.com>
135
136 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
137
e26fd2e4
PE
1382012-09-25 Paul Eggert <eggert@cs.ucla.edu>
139
140 Prefer POSIX timers if available.
141 They avoid a race if the timer is too close to the current time.
142 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
143 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 144 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 145
eedec3ee
EZ
1462012-09-25 Eli Zaretskii <eliz@gnu.org>
147
148 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
149 CHAR_STRING_ADVANCE.
150 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
151 STRING_CHAR_ADVANCE.
152
aa15c6bb
JB
1532012-09-25 Juanma Barranquero <lekktu@gmail.com>
154
155 Move Vlibrary_cache to emacs.c and reset before dumping.
156
157 * lisp.h (reset_image_types): Declare.
158 [WINDOWSNT] (Vlibrary_cache): Declare.
159
160 * image.c (reset_image_types): New function.
161
162 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
163 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
164 (Fdump_emacs): Reset Vlibrary_cache and image_types.
165
166 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
167 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
168
169 * w32.h (Vlibrary_cache): Do not declare.
170
54d629be
EZ
1712012-09-25 Eli Zaretskii <eliz@gnu.org>
172
16b22fef
EZ
173 * w32proc.c (sys_signal): Handle all signals defined by the
174 MS-Windows runtime, not just SIGCHLD. Actually install the signal
175 handlers for signals supported by Windows. Don't override
176 term_ntproc as the handler for SIGABRT.
177 (sigaction): Rewrite to call sys_signal instead of duplicating its
178 code.
179 (sys_kill): Improve commentary.
180
181 * w32.c (term_ntproc): Accept (and ignore) one argument, for
182 consistency with a signature of a signal handler. All callers
183 changed.
184 (init_ntproc): Accept an argument DUMPING. If dumping, don't
185 install term_ntproc as a signal handler for SIGABRT, as that
186 should be done by the dumped Emacs.
187
188 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
189
190 * w32select.c (term_w32select): Protect against repeated
191 invocation by setting clipboard_owner to NULL after calling
192 DestroyWindow.
193
194 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
195 and term_ntproc to their modified signatures.
196
54d629be
EZ
197 * character.c (char_string, string_char): Remove calls to
198 MAYBE_UNIFY_CHAR. See the discussion starting at
199 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
200 for the details.
201
59f7af81
CY
2022012-09-25 Chong Yidong <cyd@gnu.org>
203
204 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
205
22e8cf4a
SM
2062012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
207
208 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
209 when encountering an unknown bytecode.
210
578098f3
PE
2112012-09-24 Paul Eggert <eggert@cs.ucla.edu>
212
213 image.c, indent.c: Use bool for booleans.
214 * dispextern.h (struct image_type): Members valid_p, load, init
215 now return bool, not int. All uses changed.
216 * image.c: Omit unnecessary static decls.
217 (x_create_bitmap_mask, x_build_heuristic_mask):
218 Return void, not int, since callers don't care about the return value.
219 (x_create_bitmap_mask, define_image_type, valid_image_p)
220 (struct image_keyword, parse_image_spec, image_spec_value)
221 (check_image_size, image_background)
222 (image_background_transparent, x_clear_image_1)
223 (postprocess_image, lookup_image, x_check_image_size)
224 (x_create_x_image_and_pixmap, xbm_image_p)
225 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
226 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
227 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
228 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
229 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
230 (png_image_p, init_png_functions, png_load_body, png_load)
231 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
232 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
233 (init_gif_functions, gif_load, imagemagick_image_p)
234 (imagemagick_load_image, imagemagick_load, svg_image_p)
235 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
236 (gs_load):
237 * nsimage.m (ns_load_image):
238 * nsterm.m (ns_defined_color):
239 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
240 * xfns.c (x_defined_color):
241 * xterm.c (x_alloc_lighter_color_for_widget)
242 (x_alloc_nearest_color_1, x_alloc_nearest_color)
243 (x_alloc_lighter_color):
244 * indent.c (disptab_matches_widthtab, current_column)
245 (scan_for_column, string_display_width, indented_beyond_p)
246 (compute_motion, vmotion, Fvertical_motion):
247 Use bool for booleans.
248
a5f2b6ec
CY
2492012-09-24 Chong Yidong <cyd@gnu.org>
250
251 * chartab.c (Fset_char_table_default): Obsolete function removed.
252
18e27ea8
PE
2532012-09-23 Paul Eggert <eggert@cs.ucla.edu>
254
afea8a8a
PE
255 Move pid_t related decls out of lisp.h.
256 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
257 (interruptible_wait_for_termination):
258 Move these decls from lisp.h to syswait.h, since they use pid_t.
259 Needed on FreeBSD; see Herbert J. Skuhra in
260 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
261 * callproc.c: Include syswait.h.
262
18e27ea8
PE
263 gnutls.c, gtkutil.c: Use bool for boolean.
264 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
265 (emacs_gnutls_handle_error):
266 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
267 (xg_hide_tooltip, xg_create_frame_widgets)
268 (create_dialog, xg_uses_old_file_dialog)
269 (xg_get_file_with_chooser, xg_get_file_with_selection)
270 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
271 (xg_item_label_same_p, xg_update_menubar)
272 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
273 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
274 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
275 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
276 (update_frame_tool_bar, free_frame_tool_bar):
277 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
278 * nsmenu.m (ns_update_menubar):
279 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
280 * xfns.c (Fx_show_tip) [USE_GTK]:
281 Use bool for boolean.
282 * gtkutil.c (xg_update_frame_menubar):
283 * xmenu.c (update_frame_menubar):
284 Return void, not int, since caller ignores return value.
285 * gtkutil.c (xg_change_toolbar_position):
286 Return void, not 1.
287
af0e9f75
JB
2882012-09-23 Juanma Barranquero <lekktu@gmail.com>
289
290 * makefile.w32-in (BLOCKINPUT_H): Remove.
291 (SYSSIGNAL_H): New macro.
292 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
293 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
294 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
295 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
296 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
297 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
298 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
299 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
300 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
301 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
302 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
303 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
304 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
305 ($(BLD)/w32xfns.$(O)): Update dependencies.
306
5101529e
EZ
3072012-09-23 Eli Zaretskii <eliz@gnu.org>
308
309 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
310 fatal_error_backtrace.
311
312 * w32proc.c (sys_kill): Undo last change: don't do anything when
313 invoked to deliver SIGABRT to our own process. This is now
314 handled by emacs_raise.
315
2c3ee0ad
JB
3162012-09-23 Juanma Barranquero <lekktu@gmail.com>
317
318 * w32term.c (w32_read_socket): Remove leftover reference to
319 interrupt_input_pending.
320
62a1d661
PE
3212012-09-23 Paul Eggert <eggert@cs.ucla.edu>
322
323 Do not use SA_NODEFER.
324 Problem reported by Dani Moncayo in
325 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
326 * alloc.c (die):
327 * sysdep.c (emacs_abort): Do not reset signal handler.
328 * emacs.c (terminate_due_to_signal): Reset signal handler here.
329 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
330 wanted even on POSIXish hosts, and it doesn't work on Windows.
331
a0942b9a
JD
3322012-09-23 Jan Djärv <jan.h.d@swipnet.se>
333
334 * xterm.c (x_term_init): Call fixup_locale before and after calling
335 gtk_init (Bug#12392).
336
d07ff9db
CY
3372012-09-23 Chong Yidong <cyd@gnu.org>
338
339 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
340 Vdynamic_library_alist.
341
342 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
343 (Fgnutls_available_p): Caller changed.
344
345 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
346 (Flibxml_parse_xml_region): Likewise.
347
348 * dispextern.h (struct image_type): Remove arg from init function.
349
350 * image.c (Finit_image_library, lookup_image_type)
351 (define_image_type): Remove now-unneeded second arg.
352 (init_xpm_functions, init_png_functions, init_jpeg_functions)
353 (init_tiff_functions, init_gif_functions, init_svg_functions):
354 Arglist and w32_delayed_load calling convention changed.
355 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 356 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 357
4d7e6e51
PE
3582012-09-23 Paul Eggert <eggert@cs.ucla.edu>
359
360 Simplify and avoid signal-handling races (Bug#12471).
361 * alloc.c (die):
362 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
363 Avoid recursive loop if there's a fatal error in the function itself.
364 * atimer.c (pending_atimers):
365 * blockinput.h: Don't include "atimer.h"; no longer needed.
366 (interrupt_input_pending): Remove. All uses removed.
367 pending_signals now counts both atimers and ordinary interrupts.
368 This is less racy than having three separate pending-signal flags.
369 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
370 (input_blocked_p):
371 Rename from their upper-case counterparts BLOCK_INPUT,
372 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
373 INPUT_BLOCKED_P, and turn into functions. All uses changed.
374 This makes it easier to access volatile variables more accurately.
375 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
376 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
377 that's more reliable if the code is buggy and sets
378 interrupt_input_blocked to a negative value. All uses changed.
379 * atimer.c (deliver_alarm_signal):
380 Remove. No need to deliver this to the parent; any thread can
381 handle this signal now. All uses replaced by underlying handler.
382 * atimer.c (turn_on_atimers):
383 * dispnew.c (handle_window_change_signal):
384 * emacs.c (handle_danger_signal):
385 * keyboard.c (kbd_buffer_get_event):
386 Don't reestablish signal handler; not needed with sigaction.
387 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
388 (UNBLOCK_INPUT_TO):
389 Rework to avoid unnecessary accesses to volatile variables.
390 (UNBLOCK_INPUT_TO): Now a function.
391 (totally_unblock_input, unblock_input): New decls.
392 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
393 (init_data): Remove. Necessary stuff now done in init_signal.
394 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
395 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
396 (fatal_error_code): Remove; no longer needed.
397 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
398 it doesn't always backtrace. All uses changed. No need to reset
399 signal to default, since sigaction and/or die does that for us now.
400 Use emacs_raise (FOO), not kill (getpid (), FOO).
401 (main): Check more-accurately whether we're dumping.
402 Move fatal-error setup to sysdep.c
403 * floatfns.c: Do not include "syssignal.h"; no longer needed.
404 * gtkutil.c (xg_get_file_name, xg_get_font):
405 Remove no-longer-needed signal-mask manipulation.
406 * keyboard.c, process.c (POLL_FOR_INPUT):
407 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
408 * keyboard.c (read_avail_input): Remove.
409 All uses replaced by gobble_input.
410 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
411 (kbd_buffer_store_event_hold, gobble_input):
412 (record_asynch_buffer_change) [USABLE_SIGIO]:
413 (store_user_signal_events):
414 No need to mess with signal mask.
415 (gobble_input): If blocking input and there are terminals, simply
416 set pending_signals to 1 and return. All hooks changed to not
417 worry about whether input is blocked.
418 (process_pending_signals): Clear pending_signals before processing
419 them, in case a signal comes in while we're processing.
420 By convention callers now test pending_signals before calling us.
421 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
422 New functions, to support changes to blockinput.h.
423 (handle_input_available_signal): Now extern.
424 (reinvoke_input_signal): Remove. All uses replaced by
425 handle_async_input.
426 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
427 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
428 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
429 Clear sigmask reliably, even if Fsignal returns, which it can.
430 Omit unnecessary accesses to volatile var.
431 (quit_throw_to_read_char): No need to restore sigmask.
432 * keyboard.c (gobble_input, handle_user_signal):
433 * process.c (wait_reading_process_output):
434 Call signal-handling code rather than killing ourselves.
435 * lisp.h: Include <float.h>, for...
436 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
437 (pending_signals): Now volatile.
438 (syms_of_data): Now const if IEEE floating point.
439 (handle_input_available_signal) [USABLE_SIGIO]:
440 (terminate_due_to_signal, record_child_status_change): New decls.
441 * process.c (create_process): Avoid disaster if memory is exhausted
442 while we're processing a vfork, by tightening the critical section
443 around the vfork.
444 (send_process_frame, process_sent_to, handle_pipe_signal)
445 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
446 ignores SIGPIPE.
447 (send_process): No need for setjmp/longjmp any more, since the
448 SIGPIPE stuff is now gone. Instead, report an error if errno
449 is EPIPE.
450 (record_child_status_change): Now extern. PID and W are now args.
451 Return void, not bool. All callers changed.
452 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
453 Remove. All uses removed. This bug should be fixed now in a
454 different way.
455 (wait_for_termination_1): Use waitpid rather than sigsuspend,
456 and record the child status change directly. This avoids the
457 need to futz with the signal mask.
458 (process_fatal_action): Move here from emacs.c.
459 (emacs_sigaction_flags): New function, containing
460 much of what used to be in emacs_sigaction_init.
461 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
462 caught by emacs, to make races less likely.
463 (deliver_process_signal): Rename from handle_on_main_thread.
464 All uses changed.
465 (BACKTRACE_LIMIT_MAX): Now at top level.
466 (thread_backtrace_buffer, threadback_backtrace_pointers):
467 New static vars.
468 (deliver_thread_signal, deliver_fatal_thread_signal):
469 New functions, for more-accurate delivery of thread-specific signals.
470 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
471 (deliver_arith_signal): Handle in this thread, not
472 in the main thread, since it's triggered by this thread.
473 (maybe_fatal_sig): New function.
474 (init_signals): New arg DUMPING so that we can be more accurate
475 about whether we're dumping. Caller changed.
476 Treat thread-specific signals differently from process-general signals.
477 Block all signals while handling fatal error; that's safer.
478 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
479 on IEEE hosts.
480 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
481 Ignore SIGPIPE unless batch.
482 (emacs_backtrace): Output backtrace for the appropriate thread,
483 which is not necessarily the main thread.
484 * syssignal.h: Include <stdbool.h>.
485 (emacs_raise): New macro.
486 * xterm.c (x_connection_signal): Remove; no longer needed
487 now that we use sigaction.
488 (x_connection_closed): No need to mess with sigmask now.
489 (x_initialize): No need to reset SIGPIPE handler here, since
490 init_signals does this for us now.
491
8f4635e9
JD
4922012-09-23 Jan Djärv <jan.h.d@swipnet.se>
493
494 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 495 background rect may be larger (Bug#12245).
8f4635e9 496
3296976d
CY
4972012-09-23 Chong Yidong <cyd@gnu.org>
498
499 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
500
d41e491e
PE
5012012-09-22 Paul Eggert <eggert@cs.ucla.edu>
502
503 * .gdbinit: Just stop at fatal_error_backtrace.
504 See Stefan Monnier's request in
505 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
506 Remove no-longer-used query of system type.
507
c88b867f
CY
5082012-09-22 Chong Yidong <cyd@gnu.org>
509
510 * search.c (Freplace_match): Doc fix (Bug#12325).
511
512 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
513
514 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
515 (Fline_end_position): Doc fix.
516
517 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
518
bb4d86b4
CY
5192012-09-22 Chong Yidong <cyd@gnu.org>
520
521 * dispextern.h (struct image_type): Add new slot, storing a type
522 initialization function.
523
524 * image.c (define_image_type): Call the image initializer function
525 if it is defined. Arguments and return value changed.
526 (valid_image_p, make_image): Callers changed.
527 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
528 (gif_type, imagemagick_type, svg_type, gs_type):
529 Add initialization functions.
bb4d86b4
CY
530 (Finit_image_library): Call lookup_image_type.
531 (CHECK_LIB_AVAILABLE): Macro deleted.
532 (lookup_image_type): Call define_image_type here, rather than via
533 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
534 (syms_of_image): Move define_image_type calls for xbm_type and
535 pbm_type to lookup_image_type.
536
df9685f3
EZ
5372012-09-22 Eli Zaretskii <eliz@gnu.org>
538
539 * keyboard.c (timer_check_2): Move calculation of 'timers' and
540 'idle_timers' from here ...
541 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
542 lists, to avoid infloops when the timer does something stupid,
543 like reinvoke itself with the same or smaller time-out.
544 (Bug#12447)
545
8e17c9ba
MR
5462012-09-22 Martin Rudalics <rudalics@gmx.at>
547
548 * window.c (Fsplit_window_internal): Handle only Qt value of
549 Vwindow_combination_limit separately.
550 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
551 (Vwindow_combination_limit): New default value.
552 Rewrite doc-string.
8e17c9ba 553
589bd69b
EZ
5542012-09-22 Eli Zaretskii <eliz@gnu.org>
555
556 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
557 the new overlay string. (Bug#10159)
558
01108e3f
PE
5592012-09-22 Paul Eggert <eggert@cs.ucla.edu>
560
561 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
562 or that fprintf is async-signal-safe. POSIX doesn't require
563 either assumption.
564
82f8cd94
CY
5652012-09-22 Chong Yidong <cyd@gnu.org>
566
567 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
568 (Bug#8207).
569
3cccbd87
KH
5702012-09-22 Kenichi Handa <handa@gnu.org>
571
572 * composite.c (composition_reseat_it): Handle the case that a
573 grapheme cluster is not covered by a single font (Bug#12352).
574
09c01941
CY
5752012-09-21 Chong Yidong <cyd@gnu.org>
576
577 * image.c (define_image_type): Avoid adding duplicate types to
578 image_types (Bug#12463). Suggested by Jörg Walter.
579
acfa068f 5802012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
581
582 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
583 (print_load_command_name): Add case LC_DATA_IN_CODE.
584 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
585
acfa068f 5862012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
587
588 * eval.c (Frun_hook_with_args_until_success)
589 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
590
acfa068f 5912012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
592
593 * fileio.c (Ffile_selinux_context): Only call freecon when
594 lgetfilecon succeeded.
595 (Fset_file_selinux_context): Likewise. (Bug#12444)
596
acfa068f 5972012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
598
599 * xdisp.c (try_window_reusing_current_matrix): Under bidi
600 reordering, locate the cursor by calling set_cursor_from_row; if
601 that fails, clear the desired glyph matrix before returning a
602 failure indication to the caller. Fixes leaving garbled display
603 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
604 (compute_stop_pos_backwards): Fix a typo that caused crashes while
605 scrolling through multibyte text.
aa36e4d2 606
e99f70c8
SM
6072012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
608
609 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
610 calling mark_vectorlike since that's the one that marks the window.
611 (mark_discard_killed_buffers): Mark the final cdr.
612 * window.h (struct window): Move prev/next_buffers to the
613 non-standard fields.
614 * window.c (make_window): Initialize prev/next_buffers manually.
615
f75beb47
PE
6162012-09-20 Paul Eggert <eggert@cs.ucla.edu>
617
618 Omit unused arg EXPECTED from socket hooks.
619 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
620 * nsterm.m (ns_term_init):
621 * termhooks.h (struct terminal.read_socket_hook):
622 * w32inevt.c (w32_console_read_socket):
623 * w32term.c (w32_read_socket):
624 * xterm.c (XTread_socket):
625 Omit unused arg EXPECTED. All callers changed.
626 (store_user_signal_events): Return void, not int, since callers no
627 longer care about the return value. All uses changed.
628
b019b76a
JB
6292012-09-20 Juanma Barranquero <lekktu@gmail.com>
630
631 * w32gui.h (XParseGeometry): Do not declare.
632
05642592
PE
6332012-09-19 Paul Eggert <eggert@cs.ucla.edu>
634
e4bce92a
PE
635 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
636 Ignore 'expected'. See Eli Zaretskii in
637 <http://bugs.gnu.org/12471#8> (last line).
638
05642592
PE
639 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
640 (XParseGeometry): Now static. Substitute extremal values for
641 values that are out of range.
642
e543ae91
JD
6432012-09-19 Jan Djärv <jan.h.d@swipnet.se>
644
645 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
646
647 * nsfns.m (XParseGeometry): Remove.
648 (Fx_create_frame): Call x_set_offset to correctly interpret
649 top_pos in geometry.
650
3a880af4 651 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
652 (Fx_parse_geometry): If there is a space in string, call
653 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
654
45ba16c7
EZ
6552012-09-17 Eli Zaretskii <eliz@gnu.org>
656
c8b9f1bc
EZ
657 * search.c (scan_buffer): Use character positions in calls to
658 region_cache_forward and region_cache_backward, not byte
659 positions. (Bug#12196)
660
b4c932a2
EZ
661 * w32term.c (w32_read_socket): Set pending_signals to 1, like
662 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
663
45ba16c7
EZ
664 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
665 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
666 emacs_blocked_malloc, now deleted.
667
eeceac93
PE
6682012-09-17 Paul Eggert <eggert@cs.ucla.edu>
669
670 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
671 The workaround was for improving performance on Solaris 2.4, but
672 is getting in the way now. Emacs will still work if someone is
673 still running Solaris 2.4 in a museum somewhere; Sun dropped
674 support for Solaris 2.4 in 2003.
675 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
676 * process.c (create_process) [HAVE_WORKING_VFORK]:
677 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
678 since Emacs no longer uses vfork on that platform.
679
78f83752
GM
6802012-09-17 Glenn Morris <rgm@gnu.org>
681
682 * emacs.c: Use COPYRIGHT.
683
634b8cac
PE
6842012-09-16 Paul Eggert <eggert@cs.ucla.edu>
685
0caaedb1
PE
686 Remove configure's --without-sync-input option (Bug#12450).
687 When auditing signal-handling in preparation for cleaning it up,
688 I found that SYNC_INPUT has race conditions and would be a real
689 pain to fix. Since it's an undocumented and deprecated
690 configure-time option, now seems like a good time to remove it.
691 Also see <http://bugs.gnu.org/11080#16>.
692 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
693 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
694 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
695 (malloc_hysteresis):
696 (check_depth) [XMALLOC_OVERRUN_CHECK]:
697 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
698 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
699 (dont_register_blocks, bytes_used_when_reconsidered)
700 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
701 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
702 [!SYSTEM_MALLOC && !SYNC_INPUT]:
703 Remove. All uses removed.
704 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
705 implementation, one that depends on whether the new macro
706 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
707 is defined.
708 * atimer.c (run_timers, handle_alarm_signal):
709 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
710 (handle_async_input, process_pending_signals)
711 (handle_input_available_signal, init_keyboard):
712 * nsterm.m (ns_read_socket):
713 * process.c (wait_reading_process_output):
714 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
715 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
716 (emacs_write):
717 * xterm.c (XTread_socket):
718 Assume SYNC_INPUT.
719 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
720 * eval.c (handling_signal): Remove. All uses removed.
721 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
722 All uses replaced with the SYNC_INPUT version.
723 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
724 Remove decls.
725 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
726 Now static.
727
634b8cac
PE
728 * font.c (Ffont_shape_gstring): Remove unused local.
729
83da1b55
GM
7302012-09-16 Glenn Morris <rgm@gnu.org>
731
518650a5
GM
732 * Makefile.in (clean): No longer run nextstep's clean.
733
83da1b55
GM
734 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
735 (ns_frag): Remove.
736 (ns-app): Move here from ns.mk, and simplify.
737 (clean): Simplify nextstep entry.
738 * ns.mk: Remove file.
739
85a43e2e
KH
7402012-09-17 Kenichi Handa <handa@gnu.org>
741
742 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
743 not covert the last few charactes.
744
ba13e616 7452012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
746
747 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
748 here, but just check the validity of glyphs in the glyph-string.
749
a8c729af
MR
7502012-09-16 Martin Rudalics <rudalics@gmx.at>
751
3a880af4
SM
752 * window.c (Fwindow_parameter, Fset_window_parameter):
753 Accept any window as argument (Bug#12452).
a8c729af 754
c077c059
JD
7552012-09-16 Jan Djärv <jan.h.d@swipnet.se>
756
757 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
758 to ns_term_init to avoid memory leak.
759
760 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
761 explicit retain/release.
762 (ns_term_init): Only allow one display. Initialize outerpool and
763 ns_*_types.
764
39a57ad0
PE
7652012-09-15 Paul Eggert <eggert@cs.ucla.edu>
766
767 Port _setjmp fix to POSIXish hosts as well as Microsoft.
768 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
769 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
770 the Microsoft problem in a different way, by altering ../nt/config.nt.
771
7105c8cb
EZ
7722012-09-15 Eli Zaretskii <eliz@gnu.org>
773
774 * w32xfns.c:
775 * w32uniscribe.c:
776 * w32term.c:
777 * w32select.c:
778 * w32reg.c:
779 * w32proc.c:
780 * w32menu.c:
781 * w32inevt.c:
782 * w32heap.c:
783 * w32font.c:
784 * w32fns.c:
785 * w32console.c:
786 * w32.c:
787 * w16select.c: Remove inclusion of setjmp.h, as it is now included
788 by lisp.h. This completes removal of setjmp.h inclusion
789 erroneously announced in the previous commit. (Bug#12446)
790
791 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
792 more accurate.
793
794 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
795 not defined as a macro. The latter happens on MS-Windows.
796 (Bug#12446)
797
0328b6de
PE
7982012-09-15 Paul Eggert <eggert@cs.ucla.edu>
799
800 Port better to POSIX hosts lacking _setjmp (Bug#12446).
801 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 802 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
803 only reason for the instance was because "lisp.h" was included.
804 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
805 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
806 and _longjmp with the new symbols. Emacs already uses _setjmp if
807 available, so this change affects only POSIXish hosts that have
808 sigsetjmp but not _setjmp, such as some versions of Solaris and
809 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
810 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
811 (png_load_body) [HAVE_PNG]:
812 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
813 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
814 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
815 since PNG requires jmp_buf. This is the only exception to the
816 general rule that we now use sys_setjmp and sys_longjmp.
817 This exception is OK since this code does not change the signal
818 mask or longjmp out of a signal handler.
819
2af03429
PE
8202012-09-14 Paul Eggert <eggert@cs.ucla.edu>
821
822 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
823 Include "syssignal.h", for 'main_thread'.
824
2f294edf
DA
8252012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
826
827 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
828 * insdel.c (replace_range, replace_range_2):
829 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
830 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
831 Remove redundant check before calling offset_intervals.
832
6b533e9c
MR
8332012-09-14 Martin Rudalics <rudalics@gmx.at>
834
835 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
836 current buffer (Bug#12387).
837
2a7931e3
JB
8382012-09-14 Juanma Barranquero <lekktu@gmail.com>
839
840 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
841
c18e885b
PE
8422012-09-13 Paul Eggert <eggert@cs.ucla.edu>
843
844 Use a more backwards-compatible timer format (Bug#12430).
845 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
846 vector element, not from the 4th, since PSECS is now at the end.
847 (Fcurrent_idle_time): Doc fix.
848
d59a1afb
DA
8492012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
850
851 Function to mark objects and remove killed buffers at once.
852 * alloc.c (discard_killed_buffers): Rename to ...
853 (mark_discard_killed buffers) ... new name. Add marking
854 of remaining objects. Fix comment. Adjust users.
855 (mark_object): Do not touch frame buffer lists here.
856 * frame.c (delete_frame): Reset frame buffer lists here.
857
5f0cb45a
PE
8582012-09-13 Paul Eggert <eggert@cs.ucla.edu>
859
8ea47e3a
PE
860 Better workaround for GNOME bug when --enable-gcc-warnings.
861 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
862 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
863 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
864
4a4bbad2
PE
865 Simplify SIGIO usage (Bug#12408).
866 The code that dealt with SIGIO was crufty and confusing, e.g., it
867 played tricks like "#undef SIGIO" but these tricks were not used
868 consistently. Simplify mostly by not #undeffing standard symbols,
869 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
870 or not as we please) rather than "defined SIGIO" (standard symbol
871 that we probably shouldn't #undef).
872 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
873 Modules that need it can include it.
874 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
875 * dispextern.h (ignore_sigio): New decl.
876 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
877 unconditionally, since it's now a no-op if !USABLE_SIGIO.
878 * emacs.c (shut_down_emacs):
879 * keyboard.c (kbd_buffer_store_event_hold):
880 Use ignore_sigio rather than invoking 'signal' directly.
881 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
882 for FIONREAD.
883 (FIONREAD, SIGIO): Do not #undef.
884 (tty_read_avail_input): Use #error rather than a syntax error.
885 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
886 for I_PIPE, used by SETUP_SLAVE_PTY.
887 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
888 * sysdep.c (croak): Remove; no longer needed. This bit of
889 temporary code, with Fred N. Fish's comment that it's temporary,
890 has been in Emacs since at least 1992!
891 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
892 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
893 * syssignal.h (croak): Remove decl.
894 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
895 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
896 now that we're termios-only.
897 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
898 * term.c (dissociate_if_controlling_tty): Use #error rather than
899 a run-time error.
900
5f0cb45a
PE
901 Work around GCC and GNOME bugs when --enable-gcc-warnings.
902 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
903 to work around GNOME bug 683906.
904 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
905 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
906 This works around GCC bug 54561.
907
40bce90b
PE
9082012-09-12 Paul Eggert <eggert@cs.ucla.edu>
909
910 More fixes for 'volatile' and setjmp/longjmp.
911 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
912 * image.c (struct png_load_context) [HAVE_PNG]: New type.
913 (png_load_body) [HAVE_PNG]:
914 (jpeg_load_body) [HAVE_JPEG]:
915 New function, with most of the old parent function's body.
916 (png_load) [HAVE_PNG]:
917 (jpeg_load) [HAVE_JPEG]:
918 Invoke the new function, to avoid longjmp munging our locals.
919 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
920 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
921 longjmp is passed 2, as the C standard doesn't guarantee this.
922 Instead, store the failure code into mgr->failure_code.
923
bfeae2cf
SM
9242012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
925
926 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
927 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
928 (syms_of_keyboard): Remove support for unread-command-char.
929
8099e36b
EZ
9302012-09-12 Eli Zaretskii <eliz@gnu.org>
931
932 * w32proc.c (sys_kill): If PID is our process ID and the signal is
933 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
934 violation. (Bug#12426)
935
92547ff9
PE
9362012-09-12 Paul Eggert <eggert@cs.ucla.edu>
937
938 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
939
45b82ad0
SM
9402012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
941
942 * eval.c: Add `inhibit-debugger'.
943 (Qinhibit_debugger): New symbol.
944 (call_debugger): Bind it instead of Qdebug_on_error.
945 (maybe_call_debugger): Test Vinhibit_debugger.
946 (syms_of_eval): Define inhibit-debugger.
947 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
948 (syms_of_xdisp): Remove inhibit-debug-on-message.
949
5779a1dc
PE
9502012-09-11 Paul Eggert <eggert@cs.ucla.edu>
951
50f2e553
PE
952 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
953 If a nonvolatile local variable is written before a _longjmp to
954 the frame containing the variable, and is read after the _longjmp,
955 the value read is indeterminate. Some local variables of type
956 'struct handler' and 'struct catchtag' are used in this way, so
957 mark each of their slots as volatile if the slot can be set before
958 _longjmp and read afterwards.
959 * lisp.h (struct handler): var and chosen_clause are now volatile.
960 (struct catchtag): val, next, and pdlcount are now volatile.
961
ae1d87e2
PE
962 * bidi.c (bidi_push_it, bidi_pop_it):
963 * fns.c (copy_hash_table):
964 * image.c (define_image_type):
965 * keyboard.c (kbd_buffer_store_event_hold):
966 * process.c (Fprocess_send_eof):
967 * xfaces.c (x_create_gc) [HAVE_NS]:
968 * xgselect.c (xg_select):
969 Prefer assignment to memcpy when either will do.
970
5779a1dc
PE
971 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
972 Use pointer-to-a-pointer to simplify and avoid a NILP check each
973 time an item is removed. No need to mark this function 'inline';
974 the compiler knows better than we do.
975
c4c9756b
JD
9762012-09-11 Jan Djärv <jan.h.d@swipnet.se>
977
978 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
979 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
980 to change_frame_size (Bug#12388).
981 (windowDidResize:): Pass YES to updateFrameSize.
982
983 * nsterm.h: Add delay parameter to updateFrameSize.
984
d73e321c
DA
9852012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
986
987 Discard killed buffers from deleted window and frame objects.
988 This reduces an amount of references to killed buffers and
989 helps GC to reclaim them faster.
990 * alloc.c (discard_killed_buffers): New function.
991 (mark_object): Use it for deleted windows and frames.
992 (mark_object): If symbol's value is set up for a killed buffer
993 or deleted frame, restore it's global binding.
994 * data.c (swap_in_global_binding): Add GC notice.
995 (swap_in_symval_forwarding): Use convenient set_blv_where.
996 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
997 * window.h: ... to here.
998
e578f381
DA
9992012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1000
1001 Convenient macro to check whether the buffer is live.
1002 * buffer.h (BUFFER_LIVE_P): New macro.
1003 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1004 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1005
3057e615
YM
10062012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1007
1008 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1009 composition cases (Bug#12364).
1010
1011 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1012 overhang of succeeding glyphs overlapping box cursor.
1013
1014 * w32term.c (x_draw_glyph_string): Likewise.
1015
6fda35f2
PE
10162012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1017
c990426a
PE
1018 Simplify, document, and port floating-point (Bug#12381).
1019 The porting part of this patch fixes bugs on non-IEEE platforms
1020 with frexp, ldexp, logb.
1021 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1022 Now static.
1023 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1024 support, by removing commented-out code and briefly listing the
1025 C89 functions excluded. The commented-out stuff was confusing
1026 maintenance, e.g., we thought we needed cbrt but it was commented out.
1027 (logb): Remove decl; no longer needed.
1028 (isfinite): New macro, if not already supplied.
1029 (isnan): Don't replace any existing macro.
1030 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1031 are present on all C89 platforms.
1032 (Ffrexp): Do not special-case zero, as frexp does the right thing
1033 for that case.
1034 (Flogb): Do not use logb, as it doesn't have the desired meaning
1035 on hosts that use non-base-2 floating point. Instead, stick with
1036 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1037 frexp, to avoid getting an unspecified result.
1038
6fda35f2
PE
1039 * xdisp.c (Qinhibit_debug_on_message): Now static.
1040
16130a58
JD
10412012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1042
1043 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1044 NSBezierPath (Bug#12131).
1045
d105a573
CY
10462012-09-10 Chong Yidong <cyd@gnu.org>
1047
1048 * fns.c (Fdelq, Fdelete): Doc fix.
1049
ff55dfe8
PE
10502012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1051
1052 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1053 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1054
e7032e7c
SM
10552012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1056
1057 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1058 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1059 Use it.
1060
e9957956
EZ
10612012-09-09 Eli Zaretskii <eliz@gnu.org>
1062
aba05ce9
EZ
1063 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1064 left fringe if the window has a left margin. This avoids leaving
1065 traces of the cursor because its leftmost pixel is not drawn over.
1066
e9957956
EZ
1067 * dispnew.c (update_window_line): When the left margin area of a
1068 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1069 that screen line. (Bug#12277)
1070
f6196b87
PE
10712012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1072
1073 Assume C89 or later for math functions (Bug#12381).
1074 This simplifies the code, and makes it a bit smaller and faster,
1075 and (most important) makes it easier to clean up signal handling
1076 since we can stop worring about floating-point exceptions in
1077 library code. That was a problem before C89, but the problem
1078 went away many years ago on all practical Emacs targets.
1079 * data.c, image.c, lread.c, print.c:
1080 Don't include <math.h>; no longer needed.
1081 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1082 might be autoconfigured, as that never happens.
1083 * data.c (fmod):
1084 * doprnt.c (DBL_MAX_10_EXP):
1085 * print.c (DBL_DIG):
1086 Remove. C89 or later always defines these.
1087 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1088 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1089 (arith_error, domain_error, domain_error2):
1090 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1091 no longer needed -- we simply return what C returns. All uses removed.
1092 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1093 the wrapped code.
1094 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1095 Remove. All uses expanded, as these macros are no longer used
1096 more than once and are now more trouble than they're worth.
1097 (Ftan): Use tan, not sin / cos.
1098 (Flogb): Assume C89 frexp.
1099 (fmod_float): Assume C89 fmod.
1100 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1101 (init_floatfns): Remove. All uses removed.
1102
9d7f1863
JD
11032012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1104
1105 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1106 compositeToPoint for OSX < 10.6 (Bug#12390).
1107
eabf0404
PE
11082012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1109
1110 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1111 This produces more-accurate results.
1112
0b3b1d23
JD
11132012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1114
1115 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1116 changes (Bug#12088).
1117
6dcef6ec
CY
11182012-09-08 Chong Yidong <cyd@gnu.org>
1119
1120 * syntax.c (Fstring_to_syntax): Doc fix.
1121
aa7d57c5
JD
11222012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1123
1124 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1125 in the internal border.
1126 (x_set_window_size): Remove static variables and their usage.
1127 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
1128 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1129 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
1130 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1131 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1132 (ns_fix_rect_ibw): Remove.
1133 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1134 (ns_dumpglyphs_box_or_relief): Ditto.
1135 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1136 adjustment.
1137 (ns_dumpglyphs_image): Ditto.
fc0c31f8 1138 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
1139 border adjustment.
1140 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1141 their usage. Add fringe_extended_p and its use as in other terms.
1142 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1143 scroll bar was removed.
1144 (updateFrameSize): New function.
1145 (windowDidResize): Move code to updateFrameSize and call it.
1146
1147 * nsterm.h (EmacsView): Add updateFrameSize.
1148
1a5432bc
CY
11492012-09-07 Chong Yidong <cyd@gnu.org>
1150
b4f5313e
CY
1151 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1152
1a5432bc
CY
1153 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1154
1a4f1e9b
PE
11552012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1156
1157 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
1158 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1159 Problem introduced when merging patches. Noted by Eli Zaretskii in
1160 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
1161 * floatfns.c: Comment fix.
1162 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1163 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1164 and anyway the declaration is harmless even if SIGDANGER is not defined.
1165 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1166 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1167 source files not surprisingly expected syssignal.h to define, or
1168 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1169 Include <sys/ioctl.h>, for FIONREAD.
1170 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1171 This eliminates a problem whereby other files mysteriously had
1172 to include "syssignal.h" before including "systty.h" if they
1173 wanted to use "#ifdef SIGIO".
1174
bc8000ff
EZ
11752012-09-07 Eli Zaretskii <eliz@gnu.org>
1176
3e6d6928
EZ
1177 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1178
1179 * w32.c (sigemptyset): Empty the set.
1180 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1181
bc8000ff
EZ
1182 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1183
b4fa72f2
DA
11842012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1185
1186 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1187 (mark_object): Likewise for frame objects.
1188
30730c93
PE
11892012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1190
1191 * syssignal.h (handle_on_main_thread): Always declare,
1192 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1193 This ports to platforms without HAVE_PTHREAD.
1194
2fe28299
PE
11952012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1196
1197 Signal-handler cleanup (Bug#12327).
1198 Emacs's signal handlers were written in the old 4.2BSD style with
1199 sigblock and sigmask and so forth, and this led to some
1200 inefficiencies and confusion. Rewrite these to use
1201 pthread_sigmask etc. without copying signal sets around. Also,
1202 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1203 'signal', and instead use functions that do not attempt to take
1204 over the system name space. This patch causes Emacs's text
1205 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1206 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1207 Do not include <signal.h> or "syssignal.h", as these
1208 modules do not use signals.
1209 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1210 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1211 Do not include <signal.h>, as "syssignal.h" does that for us now.
1212 * atimer.c (sigmask_atimers): New function.
1213 (block_atimers, unblock_atimers): New functions,
1214 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1215 All uses replaced.
1216 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1217 no longer needed here.
1218 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 1219 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
1220 * sysdep.c (struct save_signal): New member 'action', replacing
1221 old member 'handler'.
1222 (save_signal_handlers, restore_signal_handlers):
1223 Use sigaction instead of 'signal' to save and restore.
1224 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1225 New function. All users of 'signal' modified to use set_sighandler
1226 if they're writeonly, and to use sys_signal if they're read+write.
1227 (emacs_sigaction_init, forwarded_signal): New functions.
1228 (sys_signal): Remove. All uses replaced by calls to sigaction
1229 and emacs_sigaction_init, or by direct calls to 'signal'.
1230 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1231 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1232 all uses replaced by pthread_sigmask etc. calls.
1233 * syssignal.h: Include <signal.h>.
1234 (emacs_sigaction_init, forwarded_signal): New decls.
1235 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1236 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1237 (sigmask, sys_sigmask): Remove; no longer needed.
1238 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1239 (sigblock, sigunblock, sigfree):
1240 (sigsetmask) [!defined sigsetmask]:
1241 Remove. All uses replaced by pthread_sigmask.
1242 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1243 no longer need to be replaced, and its typical old uses
1244 are now done via emacs_sigaction_init and sigaction.
1245 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1246 (sys_sigdel): Remove; unused.
1247 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1248
0216c128
EZ
12492012-09-06 Eli Zaretskii <eliz@gnu.org>
1250
1251 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1252 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1253
c752cfa9
DA
12542012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1255
1256 Explicitly mark buffer_defaults and buffer_local_symbols.
1257 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1258 mark_local_symbols here.
1259 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1260 since special buffers aren't marked here any more.
1261 (allocate_buffer): Chain new buffer with all_buffers here...
1262 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1263 not here.
1264 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1265 (syms_of_buffer): Remove staticpro of the above.
1266 (init_buffer_once): Set names for buffer_defaults and
1267 buffer_local_symbols.
1268
a864ef14
PE
12692012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1270
1271 Use bool for booleans in font-related modules.
1272 * font.c (font_intern_prop, font_style_to_value)
1273 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1274 (generate_otf_features, font_check_otf_features, font_check_otf)
1275 (font_match_p, font_list_entities, font_at):
1276 * fontset.c (fontset_id_valid_p, reorder_font_vector
1277 (fontset_find_font, Fset_fontset_font)
1278 (face_suitable_for_char_p) [0]:
1279 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1280 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1281 (m17n_flt_initialized, ftfont_shape_by_flt):
1282 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1283 * nsfont.m (nsfont_draw):
1284 * w32font.c (w32font_draw):
1285 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1286 Use bool for booleans.
1287 * font.h: Adjust to above API changes.
1288 (struct font, struct font_driver, struct font_driver_list):
1289 Use bool for booleans.
1290 (struct font): Remove useless member encoding_type.
1291 All users removed.
1292 * fontset.c, xftfont.c: Omit unnecessary static decls.
1293
0699fc18
DA
12942012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1295
1296 * alloc.c (mark_object): Revert window marking code
1297 since it's unsafe for the Fset_window_configuration.
1298
20ef56db
PE
12992012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1300
2fe28299 1301 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
1302 Be more systematic about preserving errno whenever a signal
1303 handler returns, even if it's not in the main thread. Do this by
1304 renaming signal handlers to distinguish between signal delivery
1305 and signal handling. All uses changed.
1306 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1307 * data.c (deliver_arith_signal): Rename from arith_error.
1308 * dispnew.c (deliver_window_change_signal): Rename from
1309 window_change_signal.
1310 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1311 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1312 * keyboard.c (deliver_input_available_signal): Rename from
1313 input_available_signal.
1314 (deliver_user_signal): Rename from handle_user_signal.
1315 (deliver_interrupt_signal): Rename from interrupt_signal.
1316 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1317 (deliver_child_signal): Rename from sigchld_handler.
1318 * atimer.c (handle_alarm_signal):
1319 * data.c (handle_arith_signal):
1320 * dispnew.c (handle_window_change_signal):
1321 * emacs.c (handle_fatal_signal, handle_danger_signal):
1322 * keyboard.c (handle_input_available_signal):
1323 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1324 * process.c (handle_pipe_signal, handle_child_signal):
1325 New functions, with the actual signal-handling code taken from the
1326 original respective signal handlers, sans the sporadic attempts to
1327 preserve errno, since that's now done by handle_on_main_thread.
1328 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1329 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1330 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1331 Move to sysdep.c.
1332 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1333 Move initialization of main_thread to sysdep.c's init_signals.
1334 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1335 our usage, and simplifies the mainline code.
1336 (record_child_status_change): New static function, as a helper
1337 for handle_child_signal, and with most of the old child handler's
1338 contents.
1339 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1340 (handle_child_signal): Use the above.
1341 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1342 Moved here from emacs.c.
1343 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1344 code moved here from emacs.c's main function.
1345 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
1346 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1347 This lets callers save and restore errno properly.
20ef56db 1348
e3ccf108
DA
13492012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1350
1351 Remove redundant or unused things here and there.
1352 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1353 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1354 * editfns.c (Fcompare_buffer_substrings): Likewise.
1355 * frame.h (struct terminal, struct font_driver_list):
1356 Remove redundant declarations.
1357 * window.h (Qleft, Qright): Likewise.
1358
697e1e39
DA
13592012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1360
1361 Do not mark objects from deleted buffers, windows and frames.
1362 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1363 (mark_object): Likewise for windows and frames.
1364
c1ca42ca
DA
13652012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1366
1367 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1368 buffer_defaults and buffer_local_symbols as valid objects.
1369 Return special value to denote them.
1370
014d93be
PE
13712012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1372
f75d7a91
PE
1373 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1374 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1375 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1376 (file_name_absolute_p, Fsubstitute_in_file_name):
1377 (check_executable, check_writable, Ffile_accessible_directory_p)
1378 (Fset_file_selinux_context, Fdefault_file_modes)
1379 (Finsert_file_contents, choose_write_coding_system)
1380 (Fwrite_region, build_annotations, a_write, e_write)
1381 (Fdo_auto_save):
1382 * filelock.c (boot_time_initialized, get_boot_time)
1383 (get_boot_time_1, lock_file_1, within_one_second):
1384 * floatfns.c (in_float):
1385 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1386 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1387 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1388 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1389 * window.c (compare_window_configurations):
1390 Use bool for booleans.
1391 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1392 (Fdefault_file_modes): Now mode_t, not int, for modes.
1393 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1394 (internal_delete_file): Now returns void, not a (boolean) int,
1395 since nobody was looking at the return value.
1396 * lisp.h, window.h: Adjust to above API changes.
1397
014d93be
PE
1398 * xdisp.c (set_message): Simplify and reindent last change.
1399
776f29e1
JB
14002012-09-05 Juanma Barranquero <lekktu@gmail.com>
1401
1402 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1403
7f7e0167
LI
14042012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1405
1406 * eval.c (call_debugger): Make the function non-static so that we
1407 can call it from set_message.
1408
1409 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1410 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1411
cf29dd84
PE
14122012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1413
1414 Give more-useful info on a fatal error (Bug#12328).
1415 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1416 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1417 of doing the work ourselves.
1418 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1419 do most of the work.
1420 (fatal_error_backtrace): New function, taken from the guts
1421 of the old fatal_error_signal, but with a new option to output
1422 a backtrace.
1423 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1424 info about the signal than just its number.
1425 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1426 * sysdep.c: Include <execinfo.h>
1427 (emacs_backtrace): New function, taken partly from the previous
1428 code of the 'die' function.
1429 (emacs_abort): Call fatal_error_backtrace rather than abort.
1430
972debf2
SM
14312012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1432
1433 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1434 eager (load-time) macro-expansion.
1435 * lisp.mk (lisp): Add macroexp.
1436
1088b922
PE
14372012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1438
1439 Simplify redefinition of 'abort' (Bug#12316).
1440 Do not try to redefine the 'abort' function. Instead, redo
1441 the code so that it calls 'emacs_abort' rather than 'abort'.
1442 This removes the need for the NO_ABORT configure-time macro
1443 and makes it easier to change the abort code to do a backtrace.
1444 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1445 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1446 Remove; sysdep.c's emacs_abort now takes its place.
1447 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1448 'abort' changed to use 'emacs_abort'.
1449 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1450 (abort) [!defined abort]: Rename to ...
1451 (emacs_abort): ... new name.
1452 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1453 the place of the old 'abort' in emacs.c.
1454 * w32.c, w32fns.c (abort): Do not #undef.
1455 * w32.c (emacs_abort): Rename from w32_abort.
1456
30934d33
EZ
14572012-09-04 Eli Zaretskii <eliz@gnu.org>
1458
1459 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1460 offsets[j].dv, since the y axis of the screen coordinates points
1461 down, while the y axis of the font definition coordinates points
1462 up. This fixes display of Arabic diacritics such as KASRA and
1463 KASRATAN. (Bug#11860)
1464
af26b72c
PE
14652012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1466
1467 Be more systematic about _setjmp vs setjmp.
1468 * alloc.c (test_setjmp, mark_stack):
1469 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1470 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1471 (png_load, my_error_exit, jpeg_load):
1472 * process.c (send_process_trap, send_process):
1473 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1474 The underscored versions are up to 30x faster on some hosts.
1475 Formerly, the code used setjmp+longjmp sometimes and
1476 _setjmp+_longjmp at other times, with no particular reason to
1477 prefer setjmp+longjmp.
1478
26d4541d
PE
14792012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1480
d42f4f0f 1481 Fix minor problem found by static checking.
26d4541d 1482 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 1483
c5e28e39
MR
14842012-09-03 Martin Rudalics <rudalics@gmx.at>
1485
1486 * buffer.c (Fdelete_all_overlays): New function.
1487
3eab3ca9
CY
14882012-09-03 Chong Yidong <cyd@gnu.org>
1489
1490 * gtkutil.c: Add extern decl for Qxft.
1491
c04889f8
PE
14922012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1493
1882aa38
PE
1494 * emacs.c, eval.c: Use bool for boolean.
1495 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1496 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1497 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1498 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1499 (main, decode_env_path, Fdaemon_initialized):
1500 * eval.c (call_debugger, Finteractive_p, interactive_p):
1501 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1502 (maybe_call_debugger, Fbacktrace):
1503 * process.c (read_process_output, exec_sentinel):
1504 Use bool for booleans.
1505 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1506 All callers changed.
1507 * eval.c (interactive_p): Omit always-true boolean argument
1508 EXCLUDE_SUBRS_P. All callers changed.
1509 * dispextern.h, lisp.h: Reflect above API changes.
1510 * firstfile.c (dummy): Use the address of 'main', whose signature
1511 won't change, instead of the address of 'initialize', whose
1512 signature just changed from int to bool.
1513 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1514 * msdos.c (fatal_error_in_progress): ... from here.
1515 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1516 of incrementing it.
1517 (redisplay_internal, unwind_redisplay): Simply clear
1518 REDISPLAYING_P when unwinding, instead of saving its previous,
1519 always-false value and then restoring it.
1520
a411ac43
PE
1521 Clean up some extern decls.
1522 Mostly, this hoists extern decls out of .c files and into .h files.
1523 That way, we're more likely to catch errors if the interfaces change.
1524 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1525 declare xg_mark_data.
1526 * dispextern.h (x_frame_parm_handlers):
1527 * font.h (Qxft):
1528 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1529 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1530 (Qultra_bold, Qoblique, Qitalic):
1531 Move extern decl here from .c file.
1532 * alloc.c (xg_mark_data) [USE_GTK]:
1533 * doc.c (Qclosure):
1534 * eval.c (Qlexical_binding):
1535 * fns.c (time) [!HAVE_UNISTD_H]:
1536 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1537 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1538 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1539 * lread.c (Qinternal_interpreter_environment):
1540 * minibuf.c (Qbuffer):
1541 * process.c (QCfamily, QCfilter):
1542 * widget.c (free_frame_faces):
1543 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1544 * xfont.c (x_clear_errors):
1545 * xterm.c (x_frame_parm_handlers):
1546 Remove now-redundant extern decls.
1547 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1548 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1549 Now static.
1550 * xfaces.c: Remove unnecessary static decls.
1551 * xterm.c (updating_frame): Remove decl of nonexistent object.
1552
c04889f8
PE
1553 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1554 when building globals.h, as the objects that are not built on
1555 this host are not needed to compile C files on this host.
1556
8b339673
JD
15572012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1558
1559 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1560
1561 * frame.h: Add missing prototype for x_wm_set_size_hint.
1562
a08d4ba7
PE
15632012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1564
1565 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1566 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1567 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1568 (Fsubstitute_command_keys):
1569 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1570 (save_excursion_save, save_excursion_restore)
1571 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1572 (format_time_string, general_insert_function)
1573 (make_buffer_string, make_buffer_string_both)
1574 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1575 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1576 (copy_text, insert_1, insert_1_both, insert_from_string)
1577 (insert_from_string_before_markers, insert_from_string_1)
1578 (insert_from_buffer, insert_from_buffer_1, replace_range)
1579 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1580 (del_range_2, modify_region):
1581 * intervals.c (intervals_equal, balance_possible_root_interval)
1582 (adjust_intervals_for_insertion, merge_properties_sticky)
1583 (graft_intervals_into_buffer, lookup_char_property)
1584 (adjust_for_invis_intang, set_point_both)
1585 (get_property_and_range, compare_string_intervals)
1586 (set_intervals_multibyte_1, set_intervals_multibyte):
1587 * keyboard.c (decode_timer):
1588 Use bool for boolean.
1589 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1590 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1591
48c948de
CY
15922012-09-02 Chong Yidong <cyd@gnu.org>
1593
1594 * keymap.c (push_key_description): Print M-TAB as C-M-i
1595 (Bug#11758).
1596
6c49a40b
JB
15972012-09-02 Juanma Barranquero <lekktu@gmail.com>
1598
1599 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1600 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1601 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1602 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1603 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1604 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1605 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1606
4dfbd238
EZ
16072012-09-01 Eli Zaretskii <eliz@gnu.org>
1608
7e510e28
EZ
1609 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1610 more than one grapheme cluster passed to the shaper: compute the
1611 offset adjustment values separately for each cluster. (Bug#11860)
1612
4dfbd238
EZ
1613 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1614 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1615 about implicit conversions from integer to pointer.
1616
86571ae0
DC
16172012-09-01 Daniel Colascione <dancol@dancol.org>
1618
1619 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1620 system used too early.
1621
0e23ef9d
PE
16222012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1623
1624 Better seed support for (random).
1625 * emacs.c (main): Call init_random.
1626 * fns.c (Frandom): Set the seed from a string argument, if given.
1627 Remove long-obsolete Gentzel cruft.
1628 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1629 (init_random): New function.
1630
17a2cbbd
DC
16312012-09-01 Daniel Colascione <dancol@dancol.org>
1632
1633 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1634 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1635 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1636 x_wm_set_size_hint, x_query_colors, x_real_positions,
1637 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1638 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1639 all of which have been moved to common code.
1640
1641 * xfaces.c: Include TERM_HEADER instead of listing all possible
1642 window-system headers.
1643
1644 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1645 to match header.
1646
1647 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1648 directly accessing frame internals.
1649
f18cbb28 1650 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
1651 globals_of_w32font.
1652
1653 * process.c: Include TERM_HEADER instead of listing all possible
1654 window-system headers.
1655
3a880af4
SM
1656 * nsterm.h: Remove declarations now in frame.h.
1657 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
1658
1659 * menu.c: Include TERM_HEADER instead of listing all possible
1660 window-system headers.
1661
1662 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1663 window system.
1664
1665 * keyboard.c: Include TERM_HEADER instead of listing all possible
1666 window-system headers.
1667
1668 * image.c: Include TERM_HEADER instead of listing all possible
1669 window-system headers. Declare Vlibrary_cache when compiling for
1670 Windows.
1671
1672 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1673 window system declarations.
1674
1675 * frame.h: Move common functions here: set_frame_menubar,
1676 x_set_window_size, x_sync, x_get_focus_frame,
1677 x_set_mouse_position, x_set_mouse_pixel_position,
1678 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1679 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1680 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1681 x_activate_menubar, x_real_positions, x_bitmap_icon,
1682 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1683 and x_query_colors.
1684
1685 * frame.c: Include TERM_HEADER instead of listing all possible
1686 window-system headers.
1687
1688 * font.c: Include TERM_HEADER instead of listing all possible
1689 window-system headers.
1690
1691 * emacs.c: Include TERM_HEADER.
1692
f18cbb28
EZ
1693 * dispnew.c: Include TERM_HEADER instead of listing all possible
1694 window-system headers.
17a2cbbd 1695
f18cbb28 1696 * ccl.h: Include character.h.
17a2cbbd
DC
1697
1698 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1699 the current window system; include in list of objects to link into
1700 Emacs.
1701
c650a5de
DA
17022012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1703
1704 Remove mark_ttys function and fix tty_display_info initialization.
1705 * lisp.h (mark_ttys): Remove prototype.
1706 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1707 to mark_ttys because all possible values of 'top_frame' slot are
1708 the frames which are reachable from Vframe_list.
1709 * term.c (mark_ttys): Remove.
1710 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1711
4e0f6479
DA
17122012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1713
1714 Change struct frame bitfields from unsigned char to unsigned.
1715 * frame.h (struct frame): Change type of 'display_preempted',
1716 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1717 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1718 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1719 bitfields from unsigned char to unsigned.
1720
8b96a52c
DA
17212012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1722
1723 Remove unused member of struct x_output and struct w32_output.
1724 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1725 * w32term.h (struct w32_output): Likewise.
1726
b4444c8a
JD
17272012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1728
1729 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1730 does not become zero (Bug#12234).
1731
b98521db
PE
17322012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1733
1734 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1735 for GCC 4.7.1 x86-64.
1736
31d02438
GM
17372012-08-30 Glenn Morris <rgm@gnu.org>
1738
1739 * lread.c (init_lread): For out-of-tree builds, only add the
1740 source directory's site-lisp dir to the load-path if it exists,
1741 consistent with in-tree builds. (Bug#12302)
1742
7f8941d8
JD
17432012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1744
1745 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 1746 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
1747 (windowShouldClose:): Set window_closed.
1748 (dealloc): New member, free button_values.
fc0c31f8
JB
1749 (process_dialog:): Make member function. Remove window argument,
1750 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
1751 in button_values.
1752 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 1753 with tag. Remove return self, declare return value as void.
7f8941d8
JD
1754 (addString:row:): Remove return self, declare return value as void.
1755 (addSplit): Remove return self, declare return value as void.
1756 (clicked:): Remove return self, declare return value as void.
fc0c31f8 1757 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
1758 (initFromContents:isQuestion:): Adjust call to process_dialog.
1759 Code formatting change.
1760 (timeout_handler:): Set timer_fired to YES.
1761 (runDialogAt:): Set timer_fired to NO.
1762 Handle click on close button as quit.
1763
1764 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1765 Add window_closed and button_values. Add void as return value for
1766 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1767 Add process_dialog as new member.
1768
eada0861 17692012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 1770
eada0861
GM
1771 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1772 is not one of the heaps we manage. (Bug#12242)
1773
17742012-08-28 Glenn Morris <rgm@gnu.org>
1775
1776 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1777
457294dd
MR
17782012-08-28 Martin Rudalics <rudalics@gmx.at>
1779
1780 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
1781 auto-buffer-name window parameter. Install revision of reverted
1782 fix.
457294dd 1783
4f2daf31
DA
17842012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1785
1786 Do not allow to set major mode for a dead buffer.
1787 * buffer.c (Fset_buffer_major_mode): Signal an error
1788 if the buffer is dead.
1789 (Fother_buffer, other_buffer_safely): Remove redundant
1790 nested declaration.
1791
66322887
DA
17922012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1793
1794 Always use set_buffer_if_live to restore original buffer at unwind.
1795 * buffer.h (record_unwind_current_buffer): New function.
1796 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1797 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1798 * undo.c, window.c: Adjust users.
1799 * buffer.c (set_buffer_if_live): Fix comment.
1800
a3d794a1
DA
18012012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1802
1803 Fix usage of set_buffer_internal.
1804 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1805 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1806 * coding.c (decode_coding): Omit redundant test.
1807 * fileio.c (decide_coding_unwind): Likewise.
1808 * fns.c (secure_hash): Likewise.
1809 * insdel.c (modify_region): Likewise.
1810 * keyboard.c (command_loop_1): Likewise.
1811 * print.c (PRINTFINISH): Likewise.
1812 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1813
59ea14cd
PE
18142012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1815
1816 * dispnew.c: Use bool for boolean.
1817 (frame_garbaged, display_completed, delayed_size_change)
1818 (fonts_changed_p, add_window_display_history)
1819 (add_frame_display_history, verify_row_hash)
1820 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1821 (row_equal_p, realloc_glyph_pool)
1822 (allocate_matrices_for_frame_redisplay)
1823 (showing_window_margins_p)
1824 (adjust_frame_glyphs_for_frame_redisplay)
1825 (build_frame_matrix_from_leaf_window, make_current)
1826 (mirrored_line_dance, mirror_line_dance, update_frame)
1827 (update_window_tree, update_single_window)
1828 (check_current_matrix_flags, update_window, update_text_area)
1829 (update_window_line, set_window_update_flags, scrolling_window)
1830 (update_frame_1, scrolling, buffer_posn_from_coords)
1831 (do_pending_window_change, change_frame_size)
1832 (change_frame_size_1, sit_for):
1833 Use bool for boolean.
1834 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1835 and remove last int (actually boolean) argument, which was always 0.
1836 All callers changed.
1837 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1838 * dispextern.h (struct composition_it): Use bool for boolean.
1839 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1840 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1841 * dired.c (file_name_completion):
1842 Use bool for boolean. (This was missed in an earlier change.)
1843
95072a94
MR
18442012-08-27 Martin Rudalics <rudalics@gmx.at>
1845
1846 * window.c (Fset_window_configuration): Revert first part of
1847 last change.
1848
0f19feff
JD
18492012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1850
1851 * nsterm.h (NSPanel): New class variable dialog_return.
1852
3a880af4
SM
1853 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
1854 Initialize dialog_return.
0f19feff
JD
1855 (windowShouldClose:): Use stop instead of stopModalWithCode.
1856 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1857 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1858 event.
1859 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1860 modal loop returns.
1861
f10fe38f
PE
18622012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1863
de1339b0
PE
1864 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1865 * composite.c (find_composition, composition_gstring_p)
1866 (composition_reseat_it, find_automatic_composition):
1867 * data.c (let_shadows_buffer_binding_p)
1868 (let_shadows_global_binding_p, set_internal, make_blv)
1869 (Fmake_variable_buffer_local, Fmake_local_variable)
1870 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1871 (cons_to_signed, arith_driver):
1872 * dbusbind.c (xd_in_read_queued_messages):
1873 * dired.c (directory_files_internal, file_name_completion):
1874 Use bool for booleans.
1875 * dired.c (file_name_completion):
1876 * process.h (fd_callback):
1877 Omit int (actually boolean) argument. It wasn't being used.
1878 All uses changed.
1879 * composite.h, lisp.h: Reflect above API changes.
1880
f10fe38f
PE
1881 * cmds.c, coding.c: Use bool for booleans.
1882 * cmds.c (move_point, Fself_insert_command):
1883 * coding.h (struct composition status, struct coding_system):
1884 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1885 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1886 (emacs_mule_char, decode_coding_emacs_mule)
1887 (encode_coding_emacs_mule, detect_coding_iso_2022)
1888 (decode_coding_iso_2022, encode_invocation_designation)
1889 (encode_designation_at_bol, encode_coding_iso_2022)
1890 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1891 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1892 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1893 (encode_coding_raw_text, detect_coding_charset)
1894 (decode_coding_charset, encode_coding_charset, detect_eol)
1895 (detect_coding, get_translation_table, produce_chars)
1896 (consume_chars, reused_workbuf_in_use)
1897 (make_conversion_work_buffer, code_conversion_save)
1898 (decode_coding_object, encode_coding_object)
1899 (detect_coding_system, char_encodable_p)
1900 (Funencodable_char_position, code_convert_region)
1901 (code_convert_string, code_convert_string_norecord)
1902 (Fset_coding_system_priority):
1903 * fileio.c (Finsert_file_contents):
1904 Use bool for booleans.
1905 * coding.h, lisp.h: Reflect above API changes.
1906 * coding.c: Remove unnecessary static function decls.
1907 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1908 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1909 not a boolean 'int', since callers never look at the return value.
1910 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1911 * coding.h (decoding_buffer_size, encoding_buffer_size)
1912 (emacs_mule_string_char): Remove unused extern decls.
1913 (struct iso_2022_spec, struct coding_system):
1914 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1915 (struct emacs_mule_spec): Remove unused field 'full_support'.
1916 All initializations removed.
1917 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1918
5474c384
DA
19192012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1920
f10fe38f 1921 Fix spare memory change (Bug#12286).
5474c384
DA
1922 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1923 (valid_lisp_object_p): Likewise.
1924
c4b6914d
MR
19252012-08-27 Martin Rudalics <rudalics@gmx.at>
1926
1927 * window.c (Fset_window_configuration): Record any window's old
1928 buffer if it's replaced (see Bug#8789). If the new current
1929 buffer doesn't appear in the selected window, go to its old
1930 point (Bug#12208).
1931
35aaa1ea
DA
19322012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1933
1934 Special MEM_TYPE_SPARE to denote reserved memory.
1935 * alloc.c (enum mem_type): New memory type.
1936 (refill_memory_reserve): Use new type for spare memory.
1937 This prevents live_cons_p and live_string_p from incorrect
1938 detection of uninitialized objects from spare memory as live.
1939
6af64513
PE
19402012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1941
8b2e00a3
PE
1942 Spelling fixes.
1943 * Makefile.in (.PHONY): versioclean -> versionclean.
1944
b52d6985
PE
1945 Remove unused external symbols.
1946 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1947 * window.c (Qwindow_valid_p, decode_valid_window):
1948 Now static, not extern.
1949 * data.c (Qinterval): Remove; unused.
1950 (syms_of_data): Do not define 'interval'.
1951 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1952 * window.h (decode_valid_window):
1953 Remove decls.
1954
d5172d4f
PE
1955 * character.c, charset.c, chartab.c: Use bool for booleans.
1956 * character.c (lisp_string_width, string_count_byte8)
1957 (string_escape_byte8):
1958 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1959 (load_charset_map_from_file, map_charset_chars)
1960 (Fdefine_charset_internal, define_charset_internal)
1961 (Fdeclare_equiv_charset, find_charsets_in_text)
1962 (Ffind_charset_region, char_charset, Fiso_charset):
1963 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1964 (sub_char_table_set, sub_char_table_set_range)
1965 (char_table_set_range, optimize_sub_char_table)
1966 (map_sub_char_table):
1967 Use bool for boolean.
1968 * character.c (str_to_unibyte): Omit last boolean argument; it was
1969 always 0. All callers changed.
1970 * character.h, charset.h: Adjust to match previous changes.
1971 * character.h (char_printable_p): Remove decl of nonexistent function.
1972 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1973 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1974 are all boolean, so make them single-bit bitfields.
1975
6af64513
PE
1976 * lisp.h (ASET): Remove attempt to detect side effects.
1977 It was meant to be temporary and it often doesn't work,
1978 because when IDX has side effects the behavior of IDX==IDX
1979 is undefined. See Stefan Monnier in
1980 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1981
e1f29348
BR
19822012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1983
1984 * lisp.h (functionp): New function (extracted from Ffunctionp).
1985 (FUNCTIONP): Use it.
1986 * eval.c (Ffunctionp): Use it.
1987
17c05d74
PE
19882012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1989
0f46bc75
PE
1990 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1991 as that's faster and simpler than static storage. Don't bother
1992 with the g_main_context_query overhead if g_main_context_pending
1993 says no events are pending.
1994 (gfds, gfds_size): Remove these static vars.
1995 (xgselect_initialize): Remove; no longer needed.
1996 All uses and decls removed.
1997
ee4c0f69
PE
1998 * emacs.c (fatal_error_signal_hook): Remove.
1999 All uses removed. This leftover from old code was always 0.
2000
17c05d74
PE
2001 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2002 * casefiddle.c (casify_object, casify_region):
2003 * casetab.c (set_case_table):
2004 * category.c, category.h (word_boundary_p):
2005 * category.h (CHAR_HAS_CATEGORY):
2006 Use bool for booleans, instead of int.
2007
391ceac5
EZ
20082012-08-25 Eli Zaretskii <eliz@gnu.org>
2009
2010 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2011
2f221583
PE
20122012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2013
f4a681b0
PE
2014 On assertion failure, print backtrace if available.
2015 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2016 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2017 * Makefile.in (LIB_EXECINFO): New macro.
2018 (LIBES): Use it.
2019
2f221583
PE
2020 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2021 * bytecode.c (exec_byte_code):
2022 * callint.c (check_mark, Fcall_interactively):
2023 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2024 (getenv_internal, sync_process_alive, call_process_exited):
2025 * lisp.h (USE_SAFE_ALLOCA):
2026 Use bool for booleans, instead of int.
2027 * lisp.h, process.h: Adjust prototypes to match above changes.
2028 * callint.c (Fcall_interactively): Don't assume the mark's
2029 offset fits in 'int'.
2030
37ef52bb
PE
20312012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2032
2033 * buffer.c, buffer.h: Use bool for boolean.
2034 * buffer.c (reset_buffer_local_variables)
2035 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2036 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2037 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2038 (overlay_touches_p, overlay_strings, Foverlay_put)
2039 (report_overlay_modification, call_overlay_mod_hooks):
2040 (mmap_enlarge, mmap_set_vars):
2041 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2042 Use bool for booleans, instead of int.
2043 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2044 since the 1-or-0 return value is always ignored anyway.
2045 (mmap_initialized_p):
2046 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2047 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2048
2cc21167
PE
20492012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2050
2051 * bidi.c: Use bool for boolean.
2052 This is a bit more readable, and makes the text segment of bidi.o
2053 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2054 Presumably it's faster too.
2055 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2056 Now bool.
2057 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2058 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2059 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2060 (bidi_explicit_dir_char, bidi_level_of_next_char)
2061 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2062 Use bool for booleans, instead of int.
2063 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2064 (bidi_unshelve_cache): Adjust decls to match code.
2065
7db4ddf4
MR
20662012-08-23 Martin Rudalics <rudalics@gmx.at>
2067
2068 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2069 argument.
2070
b1bb8011
PE
20712012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2072
2073 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2074 * atimer.h: Include <stdbool.h>.
2075
ff687885
DN
20762012-08-22 Dan Nicolaescu <dann@gnu.org>
2077
2078 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2079 compile time tests instead of run time tests on systems that do
2080 not use them.
2081 (FRAME_MAC_P): Remove leftover from deleted code.
2082 * frame.c (syms_of_frame): Remove leftover from deleted code.
2083
4ce7a138
JD
20842012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2085
2086 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2087
d733ec6d
PE
20882012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2089
2090 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2091 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 2092 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
2093 (fontset_add): Return void, for FONTSET_ADD.
2094
d0d2d26f
PE
20952012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2096
fce31d69
PE
2097 * alloc.c: Use bool for booleans.
2098 (gc_in_progress, abort_on_gc)
2099 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2100 (dont_register_blocks) [GC_MALLOC_CHECK]:
2101 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2102 (check_string_bytes, make_specified_string, memory_full)
2103 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2104 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2105 (mark_stack, valid_pointer_p, make_pure_string)
2106 (Fgarbage_collect, survives_gc_p, gc_sweep):
2107 Use bool for booleans, instead of int.
2108 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2109 Remove unused local.
2110 * alloc.c (PURE_POINTER_P):
2111 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2112 * editfns.c (Fformat):
2113 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2114 (Fdo_auto_save):
2115 * fns.c (sweep_weak_table):
2116 * lisp.h (suppress_checking, push_message, survives_gc_p)
2117 (make_pure_string, gc_in_progress, abort_on_gc):
2118 * lread.c (readchar, read1):
2119 * print.c (Fprin1_to_string):
2120 * xdisp.c (push_message):
2121 Use bool for booleans affected directly or indirectly by
2122 alloc.c's changes.
2123
d0d2d26f
PE
2124 Make recently-introduced setters macros.
2125 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2126 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2127 (set_fontset_default, set_fontset_fallback): Rename from their
2128 upper-case counterparts, and make them functions rather than macros.
2129 This is more consistent with the other recently-introduced setters.
2130 These don't need to be inline, since they're local.
2131
d18e2bb6
JD
21322012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2133
2134 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2135 the loop (Bug#12247).
2136
1b9d9d16
PE
21372012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2138
2139 * lisp.h (vcopy): Use memcpy rather than our own loop.
2140 This fixes a performance regression introduced by the recent
2141 addition of vcopy. This means 'vcopy' will need to be modified
2142 for a copying collector, but that's OK. Also, tighten the
2143 checking in the assertion.
2144
b2f09701
EZ
21452012-08-21 Eli Zaretskii <eliz@gnu.org>
2146
2147 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2148 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2149 non-base glyph for the width of the base character, according to
e1f29348
BR
2150 what x_draw_composite_glyph_string_foreground expects.
2151 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
2152 expectations, to produce correct width of the composed character.
2153 Reverse the sign of the DU offset produced by ScriptPlace.
2154
9b994fed
PE
21552012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2156
2157 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2158
086ca913
DA
21592012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2160
2161 Avoid direct writes to contents member of struct Lisp_Vector.
2162 * lisp.h (vcopy): New function to copy data into vector.
2163 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2164 * fns.c (Ffillarray): Use ASET.
2165 * keyboard.c (timer_check_2): Use AREF and ASET.
2166 (append_tool_bar_item, Frecent_keys): Use vcopy.
2167 * lread.c (read_vector): Use ASET.
2168 * msdos.c (Frecent_doskeys): Use vcopy.
2169 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2170 (Finternal_merge_in_global_face): Use ASET and vcopy.
2171 * xfont.c (xfont_list_pattern): Likewise.
2172
5481664a
MR
21732012-08-21 Martin Rudalics <rudalics@gmx.at>
2174
2175 * window.c (Fwindow_point): For the selected window always return
2176 the position of its buffer's point.
2177 (Fset_window_point): For the selected window always go in its
2178 buffer to the specified position.
2179
6d470bdd
DA
21802012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2181
2182 Setter macros for fontsets.
2183 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2184 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2185 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2186 Adjust users.
2187
24564fe1
GM
21882012-08-20 Glenn Morris <rgm@gnu.org>
2189
2190 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2191 Don't assume that `ln -f' works.
2192
0a05a035
EZ
21932012-08-20 Eli Zaretskii <eliz@gnu.org>
2194
2195 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2196 and later about non-assignments with no effect. See discussion at
2197 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2198 details.
2199
e46f2325
DA
22002012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2201
2202 Inline setter functions for Lisp_Objects slots of struct specbinding.
2203 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2204 Adjust users.
2205
734fbd86
MR
22062012-08-20 Martin Rudalics <rudalics@gmx.at>
2207
2208 * window.c (select_window): Always make selected window's buffer
2209 current.
2210
f1a95992
DA
22112012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2212
2213 Use AREF and ASET for docstrings of category tables.
2214 * category.h (CATEGORY_DOCSTRING): Use AREF.
2215 (SET_CATEGORY_DOCSTRING): Use ASET.
2216 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2217
e83064be
DA
22182012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2219
2220 Inline setter functions for hash table members.
2221 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2222 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2223 (set_hash_key_and_value, set_hash_index, set_hash_next)
2224 (set_hash_hash): New functions.
2225 * charset.c, fns.c: Adjust users.
2226
4ce60d2e
DA
22272012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2228
2229 Inline getter and setter functions for per-buffer values.
2230 * buffer.h (per_buffer_default, set_per_buffer_default)
2231 (per_buffer_value, set_per_buffer_value): New functions.
2232 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2233 * buffer.c, data.c: Adjust users.
2234
c06c9690
JB
22352012-08-20 Juanma Barranquero <lekktu@gmail.com>
2236
2237 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2238
32bd4250
PE
22392012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2240
bad03192 2241 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
2242 as gnulib does this if the system doesn't.
2243 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
2244 Remove declaration. MS-Windows declares it on stdlib.h which is
2245 included by conf_post.h.
b69a6d22
PE
2246 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2247 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2248 * vm-limit.c: Include <unistd.h>, for 'environ'.
2249
22d7feb2
PE
2250 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2251 (start_of_data): Remove decl; mem-limits.h provides it.
2252
32bd4250
PE
2253 * xdisp.c (handle_invisible_prop): Make it a bit faster
2254 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2255
450809af
CY
22562012-08-19 Chong Yidong <cyd@gnu.org>
2257
2258 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2259 ends (Bug#3874).
2260
9e677988
AS
22612012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2262
6b1319ce
AS
2263 * .gdbinit: Use call instead of set when calling a function in the
2264 inferior.
2265
9e677988
AS
2266 * data.c (set_internal): Don't use set_blv_found.
2267 (Fkill_local_variable): Likewise.
2268
d7191076
AA
22692012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2270
2271 * nsfont.m (ns_ascii_average_width): Ensure the string
2272 ascii_printable is initialized with a null-terminated character
2273 array. Otherwise, it can contain undesired extra characters.
2274
e757f1c6
PE
22752012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2276
2277 port new setting code to Sun C 5.8 2005/10/13
2278 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2279 Return void, not Lisp_Object. Otherwise, the compiler
2280 complains about (A?B:C) where B is void and C is Lisp_Object
2281 when compiling CHAR_TABLE_SET, due to the recent change to
2282 the API of sub_char_table_set_contents.
2283
a999ce26
CY
22842012-08-18 Chong Yidong <cyd@gnu.org>
2285
2286 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2287 for the string case (Bug#3874).
2288
3f22b86f
PE
22892012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2290
39eb03f1
PE
2291 * buffer.h (BSET): Remove (Bug#12215).
2292 Replace all uses with calls to new setter functions.
2293 (bset_bidi_paragraph_direction, bset_case_canon_table)
2294 (bset_case_eqv_table, bset_directory, bset_display_count)
2295 (bset_display_time, bset_downcase_table)
2296 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2297 (bset_last_selected_window, bset_local_var_alist)
2298 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2299 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2300 (bset_width_table):
2301 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2302 (bset_auto_fill_function, bset_auto_save_file_format)
2303 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2304 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2305 (bset_cache_long_line_scans, bset_case_fold_search)
2306 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2307 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2308 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2309 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2310 (bset_header_line_format, bset_indicate_buffer_boundaries)
2311 (bset_indicate_empty_lines, bset_invisibility_spec)
2312 (bset_left_fringe_width, bset_major_mode, bset_mark)
2313 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2314 (bset_name, bset_overwrite_mode, bset_pt_marker)
2315 (bset_right_fringe_width, bset_save_length)
2316 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2317 (bset_scroll_up_aggressively, bset_selective_display)
2318 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2319 (bset_word_wrap, bset_zv_marker):
2320 * category.c (bset_category_table):
2321 * syntax.c (bset_syntax_table):
2322 New setter functions.
2323
6a09a33b
PE
2324 * process.h (PSET): Remove (Bug#12215).
2325 Replace all uses with calls to new setter functions.
2326 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2327 (PROCESS_INLINE): New macro.
2328 (pset_childp): New setter function.
2329 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2330 * process.c (PROCESS_INLINE):
2331 Define to EXTERN_INLINE, so that the corresponding functions
2332 are compiled into code.
2333 (pset_buffer, pset_command, pset_decode_coding_system)
2334 (pset_decoding_buf, pset_encode_coding_system)
2335 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2336 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2337 (pset_type, pset_write_queue): New setter functions.
2338
e8c17b81
PE
2339 * window.h (WSET): Remove (Bug#12215).
2340 Replace all uses with calls to new setter functions.
2341 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2342 (WINDOW_INLINE): New macro.
2343 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2344 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2345 (wset_total_lines, wset_vertical_scroll_bar)
2346 (wset_window_end_pos, wset_window_end_valid)
2347 (wset_window_end_vpos): New setter functions.
2348 * window.c (WINDOW_INLINE):
2349 Define to EXTERN_INLINE, so that the corresponding functions
2350 are compiled into code.
2351 (wset_combination_limit, wset_dedicated, wset_display_table)
2352 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2353 (wset_new_normal, wset_new_total, wset_next_buffers)
2354 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2355 (wset_prev_buffers, wset_right_fringe_width)
2356 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2357 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2358 (wset_window_parameters):
2359 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2360 (wset_column_number_displayed, wset_region_showing):
2361 New setter functions.
2362
3f22b86f
PE
2363 * termhooks.h (TSET): Remove (Bug#12215).
2364 Replace all uses with calls to new setter functions.
2365 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2366 (TERMHOOKS_INLINE): New macro.
2367 (tset_charset_list, tset_selection_alist): New setter functions.
2368 * terminal.c (TERMHOOKS_INLINE):
2369 Define to EXTERN_INLINE, so that the corresponding functions
2370 are compiled into code.
2371 (tset_param_alist): New setter function.
2372
742af32f
PE
23732012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2374
15dbb4d6
PE
2375 * keyboard.h (KSET): Remove (Bug#12215).
2376 Replace all uses with calls to new setter functions.
2377 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2378 (KEYBOARD_INLINE): New macro.
2379 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2380 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2381 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2382 New setter functions.
2383 * keyboard.c (KEYBOARD_INLINE):
2384 Define to EXTERN_INLINE, so that the corresponding functions
2385 are compiled into code.
2386 (kset_echo_string, kset_kbd_queue)
2387 (kset_keyboard_translate_table, kset_last_prefix_arg)
2388 (kset_last_repeatable_command, kset_local_function_key_map)
2389 (kset_overriding_terminal_local_map, kset_real_last_command)
2390 (kset_system_key_syms): New setter functions.
2391
f00af5b1
PE
2392 * frame.h (FSET): Remove (Bug#12215).
2393 Replace all uses with calls to new setter functions.
2394 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2395 (FRAME_INLINE): New macro.
2396 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2397 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2398 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2399 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2400 (fset_param_alist, fset_root_window, fset_scroll_bars)
2401 (fset_selected_window, fset_title, fset_tool_bar_items)
2402 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2403 * frame.c (FRAME_INLINE):
2404 Define to EXTERN_INLINE, so that the corresponding functions
2405 are compiled into code.
2406 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2407
0c94c8d6
PE
2408 A few more naming-convention fixes for getters and setters.
2409 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2410 and rename from buffer_overlays_set_before.
2411 (set_buffer_overlays_after): Move here from buffer.h, and rename
2412 from buffer_overlays_set_after.
2413 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2414 All uses changed.
2415 (set_buffer_intervals): Rename from buffer_set_intervals.
2416 * intervals.c (set_interval_object): Move here from intervals.h,
2417 and rename from interval_set_object.
2418 (set_interval_left): Move here from intervals.h, and rename from
2419 interval_set_left.
2420 (set_interval_right): Move here from intervals.h, and rename from
2421 interval_set_right.
2422 (copy_interval_parent): Move here from intervals.h, and rename from
2423 interval_copy_parent.
2424 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2425 (set_interval_plist): Rename from interval_set_plist.
2426 Return void, not Lisp_Object, since no caller uses the result.
2427 * lisp.h (string_intervals): Rename from string_get_intervals.
2428 (set_string_intervals): Rename from string_set_intervals.
2429
34dabdb7
PE
2430 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2431 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 2432 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
2433 All uses changed. See the end of
2434 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2435
742af32f
PE
2436 * lisp.h (CSET): Remove (Bug#12215).
2437 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2438 (set_char_table_purpose): New functions,
2439 replacing CSET. All uses changed. For example, replace
2440 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 2441 "set_char_table_parent (char_table, parent);".
742af32f
PE
2442 The old version was confusing because it used the same name
2443 'parent' for two different things.
2444
a04e2c62
DA
24452012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2446
2447 Functions to get and set Lisp_Object fields of buffer-local variables.
2448 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2449 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2450 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2451 * data.c, eval.c, frame.c: Adjust users.
2452
383dcbf9
CY
24532012-08-17 Chong Yidong <cyd@gnu.org>
2454
2455 * xfaces.c (merge_face_vectors): If the target font specfies a
2456 font spec, make the font's attributes take precedence over
2457 directly-specified attributes.
2458 (merge_face_ref): Recognize :font.
2459
44386687
DA
24602012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2461
2462 Do not use memcpy for copying intervals.
2463 * intervals.c (reproduce_interval): New function.
2464 (reproduce_tree, reproduce_tree_obj): Use it.
2465 (reproduce_tree_obj): Remove prototype.
2466
927c7216
PE
24672012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2468
2469 * lisp.h (duration_to_sec_usec): Remove unused decl.
2470
93044f7b
AA
24712012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2472
2473 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2474 to an allocated instance of NSString, not to the class itself.
2475
9851e4a5
JB
24762012-08-17 Juanma Barranquero <lekktu@gmail.com>
2477
2478 * makefile.w32-in (C_CTYPE_H): New macro.
2479 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2480 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2481 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2482
620f13b0
PE
24832012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2484
2485 Use ASCII tests for character types.
2486 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2487 * xfns.c, xterm.c:
2488 Don't include <ctype.h>; was not needed.
2489 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2490 * sysdep.c, xfaces.c:
2491 Include <c-ctype.h> instead of <ctype.h>.
2492 * nsterm.m: Include <c-ctype.h>.
2493 * charset.c (read_hex):
2494 * doc.c (Fsnarf_documentation):
2495 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2496 (DRIVE_LETTER) [DOS_NT]:
2497 (Ffile_name_directory, Fexpand_file_name)
2498 (Fsubstitute_in_file_name):
2499 * font.c (font_parse_xlfd, font_parse_fcname):
2500 * frame.c (x_set_font_backend):
2501 * gtkutil.c (xg_get_font):
2502 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2503 * nsimage.m (hexchar):
2504 * nsterm.m (ns_xlfd_to_fontname):
2505 * sysdep.c (system_process_attributes):
2506 * xfaces.c (hash_string_case_insensitive):
2507 Use C-locale tests instead of locale-specific tests for character
2508 types, since we want the ASCII interpretation here, not the
2509 interpretation suitable for whatever happens to be the current locale.
2510
52162052
MR
25112012-08-16 Martin Rudalics <rudalics@gmx.at>
2512
2513 Consistently check windows for validity/liveness
2514 (Bug#11984, Bug#12025, Bug#12026).
2515 * lisp.h (CHECK_VALID_WINDOW): New macro.
2516 * window.c (decode_window): Rename to decode_live_window.
2517 (decode_valid_window, Fwindow_valid_p): New functions.
2518 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2519 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2520 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2521 (Fwindow_prev_sibling, Fwindow_combination_limit)
2522 (Fset_window_combination_limit, Fwindow_use_time)
2523 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2524 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2525 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2526 (Fwindow_hscroll, Fset_window_hscroll)
2527 (Fwindow_redisplay_end_trigger)
2528 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2529 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2530 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2531 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2532 (Fwindow_end, Fset_window_point, Fset_window_start)
2533 (Fpos_visible_in_window_p, Fwindow_line_height)
2534 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2535 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2536 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2537 (Fset_window_parameter, Fwindow_display_table)
2538 (Fset_window_display_table, Fdelete_other_windows_internal)
2539 (Fset_window_buffer, Fset_window_new_total)
2540 (Fset_window_new_normal, Fdelete_window_internal)
2541 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2542 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2543 (Fwindow_scroll_bars): Check whether argument window is a valid or
2544 live window. Update doc-strings.
2545 (syms_of_window): New symbol Qwindow_valid_p.
2546 * keyboard.c (Fposn_at_x_y): Check whether argument
2547 frame_or_window denotes a valid window.
2548
2751c80f
DA
25492012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2550
2551 Fix previous char table change.
2552 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2553 * chartab.c (optimize_sub_char_table): Likewise.
2554
032a42c8
CY
25552012-08-16 Chong Yidong <cyd@gnu.org>
2556
a2d19368
CY
2557 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2558
032a42c8
CY
2559 * xfont.c (xfont_open):
2560 * xftfont.c (xftfont_open): Set the font's max_width field.
2561
2562 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2563 min_width to space_width and average_width to the average over
2564 printable ASCII characters.
2565 (ns_char_width): Code cleanup.
2566 (ns_ascii_average_width): New utility function.
2567
2568 * font.h (struct font): Update comments.
2569
a098c930
DA
25702012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2571
032a42c8 2572 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
2573 * lisp.h (CSET): New macro.
2574 (char_table_set_extras, char_table_set_contents)
2575 (sub_char_table_set_contents): New function.
2576 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2577 * syntax.c: Adjust users.
2578
8be3a09c
SM
25792012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2580
2581 * eval.c (eval_sub): Bind lexical-binding.
2582 * lread.c (Qlexical_binding): Make non-static.
2583
ac4845a6
JD
25842012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2585
ddee6515
JD
2586 * nsmenu.m (popupSession): Remove.
2587 (pop_down_menu): Remove endModalSession.
2588 (timeout_handler:): New method.
2589 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2590 Call runModalForWindow. Check timer_fired when it returns.
2591 If not set, cancel timer and break out of loop.
2592 Otherwise loop again, with a new timeout.
2593
2594 * nsterm.m: Include fcntl.h if present.
2595 (fd_entry, t_readfds, inNsSelect): Remove.
2596 (select_writefds, select_valid, select_timeout, selfds)
2597 (select_mutex, apploopnr): Add.
2598 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2599 Otherwise call kbd_buffer_store_event.
2600 (ns_send_appdefined): Remove release of fd_entry.
2601 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2602 Increment and decrement apploopnr.
2603 (ns_select): If no file descriptors, just do a NSTimer.
2604 Otherwise copy read/write masks and start select thread (fd_handler).
2605 Start main loop and wait for application defined event.
2606 Inform select thread to stop selecting after main loop is exited.
2607 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 2608 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
2609 (fd_handler:): Loop forever, wait for info from the main thread
2610 to either start or stop selecting. When select returns, send
2611 and appdefined event.
2612 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2613 If not call kbd_buffer_store_event.
2614
2615 * nsterm.h (EmacsApp): fd_handler takes id argument.
2616 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2617
ac4845a6
JD
2618 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2619
eb424fe3
EZ
26202012-08-15 Eli Zaretskii <eliz@gnu.org>
2621
2622 * region-cache.c (move_cache_gap): Update gap_len using the actual
2623 growth of the boundaries array. Do not change cache_len.
2624 (Bug#12196)
2625
4e6a86c6
DA
26262012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2627
2628 Generalize and cleanup font subsystem checks.
2629 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
2630 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2631 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 2632
5bf192ca
DA
26332012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2634
2635 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2636
f2045622
CY
26372012-08-15 Chong Yidong <cyd@gnu.org>
2638
8be3a09c
SM
2639 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2640 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2641 extract the font descriptor instead of just the font name.
2642 In that case, return a font spec instead of a string.
f2045622
CY
2643 (x_last_font_name): Move to this file from xfns.c.
2644
2645 * xfns.c (Fx_select_font): The return value can also be a font
2646 spec. Move x_last_font_name management to gtkutil.c.
2647
2648 * xfaces.c: Make font weight and style symbols non-static.
2649
7f6feb56
SM
26502012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2651
2652 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2653 (bug#12117).
2654
fecbd8ff
SM
26552012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2656
2657 * alloc.c (Fgarbage_collect): Use plural form consistently.
2658
9b8d5165
EZ
26592012-08-14 Eli Zaretskii <eliz@gnu.org>
2660
2661 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2662 iteration through the command loop. Fixes a problem whereby mouse
2663 movements are ignored until the first mouse click.
2664
f5d9e83a
PE
26652012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2666
2667 Use bool, not int, for Lisp booleans.
2668 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2669 makes Emacs a bit smaller and presumably a bit faster.
2670 * lisp.h: Include <stdbool.h>.
2671 (struct Lisp_Boolfwd, defvar_bool):
2672 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2673 * regex.c [!emacs]: Include <stdbool.h>.
2674 (false, true): Remove; <stdbool.h> does this for us now.
2675
55802e4a
CY
26762012-08-14 Chong Yidong <cyd@gnu.org>
2677
4abcdac8
CY
2678 * character.c (Fcharacterp): Doc fix (Bug#12076).
2679
2680 * data.c (Findirect_variable): Doc fix (Bug#11040).
2681
55802e4a
CY
2682 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2683
2684 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 2685 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 2686
8e99d072
BR
26872012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2688
2689 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2690 (bug#12022).
2691
08908aca
MR
26922012-08-14 Martin Rudalics <rudalics@gmx.at>
2693
2694 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2695 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2696 * minibuf.c (choose_minibuf_frame, read_minibuf):
2697 * w32fns.c (x_create_tip_frame):
2698 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2699 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2700
56120d6f
PE
27012012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2702
2703 * intervals.c (offset_intervals): Remove obsolete comment.
2704
67b77c0b
AS
27052012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2706
2707 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2708
f48b82fd
GR
27092012-08-14 Gergely Risko <gergely@risko.hu>
2710
2711 * coding.c (decode_coding): Record buffer modification before
2712 disabling undo_list (Bug#11773).
2713
fd318b54
DA
27142012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2715
2716 Revert and cleanup some recent overlay changes.
2717 * buffer.h (enum overlay_type): Remove.
2718 (buffer_get_overlays, buffer_set_overlays): Likewise.
2719 (buffer_set_overlays_before, buffer_set_overlays_after):
2720 New function. Adjust users.
2721 (unchain_both): Add eassert.
2722
41a62dd9
DA
27232012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2724
2725 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2726
5884c324
PE
27272012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2728
2729 * gtkutil.c (xg_mark_data): Don't assume C99.
2730
ca06f160
JD
27312012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2732
2733 * gtkutil.c (xg_frame_tb_info): New struct.
2734 (TB_INFO_KEY): New define.
2735 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2736 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2737 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2738 if not present.
2739 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 2740 is up to date. Otherwise store new data.
ca06f160
JD
2741 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2742
7864a3f7
DA
27432012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2744
2745 Use KSET for write access to Lisp_Object members of struct kboard.
2746 * keyboard.h (KSET): New macro.
2747 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2748 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2749 * xterm.c: Adjust users.
2750
4c31be61
DA
27512012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2752
2753 Use BSET for write access to Lisp_Object members of struct buffer.
2754 * buffer.h (BSET): New macro.
2755 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2756 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2757 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2758 * window.c, xdisp.c, xfns.c: Adjust users.
2759
14ae4239
BT
27602012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2761
2762 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2763
32bcadb4
JD
27642012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2765
3d29b2ce 2766 * nsterm.m (not_in_argv): New function.
fc0c31f8 2767 (application:openFile, application:openTempFile:):
3d29b2ce
JD
2768 (application:openFileWithoutUI:, application:openFiles:): Open file
2769 if not_in_argv returns non-zero (bug#12171).
2770
32bcadb4 2771 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
2772 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2773 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
2774 (xg_get_font_name): Use those functions/macros here.
2775 Reported by Frans Oilinki <moilinki@gmail.com>.
2776
9ff9402d 27772012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
2778
2779 * unexmacosx.c (copy_data_segment): Copy initialized data in
2780 statically linked libraries from input file rather than memory.
2781
db74a5fc
YM
2782 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2783 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2784 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2785
25e65510
GM
27862012-08-10 Glenn Morris <rgm@gnu.org>
2787
2788 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2789 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2790
7961135c
DA
27912012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2792
2793 Fix last change to allow compilation with low optimization levels.
2794 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2795 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2796
42b3a444
DA
27972012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2798
2799 Use common inline syntax in intervals.h.
2800 * intervals.h (INTERVALS_INLINE): New macro.
2801 Change all users from LISP_INLINE.
2802
9fb0c957
DA
28032012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2804
2805 Define Qnone once for all platforms.
2806 * frame.c (Qnone): Define here.
2807 (syms_of_frame): DEFSYM it.
2808 * lisp.h (Qnone): New declaration.
2809 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2810 * xfns.c: Remove duplication. Adjust users.
2811
65e8ee52
DA
28122012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2813
2814 Remove unused macros from intervals.h.
2815 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2816 * intervals.c: Adjust comment.
2817
9b855fd6
EZ
28182012-08-10 Eli Zaretskii <eliz@gnu.org>
2819
2820 * w32fns.c <w32_unicode_gui>: New static variable.
2821 (globals_of_w32fns): Initialize it according to os_subtype.
2822 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2823 testing os_subtype.
2824
39cb9e56 28252012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
2826 Eli Zaretskii <eliz@gnu.org>
2827
2828 Fix bug #10299 with Unicode characters sent by customized
2829 keyboards created by MSKLC.
2830 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2831 (w32_init_class): Use it to initialize the Emacs class with either
2832 ANSI or Unicode API calls.
2833 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2834 later.
2835 (w32_wnd_proc): If the character code sent by WM_CHAR or
2836 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2837 original message. Call DefWindowProcW on NT and later.
2838
9374581a
GM
28392012-08-10 Glenn Morris <rgm@gnu.org>
2840
4b94e8cf
GM
2841 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2842
9374581a
GM
2843 * lisp.h (DIRECTORY_SEP): Let configure set it.
2844
a2752828
DA
28452012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2846
2847 Use TSET for write access to Lisp_Object slots of struct terminal.
2848 * termhooks.h (TSET): New macro.
2849 * coding.c, terminal.c, xselect.c: Adjust users.
2850
cc92c454
SM
28512012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2852
2853 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2854 the failing expression, include them in the error message.
2855 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2856 * lisp.h (internal_condition_case_n): Update declaration.
2857
4cb3e6b3
DA
28582012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2859
2860 Inline functions to examine and change buffer overlays.
2861 * buffer.c (unchain_both): New function.
2862 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2863 (buffer_has_overlays): New function.
2864 (enum overlay_type): New enum.
2865 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2866 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2867
8707c1e5
DA
28682012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2869
2870 Inline functions to examine and change buffer intervals.
2871 * alloc.c (mark_interval_tree): Remove.
2872 (MARK_INTERVAL_TREE): Simplify.
2873 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2874 * intervals.c (buffer_balance_intervals): New function.
2875 (graft_intervals_into_buffer): Adjust indentation.
2876 (set_intervals_multibyte): Simplify.
2877 * buffer.h (BUF_INTERVALS): Remove.
2878 (buffer_get_intervals, buffer_set_intervals): New function.
2879 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2880 * intervals.c, textprop.c: Adjust users.
2881
ad8c997f
DA
28822012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2883
2884 Inline functions to examine and change string intervals.
2885 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2886 (string_get_intervals, string_set_intervals): New function.
2887 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2888 * lread.c, print.c, textprop.c: Adjust users.
2889
32ac3a6b
GM
28902012-08-08 Glenn Morris <rgm@gnu.org>
2891
2892 * lisp.mk (lisp): Remove language/persian.elc.
2893
77c7bcb1
DA
28942012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2895
2896 Cleanup intervals.
2897 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2898 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
2899 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2900 Adjust comment. Move under #if 0.
77c7bcb1
DA
2901 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2902 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2903
9c08a8d4
DA
29042012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2905
2906 Check total length of intervals with eassert.
2907 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2908 * intervals.c: Change all users to eassert.
2909
26d16b35
EZ
29102012-08-07 Eli Zaretskii <eliz@gnu.org>
2911
14ae4239
BT
2912 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2913 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
2914 INTERNAL_FIELD in Lisp_Cons.
2915
c644523b
DA
29162012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2917
2918 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2919 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2920 name since all xname users are fixed long time ago. Do not
2921 use INTERNAL_FIELD.
2922 (set_symbol_name, set_symbol_function, set_symbol_plist):
2923 (set_symbol_next, set_overlay_plist): New function.
2924 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2925 (struct Lisp_Overlay): Likewise.
2926 (CVAR, MVAR, SVAR): Remove.
2927 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2928 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2929 * xterm.c: Adjust users.
2930 * .gdbinit: Change to use name field of struct Lisp_Symbol
2931 where appropriate.
2932
6a3d20cc
DA
29332012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2934
2935 Basic functions to set Lisp_Object and pointer slots of intervals.
2936 * intervals.h (interval_set_parent, interval_set_object):
2937 (interval_set_left, interval_set_right, interval_set_plist):
2938 (interval_copy_parent): New function.
2939 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
2940 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2941 Adjust indentation.
6a3d20cc
DA
2942 (INTERVAL_SIZE): Remove. Adjust users.
2943 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2944
4d2b044c
DA
29452012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2946
2947 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2948 * process.h (PGET): Remove.
2949 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2950 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2951
d3d50620
DA
29522012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2953
2954 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2955 * window.h (WGET): Remove.
2956 (struct window): Do not use INTERNAL_FIELD.
2957 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2958 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2959 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2960 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2961 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2962 Adjust users.
2963
d10a51dc
CY
29642012-08-07 Chong Yidong <cyd@gnu.org>
2965
2966 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2967 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2968 (Fdelete_window_internal): Signal an error if the window is not on
2969 a live frame (Bug#12025).
2970
e69b0960
DA
29712012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2972
2973 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2974 * frame.h (FGET): Remove.
2975 (struct frame): Do not use INTERNAL_FIELD.
2976 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2977 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2978 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2979 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2980
25a20a3a
JB
29812012-08-06 Juanma Barranquero <lekktu@gmail.com>
2982
2983 * w32.c: Silence compiler warnings.
2984 (map_w32_filename): Remove unused variable `is_fat'.
2985 (chase_symlinks): Add parentheses around expression.
2986
1c6f11f4
GM
29872012-08-06 Glenn Morris <rgm@gnu.org>
2988
1db4583a
GM
2989 * sysdep.c: Respect BROKEN_GETWD.
2990
1c6f11f4
GM
2991 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2992 Let configure handle it.
2993 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2994
2b90362b
DA
29952012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2996
2997 Use GCALIGNMENT where appropriate.
2998 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2999 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3000 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3001
5f50daf2
EZ
30022012-08-06 Eli Zaretskii <eliz@gnu.org>
3003
14ae4239
BT
3004 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3005 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 3006
cbcc7007
SM
30072012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3008
3009 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3010 that should be sufficient for everyone.
3011
4d365fa4
JD
30122012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3013
3014 * keyboard.c (timer_check_2): Add break so timer_check returns next
3015 timeout.
3016
dd86bd82
DA
30172012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3018
3019 Fix Windows build errors introduced after converting to WGET and WSET.
3020 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3021 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3022
054e1668
JD
30232012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3024
3025 * nsterm.m (ns_frame_rehighlight): Use FSET.
3026
3027 * nsmenu.m (ns_update_menubar): Use FSET.
3028
21238f11
DA
30292012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3030
3031 Separate read and write access to Lisp_Object slots of Lisp_Process.
3032 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3033 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3034
077288cf
DA
30352012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3036
3037 Separate read and write access to Lisp_Object slots of struct window.
3038 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3039 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3040 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3041 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3042 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3043 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3044 Adjust users.
3045
71688bd7
DA
30462012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3047
3048 Fix Windows build errors introduced after converting to FGET and FSET.
3049 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3050 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3051 (w32_judge_scroll_bars): Change to use FSET.
3052 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3053
f99bac93
DA
30542012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3055
3056 Fix replacement typo.
3057 * window.c (replace_window): Set root_window instead of
3058 selected_window. This fixes a total window subsystem
3059 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3060
8c2a0f2d
GM
30612012-08-06 Glenn Morris <rgm@gnu.org>
3062
3063 * lisp.mk (lisp): Add language/persian.elc.
3064
edd74c35
DA
30652012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3066
3067 Separate read and write access to Lisp_Object slots of struct frame.
3068 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3069 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3070 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3071 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3072 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3073
8671676c
AS
30742012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3075
3076 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3077
663e2b3f
DA
30782012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3079
3080 Generalize common compile-time constants.
3081 * lisp.h (header_size, bool_header_size, word_size): Now here.
3082 (struct Lisp_Vector): Add comment.
3083 (struct Lisp_Bool_Vector): Move up to define handy constants.
3084 (VECSIZE, PSEUDOVECSIZE): Simplify.
3085 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3086 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3087 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3088 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3089 * xfont.c, xmenu.c: Use word_size where appropriate.
3090
d32e47af
LM
30912012-08-05 Lawrence Mitchell <wence@gmx.li>
3092
3093 * search.c (Freplace_match): Treat \? in the replacement text
3094 literally (Bug#8161).
3095
e5d9c0d1
CY
30962012-08-05 Chong Yidong <cyd@gnu.org>
3097
3098 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3099 * frame.c (Vdelete_frame_functions):
3100 * emacs.c (Vkill_emacs_hook): Doc fix.
3101
8da0576b
EZ
31022012-08-04 Eli Zaretskii <eliz@gnu.org>
3103
3104 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3105 --with-x-toolkit=no builds.
3106 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3107
02676e5d
CY
31082012-08-04 Chong Yidong <cyd@gnu.org>
3109
3110 * syntax.c (Fmodify_syntax_entry): Doc fix.
3111
97147da9
EZ
31122012-08-04 Eli Zaretskii <eliz@gnu.org>
3113
76151e2c
EZ
3114 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3115 * w32.c (init_environment): Change the default values of many
3116 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
3117 them into environment when they were not already defined.
3118 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 3119 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
3120 (check_windows_init_file): Now external, not static.
3121 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
3122 called when Vload_path is already set up.
3123
3124 * w32.h (check_windows_init_file): Add prototype.
3125
3126 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3127 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3128 compatibility with Posix platforms.
3129 (main): Move the call to check_windows_init_file to here from
3130 w32.c.
3131 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3132 any, in the DEFALT argument into the root of the Emacs build or
3133 installation tree, as appropriate.
3134
3135 * callproc.c (init_callproc_1): Call decode_env_path instead of
3136 doing its equivalent by hand.
3137 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3138 the code that sets Vexec_path run on MS-Windows.
3139
3140 * lread.c (init_lread): Add comments to #ifdef's.
3141
97147da9
EZ
3142 * msdos.c (dos_set_window_size, IT_update_begin)
3143 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3144 instead of direct references.
3145
185ee146
PE
31462012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3147
3148 Export DEFAULT_REHASH_* to GDB.
3149 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3150 Now constants, not macros.
3151
8834c57a
PE
31522012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3153
98c6f1e3
PE
3154 Remove unnecessary casts involving pointers.
3155 These casts are no longer needed now that we assume C89 or later,
3156 since they involve casting to or from void *.
3157 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3158 (make_pure_float, make_pure_vector):
3159 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3160 * macros.c (Fstart_kbd_macro):
3161 * menu.c (find_and_return_menu_selection):
3162 * minibuf.c (read_minibuf_noninteractive):
3163 * sysdep.c (closedir):
3164 * xdisp.c (x_produce_glyphs):
3165 * xfaces.c (compare_fonts_by_sort_order):
3166 * xfns.c (x_real_positions, select_visual):
3167 * xselect.c (x_stop_queuing_selection_requests)
3168 (x_get_window_property, x_get_window_property_as_lisp_data):
3169 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3170 Remove unnecessary pointer casts.
3171 * alloc.c (record_xmalloc): New function.
3172 * lisp.h (record_xmalloc): New decl.
3173 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3174 more like a function. This is because the pointer cast is not
3175 needed. All uses changed.
3176 * print.c (print_string, print_error_message): Avoid length recalc.
3177
8834c57a
PE
3178 Improve fix for macroexp crash with debugging (Bug#12118).
3179 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3180 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3181 not supposed to be invoked from the garbage collector.
3182 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3183 (gc_aset): New function, which is like ASET but can be
3184 used in the garbage collector.
3185 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3186 (set_hash_index): Use it instead of ASET.
3187
6dad7178
EZ
31882012-08-03 Eli Zaretskii <eliz@gnu.org>
3189
3190 Support symlinks on latest versions of MS-Windows.
3191 * w32.c: Include winioctl.h and aclapi.h.
3192 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3193 (revert_to_self): Forward declarations of static functions.
3194 <static BOOL g_b_init_get_security_info>:
3195 <g_b_init_create_symbolic_link>: New static flags.
3196 (globals_of_w32): Initialize them to zero.
3197 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3198 (map_w32_filename): Improve commentary. Simplify switch.
3199 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3200 headers (most versions of MinGW w32api don't).
3201 (get_security_info, create_symbolic_link)
3202 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3203 New functions.
3204 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3205 in the argument file name.
3206 (sys_access): Call unc_volume_file_attributes only if
3207 GetFileAttributes fails with network-related error codes.
3208 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3209 have the required privileges.
14ae4239 3210 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
3211 get_file_security_desc.
3212 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
3213 with addition of handling of symlinks and support for 'lstat'.
3214 If possible, get file's attributes and security information by
6dad7178
EZ
3215 handle, not by name. Produce S_IFLNK bit for symlinks, when
3216 called from 'lstat'.
3217 (stat, lstat): New functions, call 'stat_worker'.
3218 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3219 symlinks when the underlying filesystem supports them.
3220
f162bcc3
PE
32212012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3222
79ea6c20
PE
3223 Fix macroexp crash on Windows with debugging (Bug#12118).
3224 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3225 checking subscripts; problem introduced with the recent
3226 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3227 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3228 since it's used in non-static inline functions now.
3229
c0ce93fd
PE
3230 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3231 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 3232
f162bcc3
PE
3233 Use C99-style 'extern inline' if available.
3234 * buffer.h (BUFFER_INLINE):
3235 * category.h (CATEGORY_INLINE):
3236 * character.h (CHARACTER_INLINE):
3237 * charset.h (CHARSET_INLINE):
3238 * composite.h (COMPOSITE_INLINE):
3239 * dispextern.h (DISPEXTERN_INLINE):
3240 * lisp.h (LISP_INLINE):
3241 * systime.h (SYSTIME_INLINE):
3242 New macro, replacing 'static inline' in this header.
3243 * buffer.h, category.h, character.h, charset.h, composite.h:
3244 * dispextern.h, lisp.h, systime.h:
3245 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3246 * alloc.c (LISP_INLINE):
3247 * buffer.c (BUFFER_INLINE):
3248 * category.c (CATEGORY_INLINE):
3249 * character.c (CHARACTER_INLINE):
3250 * charset.c (CHARSET_INLINE):
3251 * composite.c (COMPOSITE_INLINE):
3252 * dispnew.c (DISPEXTERN_INLINE):
3253 * sysdep.c (SYSTIME_INLINE):
3254 Define to EXTERN_INLINE, so that the corresponding functions
3255 are compiled into code.
3256 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3257 (INLINE_HEADER_END): New macros.
3258 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3259 since it's used in non-static inline functions now.
a8333d03 3260 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 3261
837b365b
GM
32622012-08-02 Glenn Morris <rgm@gnu.org>
3263
d66b744d
GM
3264 * s/: Remove empty directory.
3265
837b365b
GM
3266 * s/ms-w32.h: Move to ../nt/inc.
3267 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3268 Update for new ms-w32.h location.
3269
13294f95
PE
32702012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3271
3272 Port to Solaris 8.
3273 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3274
90df0db3
GM
32752012-08-02 Glenn Morris <rgm@gnu.org>
3276
3277 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3278 hard-coding the path separator.
3279
4939150c
PE
32802012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3281
3282 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3283 This how ASET and AREF are supposed to work, and makes
3284 it easier to think about future improvements. See
3285 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3286 * charset.h (set_charset_attr): New function.
3287 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3288 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3289 (aref_addr): New function. All uses of &AREF(...) changed.
3290 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3291 (set_hash_index): New functions. All lvalue-style uses of
3292 HASH_KEY etc. changed.
3293 * keyboard.c (set_prop): New function. All lvalue-style uses
3294 of PROP changed.
3295
947b2afd
AA
32962012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3297
3298 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3299 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3300 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3301 * nsfns.m (ns_set_name_as_filename): Likewise.
3302 * nsmenu.m (ns_update_menubar): Likewise.
3303 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3304
4f5d0325
EZ
33052012-08-01 Eli Zaretskii <eliz@gnu.org>
3306
2008beae
EZ
3307 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3308 Adapt to latest changes in field names of the corresponding Lisp
288479f6 3309 objects.
2008beae 3310
4f5d0325
EZ
3311 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3312
fe3cc771
GM
33132012-08-01 Glenn Morris <rgm@gnu.org>
3314
3315 * s/msdos.h: Remove file.
3316 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3317 * Makefile.in (S_FILE): Remove.
3318 (config_h): Remove S_FILE.
3319
c90acc54
JB
33202012-08-01 Juanma Barranquero <lekktu@gmail.com>
3321
3322 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3323 Remove; moved to nt/config.nt.
3324
d8a05828
DA
33252012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3326
3327 Use INTERNAL_FIELD for conses and overlays.
3328 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3329 Remove obsolete comment.
3330 (MVAR): New macro.
3331 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3332 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3333
8271d590
DA
33342012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3335
3336 Use INTERNAL_FIELD for symbols.
3337 * lisp.h (SVAR): New macro. Adjust users.
3338 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3339 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3340
3193acd2
DA
33412012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3342
3343 Use INTERNAL_FIELD for processes.
3344 * process.h (PVAR): New macro. Adjust style.
3345 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3346 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3347
3a45383a
DA
33482012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3349
3350 Use INTERNAL_FIELD for windows.
3351 * window.h (WVAR): New macro.
3352 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3353 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3354 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3355 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3356 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3357 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3358
c1dbc63c
PE
33592012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3360
3361 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3362
5c0c0e8a
GM
33632012-08-01 Glenn Morris <rgm@gnu.org>
3364
3365 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3366 Move to configure.ac.
3367
552a99b4
JB
33682012-08-01 Juanma Barranquero <lekktu@gmail.com>
3369
3370 * makefile.w32-in (CONFIG_H): Update dependencies.
3371 (CONF_POST_H): New macro.
3372
3373 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3374
8d8e2dfe
GM
33752012-07-31 Glenn Morris <rgm@gnu.org>
3376
bc96620a
GM
3377 * Makefile.in (S_FILE): No longer set by configure.
3378
476b1b2d
GM
3379 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3380 is available.
3381 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3382
b2c7a106
GM
3383 * process.h (NULL_DEVICE):
3384 * emacs.c (SEPCHAR):
3385 * editfns.c (USER_FULL_NAME): Let configure set them.
3386
d53d062a
GM
3387 * s/README, s/template.h: Remove files.
3388
4515017f
GM
3389 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3390
8d8e2dfe
GM
3391 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3392 Move to configure.ac.
3393
5b20b3cc
EZ
33942012-07-31 Eli Zaretskii <eliz@gnu.org>
3395
1e0afd9a
EZ
3396 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3397 resulting renaming of 'struct frame' members.
3398
5b20b3cc
EZ
3399 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3400
3401 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3402 after introduction of FVAR.
3403
f1310128
JD
34042012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3405
79e721e0
JD
3406 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3407
3408 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3409 instead of compositeToPoint.
3410 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3411
8d7c7eed 3412 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 3413
e34f7f79
DA
34142012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3415
3416 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3417 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 3418 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
3419 (BVAR): Change to use INTERNAL_FIELD.
3420 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3421 (KVAR): Change to use INTERNAL_FIELD.
3422 * frame.h (FVAR): New macro.
3423 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
3424 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3425 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3426 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
3427 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3428
c09bfb2f
DA
34292012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3430
3431 Miscellaneous fixes for non-default X toolkits.
3432 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3433 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3434 Move under #ifdef USE_LUCID.
3435 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3436 definition and usage to avoid warnings.
3437
14c114ae
JD
34382012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3439
3440 * nsterm.m (openFiles): Fix previous checkin.
3441
3bd21e82
PE
34422012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3443
3444 * indent.c (compute_motion): Remove unused local.
3445
c1529ded
GM
34462012-07-31 Glenn Morris <rgm@gnu.org>
3447
400d5621
GM
3448 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3449
268e2432
GM
3450 * conf_post.h [USG5_4]:
3451 Move remaining contents of s/usg5-4-common.h here.
3452 * s/usg5-4-common.h: Remove file.
3453
7552f3ee
GM
3454 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3455 * s/irix6-5.h: Remove file.
3456
6a381852
GM
3457 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3458 * s/darwin.h: Remove file.
3459
c1529ded
GM
3460 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3461 * s/hpux10-20.h: Remove file, which is now empty.
3462
b429a4ee
GM
34632012-07-30 Glenn Morris <rgm@gnu.org>
3464
3465 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3466 * Makefile.in (config_h): Add conf_post.h.
3467 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3468
adff3182
JD
34692012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3470
3471 * nsterm.m (ns_do_open_file): New variable.
b9031d69 3472 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
3473 (openFile, openTempFile, openFileWithoutUI, openFiles):
3474 Open files only if ns_do_open_file.
adff3182 3475
c32af1e4
PE
34762012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3477
7393bcbb
PE
3478 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3479 This no-op macro hasn't been needed for many years.
3480 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3481
c32af1e4
PE
3482 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3483 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3484 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3485 gdb_make_enums_visible.
3486 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3487 (DIRECTORY_SEP): Now a constant, not a macro.
3488
302fc036
EZ
34892012-07-30 Eli Zaretskii <eliz@gnu.org>
3490
3491 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3492 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3493
3494 * w32term.c <w32_keyboard_codepage>: Renamed from
3495 keyboard_codepage and now external. All users changed.
3496
3497 * w32term.h: Add declaration of w32_keyboard_codepage.
3498
3499 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3500 the codepage to translate keys to Unicode. If this argument is
3501 -1, use the value returned by GetConsoleCP. All callers changed.
3502
88fb40b4
PE
35032012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3504
0aee6912
PE
3505 Update .PHONY listings in makefiles.
3506 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3507 bootstrap-clean, distclean, maintainer-clean, versioclean,
3508 extraclean, frc.
3509
88fb40b4
PE
3510 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3511 This is a bit clearer. Fix some commentary typos.
3512
0a763bd1
GM
35132012-07-30 Glenn Morris <rgm@gnu.org>
3514
32bac6d6
GM
3515 * s/netbsd.h: Let configure include signal.h if needed.
3516 Remove file, which is now empty.
3517
b65e7c46
GM
3518 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3519 Let configure set them.
3520 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3521 No more need to undefine.
0a763bd1 3522
169304bd
AS
35232012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3524
3525 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3526 non-single-byte char when adding meta modifier. (Bug#12090)
3527
6cd7a139
DA
35282012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3529
3530 Convert safe_call to use variable number of arguments.
3531 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3532 (safe_call2): Fix comment.
3533 * lisp.h (safe_call): Adjust prototype.
3534 * coding.c (encode_coding_object): Change to use safe_call2.
3535 * xfaces.c (merge_face_heights): Change to use safe_call1.
3536
d34d6ffc
GM
35372012-07-30 Glenn Morris <rgm@gnu.org>
3538
7b8a48e4 3539 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 3540 does that unconditionally. Remove file, which is now empty.
7b8a48e4 3541
d34d6ffc
GM
3542 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3543 Remove empty files.
3544
03a660a6
PE
35452012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3546
3547 Export to GDB most of lisp.h's remaining object-like macros.
3548 * lisp.h (min, max): Move earlier, because they're used earlier now.
3549 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3550 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3551 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3552 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3553 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3554 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3555 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3556 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3557 Now constants, for GDB. They need not be macros.
3558 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3559 Now constants, for GDB, as well as macros, for static initializers.
3560 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3561 Move to after the definition of struct Lisp_Char_Table,
3562 since the former now needs that type defined.
3563 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3564 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3565 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3566 New enums, for gdb_make_enums_visible.
3567 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 3568 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
3569 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3570 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3571 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3572 enum maxargs, enum MAX_ALLOCA.
3573 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3574 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3575 no longer needed, now that they are done in lisp.h.
3576
e499d0ee
DA
35772012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3578
3579 Cleanup string bytes checking.
3580 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3581 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3582 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3583 (check_sblock, compact_small_strings): Simplify.
3584
d5040d2d
PE
35852012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3586
3587 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3588 These macros are confusing and no longer need to be defined, as
3589 the enum values now suffice. All uses replaced with definiens.
3590 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3591
7f259ae6
JB
35922012-07-29 Juanma Barranquero <lekktu@gmail.com>
3593
3594 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3595 ($(BLD)/w32console.$(O)): Update dependencies.
3596
7e63e0c3
DA
35972012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3598
3599 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3600 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3601 time. Adjust users.
3602 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3603
ffd817eb
JD
36042012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3605
3606 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3607 setting sitelisp (Bug#12010).
3608
417a7a0e
EZ
36092012-07-29 Eli Zaretskii <eliz@gnu.org>
3610
14ae4239 3611 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
3612
3613 * w32heap.c (cache_system_info):
3614 * w32.c (sys_rename):
3615 * w32proc.c (find_child_console, sys_kill): All users changed.
3616
387d4d92
PE
36172012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3618
3619 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3620
55a6cca6
EZ
36212012-07-29 Eli Zaretskii <eliz@gnu.org>
3622
3623 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3624
dbcf001c
DA
36252012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3626
3627 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
3628 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3629 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 3630
e2688e4a
DA
36312012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3632
3633 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3634 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3635 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3636 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3637 (replace_range, replace_range_2, del_range_2): Change to eassert.
3638 * marker.c (byte_char_debug_check): Adjust style.
3639
b46a6a83
PE
36402012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3641
3642 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3643 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3644 long-ago-commented-out code that talks about "WIN32".
3645 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3646 All uses changed.
3647
e32a5799
PE
36482012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3649
3650 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3651 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3652 Simplify by using alignof.
3653 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3654 * lisp.h: Include <stdalign.h>.
3655 (GCALIGNMENT): New macro and constant.
3656 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3657 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3658 (stdalign): New macro, if not already defined.
3659
df81cd29
EZ
36602012-07-28 Eli Zaretskii <eliz@gnu.org>
3661
01bd1b0d
EZ
3662 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3663 * w32inevt.c: Include w32inevt.h.
3664 (w32_read_console_input): New inline function, calls either
3665 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3666 w32_console_unicode_input.
3667 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3668 (w32_kbd_patch_key, key_event): Use the codepage returned by
3669 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3670 (key_event): use uChar.UnicodeChar only if
3671 w32_console_unicode_input is non-zero.
3672
3673 * w32console.c: Include w32heap.h.
3674 <w32_console_unicode_input>: New global variable.
3675 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3676 family of Windows, zero otherwise.
3677
3678 * w32inevt.h: Declare w32_console_unicode_input.
3679
df81cd29
EZ
3680 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3681 --without-x. (Bug#11742)
3682
c20fdd9e
PE
36832012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3684
3685 Adjust GDB to reflect pvec_type changes (Bug#12036).
3686 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
3687 2012-07-04 changes to pseudovector representation.
3688 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 3689
32770973 36902012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
3691
3692 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3693 bus address.
3694 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3695
3438fe21
EZ
36962012-07-27 Eli Zaretskii <eliz@gnu.org>
3697
bcfbc9de
EZ
3698 * alloc.c (listn): Fix the order the arguments are consed onto the
3699 list.
3700
3438fe21
EZ
3701 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3702 enumeration constants, as PURE and HEAP are too general, and clash
3703 with other headers and sources, such as gmalloc.c and the
3704 MS-Windows system headers. All users changed.
3705
eeaea515
DA
37062012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3707
3708 Revert last save_excursion_save and save_excursion_restore changes.
3709 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3710 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3711
073c88c2
DA
37122012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3713
3714 Fix recently-introduced typos in Windows port.
3715 Reported by Martin Rudalics <rudalics@gmx.at>.
3716 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 3717 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 3718
4706125e
PE
37192012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3720
3721 Improve GDB symbol export (Bug#12036).
3722 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3723 arms of an 'if', not using conditional expressions; otherwise GDB
3724 complains about the types in the unevaluated arm when the argument
3725 is an integer literal.
3726 (xgetint): Simplify expression.
3727 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3728 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3729 Zaretskii in <http://bugs.gnu.org/12036#13>.
3730 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3731 needed now that we have gdb_make_enums_visible.
3732 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3733 (enum enum_USE_LSB_TAG):
3734 New enum types, packaging up enums that need to be exported to GDB.
3735
694b6c97
DA
37362012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3737
3738 Utility function to make a list from specified amount of objects.
3739 * lisp.h (enum constype): New datatype.
3740 (listn): New prototype.
3741 * alloc.c (listn): New function.
3742 (Fmemory_use_count, syms_of_alloc): Use it.
3743 * buffer.c (syms_of_buffer): Likewise.
3744 * callint.c (syms_of_callint): Likewise.
3745 * charset.c (define_charset_internal): Likewise.
3746 * coding.c (syms_of_coding): Likewise.
3747 * keymap.c (syms_of_keymap): Likewise.
3748 * search.c (syms_of_search): Likewise.
3749 * syntax.c (syms_of_syntax): Likewise.
3750 * w32.c (init_environment): Likewise.
3751 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3752 * xdisp.c (syms_of_xdisp): Likewise.
3753 * xfns.c (syms_of_xfns): Likewise.
3754
6195f384
DA
37552012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3756
3757 Fast save_excursion_save and save_excursion_restore.
3758 * lisp.h (struct Lisp_Excursion): New data type.
3759 (PVEC_EXCURSION): New pseudovector type.
3760 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3761 to deal with it. Adjust comments.
3762 (init_marker, attach_marker): New prototype.
3763 (unchain_marker): Adjust prototype.
3764 * marker.c (attach_marker): Change to global.
3765 (init_marker): New function.
3766 * alloc.c (Fmake_marker, build_marker): Use it.
3767 (build_marker): More easserts.
3768 (mark_object): Handle struct Lisp_Excursion.
3769 * editfns.c (save_excursion_save, save_excursion_restore):
3770 Reimplement to use struct Lisp_Excursion. Add comments.
3771
5eceb8fb
PE
37722012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3773
3774 Fix export of symbols to GDB (Bug#12036).
3775 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3776 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3777 emacs.c, as this is a more-suitable home. Had this been done earlier
3778 the fix for 12036 would have avoided some of the problems noted in
3779 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3780 would have been more obvious.
562157c8
PE
3781 * emacs.c: Do not include <verify.h>; no longer needed.
3782 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
3783 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3784 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3785 Remove; now done in lisp.h.
3786 * lisp.h (PUBLISH_TO_GDB): New macro.
3787 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3788 (DATA_SEG_BITS): Use it.
3789 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3790 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3791 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3792 not be usable in #if. This simplifies things.
3793
d6749401
JB
37942012-07-26 Juanma Barranquero <lekktu@gmail.com>
3795
3796 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3797
1781b9e9
PE
37982012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3799
d89518db 3800 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
3801 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3802 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3803 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3804 Adjust to changes in lisp.h and emacs.c, by using
3805 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3806 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3807 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3808 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3809 instead of gdb_valbits.
3810 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3811 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3812 instead of gdb_array_mark_flag.
3813 (xboolvector): Get size from $->size, not $->header.size.
3814 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3815 (xreload, hook-run, hookpost-run): Remove.
3816 * emacs.c: Include <verify.h>.
3817 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3818 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3819 Remove.
3820 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3821 (gdb_USE_LSB_TAG): New enum constants.
3822 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3823 Also define these as enum constants, so they're visible to GDB.
3824 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3825 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3826 as constants, so they're visible to GDB.
3827 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3828 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3829 Now enum constants, not macros, so they're visible to GDB.
3830 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3831 more convenient now. All uses changed.
3832 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3833 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3834
3628596a
DA
38352012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3836
3837 Explicitly free restriction data that are not needed anymore.
3838 * editfns.c (save_restriction_restore): Free restriction data.
3839
7abaf5cc
SM
38402012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3841
3842 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3843 add argument, tune behavior, and adjust all callers.
3844
71f88e00
PE
38452012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3846
3847 Use typedef for EMACS_INT, EMACS_UINT.
3848 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3849 than macros. This simplifies debugging in the usual case, since
3850 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3851 and it allows expressions involving EMACS_INT casts.
3852 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3853
57ec3034
JD
38542012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3855
3856 * nsterm.m (ns_read_socket): Return early if there is a modal
3857 window (Bug#12043).
3858
8137e7b3
MR
38592012-07-25 Martin Rudalics <rudalics@gmx.at>
3860
3861 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3862 that FOCUS-FRAME can be omitted.
3863
04e9897c
DA
38642012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3865
3866 Adjust buffer text indirection counters at the end of Fkill_buffer.
3867 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3868 buffer is definitely dead. This should really fix an issue reported
3869 by Christoph Scholtes again. (Bug#12007).
3870 (init_buffer_once): Initialize indirection counters of
3871 buffer_defaults and buffer_local_symbols (for sanity and safety).
3872
8a0484e1
EZ
38732012-07-24 Eli Zaretskii <eliz@gnu.org>
3874
3875 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3876 and continuation glyphs on tooltip frames, leave them at zero.
3877 Avoids continued lines in tooltips. (Bug#11832)
3878
fa691a83
DA
38792012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3880
3881 Simplify copy_overlay.
04e9897c 3882 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
3883 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3884
436bc8e0
EZ
38852012-07-23 Eli Zaretskii <eliz@gnu.org>
3886
3887 * print.c (print_object): Don't crash when a frame's name is nil
3888 or invalid. (Bug#12025)
3889
3890 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3891 it signals an error when a tooltip frame is being created.
3892
d7a7fda3
DA
38932012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3894
3895 Cleanup miscellaneous objects allocation and initialization.
3896 * alloc.c (allocate_misc): Change to static. Add argument to
3897 specify the subtype. Adjust comment and users.
3898 (build_overlay): New function.
3899 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3900 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3901 (allocate_misc): Remove prototype.
3902 (build_overlay): Add prototype.
3903
39042012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
3905
3906 Swap buffer text indirection counters in Fbuffer_swap_text.
3907 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3908 This avoids crash reported by Christoph Scholtes at
3909 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3910
9d7fa573
JD
39112012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3912
3913 * nsmenu.m (Popdown_data): New struct.
3914 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3915 free Popdown_data.
3916 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3917 (initWithContentRect): Make imgView and contentView non-static
3918 and autorelease them. Also autorelease img and matrix (Bug#12005).
3919 (dealloc): Remove (Bug#12005).
3920
0dd6d66d
DA
39212012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3922
3923 Adjust consing_since_gc when objects are explicitly freed.
3924 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3925 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3926 (free_cons, free_misc): Subtract object size from consing_since_gc.
3927
d36d71df
DA
39282012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3929
3930 Simplify and cleanup markers positioning code.
3931 * marker.c (attach_marker): More useful eassert.
3932 (live_buffer, set_marker_internal): New function.
3933 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3934 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3935
fb9ea40f
PE
39362012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3937
3938 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3939 as it's limited by the amount of memory, not by INT_MAX.
3940
2d5c5f7d
EZ
39412012-07-21 Eli Zaretskii <eliz@gnu.org>
3942
07fb592e
EZ
3943 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3944 in special-event-map. See the discussion at
3945 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3946 for the reasons.
3947
37a9eac8 3948 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
3949 info.dwItemData. Fixes crashes on 64-bit Windows.
3950 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 3951
c4328746
JD
39522012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3953
fc0c31f8 3954 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 3955 (conversationIdentifier): Return value is NSInteger.
784051c4 3956 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 3957
6e5d1c12
CY
39582012-07-21 Chong Yidong <cyd@gnu.org>
3959
3960 * window.c (decode_any_window): Signal an error if the window is
3961 on a dead frame (Bug#11984).
3962
9928463d
DA
39632012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3964
3965 Add indirection counting to speed up Fkill_buffer.
3966 * buffer.h (struct buffer): New member.
3967 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3968 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3969 base buffer indirection counter.
3970 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3971 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3972 through buffer list if indirection counter is 0.
3973
f8643a6b
DA
39742012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3975
3976 Extend the value returned by Fgarbage_collect with heap statistics.
3977 * alloc.c (Qheap): New symbol.
3978 (syms_of_alloc): DEFSYM it.
3979 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3980 (Fmemory_free): Remove.
3981 (syms_of_alloc): Don't defsubr it.
3982 * buffer.c (Fcompact_buffer): Remove.
3983 (syms_of_buffer): Don't defsubr it.
3984
dac616ff
DA
39852012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3986
3987 Make maybe_gc inline.
3988 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3989 * lisp.h (consing_since_gc, gc_relative_threshold)
3990 (memory_full_cons_threshold): Revert declaration.
3991 (maybe_gc): Remove prototype, define as inline.
3992 * alloc.c: Remove old commented-out code.
3993 (consing_since_gc, gc_relative_threshold)
3994 (memory_full_cons_threshold): Revert to global.
3995 (maybe_gc): Remove.
3996
d7ea76b4
DA
39972012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3998
3999 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4000 * lisp.h (build_unibyte_string): New function.
4001 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4002 * sysdep.c, w32fns.c, xfns.c: Use it.
4003 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4004 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4005 Adjust users accordingly.
4006 * font.h (font_open_by_name): Adjust prototype.
4007
765e61e3
DA
40082012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4009
4010 Cleanup calls to Fgarbage_collect.
4011 * lisp.h (maybe_gc): New prototype.
4012 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4013 Remove declarations.
4014 * alloc.c (maybe_gc): New function.
4015 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4016 Make them static.
4017 * bytecode.c (MAYBE_GC): Use maybe_gc.
4018 * eval.c (eval_sub, Ffuncall): Likewise.
4019 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4020 to avoid dependency from auto-save feature.
4021
52b852c7
PE
40222012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4023
4024 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4025 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4026 'for_each_per_buffer_object_at'.
4027 All uses changed. It's better to use upper-case for macros that
4028 cannot be implemented as functions, to give the reader a clue
4029 that they're special.
4030
5db81e33
SM
40312012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4032
4033 * alloc.c (Fgarbage_collect): Tweak docstring.
4034
5b835e1d
DA
40352012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4036
4037 Tweak the value returned from Fgarbage_collect again.
4038 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4039 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4040 Adjust documentation.
4041 (total_vector_bytes): Rename to total_vector_slots, adjust
4042 accounting.
4043 (total_free_vector_bytes): Rename to total_free_vector_slots,
4044 adjust accounting.
4045 (Qstring_bytes, Qvector_slots): New symbols.
4046 (syms_of_alloc): DEFSYM them.
4047
9cd47b72
DA
40482012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4049
4050 Buffer compaction primitive which may be used from Lisp.
4051 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4052 (syms_of_buffer): Register Fcompact_buffer.
4053 * alloc.c (Fgarbage_collect): Use compact_buffer.
4054 * buffer.h (compact_buffer): New prototype.
4055 (struct buffer_text): New member.
4056
d17337e5
DA
40572012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4058
4059 New macro to iterate over all buffers, miscellaneous cleanups.
4060 * lisp.h (all_buffers): Remove declaration.
4061 * buffer.h (all_buffers): Add declaration, with comment.
4062 (for_each_buffer): New macro.
4063 * alloc.c (Fgarbage_collect, mark_object): Use it.
4064 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4065 (init_buffer): Likewise.
4066 * data.c (Fset_default): Likewise.
4067 * coding.c (code_conversion_restore): Remove redundant check
4068 for dead buffer.
4069 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4070
60cfd278
AS
40712012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4072
4073 Fix bug that created negative-length intervals.
4074 * intervals.c (merge_interval_right, merge_interval_left):
4075 Do not zero out this interval if it is absorbed by its children,
4076 as this interval's total length doesn't change in that case. See
4077 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4078
d06714cb
PE
40792012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4080
83713154
PE
4081 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4082 when invoking (make-bool-vector N t) and N is a positive
4083 multiple of 8 -- the last 8 bits were mistakenly cleared.
4084
d06714cb
PE
4085 Remove some struct layout assumptions in bool vectors.
4086 * alloc.c (bool_header_size): New constant.
4087 (header_size, word_size): Move earlier, as they're now used earlier.
4088 Use 'word_size' in a few more places, where it's appropriate.
4089 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4090 padding before the data member of a bool vector.
4091 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4092 than doing the check by hand with an abort ().
4093
464d5a5e
SM
40942012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4095
5fbc0409
SM
4096 * eval.c (Fdefvar): Don't check constants since we only set the var if
4097 it's not yet defined anyway (bug#11904).
4098
464d5a5e
SM
4099 * lisp.h (last_undo_boundary): Declare new var.
4100 * keyboard.c (command_loop_1): Set it.
4101 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4102 were auto-added by the command loop (bug#11774).
4103
8dc2e44a
AS
41042012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4105
4106 * w32font.c (Qsymbol): Remove local definition.
4107 (syms_of_w32font): Don't DEFSYM it.
4108
169925ec
DA
41092012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4110
4111 Fix sweep_vectors to handle large bool vectors correctly.
4112 * alloc.c (sweep_vectors): Account total_vector_bytes for
4113 bool vectors larger than VBLOCK_BYTES_MAX.
4114
5fbfb018
CY
41152012-07-18 Chong Yidong <cyd@gnu.org>
4116
4117 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4118 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4119
3ab6e069
DA
41202012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4121
4122 Return more descriptive data from Fgarbage_collect.
4123 Suggested by Stefan Monnier in
4124 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4125 * alloc.c (bounded_number): New function.
4126 (total_buffers, total_vectors): New variable.
4127 (total_string_size): Rename to total_string_bytes, adjust users.
4128 (total_vector_size): Rename to total_vector_bytes, adjust users.
4129 (sweep_vectors): Account total_vectors and total_vector_bytes.
4130 (Fgarbage_collect): New return value. Adjust documentation.
4131 (gc_sweep): Account total_buffers.
4132 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4133 (VECTOR_SIZE): Remove.
4134 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4135 (Qinterval, Qmisc): New symbols.
4136 (syms_of_data): Initialize them.
4137 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4138 (Qcons, Qbuffer): New declarations.
4139
6d02fe5b
PE
41402012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4141
4142 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4143 Round up, not down. Improve doc.
4144
b7ffe040
DA
41452012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4146
4147 Restore old code in allocate_string_data to avoid Faset breakage.
4148 Reported by Julien Danjou <julien@danjou.info> in
4149 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4150 * alloc.c (allocate_string_data): Restore old code with minor
4151 adjustments, fix comment to explain this subtle issue.
4152
4dc7c8d5
SM
41532012-07-17 Eli Zaretskii <eliz@gnu.org>
4154
4155 Remove FILE_SYSTEM_CASE.
4156 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4157
4158 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4159 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4160 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4161 call-process-region passes it through expand-file-name.
4162
4163 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4164
41652012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4166
4167 Fix crash when creating indirect buffer (Bug#11917)
4168 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4169 Don't handle unbound variables specially if non-zero.
4170 (Fbuffer_local_variables): Pass zero.
4171 (clone_per_buffer_values): Pass non-zero.
4172
41732012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4174
4175 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4176 to make the loop interruptible.
4177
41782012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4179
4180 * gnutls.c (emacs_gnutls_handshake): Only retry if
4181 GNUTLS_E_INTERRUPTED.
4182
cce7fefc
DA
41832012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4184
4185 Cleanup and convert miscellaneous checks to eassert.
4186 * alloc.c (mark_interval): Fix comment, partially rephrase
4187 old comment from intervals.h (see below).
4188 * intervals.c (find_interval, adjust_intervals_for_insertion)
4189 (delete_interval, adjust_intervals_for_deletion)
4190 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4191 Convert to eassert.
4192 (adjust_intervals_for_insertion, make_new_interval):
4193 Remove obsolete and unused code.
4194 * intervals.h (struct interval): Remove obsolete comment.
4195 * textprotp.c (erase_properties): Remove unused code.
4196 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4197 (Fremove_list_of_text_properties): Convert to eassert.
4198
9ea10cc3
CY
41992012-07-17 Chong Yidong <cyd@gnu.org>
4200
4201 * editfns.c (Finsert_char): Doc fix.
4202
3900d5de
DA
42032012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4204
4205 Fix previous change to make Fmemory_free always accurate.
4206 * alloc.c (make_interval): Update total_free_intervals.
4207 (make_float): Likewise for total_free_floats.
4208 (free_cons, Fcons): Likewise for total_free_conses.
4209 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4210 Likewise for total_free_vector_bytes.
4211 (Fmake_symbol): Likewise for total_free_symbols.
4212 (bytes_free): Remove.
4213
7098646f
DA
42142012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4215
4216 Simple free memory accounting feature.
4217 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4218 (sweep_vectors): Accumulate size of free vectors.
4219 (Fgarbage_collect): Setup bytes_free.
4220 (Fmemory_free): New function.
4221 (syms_of_alloc): Register it.
4222
22657b40
DA
42232012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4224
4225 Cleanup overlays checking.
4226 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4227 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4228 eassert and OVERLAYP.
4229 (sort_overlays): Change to use OVERLAYP.
4230
ddfc8813
RK
42312012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4232
4233 * editfns.c (Finsert_char): Make it interactive, and make the
4234 second arg optional. Copy interactive spec and docstring from
4235 ucs-insert.
4236
7c26cf3c
PE
42372012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4238
4239 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4240 Unlike the other wrapped functions, fabs has an unspecified
4241 effect on errno.
4242
5d127af9
JD
42432012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4244
4245 * nsterm.m (keyDown): Interpret flags without left/right bits
4246 as the left key (Bug#11670).
4247
6a0dd1d7
DA
42482012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4249
4250 Remove empty and useless init functions.
4251 * lisp.h (init_character_once, init_fns, init_image)
4252 (init_filelock, init_sound): Remove prototype.
4253 * character.c (init_character_once): Remove.
4254 * filelock.c (init_filelock): Likewise.
4255 * fns.c (init_fns): Likewise.
4256 * image.c (init_image): Likewise.
4257 * sound.c (init_sound): Likewise.
4258 * emacs.c (main): Adjust accordingly.
4259
7a6136fd
DA
42602012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4261
4262 * gtkutil.h: Tiny cleanups.
4263 (use_old_gtk_file_dialog): Remove useless declaration.
4264 (xg_uses_old_file_dialog): Add suggested const attribute.
4265
ce811ad9
EZ
42662012-07-15 Eli Zaretskii <eliz@gnu.org>
4267
4268 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4269 (bidi_paragraph_init): Use it to limit search forward for a strong
4270 directional character in abnormally large paragraphs full of
4271 neutral or weak characters. (Bug#11943)
4272
c9adfeaa
SF
42732012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4274
4275 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4276 the toolbar (Bug#9451).
4277 (xg_make_tool_item): Give the widget event box a transparent
4278 background.
4279
fff62aa9
DA
42802012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4281
4282 Cleanup basic allocation variables and functions.
4283 * alloc.c (ignore_warnings, init_intervals, init_float)
4284 (init_cons, init_symbol, init_marker): Remove.
4285 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4286 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4287 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4288 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4289 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4290 (staticidx, init_alloc_once, init_strings, free_ablock):
4291 Remove redundant initialization.
4292 * fns.c (init_weak_hash_tables): Remove.
4293 * lisp.h (init_weak_hash_tables): Remove prototype.
4294
9730daca
DA
42952012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4296
4297 Use zero_vector where appropriate.
4298 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4299 accordingly.
4300 * lisp.h (zero_vector): New declaration.
4301 * font.c (null_vector): Remove.
4302 (syms_of_font): Remove initialization and staticpro.
4303 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4304 * keymap.c (Faccessible_keymaps): Likewise.
4305
2e2d2a13
LL
43062012-07-15 Leo Liu <sdl.web@gmail.com>
4307
4308 * fringe.c: Fix typo in comments.
4309
cd276f6e
LL
43102012-07-14 Leo Liu <sdl.web@gmail.com>
4311
4312 * fringe.c: Add a new bitmap exclamation-mark.
4313
5a1131d9
EZ
43142012-07-14 Eli Zaretskii <eliz@gnu.org>
4315
4316 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4317
4318 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4319 (HAVE_MENUS): Don't define, defined by editing config.in with
4320 msdos/sed2v2.inp.
4321 (GMALLOC_INHIBIT_VALLOC): Don't define.
4322 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4323
22e983b7
JB
43242012-07-14 Juanma Barranquero <lekktu@gmail.com>
4325
4326 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4327
5b3f250f
GM
43282012-07-14 Glenn Morris <rgm@gnu.org>
4329
4330 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4331 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4332 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4333
33d63ff4
GM
43342012-07-13 Glenn Morris <rgm@gnu.org>
4335
5b633342
GM
4336 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4337
33d63ff4
GM
4338 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4339 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4340
b55b9f85
JD
43412012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4342
0dc8cf50
JD
4343 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4344 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4345 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4346 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4347 where appropriate.
4348 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4349 as boolean expression.
4350 (x_set_window_size): Remove unused variable toolbar.
4351 (ns_get_color_default, ns_mod_to_lisp): Remove.
4352 (ns_mouse_position): Remove unused variables xchar and ychar.
4353 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4354 (ns_set_vertical_scroll_bar): Remove unused variable count.
4355 (ns_delete_terminal): Remove unused variable i.
4356 (ns_term_init): Remove unused variables r, g and b.
4357 (mouseDown): Remove unused variable window.
4358 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4359 (initFrameFromEmacs): Remove unused variable vbextra.
4360 (mouseEntered): Remove unused variables p and dpyinfo.
4361 (mouseExited): Remove unused variables p and r.
4362 (ns_define_frame_cursor, ns_clear_frame_area)
4363 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4364 (menuDown): Assign [sender tag] to variable and cast the variable.
4365
4366 * nsterm.h (menuDown): Add id as type to argument sender.
4367 (ns_display_info_for_name): Add Lisp_Object argument.
4368 (ns_term_init): Add Lisp_Object argument.
4369 (ns_map_event_to_object): Add void argument.
4370 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4371 prototype with arguments and only declare if __OBJC__.
4372 (nxatoms_of_nsselect): Add void argument.
4373 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4374 (ns_alloc_autorelease_pool): Add void argument.
4375 (ns_release_autorelease_pool): Add void* argument.
4376 (ns_get_defaults_value): Add const char* argument.
4377
4378 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4379 (initFromContents): Use SSDATA where appropriate.
4380 (ns_update_menubar): Add braces to ambigous if-else.
4381 (initWithTitle): Put () around assignment in if statement.
4382 (ns_menu_show): Remove unused variables window and keymap.
4383 (update_frame_tool_bar): Remove unused variable selected_p.
4384 (initWithContentRect): Remove unused variable this_cmd_name.
4385
4386 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4387 appropriate.
4388 (setXBMColor): Remove unused variable len.
4389 (setPixmapData): Put () around assignment in loop statement.
4390
4391 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4392 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4393 where appropriate.
4394 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4395 around assignment in loop statement.
4396 (nsfont_open): Remove unused variable i.
4397 (nsfont_open): Remove unused variable len.
4398 (nsfont_draw): Remove unused variable cs.
4399
4400 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4401 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4402 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4403 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4404 (Fns_font_name, Fns_perform_service)
4405 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4406 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4407 (ns_set_name): Remove unused variable view.
4408 (x_set_menu_bar_lines): Remove unused variable olines.
4409 (x_set_tool_bar_lines): Remove unused variable root_window.
4410 (Fns_list_colors): Put () around assignment in while statement.
4411 (Fns_perform_service): Remove unused variable len.
4412 (Fns_display_usable_bounds): Remove unused variable top.
4413 (syms_of_nsfns): Remove unused variable i.
4414
b55b9f85
JD
4415 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4416 memcpy (Bug#11907).
4417
ed9265fc 44182012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
4419
4420 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4421 and free it with DestroyExceptionInfo (Bug#11558).
4422
ef099b57
JB
44232012-07-13 Juanma Barranquero <lekktu@gmail.com>
4424
4425 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4426 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4427 Set here, not in nt/config.nt.
4428
ea814a5d
EZ
44292012-07-13 Eli Zaretskii <eliz@gnu.org>
4430
4431 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4432 cursor overflow into the last glyph on display line when the right
4433 fringe is off. (Bug#11832)
4434
1a952767
PE
44352012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4436
4437 * xdisp.c (produce_special_glyphs): Now static.
4438 * dispextern.h (produce_special_glyphs): Remove decl.
4439
983188fd
GM
44402012-07-13 Glenn Morris <rgm@gnu.org>
4441
8d7c7eed 4442 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
4443 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4444
983188fd
GM
4445 * s/usg5-4-common.h (USG, USG5):
4446 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4447 * s/sol2-6.h (SOLARIS2):
4448 * s/irix6-5.h (IRIX6_5):
4449 * s/hpux10-20.h (USG, USG5, HPUX):
4450 * s/gnu-linux.h (USG, GNU_LINUX):
4451 * s/freebsd.h (BSD_SYSTEM):
4452 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4453 * s/cygwin.h (CYGWIN):
4454 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4455 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4456
d1e68667 44572012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
4458
4459 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 4460
6de0e799
GM
44612012-07-13 Glenn Morris <rgm@gnu.org>
4462
739ae010
GM
4463 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4464
dbee5793
GM
4465 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4466
6de0e799
GM
4467 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4468 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4469
b82da769
GM
44702012-07-12 Glenn Morris <rgm@gnu.org>
4471
4fae5a7a 4472 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
4473
4474 * process.c (init_process_emacs): Rename from init_process.
4475 The old name is also the name of a Mach system call.
4476 * lisp.h, emacs.c: Update for this name change.
4477 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4478 longer needed.
4479
5a979817
EZ
44802012-07-12 Eli Zaretskii <eliz@gnu.org>
4481
4482 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4483 memmove call that removes glyphs covered by the left truncation
4484 glyph. Improve commentary.
4485 (display_line): Fix display of continuation glyphs on GUI frames
4486 when the right fringe is turned off and variable-size fonts are
4487 used in the window. Move the code that appends a stretch glyph to
4488 produce_special_glyphs, so that it could be used for truncation
4489 and continuation glyphs alike.
4490 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4491 glyph of a suitably computed width, to align the special glyphs at
4492 the window margin. Code moved from display_line. (Bug#11832)
4493
3e91a053
GM
44942012-07-12 Glenn Morris <rgm@gnu.org>
4495
ba9e4b84
GM
4496 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4497
4498 * s/gnu-linux.h, s/hpux10-20.h:
4499 Do not unconditionally define HAVE_XRMSETDATABASE.
4500
3e91a053
GM
4501 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4502
b300b1f4
PE
45032012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4504
4505 Fix typos that broke OS X build.
4506 Reported by Randal L. Schwartz in
4507 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4508 * nsterm.m (ns_timeout): Add missing local decl.
4509 (ns_get_color): snprintf -> sprintf, to fix typo.
4510
6e777848
GM
45112012-07-12 Glenn Morris <rgm@gnu.org>
4512
3f922c37
GM
4513 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4514 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4515 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4516 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4517
0ab7b23a
GM
4518 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4519 Move PTY_OPEN to configure.
4520
6e777848
GM
4521 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4522 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4523 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4524
4a7edc24
DA
45252012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4526
4527 Use empty_unibyte_string where applicable.
4528 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4529 * lread.c (read1): Likewise.
4530 * xsettings.c (syms_of_xsettings): Likewise.
4531
308aab79
GM
45322012-07-12 Glenn Morris <rgm@gnu.org>
4533
42bd1719
GM
4534 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4535 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
4536 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4537 * s/hpux10-20.h (RUN_TIME_REMAP):
4538 * s/bsd-common.h (TABDLY): Move to configure.
4539
4540 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4541
4542 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4543
ea0bbd17 4544 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 4545 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
4546
4547 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 4548
308aab79
GM
4549 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4550 * s/template.h: Move NARROWPROTO to configure.
4551
ee1cf5cf
GM
45522012-07-11 Glenn Morris <rgm@gnu.org>
4553
30fe9bf4
GM
4554 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4555 unused since 2011-01-17 change to systty.h.
4556
ee1cf5cf
GM
4557 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4558 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4559 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4560
63e47e07
PE
45612012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4562
4563 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4564
c43fb4c3
GM
45652012-07-11 Glenn Morris <rgm@gnu.org>
4566
4567 * s/darwin.h, s/gnu-linux.h, s/template.h:
4568 Move INTERRUPT_INPUT to configure.
4569
e8df9267
DA
45702012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4571
4572 Minor adjustments to interning code.
4573 * lisp.h (intern, intern_c_string): Redefine as static inline
4574 wrappers for intern_1 and intern_c_string_1, respectively.
4575 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
4576 * lread.c (intern_1, intern_c_string_1, oblookup):
4577 Simplify Vobarray checking.
e8df9267
DA
4578 * font.c (font_intern_prop): Likewise. Adjust comment.
4579 * w32font.c (intern_font_name): Likewise.
4580
34348bd4
AS
45812012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4582
d96a1e0c
AS
4583 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4584
34348bd4
AS
4585 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4586 of Fcar/Fcdr if possible.
4587 * font.c (check_otf_features): Likewise.
4588 * fontset.c (Fnew_fontset): Likewise.
4589 * gnutls.c (Fgnutls_boot): Likewise.
4590 * minibuf.c (read_minibuf): Likewise.
4591 * msdos.c (IT_set_frame_parameters): Likewise.
4592 * xmenu.c (Fx_popup_dialog): Likewise.
4593 * w32menu.c (Fx_popup_dialog): Likewise.
4594
c8add24e
GM
45952012-07-11 Glenn Morris <rgm@gnu.org>
4596
4b575b3c
GM
4597 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4598 since nothing has defined it on these platforms.
4599
09f4e3b0
GM
4600 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4601 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4602
172bedef
GM
4603 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4604 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4605 Move CLASH_DETECTION to configure.
4606
249685df
GM
4607 * s/gnu.h: Remove file, which is now empty.
4608
c8add24e
GM
4609 * s/gnu.h, s/gnu-linux.h:
4610 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4611
b41253a3
JW
46122012-07-11 John Wiegley <johnw@newartisans.com>
4613
4614 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4615 function attribute, so we only use it if it exists in the
4616 compiler.
4617
d923b542
DA
46182012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4619
4620 Avoid call to strlen in fast_c_string_match_ignore_case.
4621 * search.c (fast_c_string_match_ignore_case): Change to use
4622 length argument. Adjust users accordingly.
4623 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4624
5ebbef1d
PE
46252012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4626
bb352260
PE
4627 Assume mkdir, rmdir.
4628 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4629 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4630
57054ddd
PE
4631 Assume rename.
4632 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4633
b747d3f7
PE
4634 Assume perror.
4635 * s/hpux10-20.h (HAVE_PERROR): Remove.
4636 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4637 Remove dummy definition, as this problem was obsolete long ago.
4638
5ebbef1d
PE
4639 Assume strerror.
4640 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4641
984e7f30
DA
46422012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4643
4644 Avoid calls to strlen in font processing functions.
4645 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
4646 (font_open_by_name): Change to use length argument.
4647 Adjust users accordingly.
d923b542
DA
4648 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4649 Adjust prototypes.
4650 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4651 Change to return ptrdiff_t.
984e7f30
DA
4652 (xfont_list_pattern, xfont_match): Use length returned by
4653 xfont_decode_coding_xlfd.
4654 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4655
20e94fdd
GM
46562012-07-11 Glenn Morris <rgm@gnu.org>
4657
9d596af3
GM
4658 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4659 Move DONT_REOPEN_PTY to configure.
4660
20e94fdd
GM
4661 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4662 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4663
e99a530f
PE
46642012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4665
22ffb973
PE
4666 Remove "#define unix" that is no longer needed (Bug#11905).
4667 * s/aix4-2.h (unix): Remove; no longer needed.
4668
e9a9ae03
PE
4669 EMACS_TIME simplification (Bug#11875).
4670 This replaces macros (which typically do not work in GDB)
4671 with functions, typedefs and enums, making the code easier to debug.
4672 The functional style also makes code easier to read and maintain.
4673 * systime.h: Include <sys/time.h> on all hosts, not just if
4674 WINDOWSNT, since 'struct timeval' is needed in general.
4675 (EMACS_TIME): Now a typedef, not a macro.
4676 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4677 not macros.
4678 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4679 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4680 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4681 (EMACS_TIME_LE): Now functions, not macros.
4682 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4683 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4684 which are not functions. All uses rewritten to use:
4685 (make_emacs_time): New function.
4686 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4687 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4688 not functions. All uses rewritten to use the following, respectively:
4689 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4690 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 4691 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
4692 * fileio.c (Fcopy_file):
4693 * xterm.c (XTflash): Get the current time closer to when it's used.
4694 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4695
ffacb126
PE
4696 * bytecode.c (targets): Suppress -Woverride-init warnings.
4697
e99a530f
PE
4698 Simplify by avoiding confusing use of strncpy etc.
4699 * doc.c (Fsnarf_documentation):
4700 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4701 * frame.c (Fmake_terminal_frame):
4702 * gtkutil.c (get_utf8_string):
4703 * lread.c (openp):
4704 * nsmenu.m (ns_update_menubar):
4705 * regex.c (regerror):
4706 Prefer memcpy to strncpy and strncat when either will do.
4707 * fileio.c (Fsubstitute_in_file_name):
4708 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4709 (menu_separator_name_p):
4710 * nsmenu.m (ns_update_menubar):
4711 Prefer memcmp to strncmp when either will do.
4712 * nsterm.m: Include <ftoastr.h>.
4713 (ns_get_color):
4714 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4715 Prefer snprintf to strncpy.
4716 * nsterm.m (ns_term_init):
4717 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4718 * nsterm.m (ns_term_init):
4719 Avoid the need for strncpy, by using build_string or
4720 make_unibyte_string directly. Use dtoastr, not snprintf.
4721 * process.c (Fmake_network_process): Diagnose service names that
4722 are too long, rather than silently truncating them or creating
4723 non-null-terminated names.
4724 (Fnetwork_interface_info): Likewise, for interface names.
4725 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4726 Prefer sprintf to strncat.
4727 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4728 Prefer vsnprintf to vsprintf + strncpy.
4729
c59592b3
GM
47302012-07-10 Glenn Morris <rgm@gnu.org>
4731
4732 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4733 Clarify fallback case.
4734
7d7bbefd
DA
47352012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4736
4737 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4738 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4739 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 4740 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
4741 where argument type is known to be a Lisp_Cons.
4742
3a4c8000
TT
47432012-07-10 Tom Tromey <tromey@redhat.com>
4744
4745 * bytecode.c (BYTE_CODE_THREADED): New macro.
4746 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4747 (enum byte_code_op): New type.
4748 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4749 (exec_byte_code): Use them. Use token threading when applicable.
4750
2a0213a6
DA
47512012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4752
4753 Optimize pure C strings initialization.
4754 * lisp.h (make_pure_string): Fix prototype.
4755 (build_pure_c_string): New function, defined as static inline. This
4756 provides a better opportunity to optimize away calls to strlen when
4757 the function is called with compile-time constant argument.
4758 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4759 argument, adjust users accordingly. Use build_pure_c_string where
4760 appropriate.
4761 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4762 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4763 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4764
cb1caeaf
DA
47652012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4766
4767 Avoid calls to strlen in miscellaneous functions.
4768 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4769 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4770 * lread.c (openp): Likewise.
4771
c293e30c
DA
47722012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4773
4774 Avoid calls to strlen in path processing functions.
4775 * fileio.c (file_name_as_directory): Add comment. Change to add
4776 srclen argument and return the length of result. Adjust users
4777 accordingly.
4778 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
4779 swap 1st and 2nd arguments to obey the common convention.
4780 Adjust users accordingly.
c293e30c
DA
4781 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4782
9e059e3f
GM
47832012-07-10 Glenn Morris <rgm@gnu.org>
4784
d02eb359
GM
4785 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4786 Move PENDING_OUTPUT_COUNT definition to configure.
4787
882cf227
GM
4788 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4789 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4790 * s/gnu.h (DATA_START): Move definitions to configure.
4791
af6e839f
GM
4792 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4793 We include usg5-4-common.h, which defines them both.
4794
40289a12
GM
4795 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4796 O_RDONLY already includes it).
4797
9e059e3f
GM
4798 Stop ns builds setting the EMACSLOADPATH environment variable.
4799 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4800 Now it does not set EMACSLOADPATH, just returns the load-path string.
4801 * nsterm.h: Update accordingly.
4802 * lread.c [HAVE_NS]: Include nsterm.h.
4803 (init_lread) [HAVE_NS]: Use ns_load_path.
4804 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4805
7c4e8ec0
GM
48062012-07-09 Glenn Morris <rgm@gnu.org>
4807
d4f600ff
GM
4808 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4809 since the included bsd-common.h does so.
4810
cbb31951
GM
4811 Stop ns builds setting the EMACSPATH environment variable.
4812 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4813 (ns_init_paths): Do not set EMACSPATH.
4814 * nsterm.h (ns_exec_path): Add it.
4815 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4816 Use ns_exec_path.
4817
7c4e8ec0
GM
4818 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4819
26bccfae
PE
48202012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4821
a0bee46f
PE
4822 * process.c (wait_reading_process_output): 'waitchannels' was unset
4823 when read_kbd || !NILP (wait_for_cell); fix this.
4824
5994c183
PE
4825 Add GCC-style 'const' attribute to functions that can use it.
4826 * character.h (char_resolve_modifier_mask):
4827 * keyboard.h (make_ctrl_char):
4828 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4829 (init_character_once, next_almost_prime, init_fns, init_image)
4830 (flush_pending_output, init_sound):
4831 * mem-limits.h (start_of_data):
4832 * menu.h (finish_menu_items):
4833 Add ATTRIBUTE_CONST.
4834 * emacs.c (DEFINE_DUMMY_FUNCTION):
4835 Declare the dummy function with ATTRIBUTE_CONST.
4836 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4837 Add decls with ATTRIBUTE_CONST.
4838
26bccfae
PE
4839 Minor improvements to make_formatted_string.
4840 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4841 where int is good enough, as vsprintf returns an int.
4842 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4843
a8290ec3
DA
48442012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4845
4846 Use make_formatted_string to avoid double length calculation.
4847 * lisp.h (make_formatted_string): New prototype.
4848 * alloc.c (make_formatted_string): New function.
4849 * buffer.c (Fgenerate_new_buffer_name): Use it.
4850 * dbus.c (syms_of_dbusbind): Likewise.
4851 * editfns.c (Fcurrent_time_zone): Likewise.
4852 * filelock.c (get_boot_time): Likewise.
4853 * frame.c (make_terminal_frame, set_term_frame_name)
4854 (x_report_frame_params): Likewise.
4855 * image.c (gs_load): Likewise.
4856 * minibuf.c (get_minibuffer): Likewise.
4857 * msdos.c (dos_set_window_size): Likewise.
4858 * process.c (make_process): Likewise.
4859 * xdisp.c (ensure_echo_area_buffers): Likewise.
4860 * xsettings.c (apply_xft_settings): Likewise.
4861
d01ba2f1
GM
48622012-07-09 Glenn Morris <rgm@gnu.org>
4863
4864 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4865 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4866 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4867 * nsterm.h (ns_etc_directory): Add it.
4868 * callproc.c [HAVE_NS]: Include nsterm.h.
4869 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4870
f1f924b6
DA
48712012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4872
4873 Move marker debugging code under MARKER_DEBUG.
4874 * marker.c (MARKER_DEBUG): Move marker debugging code under
4875 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4876 for bootstrap with --enable-checking (~3x slowdown reported
4877 by Juanma Barranquero <lekktu@gmail.com>).
4878 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4879
ab531b66
PE
48802012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4881
4882 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4883 See <http://bugs.gnu.org/11825#29>.
4884
c4b3bc8a
EZ
48852012-07-08 Eli Zaretskii <eliz@gnu.org>
4886
4887 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4888 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
4889 (display_line): Add commentary about displaying truncation glyphs
4890 on GUI frames.
4891 (produce_special_glyphs): Move here from term.c.
4892
4893 * term.c (produce_special_glyphs): Move to xdisp.c.
4894
4895 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4896 section.
c4b3bc8a 4897
b676b881
AS
48982012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4899
f17c5273
AS
4900 * xdisp.c (display_line): Avoid warning about implicit declaration
4901 of FRAME_FONT.
4902
298819b9
AS
4903 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4904
b676b881
AS
4905 * lisp.h: Remove empty conditional.
4906
6045c4fd
PE
49072012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4908
b3350bf9
PE
4909 * lread.c (load_path_check): Now static.
4910
6045c4fd
PE
4911 Fix some minor --with-ns problems found by static checking.
4912 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4913 (x_set_font) [!HAVE_X_WINDOWS]:
4914 * image.c (xpm_load_image) [HAVE_NS]:
4915 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4916 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4917 Remove unused local.
4918 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4919 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4920 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4921 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4922 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4923 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4924 Fix pointer signedness problem.
4925 * xfaces.c (FRAME_X_FONT_TABLE):
4926 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4927
929e7845
GM
49282012-07-07 Glenn Morris <rgm@gnu.org>
4929
4930 * lread.c (load_path_check): New function, split from init_lread.
4931 (init_lread): Reorganize. Motivation:
4932 If EMACSLOADPATH is set, check/warn about that rather than the
4933 defaults, which we are not going to use. Hence we can remove
4934 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4935 Don't warn if site-lisp directories are missing.
4936 If not installed, start from a blank load-path, since
4937 PATH_LOADSEARCH refers to the eventual installation directories.
4938
58dd0aa4
EZ
49392012-07-07 Eli Zaretskii <eliz@gnu.org>
4940
4941 Support truncation and continuation glyphs on GUI frames, when
4942 fringes are disabled. (Bug#11832)
4943 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
4944 continuation glyphs even if on GUI frames.
4945 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
4946 or both, are absent.
4947 (start_display, move_it_in_display_line_to): Handle the case of a
4948 GUI frame without a fringe to display continuation or truncation
4949 glyphs.
4950 (insert_left_trunc_glyphs): Support GUI frames: make sure
4951 truncation glyphs overwrite enough glyphs from the current line to
4952 have sufficient space in pixels.
4953 (display_line): Support truncation and continuation glyphs on GUI
4954 frames. If some spare pixels are left on the line after inserting
4955 the truncation glyphs, fill that space with a stretch glyph of a
4956 suitably computed width.
4957
4958 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4959 produce_glyphs, to support GUI sessions.
4960
31571fd7
PE
49612012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4962
5a16b9bc
PE
4963 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4964
f3047c75
PE
4965 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4966
31571fd7
PE
4967 Do not require float-time's arg to fit in time_t (Bug#11825).
4968 This works better on hosts where time_t is unsigned, and where
4969 float-time is applied to the (negative) difference between two times.
4970 * editfns.c (decode_time_components): Last arg is now double *,
4971 not int *, and means to store all the result as a double, without
4972 worrying about whether the seconds part fits in time_t.
4973 All callers changed.
4974 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4975 All callers changed.
4976 (Ffloat_time): Do not fail merely because the specified time falls
4977 outside of time_t range.
4978
4516fbef
GM
49792012-07-07 Glenn Morris <rgm@gnu.org>
4980
4981 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4982 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4983 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4984
07adc2c6
JB
49852012-07-07 Juanma Barranquero <lekktu@gmail.com>
4986
4987 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4988 Update dependencies.
4989
4990 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4991
fd573f31
PE
49922012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4993
fee5959d
PE
4994 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4995 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4996 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4997 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4998 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4999 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5000
fd573f31
PE
5001 * xfont.c (compare_font_names): Redo to omit the need for casts.
5002
ddadbc0e
AS
50032012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5004
fca8d6b6
AS
5005 * xfns.c (Fx_change_window_property): Doc fix.
5006 * w32fns.c (Fx_change_window_property): Doc fix.
5007
ddadbc0e
AS
5008 * w32fns.c (Fx_window_property): Accept the same arguments as the
5009 X Windows version. Doc fix.
5010 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5011
ed9265fc 50122012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
5013 Eli Zaretskii <eliz@gnu.org>
5014
5015 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5016 Windows-specific code from nt/config.nt moved here.
5017 Obsolete settings removed.
5018
216ee680
PE
50192012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5020
5021 * process.c: Avoid unnecessary calls to gettime.
5022 (wait_reading_process_output): Don't get the time of day
5023 when gobbling data immediately and not waiting, as there's no need
5024 for it in that case. This removes a FIXME.
5025
bdd091e4
JD
50262012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5027
5028 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5029 is defined (Bug#11768).
5030
9d44f8ce
DA
50312012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5032
5033 Fix marker debugging code.
5034 * marker.c (byte_char_debug_check): Do not perform the check
5035 if buffer is not multibyte.
090bd7cb
JB
5036 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5037 Call byte_char_debug_check with correct arguments.
9d44f8ce 5038
90fc4786
DA
50392012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5040
5041 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
5042 * marker.c (byte_char_debug_check, count_markers):
5043 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
5044 (byte_debug_flag): Remove.
5045 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5046 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5047
7b7ae965
DA
50482012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5049
4e57b342
DA
5050 Avoid code repetition in marker-related functions.
5051 * marker.c (attach_marker): New function.
5052 (Fset_marker, set_marker_restricted, set_marker_both)
5053 (set_marker_restricted_both): Use it.
5054 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5055 Consistently rename charno to charpos.
5056 (marker_position): Add eassert.
5057 (marker_byte_position): Convert to eassert.
5058
50592012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5060
5061 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 5062 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 5063 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 5064
657924ff
DA
50652012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5066
5067 Introduce fast path for the widely used marker operation.
5068 * alloc.c (build_marker): New function.
5069 * lisp.h (build_marker): New prototype.
5070 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5071 * composite.c (autocmp_chars): Likewise.
5072 * editfns.c (buildmark): Remove.
5073 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5074 (save_restriction_save): Use build_marker.
5075 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5076 * window.c (save_window_save): Likewise.
5077
041a49a6
DA
50782012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5079
5080 Do not use Fdelete_overlay in delete_all_overlays
5081 to avoid redundant calls to unchain_overlay.
5082 * buffer.c (drop_overlay): New function.
5083 (delete_all_overlays, Fdelete_overlay): Use it.
5084 * minibuf.c (get_minibuffer): Fix comment.
5085
7dca65a4
PE
50862012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5087
5088 Port to OpenBSD 5.1 amd64.
5089 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5090 This is needed for OpenBSD, and should be harmless on all BSD systems.
5091 Also, include <sys/sysctl.h>, as it should be available on all
5092 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5093 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5094 use p_pid member, not kp_proc.pid.
5095
8eb876e2
GM
50962012-07-06 Glenn Morris <rgm@gnu.org>
5097
5098 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5099
38182d90
PE
51002012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5101
5102 More xmalloc and related cleanup.
5103 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5104 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5105 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5106 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5107 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5108 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5109 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5110 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5111 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5112 * xterm.c:
5113 Omit needless casts involving void * pointers and allocation.
5114 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5115 as the former is more robust if P's type is changed.
5116 Prefer xzalloc to xmalloc + memset 0.
5117 Simplify malloc-or-realloc to realloc.
5118 Don't worry about xmalloc returning a null pointer.
5119 Prefer xstrdup to xmalloc + strcpy.
5120 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5121 growing it.
5122 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5123 alloca of a constant.
5124
6dd5a677
EZ
51252012-07-05 Eli Zaretskii <eliz@gnu.org>
5126
5127 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5128 hscroll is larger than the line width. Fixes long and futile
5129 looping inside extend_face_to_end_of_line (on a TTY) producing
5130 glyphs that are not needed and thrown away.
5131
6b312f0f
DA
51322012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5133
5134 * marker.c (set_marker_restricted_both): Simplify by using
5135 clip_to_bounds.
5136
f520ef9b
PE
51372012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5138
5139 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5140
383b7c95
JD
51412012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5142
5143 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5144 not defined (Bug#11768).
5145 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5146 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5147 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5148 followed by gtk_box_set_homogeneous (Bug#11768).
5149 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
5150 (update_theme_scrollbar_width, xg_create_scroll_bar):
5151 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
5152 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5153 (is_box_type): New function (Bug#11768).
5154 (xg_tool_item_stale_p): Call is_box_type.
5293d758 5155 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
5156 with default display (Bug#11768).
5157
d6e7bf45
EZ
51582012-07-05 Eli Zaretskii <eliz@gnu.org>
5159
5160 * xdisp.c (window_hscroll_limited): New function.
5161 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5162 coordinates when window's hscroll is set to insanely large
5163 values. (Bug#11857)
5164
431391ec
JB
51652012-07-05 Juanma Barranquero <lekktu@gmail.com>
5166
5167 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5168 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5169
23f86fce
DA
51702012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5171
5172 Cleanup xmalloc.
5173 * lisp.h (xzalloc): New prototype. Omit needless casts.
5174 * alloc.c (xzalloc): New function. Omit needless casts.
5175 * charset.c: Omit needless casts. Convert all calls to
5176 xmalloc with following memset to xzalloc.
5177 * dispnew.c: Likewise.
5178 * fringe.c: Likewise.
5179 * image.c: Likewise.
5180 * sound.c: Likewise.
5181 * term.c: Likewise.
5182 * w32fns.c: Likewise.
5183 * w32font.c: Likewise.
5184 * w32term.c: Likewise.
5185 * xfaces.c: Likewise.
5186 * xfns.c: Likewise.
5187 * xterm.c: Likewise.
5188 * atimer.c: Omit needless casts.
5189 * buffer.c: Likewise.
5190 * callproc.c: Likewise.
5191 * ccl.c: Likewise.
5192 * coding.c: Likewise.
5193 * composite.c: Likewise.
5194 * doc.c: Likewise.
5195 * doprnt.c: Likewise.
5196 * editfns.c: Likewise.
5197 * emacs.c: Likewise.
5198 * eval.c: Likewise.
5199 * filelock.c: Likewise.
5200 * fns.c: Likewise.
5201 * gtkutil.c: Likewise.
5202 * keyboard.c: Likewise.
5203 * lisp.h: Likewise.
5204 * lread.c: Likewise.
5205 * minibuf.c: Likewise.
5206 * msdos.c: Likewise.
5207 * print.c: Likewise.
5208 * process.c: Likewise.
5209 * region-cache.c: Likewise.
5210 * search.c: Likewise.
5211 * sysdep.c: Likewise.
5212 * termcap.c: Likewise.
5213 * terminal.c: Likewise.
5214 * tparam.c: Likewise.
5215 * w16select.c: Likewise.
5216 * w32.c: Likewise.
5217 * w32reg.c: Likewise.
5218 * w32select.c: Likewise.
5219 * w32uniscribe.c: Likewise.
5220 * widget.c: Likewise.
5221 * xdisp.c: Likewise.
5222 * xmenu.c: Likewise.
5223 * xrdb.c: Likewise.
5224 * xselect.c: Likewise.
5225
0497dc44
PE
52262012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5227
5228 * fileio.c (time_error_value): Check the right error number.
5229 Problem reported by Troels Nielsen in
5230 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5231
356e7178
PE
52322012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5233
4e71fd89
PE
5234 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5235 This should be fixed in a better way; see Eli Zaretskii in
5236 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5237 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5238
f0941253
PE
5239 * fileio.c (time_error_value): Rename from special_mtime.
5240 The old name's problems were noted by Eli Zaretskii in
5241 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5242
065c9eb4
PE
5243 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5244 This variable's comment says Emacs needs at least one GDB-visible
5245 symbol of type enum pvec_type, to work around GDB problems.
5246 The symbol's value doesn't matter.
5247
356e7178
PE
5248 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5249 that causes compilation to fail on pre-C99 compilers.
5250
ed9265fc 52512012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
5252
5253 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5254 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5255
3884d954
DA
52562012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5257
d209e2fb 5258 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
5259 headers for buffer_defaults and buffer_local_symbols.
5260 Reported by Juanma Barranquero <lekktu@gmail.com>.
5261
ee28be33
SM
52622012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5263
5264 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5265 * lisp.h (enum pvec_type): Use fewer bits.
5266 (PSEUDOVECTOR_SIZE_BITS): New constant.
5267 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5268 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5269 change in pvec_type.
5270 (PSEUDOVECTOR_TYPEP): New macro.
5271 (TYPED_PSEUDOVECTORP): Use it.
5272 * fns.c (internal_equal): Adapt code to extract pvectype.
5273 * emacs.c (gdb_pvec_type): Update type.
5274 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5275 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5276 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5277 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5278 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5279 abusing vector->header.next.nbytes.
5280 (live_vector_p): Use PVEC_TYPE.
5281 (mark_object): Adapt code to extract pvectype. Use switch.
5282
c7f2cd7f
PE
52832012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5284
5285 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5286 Tighten new eassert a bit.
5287
8ce70ed2
DA
52882012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5289
5290 Fix compilation with --enable-gcc-warnings and -O1
5291 optimization level.
5292 * doprnt.c (doprnt): Change type of tem to int, initialize
5293 to avoid compiler warning. Add eassert.
5294 * search.c (simple_search): Initialize match_byte to avoid
5295 compiler warning. Add eassert.
5296
dea7f1e5
PE
52972012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5298
24a212eb
PE
5299 Avoid weird behavior with large horizontal scrolls.
5300 Without this change, for example, large hscroll values would
5301 mess up Emacs's display on Fedora 15 x86, presumably due to
5302 overflows in int calculations in the display code.
5303 Also, if buffers had long lines, Emacs would freeze.
5304 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5305 (set_window_hscroll): New function, containing the old guts of
5306 Fset_window_hscroll. Return the clipped value.
5307 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5308 This avoids the need to check against PTRDIFF_MAX.
5309
dea7f1e5
PE
5310 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5311
76046526
DA
53122012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5313
5314 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5315
39adff0d
PE
53162012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5317
63807d47
PE
5318 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5319 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5320 since GCC 4.4.6 issues a bogus warning for them.
5321
39adff0d
PE
5322 Fix bugs in file timestamp newness comparisons.
5323 * fileio.c (Ffile_newer_than_file_p):
5324 * lread.c (Fload): Use full timestamp resolution of files,
5325 not just the 1-second resolution, so that files that are only
5326 slightly newer still count as newer.
5327 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5328 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5329
dbeed9a6
PE
53302012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5331
5332 * fileio.c: Improve handling of file time marker. (Bug#11852)
5333 (special_mtime): New function.
5334 (Finsert_file_contents, Fverify_visited_file_modtime):
5335 Use it to set special mtime values consistently.
5336
636334d6
AS
53372012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5338
5339 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5340 marker for non-existing file. (Bug#11852)
5341
e2017fe2
GM
53422012-07-03 Glenn Morris <rgm@gnu.org>
5343
5344 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5345 and did not make it into globals.h).
5346
404dbd37
TT
53472012-07-03 Tom Tromey <tromey@redhat.com>
5348
5349 * window.c (Fset_window_margins, Fset_window_fringes)
5350 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5351 * textprop.c (Fprevious_property_change): No longer static.
5352 * syntax.c (Fsyntax_table_p): No longer static.
5353 * process.c (Fget_process, Fprocess_datagram_address): No longer
5354 static.
5355 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5356 * keyboard.c (Fcommand_execute): No longer static.
5357 Remove EXFUN.
5358 * insdel.c (Fcombine_after_change_execute): No longer static.
5359 * image.c (Finit_image_library): No longer static.
5360 * fileio.c (Fmake_symbolic_link): No longer static.
5361 * eval.c (Ffetch_bytecode): No longer static.
5362 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
5363 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5364 No longer static.
404dbd37
TT
5365 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5366 static.
5367 * dired.c (Ffile_attributes): No longer static.
5368 * composite.c (Fcomposition_get_gstring): No longer static.
5369 * callproc.c (Fgetenv_internal): No longer static.
5370
5371 * ccl.h: Remove EXFUNs.
5372 * buffer.h: Remove EXFUNs.
5373 * dispextern.h: Remove EXFUNs.
5374 * intervals.h: Remove EXFUNs.
5375 * fontset.h: Remove EXFUN.
5376 * font.h: Remove EXFUNs.
5377 * dosfns.c (system_process_attributes): Remove EXFUN.
5378 * keymap.h: Remove EXFUNs.
5379 * lisp.h: Remove EXFUNs.
5380 * w32term.h: Remove EXFUNs.
5381 * window.h: Remove EXFUNs.
5382 * xsettings.h: Remove EXFUN.
5383 * xterm.h: Remove EXFUN.
5384
8e4fd1e1
GM
53852012-07-03 Glenn Morris <rgm@gnu.org>
5386
5387 * lisp.h (Frandom): Make it visible to C.
5388 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5389 buffer for invisible buffers. (Bug#1229)
5390
ca95b3eb
DA
53912012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5392
5393 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5394 values which aren't power of 2.
14ae4239
BT
5395 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5396 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
5397 accordingly.
5398
7555c33f
SM
53992012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5400
5401 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5402
5403 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5404
d12e8f5a
DA
54052012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5406
5407 * alloc.c (allocate_vector_block): Remove redundant
5408 calls to mallopt if DOUG_LEA_MALLOC is defined.
5409 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5410 avoid calls to mallopt if zero_vector is returned.
5411
296094c3
DA
54122012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5413
5414 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5415 is enabled, avoid dereferencing NULL current_sblock if
5416 running undumped.
5417
36429c89
DA
54182012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5419
5420 Cleanup basic buffer management.
5421 * buffer.h (struct buffer): Change layout to use generic vector
5422 marking code. Fix some comments. Change type of 'clip_changed'
5423 to bitfield. Remove unused #ifndef old.
5424 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5425 (GET_OVERLAYS_AT): Fix indentation.
5426 (for_each_per_buffer_object_at): New macro.
5427 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5428 (Fbuffer_local_variables): Use it.
5429 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5430 * alloc.c (allocate_buffer): Adjust to match new layout of
5431 struct buffer. Fix comment.
5432 (mark_overlay): New function.
5433 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5434 Lisp area of struct buffer.
5435 (mark_object): Use it. Adjust marking of misc objects
5436 and related comments.
5437
3b3e4cac
PE
54382012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5439
5440 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5441 wrapper that is not needed because the wrapped code is a no-op (zero
5442 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5443 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5444
cf5c0175
DA
54452012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5446
5447 * alloc.c (mark_buffer): Simplify. Remove prototype.
5448 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 5449 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
5450 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5451 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 5452
ca26824c
GM
54532012-06-30 Glenn Morris <rgm@gnu.org>
5454
2e4c5312
GM
5455 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5456
ca26824c
GM
5457 * epaths.in (PATH_SITELOADSEARCH): New.
5458 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5459 This is rather than relying on --enable-locallisppath elements
5460 having "site-lisp" in their names. (Bug#10208#25, 11658)
5461
0d23c240
EZ
54622012-06-30 Eli Zaretskii <eliz@gnu.org>
5463
c9240d7a
EZ
5464 * w32proc.c (sys_select): Accept and ignore one more argument.
5465
5466 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5467
0d23c240 5468 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 5469 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
5470
5471 * sysdep.c: Don't include dos.h and dosfns.h.
5472
5473 * process.c (sys_select):
5474 * msdos.c (sys_select): Accept one more argument and ignore it.
5475
5476 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5477 adapt data types and code to that.
5478
5479 * dosfns.c:
5480 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5481 which clashes with the gnulib function of the same name.
5482
af5a5a98
AS
54832012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5484
c5e4379c
AS
5485 * font.c (font_style_to_value, font_style_symbolic)
5486 (font_prop_validate_style): Add type checks for values in
5487 font_style_table.
5488
af5a5a98
AS
5489 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5490 argument.
5491 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5492 uses.
5493
8d38f461
EZ
54942012-06-29 Eli Zaretskii <eliz@gnu.org>
5495
2e5a6631
EZ
5496 * xdisp.c (try_window_id): Undo last change.
5497
8d38f461
EZ
5498 * w32.c (getwd): Adjust commentary about startup_dir.
5499 (init_environment): Always call sys_access, even in non-MSVC
5500 builds. Don't chdir to the directory of the Emacs executable.
5501 This undoes code from 1997 which was justified by the need to
5502 "avoid conflicts when removing and renaming directories". But its
5503 downside was that every relative file name was being interpreted
5504 relative to the directory of the Emacs executable, which can never
5505 be TRT. In particular, it broke sys_access when called with
5506 relative file names.
5507 (sys_access): Map GetLastError to errno.
5508
2af3565e
DA
55092012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5510
5511 * window.h (struct window): Change type of 'fringes_outside_margins'
5512 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 5513 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
5514 Adjust comment.
5515 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5516 to ptrdiff_t.
5517
c8d3a25c 55182012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 5519
c8d3a25c
GM
5520 * gnutls.c (emacs_gnutls_handshake):
5521 Add QUIT to make the loop interruptible.
57570cd3 5522
c8d3a25c 55232012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 5524
c8d3a25c
GM
5525 * charset.c (init_charset): Make lack of etc/charsets fatal.
5526
3e984ee8
DA
55272012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5528
5529 * editfns.c (region_limit): Fix type mismatch.
5530
ef884f23
DA
55312012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5532
5533 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5534 undefined. Convert from xassert to eassert.
5535 * nsmenu.m: Convert from xassert to eassert.
5536 * nsterm.m: Likewise.
5537
7d7e0027
SM
55382012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5539
5540 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5541
aa754e6a
PE
55422012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5543
5544 Avoid integer overflow on scroll-left and scroll-right.
5545 * window.c (HSCROLL_MAX): New macro.
5546 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5547 overflow when requested scroll falls outside ptrdiff_t range.
5548
80b00b08
DA
55492012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5550
5551 * window.h (struct window): Change type of 'hscroll',
5552 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5553 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5554 Adjust users accordingly.
5555 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5556 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5557 from EMACS_INT to ptrdiff_t.
5558 (make_window): Omit redundant initialization.
5559
62b2bcf6
JB
55602012-06-28 Juanma Barranquero <lekktu@gmail.com>
5561
5562 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5563
45942c7d
DA
55642012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5565
5566 * window.h (struct window): Change type of 'use_time' and
5567 'sequence_number' from Lisp_Object to int.
5568 * frame.c (make_frame): Adjust users accordingly.
5569 * print.c (print_object): Likewise.
5570 * window.c (select_window, Fwindow_use_time, make_parent_window)
5571 (make_window): Likewise.
5572
e509cfa6
DA
55732012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5574
5575 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5576 enabled with --enable-checking=[all,glyphs] configure option.
5577 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5578 adjust comments accordingly.
5579 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5580 undefined, adjust comments accordingly.
5581 * image.c: Likewise.
5582 * scroll.c: Likewise.
5583 * w32fns.c: Likewise.
5584 * w32term.c: Likewise.
5585 * xdisp.c: Likewise.
5586 * xfaces.c: Likewise.
5587 * xfns.c: Likewise.
5588 * xterm.c: Likewise.
5589
a54e2c05
DA
55902012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5591
5592 Generalize run-time debugging checks.
5593 * dispextern.h (XASSERTS): Remove.
5594 * fontset.c (xassert): Remove.
5595 Convert from xassert to eassert.
5596 * alloc.c: Convert from xassert to eassert.
5597 * bidi.c: Likewise.
5598 * dispnew.c: Likewise.
5599 * fns.c: Likewise.
5600 * fringe.c: Likewise.
5601 * ftfont.c: Likewise.
5602 * gtkutil.c: Likewise.
5603 * image.c: Likewise.
5604 * keyboard.c: Likewise.
5605 * menu.c: Likewise.
5606 * process.c: Likewise.
5607 * scroll.c: Likewise.
5608 * sound.c: Likewise.
5609 * term.c: Likewise.
5610 * w32console.c: Likewise.
5611 * w32fns.c: Likewise.
5612 * w32term.c: Likewise.
5613 * window.c: Likewise.
5614 * xdisp.c: Likewise.
5615 * xfaces.c: Likewise.
5616 * xfns.c: Likewise.
5617 * xselect.c: Likewise.
5618 * xterm.c: Likewise.
5619
1ec4b7b2
SM
56202012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5621
5622 * fns.c (maybe_resize_hash_table): Output message when growing the
5623 purify-hashtable.
5624
2014308a
DA
56252012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5626
5627 * alloc.c (allocate_string_data): Remove dead code.
5628 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5629 avoid GCC warning about unused macro.
5630
246155eb
DA
56312012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5632
5633 * alloc.c (allocate_string): Omit intervals initialization.
5634 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5635 as in make_pure_string and make_pure_c_string.
5636
43184b7b
DA
56372012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5638
d209e2fb 5639 * alloc.c (allocate_string): Fix last change.
43184b7b 5640
3fe6dd74
DA
56412012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5642
d209e2fb 5643 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
5644 to memset, add explicit initialization where appropriate.
5645
1ba6038a
GM
56462012-06-27 Glenn Morris <rgm@gnu.org>
5647
5648 * lisp.mk (lisp): Remove paths.elc.
5649
c89926a5
CY
56502012-06-27 Chong Yidong <cyd@gnu.org>
5651
5652 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5653
ed6b3510
JW
56542012-06-26 John Wiegley <johnw@newartisans.com>
5655
1ec4b7b2 5656 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
5657 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5658
ed6b3510
JW
5659 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5660 when building with Clang.
5661
8edd4a2b
SM
56622012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5663
5664 * eval.c (Fapply): Allow calling it with a single argument.
5665
f6f62d1b
EZ
56662012-06-26 Eli Zaretskii <eliz@gnu.org>
5667
5668 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5669 _stricmp and _strnicmp.
5670 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5671
62efea5e
DA
56722012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5673
5674 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5675 allocated window.
5676 (allocate_process): Likewise for new process.
8edd4a2b 5677 (allocate_terminal): Change to use offsetof.
62efea5e
DA
5678 (allocate_frame): Likewise.
5679 * frame.c (make_frame): Omit redundant initialization.
5680 * window.c (make_parent_window): Use memset.
5681 (make_window): Omit redundant initialization.
5682 * process.c (make_process): Omit redundant initialization.
5683 * terminal.c (create_terminal): Likewise.
5684
42997f4d
DA
56852012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5686
5687 * term.c (delete_tty): Remove redundant call to memset.
5688
1130ecfc
DA
56892012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5690
5691 * alloc.c: Remove build_string.
5692 * lisp.h: Define build_string as static inline. This provides
5693 a better opportunity to optimize away calls to strlen when the
5694 function is called with compile-time constant argument.
5695 * image.c (imagemagick_error): Convert to build_string.
5696 * w32proc.c (sys_spawnve): Likewise.
5697 * xterm.c (x_term_init): Likewise.
5698
cf38a720
PE
56992012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5700
99027bdd
PE
5701 Use sprintf return value instead of invoking strlen on result.
5702 In the old days this wasn't portable, since some sprintf
5703 implementations returned char *. But they died out years ago and
5704 Emacs already assumes sprintf returns int.
5705 Similarly for float_to_string.
5706 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5707 * ccl.c (ccl_driver):
5708 * character.c (string_escape_byte8):
5709 * data.c (Fnumber_to_string):
5710 * doprnt.c (doprnt):
5711 * print.c (print_object):
5712 * xdisp.c (message_dolog):
5713 * xfns.c (syms_of_xfns):
5714 Use sprintf or float_to_string result to avoid need to call strlen.
5715 * data.c (Fnumber_to_string):
5716 Use make_unibyte_string, since the string must be ASCII.
5717 * lisp.h, print.c (float_to_string): Now returns int length.
5718 * term.c (produce_glyphless_glyph):
5719 Use sprintf result rather than recomputing it.
5720
cf38a720
PE
5721 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5722 * Makefile.in (ALL_CFLAGS):
5723 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5724 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5725
3511c784
DA
57262012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5727
0a08eb21 5728 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
5729 strcasecmp if available.
5730 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5731
fb7da12e
AS
57322012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5733
5734 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5735 Avoid comma operator.
5736 * menu.c (push_submenu_start, push_submenu_end)
5737 (push_left_right_boundary, push_menu_pane): Likewise.
5738 * msdos.c (dos_rawgetc): Likewise.
5739
afa2ffd8
DA
57402012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5741
5742 * xfns.c (xic_create_fontsetname): Remove redundant calls
5743 to memset.
5744
b3b4476b
PE
57452012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5746
4495ff38
PE
5747 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5748 sprintf already null-terminates its output.
5749
b3b4476b
PE
5750 * xfns.c (x_window): Remove redundant cast.
5751
b00876c9
DA
57522012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5753
5754 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5755 `const char *' to `char *' to avoid compiler warning.
5756
d188e26b
PE
57572012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5758
885d1d74
PE
5759 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5760 instead of truncating it to 63 (admittedly a generous limit).
5761
d188e26b
PE
5762 * process.c: Fix spelling and caps in comments.
5763
e2f560b1
DN
57642012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5765
e86db54b 5766 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
5767 * sysdep.c (setpgrp): Remove definition, not used in this file.
5768
7583a3a1
JB
57692012-06-24 Juanma Barranquero <lekktu@gmail.com>
5770
5771 * makefile.w32-in: Update dependencies.
5772
696056c2
EZ
57732012-06-24 Eli Zaretskii <eliz@gnu.org>
5774
5775 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5776 (SYSTIME_H): Add nt/inc/sys/time.h.
5777
5778 * systime.h [WINDOWSNT]: Include sys/time.h.
5779
5780 * s/ms-w32.h (struct timespec): Definition moved from
5781 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5782
845ca893
PE
57832012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5784
5785 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5786 * buffer.h (buffer_slot_type_mismatch):
5787 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5788 * eval.c (unwind_to_catch):
5789 * image.c (my_png_error, my_error_exit):
5790 * keyboard.c (quit_throw_to_read_char, user_error)
5791 (Fexit_recursive_edit, Fabort_recursive_edit):
5792 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5793 (wrong_type_argument, buffer_overflow, __executable_start)
5794 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5795 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5796 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5797 (fatal):
5798 (child_setup) [!DOS_NT]:
5799 * lread.c (end_of_file_error, invalid_syntax):
5800 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5801 * puresize.h (pure_write_error):
5802 * search.c (matcher_overflow):
5803 * sound.c (sound_perror, alsa_sound_perror):
5804 * sysdep.c, syssignal.h (croak):
5805 * term.c (maybe_fatal, vfatal):
5806 * textprop.c (text_read_only):
5807 * undo.c (user_error):
5808 * unexmacosx.c (unexec_error):
5809 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5810 Use _Noreturn rather than NO_RETURN.
5811 No need for separate decl merely because of _Noreturn.
5812 * sound.c (sound_warning, parse_sound):
5813 Remove unnecessary forward decls.
5814
f1dd8073
PE
58152012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5816
5817 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5818 * lisp.h (WAIT_READING_MAX): New macro.
5819 * dispnew.c (Fsleep_for, sit_for):
5820 * keyboard.c (kbd_buffer_get_event):
5821 * process.c (Faccept_process_output):
5822 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5823 This improves on the previous patch, which introduced a bug
5824 when time_t is unsigned and as wide as intmax_t.
5825 See <http://bugs.gnu.org/9000#51>.
5826
b82c1755
EZ
58272012-06-23 Eli Zaretskii <eliz@gnu.org>
5828
5829 * dispnew.c (sit_for, Fsleep_for):
5830 * keyboard.c (kbd_buffer_get_event):
5831 * process.c (Faccept_process_output): Avoid compiler warnings when
5832 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5833
ca300656
JB
58342012-06-23 Juanma Barranquero <lekktu@gmail.com>
5835
049ec95b
JB
5836 * makefile.w32-in: Update dependencies.
5837
ca300656
JB
5838 * w32.c (ltime): Add return type and declare static.
5839 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5840
db7b8d06
PE
58412012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5842
5843 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5844 Privately reported by Herbert J. Skuhra.
5845 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5846 All uses changed.
5847 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5848 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5849
0bd8297f
EZ
58502012-06-23 Eli Zaretskii <eliz@gnu.org>
5851
96512555
EZ
5852 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5853 last argument of make_unibyte_string.
5854
0bd8297f
EZ
5855 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5856 language ID in the event parameters.
5857
5858 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5859 event.code, not the obscure "character set ID".
5860
63def6b6
CY
58612012-06-23 Chong Yidong <cyd@gnu.org>
5862
5863 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5864
e8a02204
EZ
58652012-06-23 Eli Zaretskii <eliz@gnu.org>
5866
388cdec0
EZ
5867 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5868 * w32.c (fdutimens): New function.
5869
5870 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5871
5872 * s/ms-w32.h (pselect): Redirect to sys_select.
5873
5874 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5875
e8a02204
EZ
5876 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5877 in the logic of incrementing and decrementing the value of
5878 use_relocatable_buffers.
5879
d054f3fb
PE
58802012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5881
5882 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5883 Privately reported by Herbert J. Skuhra.
5884 [__FreeBSD__]: Remove "*/" typo after "#include".
5885 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5886 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5887 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5888 Don't assume EMACS_TIME and struct timeval are the same type.
5889
d35af63c
PE
58902012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5891
5892 Support higher-resolution time stamps (Bug#9000).
5893 The time stamps are only nanosecond-resolution at the C level,
5894 since that's the best that any real-world system supports now.
5895 But they are picosecond-resolution at the Lisp level, as that's
5896 easy, and leaves room for future OS improvements.
5897
5898 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5899 (LIBES): Use it.
5900
5901 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5902 Don't get current time unless it's needed.
5903
5904 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5905 now provides it if it's absent.
5906 (start_atimer): Port to higher-res time stamps.
5907 Check for time stamp overflow. Don't get current time more
5908 often than is needed.
5909
5910 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5911 Include systime.h, not time.h.
5912 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5913
5914 * dired.c: Include stat-time.h.
5915 (Ffile-attributes): File times now have higher resolution.
5916
5917 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5918 (struct image): Timestamp now has higher resolution.
5919
5920 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5921 has at least microseconds now. All uses removed.
5922 (update_frame, update_single_window, update_window, update_frame_1)
5923 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 5924 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
5925
5926 * editfns.c (time_overflow): Now extern.
5927 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5928 (float-time, Fformat_time_string, Fcurrent_time_string)
5929 (Fcurrent_time_zone): Accept and generate higher-resolution
5930 time stamps.
5931 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5932 (decode_time_components, lisp_seconds_argument): New functions.
5933 (make_time): Now static.
5934 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5935 Report an error if the time is invalid, rather than having the caller
5936 do that.
5937
5938 * fileio.c: Include <stat-time.h>
5939 (Fcopy_file): Copy higher-resolution time stamps.
5940 Prefer to set the time stamp via a file descriptor if that works.
5941 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5942 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5943 (Fvisited_file_modtime, Fset_visited_file_modtime):
5944 Support higher-resolution time stamps.
5945
5946 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5947
5948 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5949
5950 * image.c (prepare_image_for_display, clear_image_cache)
5951 (lookup_image): Port to higer-resolution time stamps.
5952
5953 * keyboard.c (start_polling, bind_polling_period):
5954 Check for time stamp overflow.
5955 (read_char, kbd_buffer_get_event, timer_start_idle)
5956 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5957 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5958 Port to higher-resolution time stamps. Do not assume time_t is signed.
5959 (decode_timer): New function. Timers are now vectors of length 9,
5960 not 8, to accommodate the picosecond component.
5961 (timer_check_2): Use it.
5962
5963 * nsterm.m (select_timeout, timeval_subtract): Remove.
5964 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5965 as they're a bit more accurate and handle overflow better.
5966 (ns_select): Change prototype to be compatible with pselect.
5967 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5968 * nsterm.h (ns_select): Adjust prototype.
5969
5970 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5971 us-resolution time stamps.
5972 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5973
5974 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5975
5976 * lisp.h (time_overflow): New decl.
5977 (wait_reading_process_output): First arg is now intmax_t, not int,
5978 to accommodate larger waits.
5979
5980 * process.h (struct Lisp_Process.read_output_delay):
5981 Now counts nanoseconds, not microseconds.
5982 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5983 EMACS_HAS_USECS.
5984 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5985 (wait_reading_process_output):
5986 Port to ns-resolution time stamps.
5987 (Faccept_process_output, wait_reading_process_output):
5988 Check for time stamp overflow. Do not assume time_t is signed.
5989 (select_wrapper): Remove; we now use pselect.
5990 (Fprocess_attributes): Now generates ns-resolution time stamps.
5991
5992 * sysdep.c: Include utimens.h. Don't include utime.h
5993 or worry about struct utimbuf; gnulib does that for us now.
5994 (gettimeofday): Remove; gnulib provides a substitute.
5995 (make_timeval): New function.
5996 (set_file_times): Now sets ns-resolution time stamps.
5997 New arg FD; all uses changed.
5998 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5999 (system_process_attributes):
6000 Now returns ns-resolution time stamp. All uses changed.
6001 Check for time stamp overflow.
6002
6003 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6004 provides a substitute now.
6005
6006 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6007 since it guarantees struct timespec.
6008 (EMACS_TIME): Now struct timespec, so that we can support
6009 ns-resolution time stamps.
6010 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6011 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6012 (EMACS_USECS): Remove.
6013 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6014 so multiply the arg by 1000 before storing it.
6015 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6016 New macros.
6017 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6018 Port to ns-resolution time stamps.
6019 (EMACS_TIME_NEG_P): Remove; replaced by....
6020 (EMACS_TIME_SIGN): New macro.
6021 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6022 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6023 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6024 (make_timeval, make_lisp_time, decode_time_components): New decls.
6025 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6026 that it mishandled time_t overflow. You can't compare by subtracting!
6027 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6028 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6029
6030 * term.c: Include <sys/time.h>.
6031 (timeval_to_Time): New function, for proper overflow wraparound.
6032 (term_mouse_position, term_mouse_click): Use it.
6033
6034 * undo.c (record_first_change): Support higher-resolution time stamps
6035 in the undo buffer.
6036 (Fprimitive_undo): Use them when restoring time stamps.
6037
6038 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6039 (w32_get_internal_run_time):
6040 Port to higher-resolution Emacs time stamps.
6041 (ltime): Now accepts single 64-bit integer, as that's more convenient
6042 for callers.
6043
6044 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6045
6046 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6047 for compatibility with pselect. Support ns-resolution time stamps.
6048
6049 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6050
6051 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6052 Check for time stamp overflow, and support ns-resolution time stamps.
6053
6054 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6055 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6056 (timeval_subtract): Remove; no longer needed.
6057 (XTflash, XTring_bell, x_wait_for_event):
6058 Port to ns-resolution time stamps. Don't assume time_t is signed.
6059
b6a92dfe
CY
60602012-06-22 Chong Yidong <cyd@gnu.org>
6061
6062 * xdisp.c (x_consider_frame_title): Revert last change.
6063
d251c37c
EZ
60642012-06-22 Eli Zaretskii <eliz@gnu.org>
6065
6066 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6067 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6068 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6069 staticidx goes up to 1597 out of 1600 = 0x640.)
6070
f10deafb
PE
60712012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6072
6073 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6074 Otherwise, the umask might be mistakenly 0 while handling input signals.
6075
ec6de1e2
SM
60762012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6077
6078 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6079
28be1ada
DA
60802012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6081
6082 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6083 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6084 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6085 access to `contents' member of Lisp_Vector objects with AREF and ASET
6086 where appropriate.
6087
c6bf3022
CY
60882012-06-19 Chong Yidong <cyd@gnu.org>
6089
6090 * frame.c (delete_frame): When selecting a frame on a different
6091 text terminal, do not alter the terminal's top-frame.
6092
6093 * xdisp.c (format_mode_line_unwind_data): Record the target
6094 frame's selected window and its terminal's top-frame.
6095 (unwind_format_mode_line): Restore them.
6096 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6097 Callers changed.
6098 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6099 since tty frames can be explicitly named.
6100 (prepare_menu_bars): Likewise.
6101
6102 * term.c (Ftty_top_frame): New function.
6103
defd4196
PE
61042012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6105
6106 Port byte-code-meter to modern targets.
6107 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6108 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 6109 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
6110 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6111 (METER_1, METER_2): Simplify.
6112
1053a871
SM
61132012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6114
6115 * data.c (Fdefalias): Return `symbol' (bug#11686).
6116
b7e8d081
MR
61172012-06-18 Martin Rudalics <rudalics@gmx.at>
6118
6119 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
6120 gets killed during executing of this function (Bug#11665).
6121 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
6122 (Vkill_buffer_query_functions): In doc-string say that functions
6123 run by this hook should not change the current buffer.
6124
7ea2b339
PE
61252012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6126
6127 Fix recently-introduced process.c problems found by static checking.
6128 * process.c (write_queue_push, write_queue_pop, send_process):
6129 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6130 (write_queue_pop): Fix pointer signedness problem.
6131 (send_process): Remove unused local.
6132
96a313a1
CY
61332012-06-17 Chong Yidong <cyd@gnu.org>
6134
6135 * xdisp.c (redisplay_internal): No need to redisplay terminal
6136 frames that are not on top.
6137
20ca2e94
TN
61382012-06-17 Troels Nielsen <bn.troels@gmail.com>
6139
6140 * process.c (make_process): Initialize write_queue.
6141 (write_queue_push, write_queue_pop): New functions.
6142 (send_process): Use them to maintain correct ordering of process
6143 writes (Bug#10815).
6144
9a900ca9
PE
61452012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6146
310fbfa8
PE
6147 * lisp.h (eassert): Assume C89 or later.
6148 This removes the need for CHECK.
6149 (CHECK): Remove. Its comments about always evaluating its
6150 argument were confusing, as 'eassert' typically does not evaluate
6151 its argument.
6152
27bb1ca4
PE
6153 * coding.c (produce_chars): Use ptrdiff_t, not int.
6154
9a900ca9
PE
6155 * xterm.c (x_draw_underwave): Check for integer overflow.
6156 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6157
41b7f8bc 61582012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
6159
6160 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6161 referenced (Bug#11583).
6162
9b0e3eba
AA
61632012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6164
6165 Implement wave-style variant of underlining.
6166 * dispextern.h (face_underline_type): New enum.
6167 (face): Add field for underline type.
6168 * nsterm.m (ns_draw_underwave): New function.
6169 (ns_draw_text_decoration): Use it.
6170 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6171 New functions.
6172 (x_draw_glyph_string): Use them.
6173 * xfaces.c (Qline, Qwave): New Lisp objects.
6174 (check_lface_attrs, merge_face_ref)
1053a871
SM
6175 (Finternal_set_lisp_face_attribute, realize_x_face):
6176 Handle wave-style underline face attributes.
9b0e3eba
AA
6177 * xterm.c (x_draw_underwave): New function.
6178 (x_draw_glyph_string): Use it.
6179
0fb52f11
JB
61802012-06-16 Juanma Barranquero <lekktu@gmail.com>
6181
6182 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6183 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6184 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6185 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6186 ($(BLD)/w32select.$(O)): Update dependencies.
6187
e5560ff7
AS
61882012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6189
6190 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6191 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6192 * character.c (_fetch_multibyte_char_p): Remove.
6193 * alloc.c: Include "character.h" before "buffer.h".
6194 * bidi.c: Likewise.
6195 * buffer.c: Likewise.
6196 * bytecode.c: Likewise.
6197 * callint.c: Likewise.
6198 * callproc.c: Likewise.
6199 * casefiddle.c: Likewise.
6200 * casetab.c: Likewise.
6201 * category.c: Likewise.
6202 * cmds.c: Likewise.
6203 * coding.c: Likewise.
6204 * composite.c: Likewise.
6205 * dired.c: Likewise.
6206 * dispnew.c: Likewise.
6207 * doc.c: Likewise.
6208 * dosfns.c: Likewise.
6209 * editfns.c: Likewise.
6210 * emacs.c: Likewise.
6211 * fileio.c: Likewise.
6212 * filelock.c: Likewise.
6213 * font.c: Likewise.
6214 * fontset.c: Likewise.
6215 * fringe.c: Likewise.
6216 * indent.c: Likewise.
6217 * insdel.c: Likewise.
6218 * intervals.c: Likewise.
6219 * keyboard.c: Likewise.
6220 * keymap.c: Likewise.
6221 * lread.c: Likewise.
6222 * macros.c: Likewise.
6223 * marker.c: Likewise.
6224 * minibuf.c: Likewise.
6225 * nsfns.m: Likewise.
6226 * nsmenu.m: Likewise.
6227 * print.c: Likewise.
6228 * process.c: Likewise.
6229 * regex.c: Likewise.
6230 * region-cache.c: Likewise.
6231 * search.c: Likewise.
6232 * syntax.c: Likewise.
6233 * term.c: Likewise.
6234 * textprop.c: Likewise.
6235 * undo.c: Likewise.
6236 * unexsol.c: Likewise.
6237 * w16select.c: Likewise.
6238 * w32fns.c: Likewise.
6239 * w32menu.c: Likewise.
6240 * window.c: Likewise.
6241 * xdisp.c: Likewise.
6242 * xfns.c: Likewise.
6243 * xmenu.c: Likewise.
6244 * xml.c: Likewise.
6245 * xselect.c: Likewise.
6246
2f07e6af
EZ
62472012-06-16 Eli Zaretskii <eliz@gnu.org>
6248
1053a871
SM
6249 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6250 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 6251 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
6252 row.
6253 (handle_face_prop): Use chunk-relative overlay string index when
6254 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
6255 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6256 the rightmost. (Bug#11720)
2f07e6af 6257
29b83cec
AS
62582012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6259
6260 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6261 (CATEGORY_MEMBER): Enforce 1/0 value.
6262 * category.c (_temp_category_set): Remove.
6263
4c5501e9
EZ
62642012-06-16 Eli Zaretskii <eliz@gnu.org>
6265
6266 * window.c (Fdelete_other_windows_internal)
6267 (Fdelete_window_internal): Don't access frame's mouse highlight
6268 info of the initial frame. (Bug#11677)
6269
2b570124
PE
62702012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6271
e93864f9
PE
6272 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6273 Assume USE_2_TAGS_FOR_INTS.
6274 (xreload): Adjust $tagmask width to match recent lisp.h change.
6275
2b570124
PE
6276 Simplify lisp.h in minor ways that should not affect code.
6277 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6278 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6279 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6280 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6281 (INTTYPEBITS): New macro, for clarity.
6282 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
6283 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6284 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
6285 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6286 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6287
81755f69
JB
62882012-06-13 Juanma Barranquero <lekktu@gmail.com>
6289
6290 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6291
16192a57
GM
62922012-06-13 Glenn Morris <rgm@gnu.org>
6293
6294 * s/bsd-common.h (BSD4_3):
6295 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6296
646b5f55
AS
62972012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6298
6299 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6300 instead of union.
6301 (XLI, XIL): Define.
1053a871
SM
6302 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6303 Use them.
6304 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 6305 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 6306 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
6307 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6308 * frame.c (delete_frame): Remove outdated comment.
6309 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6310 USE_LISP_UNION_TYPE.
6311 (Fw32_unregister_hot_key): Likewise.
6312 (Fw32_toggle_lock_key): Likewise.
6313 * w32menu.c (add_menu_item): Likewise.
6314 (w32_menu_display_help): Use XIL instead of checking
6315 USE_LISP_UNION_TYPE.
6316 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6317 (init_heap): Likewise.
6318 * w32term.c (w32_read_socket): Update comment.
6319
1d3823c9
GM
63202012-06-13 Glenn Morris <rgm@gnu.org>
6321
c62ff706
GM
6322 * s/usg5-4-common.h, src/s/unixware.h:
6323 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6324
1d3823c9
GM
6325 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6326
bfe3e0a2
PE
63272012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6328
6329 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6330 * alloc.c (make_number) [!defined make_number]:
6331 Remove, as lisp.h always defines this now.
6332 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6333 (roundup_size): Verify that it is a power of 2.
6334 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6335 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6336 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6337 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6338 USE_LSB_TAG now is always defined to be either 0 or 1.
6339 All uses changed.
6340 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6341 code works fine either way, and efficiency is not a concern here,
6342 as the union type is for debugging, not for production.
6343 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6344 Use an inline function on all platforms when using the union type,
6345 since this is simpler and 'static inline' can be used portably
6346 within Emacs now.
6347 (LISP_INITIALLY_ZERO): New macro.
6348 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6349 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6350
45fa9c0f
GM
63512012-06-12 Glenn Morris <rgm@gnu.org>
6352
b4492cba
GM
6353 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6354
6355 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 6356
45fa9c0f
GM
6357 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6358 Move BROKEN_SIGIO to configure.
6359
6360 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6361 Move NO_TERMIO to configure.
6362
0e25d334
CY
63632012-06-12 Chong Yidong <cyd@gnu.org>
6364
6365 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6366 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6367 MagickExportImagePixels is undefined.
6368
43682bb6
PE
63692012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6370
6371 * image.c (imagemagick_load_image): Remove unused label.
6372
a9be7d2b
GM
63732012-06-11 Glenn Morris <rgm@gnu.org>
6374
6375 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6376 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6377 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6378 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6379
3017f87f
SM
63802012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6381
6382 * alloc.c (make_byte_code): New function.
6383 (Fmake_byte_code): Use it. Don't purify here.
6384 * lread.c (read1): Use it as well to avoid extra allocation.
6385
1b9b4cf4
CY
63862012-06-11 Chong Yidong <cyd@gnu.org>
6387
6388 * image.c (imagemagick_load_image): Implement transparency.
6389
95988fcf
AS
63902012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6391
6392 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6393 account for preceding backslashes. (Bug#11663)
6394
cd4eb164
CY
63952012-06-09 Chong Yidong <cyd@gnu.org>
6396
6397 * term.c: Support italics in capable terminals (Bug#9652).
6398 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6399 (turn_on_face): Output using TS_enter_italic_mode if available.
6400 Don't handle unused blinking and alt-charset cases.
6401 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6402 and tty_alt_charset_p cases.
6403 (tty_capable_p, init_tty): Support italics.
6404
6405 * termchar.h (struct tty_display_info): Add field for italics.
6406 Remove unused blink field.
6407
6408 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6409 Handle slant.
6410
6411 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6412 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6413 tty_alt_charset_p. Add tty_italic_p.
6414
ff88beb8
MA
64152012-06-09 Michael Albinus <michael.albinus@gmx.de>
6416
6417 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6418 dbus_type_is_basic if available.
6419 (xd_extract_signed, xd_extract_unsigned): Rename from
6420 extract_signed and extract_unsigned, respectively. Adapt callers.
6421
44286096
CY
64222012-06-09 Chong Yidong <cyd@gnu.org>
6423
1682701f
CY
6424 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6425
44286096
CY
6426 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6427 case (Bug#9752).
6428
d86feb17
PE
64292012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6430
6431 * xdisp.c (vmessage): Treat frame message as multibyte.
6432 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6433 would generate the diagnostic "Making \302\247 buffer-local while
6434 let-bound!".
6435
d5c20fe8
EZ
64362012-06-08 Eli Zaretskii <eliz@gnu.org>
6437
6438 * dispnew.c (showing_window_margins_p): Undo last change, which
6439 was done due to an inadvertent commit.
6440 (adjust_frame_glyphs_for_frame_redisplay): Do call
6441 showing_window_margins_p.
6442
513749ee
SM
64432012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6444
6445 * eval.c (Fmake_var_non_special): New primitive.
6446 (syms_of_eval): Defsubr it.
6447 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6448
d4a8f5c1
JB
64492012-06-08 Juanma Barranquero <lekktu@gmail.com>
6450
6451 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6452 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6453
8bbbc977
EZ
64542012-06-08 Eli Zaretskii <eliz@gnu.org>
6455
6456 * alloc.c (allocate_vectorlike): Fix last change.
6457
f3372c87
DA
64582012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6459
6460 Block-based vector allocation of small vectors.
6461 * lisp.h (struct vectorlike_header): New field `nbytes',
6462 adjust comment accordingly.
6463 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 6464 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
6465 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6466 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6467 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6468 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6469 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6470 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6471 (roundup_size): New constant.
6472 (struct vector_block): New data type.
6473 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 6474 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
6475 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6476 (sweep_vectors): New functions.
6477 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 6478 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
6479 or equal to VBLOCK_BYTES_MAX.
6480 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6481 (init_alloc_once): Add call to init_vectors.
6482
4f18a4ed
SM
64832012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6484
6485 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6486
86f158bc
PE
64872012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6488
6489 * doprnt.c (doprnt): Truncate multibyte char correctly.
6490 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6491 would mishandle a string argument "Xc" if X was a multibyte
6492 character of length 2: it would truncate after X's first byte
6493 rather than including all of X.
6494
c5cfcbe0
CY
64952012-06-06 Chong Yidong <cyd@gnu.org>
6496
6497 * buffer.c (word_wrap): Doc fix.
6498
c05cf390
PE
64992012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6500
6501 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6502
0c3461de
GM
65032012-06-03 Glenn Morris <rgm@gnu.org>
6504
6505 * xdisp.c (tool-bar-style): Doc fix.
6506
c71232db
UM
65072012-06-03 Ulrich Müller <ulm@gentoo.org>
6508
6509 * Makefile.in (PAXCTL): Define.
6510 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6511 binary via PaX flags if the paxctl utility is available.
6512 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6513 Restore PaX flags to their default. (Bug#11398)
6514
383f7350
CY
65152012-06-03 Chong Yidong <cyd@gnu.org>
6516
6517 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6518 buffer (Bug#11226).
6519
5f2c76c6
CY
65202012-06-03 Chong Yidong <cyd@gnu.org>
6521
6522 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6523 (note_mode_line_or_margin_highlight): If there is no help echo,
6524 use mode-line-default-help-echo. Handle the case where the mouse
6525 position is past the end of the mode line string.
6526
6527 * buffer.c (buffer_local_value_1): New function, split from
6528 Fbuffer_local_value; can return Qunbound.
6529 (Fbuffer_local_value): Use it.
6530 (Vmode_line_format): Docstring tweaks.
6531
773d47f6
PE
65322012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6533
6534 * sysdep.c (system_process_attributes): Improve comment.
6535
f2d6a3df
SM
65362012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6537
6538 * keyboard.c: Export real-this-command to Elisp.
6539 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6540 and DEFVAR it. Update all users.
6541
63810350
PE
65422012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6543
7bd5c1f4
PE
6544 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6545
63810350
PE
6546 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6547 Convert pctcpu and pctmem to Lisp float properly.
6548 Let the compiler fold better, as 100.0/0x8000 is exact.
6549
a2821611
AS
65502012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6551
6552 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6553 cons_block.
6554
5fceba1d
PE
65552012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6556
6557 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6558
c98ff5dd
DA
65592012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6560
6561 For a 'struct window', replace some Lisp_Object fields to
6562 bitfields where appropriate, remove unused fields.
6563 * window.h (struct window): Remove unused 'last_mark_x' and
6564 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6565 change it's type from Lisp_Object to bitfield.
6566 Change type of 'force_start', 'optional_new_start',
6567 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 6568 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 6569
ca34e0be
PE
65702012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6571
6572 Pacify gcc -Wdouble-precision when using Xaw.
6573 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6574 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6575 Use 'float' consistently, rather than 'float' in most places
6576 and 'double' in a couple of places.
6577
efc00ab1 65782012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
6579
6580 * xdisp.c (handle_stop): Detect whether we have overlay strings
6581 loaded by testing it->current.overlay_string_index to be
6582 non-negative, instead of checking whether n_overlay_strings is
6583 positive. (Bug#11587)
6584
efc00ab1 65852012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
6586
6587 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6588
6589 * doc.c (Fsubstitute_command_keys): Doc fix.
6590
efc00ab1 65912012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
6592
6593 * search.c (search_buffer): Remove calls to
6594 r_alloc_inhibit_buffer_relocation, as it is now called by
6595 maybe_unify_char, which was the cause of relocation of buffer text
6596 in bug#11519.
6597
efc00ab1 65982012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
6599
6600 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6601 for the duration of call to load_charset, to avoid problems with
6602 callers of maybe_unify_char that access buffer text through C
6603 pointers.
6604
6605 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6606 decrement the inhibition flag, instead of just setting or
6607 resetting it.
6608
ba93a187
PE
66092012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6610
6611 Remove obsolete '#define static' cruft.
6612 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6613 This #undef was "temporary" in 2000; it is no longer needed
6614 now that '#define static' has gone away.
6615 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6616 (gray_bitmap_bits): Remove; no longer needed.
6617 All uses replaced with definiens.
6618 * xterm.c: Include "bitmaps/gray.xbm".
6619
9e4bf381
PE
66202012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6621
6622 Clean up __executable_start, monstartup when --enable-profiling.
6623 The following changes affect the code only when profiling.
6624 * dispnew.c (__executable_start): Rename from safe_bcopy.
6625 Define only on platforms that need it.
6626 * emacs.c: Include <sys/gmon.h> when profiling.
6627 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6628 (__executable_start): Remove decl, since lisp.h does it now.
6629 (safe_bcopy): Remove decl; no longer has that name.
6630 (main): Coalesce #if into single bit of code, for simplicity.
6631 Cast pointers to uintptr_t, since standard libraries want integers
6632 and not pointers.
6633 * lisp.h (__executable_start): New decl.
6634
32d72c2f
GM
66352012-05-31 Glenn Morris <rgm@gnu.org>
6636
6637 * image.c (Fimagemagick_types): Doc fix.
6638
baac5bc7
JM
66392012-05-30 Jim Meyering <meyering@redhat.com>
6640
6641 * callproc.c (Fcall_process_region): Include directory component
6642 in mkstemp error message (Bug#11586).
6643
72cb32cf
PE
66442012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6645
6646 * alloc.c, lisp.h (make_pure_vector): Now static.
6647
61b108cc
SM
66482012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6649
6650 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6651 Move to byte-run.el.
6652 (Fautoload): Do the hash-doc more carefully.
6653 * data.c (Fdefalias): Purify definition, except for keymaps.
6654 (Qdefun): Move from eval.c.
6655 * lisp.h (Qdefun): Remove.
6656 * lread.c (read1): Tiny simplification.
6657
471fe23d
TN
66582012-05-29 Troels Nielsen <bn.troels@gmail.com>
6659
934f3f58 6660 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
6661 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6662 Bug#9642, but explicitly check that the buffer the overlay would
6663 be moved to is live and rearrange lines to make sure that errors
6664 will not put the overlay in an inconsistent state.
6665 (Fdelete_overlay): Cosmetics.
6666
85d0efd1
EZ
66672012-05-28 Eli Zaretskii <eliz@gnu.org>
6668
6669 * w32term.c (my_bring_window_to_top): New function.
6670 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
6671 could be different from the original one.
6672 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
6673 (Bug#11513)
6674
6675 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6676 by calling BringWindowToTop.
6677
6678 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6679 (WM_EMACS_END): Increase by one.
6680
da92a98c
PE
66812012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6682
6683 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6684 This avoids undefined behavior that might cause the eassert
6685 to not catch an out-of-range value.
6686
74d1f848
JB
66872012-05-28 Juanma Barranquero <lekktu@gmail.com>
6688
6689 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6690 Update dependencies.
6691
9e1a06fc
EZ
66922012-05-27 Eli Zaretskii <eliz@gnu.org>
6693
6694 * bidi.c (bidi_mirror_char): Fix last change.
6695
f3dd7312
AS
66962012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6697
6698 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6699 when referring to sectname field in printf format.
6700
81899c91
PE
67012012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6702
57b81a9f
PE
6703 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6704 Only r_alloc_inhibit_buffer_relocation needed to be added;
6705 the others were already declared.
6706
81899c91
PE
6707 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6708 before checking whether it's out of range. Put the check inside
6709 eassert. See
6710 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6711
33017faf 67122012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
6713
6714 * callproc.c (Fcall_process): Restore a line that was accidentally
6715 commented out in the 2011-02-13 change (bug#11547).
6716
33017faf 67172012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
6718
6719 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6720 defined on ralloc.c.
6721
6722 * buffer.c [REL_ALLOC]: Remove prototypes of
6723 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6724 they are now on lisp.h.
6725
6726 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6727
6728 * search.c (search_buffer): Use it to inhibit relocation of buffer
6729 text while re_search_2 is doing its job, because re_search_2 is
6730 passed C pointers to buffer text. (Bug#11519)
6731
23415acf
EZ
6732 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6733 Update value to 24.
6734
44e27368
EZ
6735 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6736 state after an additional call to move_it_in_display_line_to, keep
6737 the values of it->max_ascent and it->max_descent found for the
6738 entire line.
6739 (pos_visible_p): Revert the comparison against bottom_y to what it
6740 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6741 (Bug#11464)
6742
c1892f11
PE
67432012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6744
6745 Fix coding-related core dumps with gcc -ftrapv.
6746 The code was computing A - B, where A and B are pointers, and B is
6747 random garbage. This can lead to core dumps on platforms that
6748 have special pointer registers, and it also leads to core dumps on
6749 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6750 A - B only when B is initialized properly.
6751 * coding.c (coding_set_source, coding_set_destination): Return void.
6752 (coding_change_source, coding_change_destinations): New functions,
6753 with the old behaviors of coding_set_source and coding_set_destination.
6754 All callers that need an offset changed to use these new functions.
6755
eb7afdad
GM
67562012-05-26 Glenn Morris <rgm@gnu.org>
6757
6758 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6759
f12fdf02
EZ
67602012-05-26 Eli Zaretskii <eliz@gnu.org>
6761
53a63be6 6762 Extend mouse support on W32 text-mode console.
61b108cc
SM
6763 * xdisp.c (draw_row_with_mouse_face):
6764 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 6765
eb3f6f01 6766 * w32console.c: Include window.h.
61b108cc
SM
6767 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6768 New functions.
eb3f6f01
EZ
6769 (initialize_w32_display): Initialize mouse-highlight data.
6770
53a63be6
EZ
6771 * w32inevt.c: Include termchar.h and window.h.
6772 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6773 moves, call note_mouse_highlight. If help_echo changed, call
6774 gen_help_event to produce help-echo message in the echo area.
6775 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6776 highlight info.
6777
4cfd81f6
PE
67782012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6779
6780 * lread.c (read1): Simplify slightly to avoid an overflow warning
6781 with GCC 4.7.0 on x86-64.
6782
4446092a
EZ
67832012-05-26 Eli Zaretskii <eliz@gnu.org>
6784
6785 * bidi.c (bidi_mirror_char): Revert last change: an int is
6786 definitely wide enough here.
6787
42b2a986 67882012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 6789
42b2a986 6790 Fix integer width and related bugs (Bug#9874).
eb106a49 6791 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
6792 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6793 (string_bytes, check_sblock, allocate_string_data):
6794 (compact_small_strings, Fmake_bool_vector, make_string)
6795 (make_unibyte_string, make_multibyte_string)
6796 (make_string_from_bytes, make_specified_string)
6797 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6798 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6799 (mark_vectorlike):
6800 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6801 (allocate_pseudovector):
6802 Use int, not EMACS_INT, where int is wide enough.
6803 (inhibit_garbage_collection, Fgarbage_collect):
6804 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6805 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6806 int might not be wide enough.
6807 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6808 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6809 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6810 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6811 (bidi_level_of_next_char, bidi_move_to_visually_next):
6812 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6813 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6814 (Fkill_buffer, Fset_buffer_major_mode)
6815 (advance_to_char_boundary, Fbuffer_swap_text)
6816 (Fset_buffer_multibyte, overlays_at, overlays_in)
6817 (overlay_touches_p, struct sortvec, record_overlay_string)
6818 (overlay_strings, recenter_overlay_lists)
6819 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6820 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6821 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6822 (Foverlay_recenter, last_overlay_modification_hooks_used)
6823 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6824 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
6825 (validate_region): Omit unnecessary test for b <= e,
6826 since that's guaranteed by the previous test.
d311d28c
PE
6827 (adjust_overlays_for_delete): Avoid pos + length overflow.
6828 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6829 (report_overlay_modification):
6830 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6831 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6832 Omit pointer cast, which isn't needed anyway, and doesn't work
6833 after the EMACS_INT -> ptrdiff_t change.
02481186 6834 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
6835 * buffer.h: Adjust decls to match defn changes elsewhere.
6836 (struct buffer_text, struct buffer):
6837 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6838 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
6839 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6840 not int, to avoid needless 32-bit limit on 64-bit hosts.
6841 (exec_byte_code): Use tighter memory-full test, one that checks
6842 for alloca overflow. Don't compute the address of the object just
6843 before an array, as that's not portable. Use EMACS_INT, not
6844 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
6845 * callint.c (Fcall_interactively):
6846 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6847 * callproc.c (call_process_kill, Fcall_process):
6848 Don't assume pid_t fits into an Emacs fixnum.
6849 (call_process_cleanup, Fcall_process, child_setup):
6850 Don't assume pid_t fits into int.
6851 (call_process_cleanup, Fcall_process, delete_temp_file)
6852 (Fcall_process_region):
6853 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6854 (Fcall_process): Simplify handling of volatile integers.
6855 Use int, not EMACS_INT, where int will do.
6856 * casefiddle.c (casify_object, casify_region, operate_on_word)
6857 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6858 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6859 (casify_object): Avoid integer overflow when overallocating buffer.
6860 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 6861 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
6862 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6863 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6864 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6865 integers are now checked earlier. All uses replaced with XINT.
6866 (ccl_driver):
6867 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6868 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
6869 (ccl_driver, Fregister_code_conversion_map):
6870 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
6871 (resolve_symbol_ccl_program): Check that vector header is in range.
6872 Always copy the vector, so that we can check its contents reliably
6873 now rather than having to recheck each instruction as it's being
6874 executed. Check that vector words fit in 'int'.
6875 (ccl_get_compiled_code, Fregister_ccl_program)
6876 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6877 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6878 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6879 contents are in range.
6880 (Fccl_execute_on_string): Check that status is in range.
6881 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6882 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6883 Accept and return EMACS_INT, not int, because callers can pass values
6884 out of 'int' range.
6885 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6886 (multibyte_chars_in_text, parse_str_as_multibyte)
6887 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6888 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6889 (string_escape_byte8, Fget_byte):
6890 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 6891 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
6892 avoid mishandling large integers.
6893 * character.h: Adjust decls to match defn changes elsewhere.
6894 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6895 (Ffind_charset_region):
6896 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6897 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6898 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 6899 Don't assume fixnum fits in int.
d311d28c
PE
6900 (load_charset_map_from_vector, Fmap_charset_chars):
6901 Remove now-unnecessary CHECK_NATNUMs.
6902 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
6903 Don't rely on undefined behavior with signed left shift overflow.
6904 Don't assume unsigned int fits into fixnum, or that fixnum fits
6905 into unsigned int. Don't require max_code to be a valid fixnum;
6906 that's not true for gb10830 4-byte on a 32-bit host. Allow
6907 invalid_code to be a cons, for the same reason. Require code_offset
6908 to be a character. Avoid int overflow if max_char is close
6909 to INT_MAX.
6910 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6911 this is intended anyway and avoids some undefined behavior.
6912 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6913 INDEX_TO_CODE_POINT, as that's what it expects.
6914 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
6915 * charset.h (DECODE_CHAR): Return int, not unsigned;
6916 this is what was intended anyway, and it avoids undefined behavior.
6917 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6918 integer-overflow issues.
6919 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6920 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6921 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
6922 * chartab.c (Fmake_char_table, Fset_char_table_range)
6923 (uniprop_get_decoder, uniprop_get_encoder):
6924 Don't assume fixnum fits in int.
6925 * cmds.c (move_point): New function, that does the gist of
6926 Fforward_char and Fbackward_char, but does so while checking
6927 for integer overflow more accurately.
c96e5d6a 6928 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
6929 (Fforward_line, Fend_of_line, internal_self_insert)
6930 (internal_self_insert):
6931 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6932 Fix a FIXME, by checking for integer overflow when calculating
6933 target_clm and actual_clm.
6934 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 6935 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
6936 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6937 (coding_alloc_by_making_gap, alloc_destination)
6938 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6939 (encode_coding_utf_16, detect_coding_emacs_mule)
6940 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6941 (detect_coding_iso_2022, decode_coding_iso_2022)
6942 (encode_invocation_designation, encode_designation_at_bol)
6943 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6944 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6945 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6946 (encode_coding_ccl, encode_coding_raw_text)
6947 (detect_coding_charset, decode_coding_charset)
6948 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6949 (produce_composition, produce_charset, produce_annotation)
6950 (decode_coding, handle_composition_annotation)
6951 (handle_charset_annotation, consume_chars, decode_coding_gap)
6952 (decode_coding_object, encode_coding_object, detect_coding_system)
6953 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6954 (code_convert_region, code_convert_string)
8f50130c
PE
6955 (Fdefine_coding_system_internal)
6956 (coding_set_source, coding_set_destination):
d311d28c
PE
6957 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6958 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6959 (Fdefine_coding_system_internal):
6960 Don't assume fixnums fit in int.
6961 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 6962 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
6963 (Funencodable_char_position, Fcheck_coding_systems_region)
6964 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 6965 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 6966 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 6967 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 6968 Don't access memory outside of the args array.
d311d28c 6969 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
6970 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6971 result of ENCODE_CHAR.
d311d28c
PE
6972 * coding.h: Adjust decls to match defn changes elsewhere.
6973 (struct coding_system):
6974 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6975 * composite.c (get_composition_id, find_composition)
6976 (run_composition_function, update_compositions)
6977 (compose_text, composition_gstring_put_cache)
6978 (composition_gstring_p, composition_gstring_width)
6979 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6980 (composition_compute_stop_pos, composition_reseat_it)
6981 (composition_update_it, struct position_record)
6982 (find_automatic_composition, composition_adjust_point)
6983 (Fcomposition_get_gstring, Ffind_composition_internal):
6984 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6985 (update_compositions):
6986 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6987 * composite.h: Adjust decls to match defn changes elsewhere.
6988 (struct composition):
6989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6990 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6991 Do not attempt to compute the address of the object just before a
6992 buffer; this is not portable.
6993 (Faref, Faset):
6994 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6995 (Faset): Use int, not EMACS_INT, where int is wide enough.
6996 (Fstring_to_number): Don't assume fixnums fit in int.
6997 (Frem): Don't assume arg is nonnegative.
6998 * dbusbind.c (xd_append_arg): Check for integers out of range.
6999 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 7000 (extract_signed, extract_unsigned): New functions.
243e0530
PE
7001 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7002 (xd_get_connection_references): Return ptrdiff_t, not int.
7003 All uses changed.
7004 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7005 (xd_read_message_1):
7006 Use int, not unsigned, where the dbus API uses int.
7007 (Fdbus_message_internal): Don't overflow mtype.
7008 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
7009 * dired.c (directory_files_internal, file_name_completion, scmp)
7010 (file_name_completion_stat):
7011 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7012 (file_name_completion): Don't overflow matchcount.
7013 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7014 * dispextern.h: Adjust decls to match defn changes elsewhere.
7015 (struct text_pos, struct glyph, struct bidi_saved_info)
7016 (struct bidi_string_data, struct bidi_it, struct composition_it)
7017 (struct it):
7018 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7019 (struct display_pos, struct composition_it, struct it):
7020 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7021 * dispnew.c (increment_matrix_positions)
7022 (increment_row_positions, mode_line_string)
7023 (marginal_area_string):
7024 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 7025 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
7026 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7027 (duration_to_sec_usec): New function, to check for overflow better.
7028 (Fsleep_for, sit_for): Use it.
7029 * doc.c (get_doc_string, store_function_docstring):
7030 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7031 (get_doc_string, Fsnarf_documentation):
7032 Use int, not EMACS_INT, where int is wide enough.
7033 (get_doc_string):
7034 Use SAFE_ALLOCA, not alloca.
7035 Check for overflow when converting EMACS_INT to off_t.
7036 * doprnt.c (doprnt):
7037 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7038 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7039 Don't assume uid_t fits into fixnum.
7040 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7041 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7042 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7043 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7044 (general_insert_function)
7045 (Finsert_char, make_buffer_string, make_buffer_string_both)
7046 (update_buffer_properties, Fbuffer_substring)
7047 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7048 (Fsubst_char_in_region, check_translation)
7049 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7050 (transpose_markers, Ftranspose_regions):
7051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7052 (clip_to_bounds): Move to lisp.h as an inline function).
7053 (Fconstrain_to_field): Don't assume integers are nonnegative.
7054 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7055 (Fsubst_char_in_region, Fsave_restriction):
7056 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7057 (Femacs_pid): Don't assume pid_t fits into fixnum.
7058 (lo_time): Use int, not EMACS_INT, when int suffices.
7059 (lisp_time_argument): Check for usec out of range.
7060 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
7061 (Fuser_login_name, Fuser_full_name): Signal an error
7062 if a uid argument is out of range, rather than relying on
7063 undefined behavior.
c8d5c857
PE
7064 (Fformat_time_string): Remove now-unnecessary check.
7065 lisp_time_argument checks for out-of-range usec now.
243e0530 7066 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
7067 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7068 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7069 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7070 (init_cmdargs, Fdump_emacs):
7071 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7072 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7073 the bottom (typically) 32 bits of the fixnum.
7074 * eval.c (specpdl_size, call_debugger):
7075 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7076 (when_entered_debugger, Fbacktrace_debug):
7077 Don't assume fixnum can fit in int.
7078 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7079 the object just before a buffer; this is not portable.
7080 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7081 (grow_specpdl, unbind_to):
7082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7083 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7084 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 7085 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
7086 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7087 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7088 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7089 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7090 (a_write, e_write):
7091 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7092 (Fcopy_file, non_regular_nbytes, read_non_regular)
7093 (Finsert_file_contents):
7094 Use int, not EMACS_INT, where int is wide enough.
7095 (READ_BUF_SIZE): Verify that it fits in int.
7096 (Finsert_file_contents): Check that counts are in proper range,
7097 rather than assuming fixnums fit into ptrdiff_t etc.
7098 Don't assume fixnums fit into int.
125b3835 7099 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
7100 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7101 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
7102 (string_char_to_byte, string_byte_to_char)
7103 (string_make_multibyte, string_to_multibyte)
7104 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7105 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7106 (substring_both, Fdelete, internal_equal, Ffillarray)
7107 (Fclear_string, mapcar1)
7108 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7109 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7110 (larger_vector, make_hash_table, maybe_resize_hash_table)
7111 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7112 (Fmaphash, secure_hash):
7113 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7114 (concat): Check for string index and length overflow.
7115 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7116 (Frequire):
7117 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7118 (larger_vector): New API (vec, incr_min, size_max) replaces old
7119 one (vec, new_size, init). This catches size overflow.
7120 INIT was removed because it was always Qnil.
7121 All callers changed.
7122 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7123 the upper bound on a hash table index size.
7124 (make_hash_table, maybe_resize_hash_table): Use it.
7125 (secure_hash): Computer start_byte and end_byte only after
7126 they're known to be in ptrdiff_t range.
7127 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7128 (Ffont_get_glyphs, Ffont_at):
7129 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7130 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7131 (Flist_fonts, Fopen_font):
7132 Don't assume fixnum can fit in int.
7133 (check_gstring): Don't assume index can fit in int.
7134 (font_match_p): Check that fixnum is a character, not a nonnegative
7135 fixnum, since the later code needs to stuff it into an int.
7136 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7137 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7138 conversion overflow issues.
7139 (Fopen_font): Check for integer out of range.
7140 (Ffont_get_glyphs): Don't assume index can fit in int.
7141 * font.h: Adjust decls to match defn changes elsewhere.
7142 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7143 integer overflow.
7144 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7145 printmax_t, where ptrdiff_t is wide enough.
7146 (Finternal_char_font):
7147 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7148 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7149 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7150 (Fset_frame_position, x_set_frame_parameters)
7151 (x_set_line_spacing, x_set_border_width)
7152 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7153 Check that fixnums are in proper range for system types.
7154 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7155 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7156 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7157 Use SAFE_ALLOCA_LISP, not alloca.
7158 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7159 intptr_t is wide enough.
7160 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7161 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7162 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7163 Check for fixnum out of range.
7164 * ftfont.c (ftfont_list): Don't assume index fits in int.
7165 Check that fixnums are in proper range for system types.
7166 (ftfont_shape_by_flt):
7167 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
7168 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7169 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7170 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7171 Check that fixnums are in proper range for system types.
7172 * gnutls.h: Adjust decls to match defn changes elsewhere.
7173 * gtkutil.c (xg_dialog_run):
7174 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7175 (update_frame_tool_bar):
7176 Check that fixnums are in proper range for system types.
7177 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 7178 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
7179 * indent.c (last_known_column, last_known_column_point):
7180 (current_column_bol_cache):
7181 (skip_invisible, current_column, check_display_width):
7182 (check_display_width, scan_for_column, current_column_1)
7183 (Findent_to, Fcurrent_indentation, position_indentation)
7184 (indented_beyond_p, Fmove_to_column, compute_motion):
7185 (Fcompute_motion, Fvertical_motion):
7186 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7187 (last_known_column_modified): Use EMACS_INT, not int.
7188 (check_display_width):
7189 (Fcompute_motion):
7190 Check that fixnums and floats are in proper range for system types.
7191 (compute_motion): Don't assume index or fixnum fits in int.
7192 (compute_motion, Fcompute_motion):
7193 Use int, not EMACS_INT, when it is wide enough.
7194 (vmotion): Omit local var start_hpos that is always 0; that way
7195 we don't need to worry about overflow in expressions involving it.
7196 * indent.h: Adjust decls to match defn changes elsewhere.
7197 (struct position):
7198 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7199 Use int, not EMACS_INT, where int is wide enough.
7200 Remove unused members ovstring_chars_done and tab_offset;
7201 all uses removed.
7202 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7203 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7204 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7205 (make_gap, copy_text, insert, insert_and_inherit)
7206 (insert_before_markers, insert_before_markers_and_inherit)
7207 (insert_1, count_combining_before, count_combining_after)
7208 (insert_1_both, insert_from_string)
7209 (insert_from_string_before_markers, insert_from_string_1)
7210 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7211 (adjust_after_replace, adjust_after_insert, replace_range)
7212 (replace_range_2, del_range, del_range_1, del_range_byte)
7213 (del_range_both, del_range_2, modify_region)
7214 (prepare_to_modify_buffer, signal_before_change)
7215 (signal_after_change, Fcombine_after_change_execute):
7216 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7217 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7218 (balance_an_interval, split_interval_right, split_interval_left)
7219 (find_interval, next_interval, update_interval)
7220 (adjust_intervals_for_insertion, delete_node, delete_interval)
7221 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7222 (static_offset_intervals, offset_intervals)
7223 (merge_interval_right, merge_interval_left, make_new_interval)
7224 (graft_intervals_into_buffer, temp_set_point_both)
7225 (temp_set_point, set_point, adjust_for_invis_intang)
7226 (set_point_both, move_if_not_intangible, get_property_and_range)
7227 (get_local_map, copy_intervals, copy_intervals_to_string)
7228 (compare_string_intervals, set_intervals_multibyte_1):
7229 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7230 * intervals.h: Adjust decls to match defn changes elsewhere.
7231 (struct interval):
7232 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7233 * keyboard.c (this_command_key_count, this_single_command_key_start)
7234 (before_command_key_count, before_command_echo_length, echo_now)
7235 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7236 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7237 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7238 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7239 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7240 (last_non_minibuf_size, last_point_position, echo_truncate)
7241 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7242 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7243 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7244 (stuff_buffered_input):
7245 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7246 (last_auto_save, command_loop_1, read_char):
7247 Use EMACS_INT, not int, to avoid integer overflow.
7248 (record_char): Avoid overflow in total_keys computation.
7249 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7250 * keyboard.h: Adjust decls to match defn changes elsewhere.
7251 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7252 (Fkey_description, Fdescribe_vector, Flookup_key):
7253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7254 (click_position): New function, to check that positions are in range.
7255 (Fcurrent_active_maps):
7256 (describe_command):
7257 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7258 (Faccessible_keymaps, Fkey_description):
7259 (preferred_sequence_p):
7260 Don't assume fixnum can fit into int.
7261 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7262 Check for integer overflow in size calculations.
7263 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7264 avoid mishandling large integers.
7265 * lisp.h: Adjust decls to match defn changes elsewhere.
7266 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7267 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7268 (struct Lisp_Marker):
7269 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7270 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
7271 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7272 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7273 All callers changed.
7274 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7275 Assume the arg has valid form, since it always does.
7276 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7277 unsigned integer system type.
7278 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7279 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7280 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7281 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7282 (duration_to_sec_usec): New decl.
7283 * lread.c (read_from_string_index, read_from_string_index_byte)
7284 (read_from_string_limit, readchar, unreadchar, openp)
7285 (read_internal_start, read1, oblookup):
7286 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7287 (Fload, readevalloop, Feval_buffer, Feval_region):
7288 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7289 (openp): Check for out-of-range argument to 'access'.
7290 (read1): Use int, not EMACS_INT, where int is wide enough.
7291 Don't assume fixnum fits into int.
6efdadfd 7292 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
7293 (read_filtered_event): Use duration_to_sec_usec
7294 to do proper overflow checking on durations.
d311d28c
PE
7295 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7296 in size calculation.
7297 (Fexecute_kbd_macro):
7298 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7299 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7300 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7301 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7302 (set_marker_both, set_marker_restricted_both, marker_position)
7303 (marker_byte_position, Fbuffer_has_markers_at):
7304 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7305 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 7306 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
7307 It now merely ensures that the menu is large enough, without
7308 necessarily growing it, as this avoids some integer overflow issues.
7309 All callers changed.
7310 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7311 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7312 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7313 Use SAFE_ALLOCA_LISP, not alloca.
7314 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7315 to EMACS_INT. Check that fixnums are in proper range for system types.
7316 * minibuf.c (minibuf_prompt_width, string_to_object)
7317 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7318 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7319 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7320 (get_minibuffer, read_minibuf_unwind):
7321 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7322 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7323 this simplifies overflow checking. All callers changed.
7324 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7325 (Ftest_completion):
7326 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7327 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7328 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7329 Check that fixnums are in proper range for system types.
7330 (Fx_create_frame, Fx_show_tip):
7331 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7332 * nsfont.m (ns_findfonts, nsfont_list_family):
7333 Don't assume fixnum fits in long.
7334 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7336 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7337 wide enough.
17fdb222 7338 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
7339 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7340 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7341 (PRINTDECLARE, PRINTPREPARE):
7342 (strout, print_string):
7343 (print, print_preprocess, print_check_string_charset_prop)
7344 (print_object):
7345 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7346 (PRINTDECLARE):
7347 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7348 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7349 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 7350 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 7351 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
7352 (print_error_message): Use SAFE_ALLOCA, not alloca.
7353 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
7354 (print_depth, new_backquote_output, print_number_index):
7355 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
7356 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7357 (Fset_process_window_size, Fformat_network_address)
7358 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 7359 (sigchld_handler):
d311d28c 7360 Check that fixnums are in proper range for system types.
d44287d4 7361 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
7362 Check for process-ids out of pid_t range rather than relying on
7363 undefined behavior.
e4d81efc 7364 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
7365 (Fformat_network_address, read_process_output, send_process)
7366 (Fprocess_send_region, status_notify):
7367 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7368 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7369 (wait_reading_process_output, read_process_output, exec_sentinel):
7370 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7371 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7372 (Faccept_process_output): Use duration_to_sec_usec to do proper
7373 overflow checking on durations.
dde14581
PE
7374 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7375 Don't assume pid_t fits in int.
02481186
PE
7376 * process.h (struct Lisp_Process): Members tick and update_tick
7377 are now of type EMACS_INT, not int.
b62b53e8
PE
7378 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7379 configured --with-wide-int.
d311d28c
PE
7380 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7381 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7382 * search.c (looking_at_1, string_match_1):
7383 (fast_string_match, fast_c_string_match_ignore_case)
7384 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7385 (scan_newline, find_before_next_newline, search_command)
7386 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7387 (set_search_regs, wordify):
7388 (Freplace_match):
7389 (Fmatch_data):
7390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7391 (string_match_1, search_buffer, set_search_regs):
7392 (Fmatch_data):
7393 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7394 (wordify): Check for overflow in size calculation.
7395 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7396 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7397 Check that fixnums are in proper range for system types.
7398 * sound.c (struct sound_device)
7399 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7400 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7401 (Fplay_sound_internal):
7402 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 7403 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
7404 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7405 (Fparse_partial_sexp):
7406 Don't assume fixnums can fit in int.
7407 (struct lisp_parse_state, find_start_pos, find_start_value)
7408 (find_start_value_byte, find_start_begv)
7409 (update_syntax_table, char_quoted, dec_bytepos)
7410 (find_defun_start, prev_char_comend_first, back_comment):
7411 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7412 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7413 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7414 (Finternal_describe_syntax_value): Check that match_lisp is a
7415 character, not an integer, since the code stuffs it into int.
7416 (scan_words, scan_sexps_forward):
7417 Check that fixnums are in proper range for system types.
7418 (Fforward_word):
7419 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7420 (scan_sexps_forward):
7421 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7422 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7423 * syntax.h: Adjust decls to match defn changes elsewhere.
7424 (struct gl_state_s):
7425 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
7426 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7427 MOST_POSITIVE_FIXNUM.
d311d28c
PE
7428 * sysdep.c (wait_for_termination_1, wait_for_termination)
7429 (interruptible_wait_for_termination, mkdir):
7430 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7431 (emacs_read, emacs_write):
7432 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
7433 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7434 and double all fit in int.
d311d28c
PE
7435 * term.c (set_tty_color_mode):
7436 Check that fixnums are in proper range for system types.
7437 * termhooks.h (struct input_event):
7438 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7439 * textprop.c (validate_interval_range, interval_of)
7440 (Fadd_text_properties, set_text_properties_1)
7441 (Fremove_text_properties, Fremove_list_of_text_properties)
7442 (Ftext_property_any, Ftext_property_not_all)
7443 (copy_text_properties, text_property_list, extend_property_ranges)
7444 (verify_interval_modification):
7445 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7446 (Fnext_single_char_property_change)
7447 (Fprevious_single_char_property_change):
7448 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
7449 (copy_text_properties):
7450 Check for integer overflow in index calculation.
d311d28c
PE
7451 * undo.c (last_boundary_position, record_point, record_insert)
7452 (record_delete, record_marker_adjustment, record_change)
7453 (record_property_change):
7454 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7455 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7456 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7457 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7458 (Fx_hide_tip, Fx_file_dialog):
7459 * w32menu.c (set_frame_menubar):
7460 Use ptrdiff_t, not int, for consistency with rest of code.
7461 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7462 (select_window, Fdelete_other_windows_internal)
7463 (window_scroll_pixel_based, window_scroll_line_based)
7464 (Frecenter, Fset_window_configuration):
7465 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7466 (Fset_window_hscroll, run_window_configuration_change_hook)
7467 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 7468 (Fscroll_other_window, Frecenter):
d311d28c
PE
7469 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7470 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7471 Don't assume fixnum fits in int.
7472 (Fset_window_scroll_bars):
7473 Check that fixnums are in proper range for system types.
7474 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7475 (string_pos, c_string_pos, number_of_chars, init_iterator)
7476 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7477 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7478 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
7479 (face_before_or_after_it_pos, handle_invisible_prop)
7480 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
7481 (display_prop_intangible_p, string_buffer_position_lim)
7482 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7483 (get_overlay_strings_1, get_overlay_strings)
7484 (iterate_out_of_display_property, forward_to_next_line_start)
7485 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7486 (get_next_display_element, set_iterator_to_next)
7487 (get_visually_first_element, compute_stop_pos_backwards)
7488 (handle_stop_backwards, next_element_from_buffer)
7489 (move_it_in_display_line_to, move_it_in_display_line)
7490 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7491 (add_to_log, message_dolog, message_log_check_duplicate)
7492 (message2, message2_nolog, message3, message3_nolog
7493 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7494 (current_message_1, truncate_echo_area, truncate_message_1)
7495 (set_message, set_message_1, store_mode_line_noprop)
7496 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7497 (text_outside_line_unchanged_p, check_point_in_composition)
7498 (reconsider_clip_changes)
7499 (redisplay_internal, set_cursor_from_row, try_scrolling)
7500 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7501 (redisplay_window, find_last_unchanged_at_beg_row)
7502 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7503 (trailing_whitespace_p, find_row_edges, display_line)
7504 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7505 (display_mode_element, store_mode_line_string)
7506 (pint2str, pint2hrstr, decode_mode_spec)
7507 (display_count_lines, display_string, draw_glyphs)
7508 (x_produce_glyphs, x_insert_glyphs)
7509 (rows_from_pos_range, mouse_face_from_buffer_pos)
7510 (fast_find_string_pos, mouse_face_from_string_pos)
7511 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7512 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7513 (safe_call, init_from_display_pos, handle_fontified_prop)
7514 (handle_single_display_spec, load_overlay_strings)
7515 (with_echo_area_buffer, setup_echo_area_for_printing)
7516 (display_echo_area, echo_area_display)
7517 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7518 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
7519 (redisplay_window, dump_glyph_row, display_mode_line)
7520 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 7521 (handle_display_spec, display_prop_string_p):
d311d28c
PE
7522 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7523 (handle_single_display_spec, build_desired_tool_bar_string)
7524 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7525 (get_specified_cursor_type):
7526 Check that fixnums are in proper range for system types.
7527 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7528 (Flookup_image_map):
7529 Don't assume fixnums fit in int.
7530 (compare_overlay_entries):
7531 Avoid mishandling comparisons due to subtraction overflow.
7532 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7533 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7534 (handle_tool_bar_click):
7535 Use int, not unsigned, since we prefer signed and the signedness
7536 doesn't matter here.
7537 (get_next_display_element, next_element_from_display_vector):
7538 Use int, not EMACS_INT, when int is wide enough.
7539 (start_hourglass): Use duration_to_sec_usec to do proper
7540 overflow checking on durations.
7541 * xfaces.c (Fbitmap_spec_p):
7542 Check that fixnums are in proper range for system types.
7543 (compare_fonts_by_sort_order):
7544 Avoid mishandling comparisons due to subtraction overflow.
7545 (Fx_family_fonts, realize_basic_faces):
7546 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7547 (Fx_family_fonts):
7548 Don't assume fixnum fits in int.
7549 Use SAFE_ALLOCA_LISP, not alloca.
7550 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7551 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7552 (face_at_buffer_position, face_for_overlay_string)
7553 (face_at_string_position):
7554 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7555 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7556 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7557 (Fx_show_tip):
7558 Check that fixnums are in proper range for system types.
7559 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7560 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7561 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7562 (Fx_change_window_property): Don't assume fixnums fit in int.
7563 * xfont.c (xfont_chars_supported):
7564 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7565 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7566 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7567 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7568 * xml.c (parse_region):
7569 * xrdb.c (magic_file_p):
7570 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7571 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7572 (x_get_local_selection, x_reply_selection_request)
7573 (x_handle_selection_request, wait_for_property_change):
7574 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7575 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7576 short is wide enough.
7577 (x_send_client_event): Don't assume fixnum fits in int.
7578 * xterm.c (x_x_to_emacs_modifiers):
7579 Don't assume EMACS_INT overflows nicely into int.
7580 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7581 may come from Lisp.
7582 (handle_one_xevent): NATNUMP can eval its arg twice.
7583 (x_connection_closed):
7584 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7585 * xterm.h: Adjust decls to match defn changes elsewhere.
7586 (struct scroll_bar): Use struct vectorlike_header
7587 rather than rolling our own approximation.
7588 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7589
c6574eb5
GM
75902012-05-25 Glenn Morris <rgm@gnu.org>
7591
7592 * lisp.mk (lisp): Update for more files being compiled now.
7593
e8d32c7e
SM
75942012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7595
48def666
SM
7596 * lread.c: Remove `read_pure' which makes no difference.
7597 (read_pure): Remove var.
7598 (unreadpure): Remove function.
7599 (readevalloop): Don't call read_list with -1 flag.
7600 (read1, read_vector): Don't test read_pure any more.
7601 (read_list): Simplify.
7602
e8d32c7e
SM
7603 * fileio.c, character.h: Minor style tweaks.
7604
4b2addb7
DA
76052012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7606
7607 * window.h (clip_changed): Remove useless declaration.
7608
584461b2
JB
76092012-05-22 Juanma Barranquero <lekktu@gmail.com>
7610
7611 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7612 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7613
34374650
PE
76142012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7615
7616 Remove src/m/*.
7617 This directory predates autoconf and is no longer needed nowadays.
7618 Move its few remaining bits of functionality to where they're needed.
7619 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7620 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7621 * m/template.h: Remove.
7622 * Makefile.in (M_FILE): Remove. All uses removed.
7623 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7624 * lisp.h (USE_LSB_TAG):
7625 * mem-limits.h (EXCEEDS_LISP_PTR):
7626 Use VAL_MAX, not VALBITS, in #if.
7627 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7628 (EMACS_UINT): Define unconditionally now.
7629 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7630 (BITS_PER_EMACS_INT): New constants, replacing
7631 what used to be in config.h, but not useful in #if.
7632 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7633 define them any more.
7634 (VAL_MAX): New macro.
7635 (VALMASK): Use it.
7636 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7637 BITS_PER_EMACS_INT, in #if.
7638 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7639 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7640 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7641 * s/ms-w32.h (DATA_START):
7642 Move here from removed file m/intel386.h.
7643 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7644 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7645
261cb4bb
PE
76462012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7647
7648 Assume C89 or later.
7649 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7650 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7651 (xrealloc):
7652 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7653 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7654 * textprop.c, tparam.c (NULL): Remove.
7655 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7656 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7657 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7658 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7659 * xterm.c (input_signal_count): Assume volatile works.
7660
ff23cd9f
KB
76612012-05-21 Ken Brown <kbrown@cornell.edu>
7662
7663 * xgselect.c (xg_select): Fix first argument in call to 'select'
7664 (bug#11508).
7665
1b170bc6
KB
76662012-05-20 Ken Brown <kbrown@cornell.edu>
7667
7668 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 7669 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 7670
b2f4d39f
KB
76712012-05-19 Ken Brown <kbrown@cornell.edu>
7672
7673 * xfns.c (x_in_use): Remove `static' qualifier.
7674 * xterm.h (x_in_use): Declare.
7675 * xgselect.c: Include xterm.h.
7676 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7677 and `display_arg' (bug#9754).
7678
003fdae2
PE
76792012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7680
9232a6d9
PE
7681 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7682
003fdae2
PE
7683 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7684 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7685
784b56e2
EZ
76862012-05-18 Eli Zaretskii <eliz@gnu.org>
7687
7688 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7689
7690 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 7691 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
7692
7693 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7694 reference to image_cache->refcount.
7695 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7696
a0a79cde
JL
76972012-05-17 Juri Linkov <juri@jurta.org>
7698
7699 * search.c (Fword_search_regexp, Fword_search_backward)
7700 (Fword_search_forward, Fword_search_backward_lax)
7701 (Fword_search_forward_lax): Move functions to isearch.el
7702 (bug#10145, bug#11381).
7703
b0572523
PE
77042012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7705
7706 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7707
9660f5fc
SM
77082012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7709
7710 * lread.c (init_obarray): Declare Qt and Qnil as special.
7711
4374de83
GM
77122012-05-14 Glenn Morris <rgm@gnu.org>
7713
7714 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 7715 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 7716
dc44c39a
PE
77172012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7718
078c97cb
PE
7719 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7720
dc44c39a
PE
7721 * unexaix.c: Port to more-recent AIX compilers.
7722 (report_error, report_error_1, make_hdr, copy_sym)
7723 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7724 Make arguments const char *, not char *, to avoid violations of C
7725 standard and to fix some AIX warnings reported by Gilles Pion.
7726
e18afed7 77272012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
7728
7729 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7730 already have overlays loaded.
7731 (handle_single_display_spec): Before returning without displaying
7732 fringe bitmap, synchronize the bidi iterator with the main display
7733 iterator, by calling iterate_out_of_display_property.
7734 (iterate_out_of_display_property): Detect buffer iteration by
7735 testing that it->string is a Lisp string.
7736 (get_next_display_element): When the current object is exhausted,
7737 and there's something on it->stack, call set_iterator_to_next to
7738 proceed with what's on the stack, instead of returning zero.
7739 (set_iterator_to_next): If called at the end of a Lisp string,
7740 proceed to consider_string_end without incrementing string
7741 position. Don't increment display vector index past the end of
7742 the display vector. (Bug#11417)
c8fb9dc6
EZ
7743 (pos_visible_p): Don't report a position visible when move_it_to
7744 stopped at the last line of window, which happens to be scanned
7745 backwards by the bidi iteration. (Bug#11464)
ac268e67 7746
e18afed7 77472012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
7748
7749 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7750 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
7751 are on a TTY, and thus unable to display on the fringes.
7752 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
7753 so we need to signal to the caller that this is a "replacing"
7754 display spec. This fixes display when the spec is invalid or we
7755 are on a TTY.
7756
e18afed7 77572012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
7758
7759 * unexaix.c (make_hdr): Fix typo in prototype.
7760 This bug broke the build on AIX. Problem reported by Gilles Pion.
7761
9d0a235a
MA
77622012-05-14 Michael Albinus <michael.albinus@gmx.de>
7763
7764 * keyboard.c (kbd_buffer_get_event): Read special events also in
7765 batch mode. (Bug#11415)
7766
9e6b06ed
GM
77672012-05-12 Glenn Morris <rgm@gnu.org>
7768
7769 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7770
c1a1d7a3
EZ
77712012-05-12 Eli Zaretskii <eliz@gnu.org>
7772
7773 * lisp.mk (lisp): Add newcomment.elc.
7774
3fe7cdc8
GM
77752012-05-12 Glenn Morris <rgm@gnu.org>
7776
7777 * Makefile.in (MKDIR_P): New, set by configure.
7778 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7779
53f7d2c0
PE
77802012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7781
7782 Remove unused function hourglass_started.
7783 * dispextern.h (hourglass_started):
7784 * w32fns.c (hourglass_started):
7785 * xdisp.c (hourglass_started): Remove.
7786
75aafb17
JB
77872012-05-10 Juanma Barranquero <lekktu@gmail.com>
7788
7789 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7790 Update dependencies.
7791
12959e8e
PE
77922012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7793
97107e2e
PE
7794 * xgselect.c (xg_select): Put maxfds+1 into a var.
7795 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7796
12959e8e
PE
7797 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7798
836d29b3
DA
77992012-05-10 Dave Abrahams <dave@boostpro.com>
7800
7801 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7802 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7803
5cb67954
MA
78042012-05-09 Michael Albinus <michael.albinus@gmx.de>
7805
7806 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7807 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7808 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7809 Initialize xd_registered_buses.
7810
3478ec45
PE
78112012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7812
b263a6b0
PE
7813 Untag more efficiently if USE_LSB_TAG.
7814 This is based on a proposal by YAMAMOTO Mitsuharu in
7815 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7816 For an admittedly artificial (nth 8000 longlist) benchmark on
7817 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7818 Emacs's overall text size by 1%.
7819 * lisp.h (XUNTAG): New macro.
7820 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7821 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7822 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7823 * eval.c (Fautoload):
7824 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7825 * frame.h (XFRAME): Use XUNTAG.
7826
3478ec45
PE
7827 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7828 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7829 Remove unportable assumptions about print widths of types like
7830 dbus_uint32_t.
7831 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7832 intptr_t when converting between pointer and integer, to avoid GCC
7833 warnings about wrong width.
7834
666b903b 78352012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
7836
7837 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7838 stack for each reader_thread, instead of defaulting to 8MB
7839 determined by the linker. This avoids failures in creating
7840 subprocesses on Windows 7, see the discussion in this thread:
7841 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7842
b120cc17
JC
78432012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7844
7845 Fix up display of the *Minibuf-0* buffer in the mini window.
7846 * keyboard.c (read_char): Don't clear the echo area if there's no
7847 message to clear.
7848 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 7849 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 7850
9a4b36f8
MA
78512012-05-07 Michael Albinus <michael.albinus@gmx.de>
7852
7853 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7854 batch mode.
7855
e5f9458f
CY
78562012-05-06 Chong Yidong <cyd@gnu.org>
7857
7858 * lisp.mk (lisp): Update.
7859
eceeb5fc 78602012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
7861
7862 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7863
71873e2b
SM
78642012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7865
7866 * data.c (PUT_ERROR): New macro.
7867 (syms_of_data): Use it. Add new error type `user-error'.
7868 * undo.c (user_error): New function.
7869 (Fprimitive_undo): Use it.
7870 * print.c (print_error_message): Adjust print style for `user-error'.
7871 * keyboard.c (user_error): New function.
7872 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7873
ab0fa4e4
PE
78742012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7875
7876 Do not limit current-time-string to years 1000..9999.
7877 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7878 (Fcurrent_time_string): Support any year that is supported by the
7879 underlying localtime representation. Don't use asctime, as it
7880 has undefined behavior for years outside the range -999..9999.
7881
7ed806a7
PE
78822012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7883
7884 Fix race conditions involving setenv, gmtime, localtime, asctime.
7885 Without this fix, interrupts could mess up code that uses these
7886 nonreentrant functions, since setting TZ invalidates existing
7887 tm_zone or tzname values, and since most of these functions return
7888 pointers to static storage.
7889 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7890 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7891 Grow the critical sections to include not just invoking
7892 localtime/gmtime, but also accessing these functions' results
7893 including their tm_zone values if any, and any related TZ setting.
7894 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
7895 so that the struct tm is saved in the critical section.
7896 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
7897 motivated by the fact that memory allocation needs to be outside
7898 the critical section.
7899
0c16dfed
DA
79002012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7901
7902 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7903 with RESET_INTERVAL.
7904
7905 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7906 Remove duplicated buffer name initialization.
7907
3f83ace8
JM
79082012-05-02 Jim Meyering <jim@meyering.net>
7909
7910 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7911
c7b8541e
JM
7912 * xfns.c (x_window): Use xstrdup (Bug#11375).
7913
90207a15 79142012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
7915
7916 * xdisp.c (pos_visible_p): If already at a newline from the
7917 display string before the 'while' loop, don't walk back the glyphs
7918 from it3.glyph_row. Solves assertion violation when the display
7919 string begins with a newline (egg.el). (Bug#11367)
7920
b593d6a9
AH
79212012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7922
7923 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7924 Move to simple.el.
7925
4737362e
GM
79262012-05-01 Glenn Morris <rgm@gnu.org>
7927
99cf43f9
GM
7928 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7929 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7930 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7931 All were removed before 23.1.
7932
9311dcff
GM
7933 * dispnew.c: Remove HAVE_LIBNCURSES test;
7934 it is always true on relevant platforms.
7935
4d5c6349
GM
7936 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7937 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7938
4737362e
GM
7939 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7940
74dd3a6b
AS
79412012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7942
7943 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7944 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7945 Remove.
7946
13c379ee
PE
79472012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7948
7949 Do not avoid creating empty evaporating overlays (Bug#9642).
7950 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7951 That is, do not delete an evaporating overlay if it becomes
7952 empty after its bounds are adjusted to fit within its buffer.
7953 This fix caused other problems, and I'm reverting it until we get
7954 to the bottom of them.
7955
a8e7d6d7 79562012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
7957
7958 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7959
a8e7d6d7 79602012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
7961
7962 * xdisp.c (pos_visible_p): If the window start position is beyond
7963 ZV, start the display from buffer beginning. Prevents assertion
7964 violation in init_iterator when the minibuffer window is scrolled
7965 via the scroll bar.
7966
7967 * window.c (window_scroll_pixel_based): Likewise.
7968
a8e7d6d7 79692012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
7970
7971 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7972
a8e7d6d7 79732012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
7974
7975 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7976 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7977
a8e7d6d7 79782012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 7979
b593d6a9
AH
7980 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7981 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 7982
1c6900d9
EZ
79832012-04-26 Eli Zaretskii <eliz@gnu.org>
7984
4c3fa1d9
EZ
7985 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7986 display element, check also the underlying string or buffer
7987 character. (Bug#11341)
7988
1c6900d9
EZ
7989 * w32menu.c: Include w32heap.h.
7990 (add_menu_item): If the call to AppendMenuW (via
7991 unicode_append_menu) fails, disable Unicode menus only if we are
7992 running on Windows 9X/Me.
7993
42bf8205
AS
79942012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7995
7996 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7997 (xgetint): Add missing shift for LSB tags.
7998
b1bac16e
MR
79992012-04-24 Martin Rudalics <rudalics@gmx.at>
8000
8001 * keyboard.c (read_char): Don't wipe echo area for select window
8002 events: These might get delayed via `mouse-autoselect-window'
8003 (Bug#11304).
8004
d69621cc
JB
80052012-04-24 Juanma Barranquero <lekktu@gmail.com>
8006
8007 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8008 manipulation of :loaded-from data.
8009
02fd101b
JB
80102012-04-23 Juanma Barranquero <lekktu@gmail.com>
8011
8012 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8013 now a cons (bug#11311).
8014
888bec30
PE
80152012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8016
89a438bd
PE
8017 Do not create empty overlays with the evaporate property (Bug#9642).
8018 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8019 if it becomes empty after its bounds are adjusted to fit within
8020 its buffer. Without this fix, in a nonempty buffer (let ((o
8021 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8022 yields an empty overlay that has the evaporate property, which is
8023 not supposed to happen.
8024
1068fe4d
PE
8025 Fix minor GTK3 problems found by static checking.
8026 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8027 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8028 (struct _EmacsFixedClass, emacs_fixed_get_type):
8029 Move decls here from emacsgtkfixed.h, since they needn't be public.
8030 (emacs_fixed_get_type): Now static.
8031 (emacs_fixed_class_init): Omit unused local.
8032 (emacs_fixed_child_type): Remove; unused.
8033 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8034 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8035 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8036 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8037 (EMACS_FIXED_GET_CLASS): Remove; unused.
8038 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8039
888bec30
PE
8040 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8041 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8042
de85e130
PE
80432012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8044
d0baac98 8045 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 8046 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
8047 (__malloc_size_t, __malloc_ptrdiff_t):
8048 Remove. All uses removed, replaced by the definiens if needed,
8049 since we can assume C89 or better now.
8050 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8051 (protect_malloc_state, align, get_contiguous_space)
8052 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8053 (malloc_atfork_handler_child, malloc_enable_thread)
8054 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8055 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8056 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8057 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8058 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8059 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8060 Define using prototypes, not old style.
8061 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8062 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8063 (align): Don't assume that signed integer overflow wraps around.
8064 Omit unused local var.
8065 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8066 (_free_internal_nolock, memalign, mallochook, reallochook):
8067 Omit no-longer-needed casts.
8068 (valloc): Use getpagesize, not __getpagesize.
8069 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8070 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8071
de85e130
PE
8072 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8073
dcbf5805
MA
80742012-04-22 Michael Albinus <michael.albinus@gmx.de>
8075
8076 Move functions from C to Lisp. Make non-blocking method calls
8077 the default. Implement further D-Bus standard interfaces.
8078
8079 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8080 (QCdbus_request_name_allow_replacement)
8081 (QCdbus_request_name_replace_existing)
8082 (QCdbus_request_name_do_not_queue)
8083 (QCdbus_request_name_reply_primary_owner)
8084 (QCdbus_request_name_reply_in_queue)
8085 (QCdbus_request_name_reply_exists)
8086 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8087 (QCdbus_registered_serial, QCdbus_registered_method)
8088 (QCdbus_registered_signal): New Lisp objects.
8089 (XD_DEBUG_MESSAGE): Use sizeof.
8090 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8091 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8092 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8093 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8094 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8095 (xd_signature, xd_append_arg): Allow float for integer types.
8096 (xd_get_connection_references): New function.
b593d6a9
AH
8097 (xd_get_connection_address): Rename from xd_initialize.
8098 Return cached address.
dcbf5805
MA
8099 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8100 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8101 level.
8102 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 8103 Return number of refcounts.
dcbf5805
MA
8104 (Fdbus_get_unique_name): Make stronger parameter check.
8105 (Fdbus_message_internal): New defun.
8106 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8107 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8108 (Fdbus_send_signal, Fdbus_register_service)
8109 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8110 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8111 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8112 (Vdbus_compiled_version, Vdbus_runtime_version)
8113 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8114 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8115 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
8116 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8117 Adapt docstring.
dcbf5805 8118
52828e02
PE
81192012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8120
da05bc4c
PE
8121 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8122 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8123 Do not assume ptrdiff_t is the same width as 'int'.
8124
52828e02
PE
8125 * alloc.c: Handle unusual debugging option combinations.
8126 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8127 since the two debugging options are incompatible.
8128 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8129 is defined.
8130 (mem_init, mem_insert, mem_insert_fixup):
8131 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8132 (NEED_MEM_INSERT): Remove; no longer needed.
8133
f01769f9
LL
81342012-04-22 Leo Liu <sdl.web@gmail.com>
8135
8136 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8137
5790543d
PE
81382012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8139
8140 * sysdep.c [__FreeBSD__]: Minor cleanups.
8141 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8142 Use Emacs indenting style more consistently. Avoid some casts.
8143 Use 'double' consistently rather than mixing 'float' and 'double'.
8144
b91b7e4d
EW
81452012-04-21 Eduard Wiebe <usenet@pusto.de>
8146
b593d6a9
AH
8147 * sysdep.c (list_system_processes, system_process_attributes):
8148 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 8149
6114eb15
AS
81502012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8151
8152 * lisp.mk (lisp): Update.
8153
2f38dff7
PE
81542012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8155
8156 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8157 It is never used otherwise.
8158
4ae29f89
SM
81592012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8160
8161 * print.c (print_preprocess): Only check print_depth if print-circle
8162 is nil.
8163 (print_object): Check for cycles even when print-circle is nil and
8164 print-gensym is t, but only check print_depth if print-circle is nil.
8165
f30d612a
CY
81662012-04-20 Chong Yidong <cyd@gnu.org>
8167
8168 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8169 set the status to "failed" and ensure that sentinel is run.
8170
c07a4c0b 81712012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
8172
8173 * process.c (Fset_process_inherit_coding_system_flag)
8174 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 8175 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 8176
c07a4c0b 81772012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
8178
8179 * xdisp.c (string_buffer_position_lim): Limit starting position to
8180 BEGV.
8181 (set_cursor_from_row): If called for a mode-line or header-line
8182 row, return zero immediately.
8183 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
8184 farther than the first row after the header line, if any.
8185 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
8186 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8187
c07a4c0b 81882012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8189
4ae29f89
SM
8190 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8191 (bug#11238).
ad3a2b41 8192
c07a4c0b 81932012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 81942012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
8195
8196 configure: new option --enable-gcc-warnings (Bug#11207)
8197 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8198 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8199 (ALL_CFLAGS): Use new macros rather than old.
8200 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8201 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8202 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8203 -Wunused-result, -Wunused-variable. This should go away once
8204 the Emacs and Gnulib regex code is merged.
8205 (xmalloc, xrealloc): Now static.
8206
aba027e8
PE
82072012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8208
8209 * dired.c (Fsystem_groups): Remove unused local.
8210
e5a36063
GM
82112012-04-17 Glenn Morris <rgm@gnu.org>
8212
8213 * dired.c (Fsystem_users): Doc fix.
8214
316411f0
DA
82152012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8216
8217 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8218 (syms_of_dired): Add them.
8219
9426aba4
PE
82202012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8221
b62a57be
PE
8222 Fix minor alloc.c problems found by static checking.
8223 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8224 New extern decls, to avoid calling undeclared functions.
8225 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8226 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8227 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8228 (NEED_MEM_INSERT): New macro.
8229 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 8230 Remove one incorrect comment and fix another.
b62a57be 8231
3539f31f
PE
8232 Fix minor ralloc.c problems found by static checking.
8233 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8234 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8235 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8236 (r_alloc_sbrk): Now static.
8237
a041960a
PE
8238 Improve ralloc.c interface checking.
8239 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8240 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8241 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8242 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8243 [REL_ALLOC]: ... to here, to check interface.
8244 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8245 Remove decls. This fixes an "It stinks!".
8246
9426aba4
PE
8247 * alloc.c (which_symbols): Fix alignment issue / type clash.
8248
d55c12ed
AS
82492012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8250
8251 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8252 (struct Lisp_Misc_Any): Likewise.
8253 (struct Lisp_Free): Likewise.
8254 * alloc.c (union aligned_Lisp_Symbol): Define.
8255 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8256 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8257 (union aligned_Lisp_Misc): Define.
8258 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8259 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 8260 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 8261
b948ce8b
PE
82622012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8263
8264 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8265 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8266 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8267 * s/netbsd.h, s/sol2-6.h:
8268 Remove definition of GC_MARK_STACK, since the default now works.
8269 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8270 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8271 no longer the default.
8272 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8273
35dc09a1 82742012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8275
35dc09a1
GM
8276 * lread.c (lisp_file_lexically_bound_p):
8277 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 8278
35dc09a1
GM
82792012-04-14 Eli Zaretskii <eliz@gnu.org>
8280
8281 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8282 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8283
82842012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8285
8286 * nsterm.m (constrainFrameRect): Always constrain when there is only
8287 one screen (Bug#10962).
8288
bcd86815
KB
82892012-04-13 Ken Brown <kbrown@cornell.edu>
8290
8291 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8292
c25df26e
RT
82932012-04-13 Reuben Thomas <rrt@sc3d.org>
8294
8295 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8296
0fc59f1e
DC
82972012-04-11 Daniel Colascione <dancol@dancol.org>
8298
8299 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8300 against is gone. It's better to use vfork now so that when Cygwin
8301 gains a new, working vfork, we use it automatically (bug#10398).
8302
de8c03dc
SM
83032012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8304
8305 * window.c (save_window_save): Obey window-point-insertion-type.
8306
2f097256
GM
83072012-04-11 Glenn Morris <rgm@gnu.org>
8308
8309 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8310
453b951e
SM
83112012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8312
8313 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8314
75f1671a 83152012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
8316
8317 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8318 (force_quit_count): New var.
8319 (handle_interrupt): Use it.
8320
2a8ce227
JB
83212012-04-10 Juanma Barranquero <lekktu@gmail.com>
8322
8323 * w32.c (w32_delayed_load): Record the full path of the library
8324 being loaded (bug#10424).
8325
935396c0
GM
83262012-04-09 Glenn Morris <rgm@gnu.org>
8327
05920a43
GM
8328 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8329 not just in the obarray, before snarfing them. (Bug#11036)
8330
935396c0
GM
8331 * Makefile.in ($(leimdir)/leim-list.el):
8332 Pass EMACS rather than BUILT_EMACS.
8333
a18ecafa
TZ
83342012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8335
8336 * process.c (make_process):
8337 * process.h: Add integer `gnutls_handshakes_tried' member to
8338 process struct.
8339
6bbef4e5
JC
8340 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8341 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
8342
8343 * gnutls.c (gnutls_log_function2i): Convenience log function.
8344 (emacs_gnutls_read): Use new log functions,
8345 `gnutls_handshakes_tried' process member, and
8346 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8347 attempts per process (connection).
8348
b4d3bc10
CY
83492012-04-09 Chong Yidong <cyd@gnu.org>
8350
8351 * eval.c (Fuser_variable_p, user_variable_p_eh)
8352 (lisp_indirect_variable): Functions deleted.
8353 (Fdefvar): Caller changed.
8354
8355 * callint.c (Finteractive, Fcall_interactively):
8356 * minibuf.c (Fread_variable): Callers changed.
8357
70f4d973
EZ
83582012-04-09 Eli Zaretskii <eliz@gnu.org>
8359
8360 * xdisp.c (set_cursor_from_row): If the display string appears in
8361 the buffer at position that is closer to point than the position
8362 after the display string, display the cursor on the first glyph of
8363 the display string. Fixes cursor display when a 'display' text
8364 property immediately follows invisible text. (Bug#11094)
8365
cb3c2e3e
PE
83662012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8367
8368 composite.c: use 'double' consistently
8369 * composite.c (get_composition_id): Use 'double' consistently
8370 instead of converting 'float' to 'double' and vice versa; this is
8371 easier to understand and avoids a GCC warning.
8372
fd06db5d
GM
83732012-04-09 Glenn Morris <rgm@gnu.org>
8374
50fe702a
GM
8375 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8376 preparation for dumping it with emacs. (Bug#4789)
8377 (leimdir): New variable.
8378 ($(leimdir)/leim-list.el): New rule.
8379 (emacs$(EXEEXT)): Depend on leim-list.el.
8380
fd06db5d
GM
8381 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8382 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8383 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8384
55c131ee
AS
83852012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8386
8387 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8388 proper alignment.
8389
9209588f
JB
83902012-04-07 Juanma Barranquero <lekktu@gmail.com>
8391
8392 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8393 Remove unused local variable.
8394
e3fb2efb
PE
83952012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8396
8397 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8398 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8399 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8400 objects, as mark_maybe_pointer will catch them otherwise.
8401 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8402 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8403
b5385551
PE
84042012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8405
8406 Fix typo that broke non-Windows builds.
8407 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8408
9078ead6
EZ
84092012-04-07 Eli Zaretskii <eliz@gnu.org>
8410
8411 Support building on MS-Windows with libxml2.
8412
8413 * makefile.w32-in (OBJ2): Add xml.$(O).
8414 (GLOBAL_SOURCES): Add xml.c.
8415 ($(BLD)/xml.$(O)): New dependency list.
8416
8417 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8418 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8419 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8420 [!WINDOWSNT]: New macros.
8421 (init_libxml2_functions, libxml2_loaded_p): New functions.
8422 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8423 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8424 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8425 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8426 linked in).
6bbef4e5
JC
8427 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8428 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
8429 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8430
8431 * emacs.c: Don't include libxml/parser.h.
8432 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8433 xmlCleanupParser directly.
8434
8435 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8436
3811fdf3
EZ
84372012-04-07 Eli Zaretskii <eliz@gnu.org>
8438
8439 * indent.c (Fvertical_motion): If there is a display string at
8440 point, use it.vpos to compute how many lines to backtrack after
8441 move_it_to point. (Bug#11133)
8442
2f8e16b2
EZ
84432012-04-06 Eli Zaretskii <eliz@gnu.org>
8444
8445 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8446 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8447 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8448 macros related to unification of CJK characters. For the details,
8449 see the discussion following the message here:
8450 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8451
3d439cd1
CY
84522012-04-04 Chong Yidong <cyd@gnu.org>
8453
8454 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8455
8bc53d00
EZ
84562012-04-01 Eli Zaretskii <eliz@gnu.org>
8457
8458 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8459 instead of alloca. (Bug#11138)
8460
3b0512a3
AS
84612012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8462
8463 * w32menu.c (is_simple_dialog): Properly check lisp types.
8464 (Bug#11141)
8465
8427ddd2
EZ
84662012-03-31 Eli Zaretskii <eliz@gnu.org>
8467
979022ef
EZ
8468 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8469 position we get to after a call to move_it_to fails the
8470 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8471 only if we wind up in a string from display property. (Bug#11063)
8472
a6b1c7cc
EZ
8473 * window.c (Fdelete_other_windows_internal): Invalidate the row
8474 and column information about mouse highlight, so that redisplay
8475 restores it after reallocating the glyph matrices. (Bug#7464)
8476
8427ddd2
EZ
8477 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8478 string comes from a `display' text property, use the buffer
8479 position of that property as if we actually saw that position in
8480 the row's glyphs.
697ba24b
EZ
8481 (move_it_by_lines): Remove the assertion that
8482 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8483 violated when there's a before-string at the beginning of a line.
8484 (Bug#11063)
8427ddd2 8485
65a0a738
EZ
84862012-03-30 Eli Zaretskii <eliz@gnu.org>
8487
8488 * xdisp.c (append_space_for_newline): If the default face was
8489 remapped, use the remapped face for the appended newline.
8490 (extend_face_to_end_of_line): Use the remapped default face for
8491 extending the face to the end of the line.
8492 (display_line): Call extend_face_to_end_of_line when the default
8493 face was remapped. (Bug#11068)
8494
581355cc
EZ
84952012-03-29 Eli Zaretskii <eliz@gnu.org>
8496
8497 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8498
e8fc049f
SM
84992012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8500
8501 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8502
4fb9a543
GM
85032012-03-27 Glenn Morris <rgm@gnu.org>
8504
8505 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8506 Doc fixes.
8507
679910f1
KH
85082012-03-26 Kenichi Handa <handa@m17n.org>
8509
8510 * dispextern.h (struct glyph): Fix previous change. Change the
8511 bit length of glyphless.ch to 25 (Bug#11082).
8512
90d49b7f
CY
85132012-03-26 Chong Yidong <cyd@gnu.org>
8514
8515 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8516 (command_loop_1): Use it; inhibit selection update for
8517 handle-select-window too (Bug#8996).
8518
f514f6f0
FP
85192012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8520
e8fc049f 8521 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 8522
bf43fa51
KH
85232012-03-25 Kenichi Handa <handa@m17n.org>
8524
8525 * dispextern.h (struct glyph): Change the bit length of
8526 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8527
8a0c01dd
EZ
85282012-03-24 Eli Zaretskii <eliz@gnu.org>
8529
8530 * s/ms-w32.h (tzname): Include time.h before redirecting to
8531 _tzname. Fixes the MSVC build. (Bug#9960)
8532
7d1c3a76
AS
85332012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8534
8ed79523
AS
8535 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8536 characters.
8537
7d1c3a76
AS
8538 * xterm.c (XTread_socket): Only modify handling_signal if
8539 !SYNC_INPUT. (Bug#11080)
8540
e99a9b8b
EZ
85412012-03-23 Eli Zaretskii <eliz@gnu.org>
8542
8543 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8544 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8545 when fetching a multibyte character consumes more bytes than
8546 CHAR_BYTES returns, due to unification of CJK characters in
8547 string_char. (Bug#11073)
8548
5063c0e1
TN
85492012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8550
8551 * process.c (wait_reading_process_output): Handle pty disconnect
8552 by refraining from sending oneself a SIGCHLD (bug#10933).
8553
9f851fbd
CY
85542012-03-22 Chong Yidong <cyd@gnu.org>
8555
8556 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8557
5063c0e1 8558 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
8559 Mark string as coming from a prefix property.
8560 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8561 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8562
fb5b8aca
CY
85632012-03-21 Chong Yidong <cyd@gnu.org>
8564
8565 * xfaces.c (Vface_remapping_alist): Doc fix.
8566
62356a1b
EZ
85672012-03-20 Eli Zaretskii <eliz@gnu.org>
8568
8569 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
8570 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8571 Doc fixes.
62356a1b 8572
025de85b
CY
85732012-03-20 Chong Yidong <cyd@gnu.org>
8574
8575 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8576 to reflect default non-nil value of redisplay-dont-pause.
8577
4827f94e
KH
85782012-03-19 Kenichi Handa <handa@m17n.org>
8579
8580 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8581 it fit in a valid range (Bug#11003).
8582
e50a24a2
EZ
85832012-03-18 Eli Zaretskii <eliz@gnu.org>
8584
8585 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8586 that is not from display property, accept the row as a "cursor
8587 row" if one of the string's character has a non-nil `cursor'
8588 property. Fixes cursor positioning when there are newlines in
8589 overlay strings, e.g. in icomplete.el. (Bug#11035)
8590
9af5ed87
PE
85912012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8592
8593 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8594
d1f55f16
CY
85952012-03-12 Chong Yidong <cyd@gnu.org>
8596
8597 * eval.c (inhibit_lisp_code): Rename from
8598 inhibit_window_configuration_change_hook; move from window.c.
8599
8600 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8601 * window.c (run_window_configuration_change_hook)
8602 (syms_of_window): Callers changed.
8603
66c5eebd
CY
86042012-03-11 Chong Yidong <cyd@gnu.org>
8605
413df973
CY
8606 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8607
66c5eebd
CY
8608 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8609
1de11f56
CY
86102012-03-10 Chong Yidong <cyd@gnu.org>
8611
8612 * frame.c (other_visible_frames): Don't assume the selected frame
8613 is visible (Bug#10955).
8614
cae07000
SM
86152012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8616
8617 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8618
89c94350
JD
86192012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8620
8621 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8622 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8623 zero (Bug#10954).
8624
999dd333
GM
86252012-03-03 Glenn Morris <rgm@gnu.org>
8626
01a6dcc8 8627 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 8628
de0100f2
EZ
86292012-03-02 Eli Zaretskii <eliz@gnu.org>
8630
8631 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8632 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
8633 (redisplay_window, next_element_from_string): Fix typos in
8634 comments.
3e441275
EZ
8635 (redisplay_window): Pass to move_it_vertically the margin in
8636 pixels, not in screen lines.
de0100f2 8637
96a72ee9
GM
86382012-03-02 Glenn Morris <rgm@gnu.org>
8639
8640 * buffer.c (buffer-list-update-hook): Doc fix.
8641
312508d7
EZ
86422012-02-29 Eli Zaretskii <eliz@gnu.org>
8643
8644 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8645 push_it before setting up the iterator for the first overlay
8646 string, even if we have an empty string loaded.
8647 (next_overlay_string): If there's an empty string on the iterator
8648 stack, pop the stack. (Bug#10903)
8649
27f3c637
PE
86502012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8651
8652 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8653 Suggested by Stefan Monnier in
8654 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8655 * alloc.c (widen_to_Lisp_Object): New static function.
8656 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8657 and widening them to Lisp_Objects. This would work even if
8658 USE_LSB_TAG is defined and wide integers are used, which might
8659 happen in a future version of Emacs.
8660
3c9dfce6
CY
86612012-02-25 Chong Yidong <cyd@gnu.org>
8662
fa74b241
CY
8663 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8664 Doc fix.
8665
3c9dfce6
CY
8666 * xselect.c (Fx_selection_exists_p): Doc fix.
8667 (x_clipboard_manager_save_all): Print an informative message
8668 before saving to clipboard manager.
8669
9486df08
CY
86702012-02-24 Chong Yidong <cyd@gnu.org>
8671
8672 * keyboard.c (process_special_events): Handle all X selection
8673 requests in kbd_buffer, not just the next one (Bug#8869).
8674
f01d3321
CY
86752012-02-23 Chong Yidong <cyd@gnu.org>
8676
8677 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8678 call when setting menu-bar-lines and tool-bar-lines parameters.
8679 (unwind_create_frame_1): New helper function.
8680
8681 * window.c (inhibit_window_configuration_change_hook): New var.
8682 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 8683 (syms_of_window): Initialize it.
f01d3321 8684
86b847b6
CY
86852012-02-22 Chong Yidong <cyd@gnu.org>
8686
8687 * xterm.c (x_draw_image_relief): Add missing type check for
8688 Vtool_bar_button_margin (Bug#10743).
8689
a59225b1
CY
86902012-02-21 Chong Yidong <cyd@gnu.org>
8691
8692 * fileio.c (Vfile_name_handler_alist): Doc fix.
8693
8694 * buffer.c (Fget_file_buffer): Protect against invalid file
8695 handler return value.
8696
310f5bd4
PE
86972012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8698
cb3a28cc
PE
8699 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8700 when computing $valmask.
8701
310f5bd4
PE
8702 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8703 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8704 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8705 It's useless in that case, and it can cause problems on hosts
8706 that allocate halves of EMACS_INT values separately.
8707 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8708 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8709 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8710 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8711 it avoids undefined behavior on hosts where shifting right by more
8712 than the word width has undefined behavior.
8713
2375c96a
CY
87142012-02-19 Chong Yidong <cyd@gnu.org>
8715
8716 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8717 (Funhandled_file_name_directory, Ffile_name_as_directory)
8718 (Fdirectory_file_name, Fexpand_file_name)
8719 (Fsubstitute_in_file_name): Protect against invalid file handler
8720 return values (Bug#10845).
8721
3eb49e71
EZ
87222012-02-18 Eli Zaretskii <eliz@gnu.org>
8723
8724 * .gdbinit (pitx): Fix incorrect references to fields of the
8725 iterator stack.
8726
7b926f3f
CY
87272012-02-17 Chong Yidong <cyd@gnu.org>
8728
8729 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8730
11273115
PE
87312012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8732
8733 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8734 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8735
c3a70e2b
CY
87362012-02-15 Chong Yidong <cyd@gnu.org>
8737
8738 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8739 marked as special. Also, starting docstrings with * is obsolete.
8740
0ca43699
AS
87412012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8742
8743 * gnutls.c (emacs_gnutls_write): Fix last change.
8744
2e8f3c56
LI
87452012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8746
8747 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8748 send_process.
8749
af70074f
SM
87502012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8751
8752 * keymap.c (Fsingle_key_description): Handle char ranges.
8753
95986d52
CY
87542012-02-12 Chong Yidong <cyd@gnu.org>
8755
afd83bd1
CY
8756 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8757 as that creates a dangerous corner case.
8758
95986d52
CY
8759 * window.c (Fdelete_window_internal): Invalidate the mouse
8760 highlight (Bug#9904).
8761
bd7da63e
GM
87622012-02-12 Glenn Morris <rgm@gnu.org>
8763
8764 * xselect.c (Fx_own_selection_internal)
8765 (Fx_get_selection_internal, Fx_disown_selection_internal)
8766 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8767 * nsselect.m (Fx_own_selection_internal)
8768 (Fx_disown_selection_internal, Fx_selection_exists_p)
8769 (Fx_selection_owner_p, Fx_get_selection_internal):
8770 Sync docs and argument specs with the xselect.c versions.
8771
77abcbc2
LI
87722012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8773
8774 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8775
90b671e2
EZ
87762012-02-11 Eli Zaretskii <eliz@gnu.org>
8777
1c0ca0b7
EZ
8778 * w32select.c (Fx_selection_exists_p): Sync doc string and
8779 argument list with xselect.c. (Bug#10783)
8780
8781 * w16select.c (Fx_selection_exists_p): Sync doc string and
8782 argument list with xselect.c. (Bug#10783)
90b671e2 8783
49241268
GM
87842012-02-10 Glenn Morris <rgm@gnu.org>
8785
8786 * fns.c (Fsecure_hash): Doc fix.
8787
f998bbe7 87882012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
8789
8790 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8791
0992bd9c
CY
87922012-02-07 Chong Yidong <cyd@gnu.org>
8793
8794 * buffer.c (Fbuffer_local_variables)
8795 (buffer_lisp_local_variables): Handle unbound vars correctly;
8796 don't let Qunbound leak into Lisp.
8797
af008560
GM
87982012-02-07 Glenn Morris <rgm@gnu.org>
8799
dd605cc4
GM
8800 * image.c (Fimagemagick_types): Doc fix.
8801
af008560
GM
8802 * image.c (imagemagick-render-type): Change it from a lisp object
8803 to an integer. Move the doc here from the lisp manual.
8804 Treat all values not equal to 0 the same.
8805
1449fa1d
CY
88062012-02-06 Chong Yidong <cyd@gnu.org>
8807
8808 * doc.c (store_function_docstring): Avoid applying docstring of
8809 alias to base function (Bug#2603).
8810
3723ec07
AS
88112012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8812
8813 * .gdbinit (pp1, pv1): Remove redundant defines.
8814 (pr): Use pp.
8815
79c1cc1e
CY
88162012-02-04 Chong Yidong <cyd@gnu.org>
8817
8818 * nsterm.m: Declare a global (Bug#10694).
8819
d7f29f8e
EZ
88202012-02-04 Eli Zaretskii <eliz@gnu.org>
8821
cae07000
SM
8822 * w32.c (get_emacs_configuration_options):
8823 Include --enable-checking, if specified, in the return value.
d7f29f8e 8824
3b95a6f9
MR
88252012-02-04 Martin Rudalics <rudalics@gmx.at>
8826
8827 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8828 after rounding frame sizes. (Bug#9723)
8829
d6fa96a6
EZ
88302012-02-04 Eli Zaretskii <eliz@gnu.org>
8831
8832 * keyboard.c (adjust_point_for_property): Don't position point
8833 before BEGV. (Bug#10696)
8834
df0b2940
PE
88352012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8836
8837 Handle overflow when computing char display width (Bug#9496).
8838 * character.c (char_width): Return EMACS_INT, not int.
8839 (char_width, c_string_width): Check for overflow when
8840 computing the width; this is possible now that individual
8841 characters can have unbounded width. Problem introduced
8842 by merge from Emacs 23 on 2012-01-19.
8843
6bee44d6
MA
88442012-02-02 Michael Albinus <michael.albinus@gmx.de>
8845
8846 * dbusbind.c (Fdbus_register_method): Mention the return value
8847 :ignore in the docstring.
8848
44f92739
GM
88492012-02-02 Glenn Morris <rgm@gnu.org>
8850
1b9f60cc
GM
8851 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8852
44f92739
GM
8853 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8854 Unconditionally set to t. (Bug#10673)
8855 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8856 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8857 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8858
c5d3843c
KH
88592012-02-02 Kenichi Handa <handa@m17n.org>
8860
8861 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8862 0, do not call append_composite_glyph.
8863
159462d4 88642012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
8865
8866 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8867 NULL (Bug#6988).
8868 (x_produce_glyphs): If the component of a composition is a null
8869 string, set it->pixel_width to 1 to avoid zero-width glyph.
8870
78cef877
EZ
88712012-02-01 Eli Zaretskii <eliz@gnu.org>
8872
8873 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8874 first 2 arguments are identical. This makes inserting large
8875 output from a subprocess an order of magnitude faster on
8876 MS-Windows, where all sbrk'ed memory is always contiguous.
8877
97897668
GM
88782012-01-31 Glenn Morris <rgm@gnu.org>
8879
8880 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 8881 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
8882 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8883
31fd3586
GM
88842012-01-29 Glenn Morris <rgm@gnu.org>
8885
8886 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8887
0e24a8b2
CY
88882012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8889
8890 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8891
cc0adcb0
CY
88922012-01-28 Chong Yidong <cyd@gnu.org>
8893
8894 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8895
acc28cb9
CY
88962012-01-26 Chong Yidong <cyd@gnu.org>
8897
9c69cfb7
CY
8898 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8899
acc28cb9
CY
8900 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8901 repeat counts (Bug#10507).
8902
48da7392
GM
89032012-01-26 Glenn Morris <rgm@gnu.org>
8904
8905 * lread.c (syms_of_lread): Doc fix.
8906
14af5f7f
CY
89072012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8908
8909 * coding.c (encode_designation_at_bol): Change return value to
8910 EMACS_INT.
8911
0b21c100
CY
89122012-01-25 Chong Yidong <cyd@gnu.org>
8913
8914 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8915
3c2907f7
CY
89162012-01-21 Chong Yidong <cyd@gnu.org>
8917
8918 * floatfns.c (Fcopysign): Make the second argument non-optional,
8919 since nil is not allowed anyway.
8920
959ad23f
AS
89212012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8922
8923 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8924 (send_process): Likewise.
8925
34a02f46
MR
89262012-01-19 Martin Rudalics <rudalics@gmx.at>
8927
8928 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
8929 (Vwindow_persistent_parameters): Do not use Qstate.
8930 Rewrite doc-strings.
34a02f46 8931
1259009a 89322012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
8933
8934 * character.c (char_width): New function.
70d4fdf6
GM
8935 (Fchar_width, c_string_width, lisp_string_width):
8936 Use char_width (Bug#9496).
25ed9e61 8937
6a6ee00d
MR
89382012-01-16 Martin Rudalics <rudalics@gmx.at>
8939
8940 * window.c (Vwindow_persistent_parameters): New variable.
8941 (Fset_window_configuration, save_window_save): Handle persistent
8942 window parameters.
8943
c85efaf7
EZ
89442012-01-14 Eli Zaretskii <eliz@gnu.org>
8945
8946 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8947 thrashing the stack of the thread. (Bug#9087)
8948
5944709e
PE
89492012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8950
8951 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8952
e71f5d99
EZ
89532012-01-11 Eli Zaretskii <eliz@gnu.org>
8954
8955 * xdisp.c (rows_from_pos_range): Handle the case where the
8956 highlight ends on a newline. (Bug#10464)
8957 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8958 he end column for display of highlight that ends on a newline
8959 before a R2L line.
8960
ce316182
GM
89612012-01-11 Glenn Morris <rgm@gnu.org>
8962
8963 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8964 from load-path also when installation-directory is nil. (Bug#10208)
8965
5b43da69
GM
89662012-01-10 Glenn Morris <rgm@gnu.org>
8967
74cc8ff9
GM
8968 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8969
7d8d6e4e
GM
8970 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8971 Update template values to be closer to their typical values these days.
5b43da69 8972
a0db8d43
EZ
89732012-01-09 Eli Zaretskii <eliz@gnu.org>
8974
8975 * xdisp.c (rows_from_pos_range): Accept additional argument
8976 DISP_STRING, and accept any glyph in a row whose object is that
8977 string as eligible for mouse highlight. Fixes mouse highlight of
8978 display strings from overlays. (Bug#10464)
8979
9a0115ab 89802012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 8981
b9110d6a 8982 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
8983 * fileio.c (auto_saving_dir_umask): New static var.
8984 (Fmake_directory_internal): Use it.
8985 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8986 creating the directory. The old code temporarily assigns
8987 too-generous permissions to the directory.
8988 (do_auto_save_eh): Clear it.
b9110d6a 8989 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
8990 that the var is always cleared.
8991
6c1bd3f3
EZ
89922012-01-07 Eli Zaretskii <eliz@gnu.org>
8993
8994 * search.c (scan_buffer): Pass character positions to
8995 know_region_cache, not byte positions. (Bug#6540)
8996
069d2b50
L
89972012-01-07 LynX <_LynX@bk.ru> (tiny change)
8998
8999 * w32.c (sys_rename): Report EXDEV when rename of a directory
9000 fails because the target is on another logical disk. (Bug#10284)
9001
75bf0d33
DB
90022012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9003
9004 * xterm.c (x_embed_request_focus): New function.
9005
9006 * xterm.h: Add prototype.
9007
9008 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9009
1c6e5a32
GM
90102012-01-05 Glenn Morris <rgm@gnu.org>
9011
9012 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9013
651e947e
EZ
90142012-01-01 Eli Zaretskii <eliz@gnu.org>
9015
9016 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9017 Load gnutls_transport_set_lowat only if GnuTLS version is below
9018 2.11.1.
9019 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9020 GnuTLS versions below 2.11.1.
9021
3778cdd8
AL
90222011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9023
9024 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9025 to the doc string advising against its use for altering the way
9026 windows are scrolled.
9027
0e5317f7
KH
90282011-12-28 Kenichi Handa <handa@m17n.org>
9029
9030 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9031 coding-system ASCII compatible only when it does not produce BOM
9032 on encoding (Bug#10383).
9033
93d5ca1f
JD
90342011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9035
9036 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9037 can scroll.
9038 (create_and_show_popup_menu): Always use menu_position_func for
9039 Gtk3 (Bug#10361).
9040
ca22b785
AS
90412011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9042
9043 * callint.c (Fcall_interactively): Don't truncate prompt string.
9044
d048e1e6
EZ
90452011-12-23 Eli Zaretskii <eliz@gnu.org>
9046
9047 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9048 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 9049 resumed from there (after widening). (Bug#10360)
d048e1e6 9050
5ccaba1f
JD
90512011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9052
9053 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9054
204ee57f
JD
90552011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9056
b81d40f0
JB
9057 * nsterm.m (x_free_frame_resources):
9058 Release f->output_data.ns->miniimage.
204ee57f
JD
9059 (ns_index_color): Fix indentation. Do not retain
9060 color_table->colors[i].
9061
9062 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9063 before returning.
9064
9065 * nsfns.m (x_set_background_color): Assign return value from
9066 ns_index_color to face-background instead of NSColor*.
9067 (ns_implicitly_set_icon_type): Fix indentation.
9068 Change assignment in for loop to comparison.
9069
9070 * emacs.c (ns_pool): New variable.
9071 (main): Assign ns_pool.
9072 (Fkill_emacs): Call ns_release_autorelease_pool.
9073
9074 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9075 autorelease fdesc, release fdAttrs and tdict.
9076 (ns_get_covering_families): Release charset.
9077 (ns_findfonts): Release NSFontDescriptor created with new.
9078 (ns_uni_to_glyphs): Fix indentation.
9079 (setString): Release attrStr before assigning new value.
9080
c803b2b7
JD
90812011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9082
678f4426
JD
9083 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9084 and NS_IMPL_COCOA.
9085 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9086 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9087
cd394be1 90882011-12-18 David Reitter <reitter@cmu.edu>
678f4426 9089
5fecd5fc
JD
9090 * nsterm.m (ns_term_init): Subscribe for notifications
9091 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9092 to method trackingNotification in EmacsMenu.
9093
9094 * nsmenu.m (trackingMenu): New variable.
3771cb17 9095 (trackingNotification): New method (from Aquamacs).
5fecd5fc 9096 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 9097 from Aquamacs (Bug#7030).
678f4426
JD
9098
90992011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 9100
c803b2b7
JD
9101 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9102 (symbol_to_nsstring): Fix indentation.
9103 (ns_symbol_to_pb): New function.
cae07000
SM
9104 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9105 (Fns_rotate_cut_buffers_internal): Remove.
9106 (Fns_store_selection_internal): Rename from
c803b2b7
JD
9107 Fns_store_cut_buffer_internal.
9108 (ns_get_foreign_selection, Fx_own_selection_internal)
9109 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
9110 (Fns_get_selection_internal, Fns_store_selection_internal):
9111 Use ns_symbol_to_pb and check if return value is nil.
9112 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9113 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
9114 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9115 renamed to Sns_store_selection_internal.
9116 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9117 and remove this function.
9118 (ns_handle_selection_clear): Remove, never used.
9119 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9120 here.
9121
e1b01a3a
KB
91222011-12-17 Ken Brown <kbrown@cornell.edu>
9123
9124 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9125 GID is unknown (Bug#10257).
9126
2adb6e85
PE
91272011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9128
9129 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9130 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9131 which caused a build failure on GNU/Linux IA-64. This problem was
9132 introduced by my 2011-10-07 patch.
9133
d1d7b339
JL
91342011-12-15 Juri Linkov <juri@jurta.org>
9135
9136 * image.c (imagemagick_error): New function. (Bug#10112)
9137 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9138 Use `imagemagick_error' where ImageMagick functions return
9139 `MagickFalse'.
9140 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9141 proper order.
9142
100d5755
KH
91432011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9144
9145 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9146 fill background (Bug#8992).
9147
454592a6
MR
91482011-12-13 Martin Rudalics <rudalics@gmx.at>
9149
9150 * window.c (Vwindow_combination_resize)
9151 (Vwindow_combination_limit): Use t instead of non-nil in
9152 doc-strings.
61d4b438
MR
9153 (Vrecenter_redisplay): Add first sentence of doc-string on
9154 separate line.
53524d93 9155 (Frecenter): Fix doc-string typo.
454592a6 9156
3633e3aa
KH
91572011-12-11 Kenichi Handa <handa@m17n.org>
9158
9159 * coding.c (Funencodable_char_position): Pay attention to the
9160 buffer text relocation (Bug#9389).
9161
7b9d523a 91622011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 9163
7b9d523a
JD
9164 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9165 gtk_init (Bug#10100).
9166
b73189c6
EZ
91672011-12-10 Eli Zaretskii <eliz@gnu.org>
9168
9169 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9170 IT->string is nil. (Bug#10263)
9171
f7dfe5d6
JD
91722011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9173
83faebb4
JD
9174 * nsterm.h (x_free_frame_resources): Declare.
9175
f7dfe5d6
JD
9176 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9177 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9178
9179 * nsterm.h (ns_get_defaults_value): Declare.
9180
9181 * nsterm.m (ns_default): Call ns_get_defaults_value.
9182
7cd4e72c
EZ
91832011-12-09 Eli Zaretskii <eliz@gnu.org>
9184
9185 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9186 (Bug#10170)
9187
b34d7317
YM
91882011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9189
9190 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9191 that where the value of an _OBJC_* symbol points to is in the .bss
9192 section (Bug#10240).
9193
76470ad1
KH
91942011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9195
9196 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 9197 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 9198
745fff94
KH
91992011-12-08 Kenichi Handa <handa@m17n.org>
9200
9201 * ftfont.c (get_adstyle_property): Fix previous change
9202 (Bug#10233).
9203
6e44397c
JB
92042011-12-07 Juanma Barranquero <lekktu@gmail.com>
9205
9206 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9207 dirs from the default value of EMACSLOADPATH (bug#10208).
9208
7efa6272
GM
92092011-12-07 Glenn Morris <rgm@gnu.org>
9210
9211 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9212 installation and source directories as well. (Bug#10208)
9213
f6fc4d87
CY
92142011-12-06 Chong Yidong <cyd@gnu.org>
9215
9216 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9217
2bf26180
GM
92182011-12-06 Glenn Morris <rgm@gnu.org>
9219
9220 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9221 as an error, not just -1. (Bug#10217)
9222
3a6ad4f0
CY
92232011-12-05 Chong Yidong <cyd@gnu.org>
9224
9225 * keyboard.c (process_special_events): New function.
9226 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9227
75a3b399
PE
92282011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9229
9230 * coding.c (encode_designation_at_bol): Don't use uninitialized
9231 local variable (Bug#9318).
9232
c3c9e25e
KH
92332011-12-05 Kenichi Handa <handa@m17n.org>
9234
9235 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9236 return Qnil (Bug#8046, Bug#10193).
9237
5eb05ea3
KH
92382011-12-05 Kenichi Handa <handa@m17n.org>
9239
9240 * coding.c (encode_designation_at_bol): New args charbuf_end and
9241 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
9242 (coding_set_source): Return how many bytes coding->source was
9243 relocated.
9244 (coding_set_destination): Return how many bytes
9245 coding->destination was relocated.
9246 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 9247 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
9248
92492011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9250
9251 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9252 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9253 macro (Bug#9318).
9254
92552011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9256
9257 The following changes are to fix Bug#9318.
9258
a79703f5 9259 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
9260 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9261 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 9262 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 9263
7dbda6df
JB
92642011-12-05 Juanma Barranquero <lekktu@gmail.com>
9265
9266 * lisp.h (process_quit_flag): Fix external declaration.
9267
6d5eb5b0
SM
92682011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9269
9270 Don't macro-inline non-performance-critical code.
9271 * eval.c (process_quit_flag): New function.
9272 * lisp.h (QUIT): Use it.
9273
a0c3fad0
JD
92742011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9275
9276 * nsfns.m (get_geometry_from_preferences): New function.
9277 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9278
6c07aac2
AS
92792011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9280
9281 * emacs.c (Qkill_emacs): Define.
9282 (syms_of_emacs): Initialize it.
9283 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9284 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
9285 (quit_throw_to_read_char): Add parameter `from_signal'.
9286 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
9287 * lisp.h (QUIT): Call Fkill_emacs if requested.
9288
c052ead4
JD
92892011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9290
9291 * widget.c (update_wm_hints): Return if wmshell is null.
9292 (widget_update_wm_size_hints): New function.
9293
9294 * widget.h (widget_update_wm_size_hints): Declare.
9295
9296 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9297 widget_update_wm_size_hints (Bug#10104).
9298
9e49252b
EZ
92992011-12-03 Eli Zaretskii <eliz@gnu.org>
9300
9301 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9302 before a newline, prepare the bidi iterator for consuming the
9303 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 9304 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 9305
02b16839
JL
93062011-12-02 Juri Linkov <juri@jurta.org>
9307
9308 * search.c (Fword_search_regexp): New Lisp function created from
9309 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9310 (Fword_search_backward, Fword_search_forward)
9311 (Fword_search_backward_lax, Fword_search_forward_lax):
9312 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9313 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9314
0068070e
SM
93152011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9316
9317 * fileio.c (Finsert_file_contents): Move after-change-function call
9318 to before the "handled:" label, since all "goto handled" appear in
9319 cases where the *-change-functions have already been properly called
9320 (bug#10117).
9321
3360a3fc
AS
93222011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9323
9324 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9325 waiting for input. (Bug#10169)
9326
73d6c093
EZ
93272011-11-30 Eli Zaretskii <eliz@gnu.org>
9328
9329 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9330 verifies glyph row's hash code--we have just reallocated the
9331 glyphs, so their contents can be complete garbage. (Bug#10164)
9332
febe6bea
JB
93332011-11-30 Juanma Barranquero <lekktu@gmail.com>
9334
9335 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9336
801a4313
EZ
93372011-11-30 Eli Zaretskii <eliz@gnu.org>
9338
9339 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9340 attributes are tested _before_ calling verify_row_hash, to protect
9341 against GCC re-ordering of the tests. (Bug#10164)
9342
2b56b87e
JD
93432011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9344
9345 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9346
9347 * xterm.c (handle_one_xevent): Only set async_visible and friends
9348 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 9349 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
9350 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9351
dbf31225
PE
93522011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9353
9354 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9355 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9356 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9357 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9358 All uses changed to use GCPRO1 etc.
9359 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9360 Revert to old implementation (i.e., before 2011-03-11).
9361
1305621b
YM
93622011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9363
9364 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9365 of scroll runs so as to avoid assigning disabled bogus rows and
9366 unnecessary graphics copy operations.
9367
8c9afb46
EZ
93682011-11-27 Eli Zaretskii <eliz@gnu.org>
9369
9370 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9371 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9372 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9373 (malloc, free, realloc, calloc): Redirect to e_* only when
9374 compiling Emacs.
9375
9376 * lisp.h (GCTYPEBITS): Move before first use.
9377 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9378 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9379 this macro definition.
9380
9381 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9382 _MSC_VER.
9383
54e9e3bf
JD
93842011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9385
6d5eb5b0
SM
9386 * gtkutil.c (xg_create_frame_widgets):
9387 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
9388 present with Gtk+ 2.0.
9389
83aca1cb
PE
93902011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9391
9392 * fileio.c (Finsert_file_contents): Undo previous change; see
9393 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9394
5b76caa4
PE
93952011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9396
9397 Rename locals to avoid shadowing.
9398 * fileio.c (Finsert_file_contents):
9399 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9400 * process.c (wait_reading_process_output):
9401 Rename inner 'proc' to 'p' to avoid shadowing.
9402 Indent for consistency with usual Emacs style.
9403
8c535114
EZ
94042011-11-25 Eli Zaretskii <eliz@gnu.org>
9405
9406 * xdisp.c (redisplay_window): If cursor row is not fully visible
9407 after recentering, and scroll-conservatively is set to a large
9408 number, scroll window by a few more lines to make the cursor fully
9409 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
9410 (start_display): Don't move to the next line if the display should
9411 start at a newline that is part of a display vector or an overlay
9412 string. (Bug#10119)
8c535114 9413
fa4fdb5c
JL
94142011-11-24 Juri Linkov <juri@jurta.org>
9415
9416 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9417 after the `MagickPingImage' call. (Bug#10112)
9418
90ec88df
CY
94192011-11-23 Chong Yidong <cyd@gnu.org>
9420
9421 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9422
56e2e794
MR
94232011-11-23 Martin Rudalics <rudalics@gmx.at>
9424
9425 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9426 making another buffer current. (Bug#10114)
9427
b6e64c41
GM
94282011-11-23 Glenn Morris <rgm@gnu.org>
9429
9430 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9431
6b21de18
CY
94322011-11-23 Chong Yidong <cyd@gnu.org>
9433
9434 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9435 using it (Bug#5984).
9436
b12cd789
EZ
94372011-11-22 Eli Zaretskii <eliz@gnu.org>
9438
9439 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9440 and header-lines, as they don't have one computed for them.
9441 (Bug#10098)
9442
9443 * .gdbinit (prow): Make displayed values more self-explaining.
9444 Add row's hash code.
9445
261b6fd4
LMI
94462011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9447
9448 * process.c (wait_reading_process_output): Fix asynchrounous
9449 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 9450 (wait_reading_process_output): Add comment and URL.
261b6fd4 9451
e7cfd277
JD
94522011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9453
9454 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9455
a9b9b7f5
CY
94562011-11-21 Chong Yidong <cyd@gnu.org>
9457
9458 * window.c (Fnext_window, Fprevious_window): Doc fix.
9459
b0d15b4f
SM
94602011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9461
9462 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9463
fe7a3057
JB
94642011-11-20 Juanma Barranquero <lekktu@gmail.com>
9465
9466 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9467
d2999b1a
MR
94682011-11-20 Martin Rudalics <rudalics@gmx.at>
9469
9470 * window.c (Fset_window_combination_limit): Rename argument
9471 STATUS to LIMIT.
9472 (Vwindow_combination_limit): Remove "status" from doc-string.
9473
d5ff9cd0
AS
94742011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9475
9476 * m/ibms390.h: Remove.
9477 * m/ibms390x.h: Don't include "ibms390.h".
9478
a5bb9bd3
SM
94792011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9480
9481 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9482 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9483
cd1181db
JB
94842011-11-20 Juanma Barranquero <lekktu@gmail.com>
9485
9486 * casetab.c (Fset_case_table):
9487 * charset.c (Fcharset_after): Fix typos.
9488
615a3b8d 94892011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 9490
17e845af
PE
9491 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9492 Otherwise, valgrind does not work on some platforms.
9493 Problem reported by Andreas Schwab in
6a0bf43d
PE
9494 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9495 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9496 is set, removing the need for VIRT_ADDRESS_VARIES.
9497 (PURE_P): Use a more-efficient implementation that needs just one
9498 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9499 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9500 to 4 (xorl, subq, cmpq, setbe).
9501 * alloc.c (pure): Always extern now, since that's the
9502 VIRT_ADDR_VARIES behavior.
9503 (PURE_POINTER_P): Use a single comparison, not two, for
9504 consistency with the new puresize.h.
9505 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9506 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9507 Remove VIRT_ADDR_VARIES no longer needed.
9508
f8fe6f96
EZ
95092011-11-19 Eli Zaretskii <eliz@gnu.org>
9510
9511 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9512 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9513 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9514 behave as if the cursor position were at the window margin.
9515
9516 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9517 and the cursor position is out of bounds, behave as if the cursor
9518 position were at the window margin. (Bug#10075)
9519
df05a53c
CY
95202011-11-18 Chong Yidong <cyd@gnu.org>
9521
9522 * window.c (Fwindow_combination_limit): Make first argument
9523 non-optional, since it is meaningless for live windows like the
9524 selected window.
61ccba97 9525
2071918e
DA
95262011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9527
9528 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9529
b50a28de
SM
95302011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9531
9532 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9533 (graft_intervals_into_buffer): Simplify.
9534
015137db
EZ
95352011-11-18 Eli Zaretskii <eliz@gnu.org>
9536
9537 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9538 hash values of the two rows.
9539 (copy_row_except_pointers): Preserve the used[] arrays and the
9540 hash values of the two rows. (Bug#10035)
68c95424 9541 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
9542
9543 * xdisp.c (row_hash): New function, body extracted from
9544 compute_line_metrics.
9545 (compute_line_metrics): Call row_hash, instead of computing the
9546 hash code inline.
9547
9548 * dispnew.c (verify_row_hash): Call row_hash for computing the
9549 hash code of a row, instead of duplicating code from xdisp.c.
9550
9551 * dispextern.h (row_hash): Add prototype.
9552
a2addb04
TH
95532011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9554
9555 * frame.c (delete_frame): Don't delete the terminal when the last
9556 X frame is closed if emacs is built with GTK toolkit.
9557
df85d315
JB
95582011-11-17 Juanma Barranquero <lekktu@gmail.com>
9559
9560 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9561
a0c2d0ae
MR
95622011-11-17 Martin Rudalics <rudalics@gmx.at>
9563
9564 * window.c (Vwindow_splits): Rename to
9565 Vwindow_combination_resize. Suggested by Juri Linkov.
9566 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9567 of Vwindow_splits.
9568
58179cce
JB
95692011-11-16 Juanma Barranquero <lekktu@gmail.com>
9570
7877f373
JB
9571 * nsfns.m (Fns_font_name):
9572 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 9573
b6f67890
MR
95742011-11-16 Martin Rudalics <rudalics@gmx.at>
9575
9576 * window.h (window): Rename slot "nest" to "combination_limit".
9577 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9578 (Fset_window_nest): Rename to Fset_window_combination_limit.
9579 (Vwindow_nest): Rename to Vwindow_combination_limit.
9580 (recombine_windows, make_parent_window, make_window)
9581 (Fsplit_window_internal, saved_window)
9582 (Fset_window_configuration, save_window_save): Rename all
9583 occurrences of window_nest to window_combination_limit.
9584
c7015153
JB
95852011-11-15 Juanma Barranquero <lekktu@gmail.com>
9586
9587 * image.c (imagemagick_load_image): Fix typo.
9588
322ad6ec
EZ
95892011-11-14 Eli Zaretskii <eliz@gnu.org>
9590
9591 * xdisp.c (display_line): Move the call to
9592 highlight_trailing_whitespace before the call to
9593 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
9594 faces of all the glyphs to compute ROW's hash value.
9595 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 9596
f067b8ec
JB
95972011-11-14 Juanma Barranquero <lekktu@gmail.com>
9598
9599 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9600 just return (bug#10044).
9601
1e5b2111
EZ
96022011-11-12 Eli Zaretskii <eliz@gnu.org>
9603
7ef3cbd5
EZ
9604 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9605 with user-defined heap size. Bump the default size of the temacs
9606 heap to 27MB, to avoid memory warning when running temacs.
9607 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9608
1e5b2111
EZ
9609 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9610 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
9611 (verify_row_hash) [XASSERTS]: New function.
9612 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9613 that the hash value of glyph rows is correct.
1e5b2111 9614
89d61221
MR
96152011-11-12 Martin Rudalics <rudalics@gmx.at>
9616
9617 * window.h (window): Remove splits slot.
9618 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9619 (Fdelete_other_windows_internal, make_parent_window)
9620 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9621 (Fset_window_configuration, save_window_save): Don't deal with
9622 split status of windows.
9623 (saved_window): Remove splits slot.
9624 (Vwindow_splits): Rewrite doc-string.
9625
97f18cc8
JD
96262011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9627
9628 * xfns.c (unwind_create_frame):
9629 * nsfns.m (unwind_create_frame):
9630 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9631 Vframe_list (Bug#9999).
9632
22a648b4
DA
96332011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9634
0b381c7e 9635 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 9636
659afede
KH
96372011-11-11 Kenichi Handa <handa@m17n.org>
9638
9639 * callproc.c (Fcall_process): Set the member dst_multibyte of
9640 process_coding.
9641
9ac0394b
KH
96422011-11-11 Johan Bockgård <bojohan@gnu.org>
9643
9644 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9645 avoid a crash (bug#9496).
9646
2fbdc249
CY
96472011-11-09 Chong Yidong <cyd@gnu.org>
9648
9649 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9650 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9651
ac6b1f81
PE
96522011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9653
9654 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9655
09db192c
PE
96562011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9657
9658 Avoid some portability problems by eschewing 'extern inline' functions.
9659 The trivial performance wins aren't worth the portability hassles; see
9660 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9661 et seq.
9662 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9663 (window_box_width, window_box_left, window_box_left_offset)
9664 (window_box_right, window_box_right_offset): Undo previous change,
9665 by removing the "extern"s.
9666 * intervals.c (adjust_intervals_for_insertion)
9667 (adjust_intervals_for_deletion): Undo previous change,
9668 making these static again.
9669 (offset_intervals, temp_set_point_both, temp_set_point)
9670 (copy_intervals_to_string): No longer inline.
9671 * xdisp.c (window_text_bottom_y, window_box_width)
9672 (window_box_height, window_box_left_offset)
9673 (window_box_right_offset, window_box_left, window_box_right)
9674 (window_box): No longer inline.
9675
105216ed
CY
96762011-11-08 Chong Yidong <cyd@gnu.org>
9677
9678 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
9679 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9680 Signal an error if not a live window.
105216ed
CY
9681 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9682 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9683
ae9e237f
JB
96842011-11-07 Juanma Barranquero <lekktu@gmail.com>
9685
9686 * lisp.h (syms_of_abbrev): Remove declaration.
9687 Reported by CHENG Gao <chenggao@royau.me>.
9688
c7aa8333
EZ
96892011-11-07 Eli Zaretskii <eliz@gnu.org>
9690
9691 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9692 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9693 of temacs in GUI mode.
9694
be7f5545
MR
96952011-11-07 Martin Rudalics <rudalics@gmx.at>
9696
9697 * window.h: Declare delete_all_child_windows instead of
9698 delete_all_subwindows.
9699 * window.c (Fwindow_nest, Fset_window_nest)
9700 (Fset_window_new_total, Fset_window_new_normal)
9701 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9702 (delete_all_subwindows): Rename to delete_all_child_windows.
9703 (Fdelete_other_windows_internal, Fset_window_configuration):
9704 Call delete_all_child_windows instead of delete_all_subwindows.
9705 * frame.c (delete_frame): Call delete_all_child_windows instead
9706 of delete_all_subwindows.
9707
ca78dc43
PE
97082011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9709
9710 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9711 This is also needed for porting to any host where GC_MARK_STACK is
9712 not GC_MAKE_GCPROS_NOOPS.
9713 (which_symbols): Use it.
9714
a0241d01
KH
97152011-11-07 Kenichi Handa <handa@m17n.org>
9716
9717 * coding.c (coding_set_destination): Check coding->src_pos only
9718 when coding->src_object is a buffer (bug#9910).
9719
9720 * process.c (send_process): Set the member src_multibyte of coding
9721 to 0 (bug#9911) when sending a unibyte text.
9722
9723 * callproc.c (Fcall_process): Set the member src_multibyte of
9724 process_coding to 0 (bug#9912).
9725
a64bfdfa 97262011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
9727
9728 * xmenu.c (cleanup_widget_value_tree): New function.
9729 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9730 calling free_menubar_widget_value_tree directly (Bug#9830).
9731
cb41b32a
PE
97322011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9733
9734 Fix some portability problems with 'inline'.
9735 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9736 (window_box_width, window_box_left, window_box_left_offset)
9737 (window_box_right, window_box_right_offset): Declare extern.
9738 Otherwise, these inline functions do not conform to C99 and
9739 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9740 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9741 * intervals.c (adjust_intervals_for_insertion)
9742 (adjust_intervals_for_deletion): Now extern, because otherwise the
9743 extern inline functions 'offset_intervals' couldn't refer to it.
9744 (static_offset_intervals): Remove.
9745 (offset_intervals): Rewrite using the old contents of
9746 static_offset_intervals. The old version didn't conform to C99
9747 because an extern inline function contained a reference to an
9748 identifier with static linkage.
9749
b7041366
AS
97502011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9751
9752 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9753 GC.
9754
88a37c4d
EZ
97552011-11-06 Eli Zaretskii <eliz@gnu.org>
9756
9757 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9758 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9759 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9760 return Qleft_to_right.
9761
49745b39
CY
97622011-11-06 Chong Yidong <cyd@gnu.org>
9763
9764 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9765 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9766 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9767 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9768 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9769 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9770 (Fwindow_vscroll): Doc fix.
9771 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9772 argument, since it makes no sense to pass a live window and for
9773 consistency with window-child.
9774
1f05cd82
CS
97752011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9776
9777 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9778 support MSVC.
9779
22610910
JR
97802011-11-05 Jason Rumney <jasonr@gnu.org>
9781
9782 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9783 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9784 fonts (Bug#6029).
9785 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9786 bitwise arithmetic preventing use of unicode-sip and non-truetype
9787 opentype fonts.
9788
a06776b2
EZ
97892011-11-05 Eli Zaretskii <eliz@gnu.org>
9790
3ad924ba
EZ
9791 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9792 "emacs"-only part.
9793
a06776b2
EZ
9794 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9795 initialization code to keep similarity to xfns.c after changes
9796 from 2011-11-05.
9797
c9e7db78
JD
97982011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9799
a97f8f3f
JD
9800 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9801 (unwind_create_frame): New function (Bug#9943).
9802 (Fx_create_frame): Restructure code to be more similar to the one in
9803 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9804 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9805 Move terminal->reference_count++ just before making the frame official
9806 (Bug#9943).
9807
9808 * nsterm.m (x_free_frame_resources): New function.
9809 (x_destroy_window): Move code to x_free_frame_resources.
9810
c9e7db78 9811 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
9812 (Fx_create_frame, x_create_tip_frame):
9813 Move terminal->reference_count++ just before making the frame
75f1671a 9814 official. Move initialization of image_cache_refcount and
c9e7db78
JD
9815 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9816
a6fc3b5c
EZ
98172011-11-05 Eli Zaretskii <eliz@gnu.org>
9818
9819 Support MSVC build with newer versions of Visual Studio.
9820 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9821 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9822 nt/gmake.defs.
9823
9824 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9825 which are not supported by MSVC.
9826 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9827 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9828 bitfields.
9829 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9830 types in bitfields.
9831 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9832
9833 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9834
58179cce 98352011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
9836
9837 Support MSVC build with newer versions of Visual Studio.
9838 * w32.c: Don't include w32api.h for MSVC.
9839 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9840
9841 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9842 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9843 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9844 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9845 e_* cousins.
9846 (alloca) [_MSC_VER]: Define to _alloca.
9847
9848 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9849
9850 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9851
a58c13ed
EZ
98522011-11-04 Eli Zaretskii <eliz@gnu.org>
9853
9854 * xdisp.c (note_mouse_highlight): If either of
9855 previous/next-single-property-change returns nil, treat that as
9856 the beginning or the end of the buffer. (Bug#9955)
9857
fe0b6370
JD
98582011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9859
a58c13ed 9860 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
9861 label is not null (Bug#9951).
9862 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9863 may be NULL.
9864
89bd5ee1
EZ
98652011-11-04 Eli Zaretskii <eliz@gnu.org>
9866
9867 * window.c (Fwindow_body_size): Mention in the doc string that the
9868 return value is in frame's canonical units. (Bug#9949)
9869
84c3edb9
EZ
98702011-11-03 Eli Zaretskii <eliz@gnu.org>
9871
4e2fb5c7
EZ
9872 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9873
84c3edb9 9874 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 9875 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 9876 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 9877
bc17a887
EZ
98782011-11-01 Eli Zaretskii <eliz@gnu.org>
9879
9880 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9881 Don't stop backward scan on the continuation glyph, even though
9882 its CHARPOS is positive.
6d5eb5b0
SM
9883 (mouse_face_from_buffer_pos, note_mouse_highlight):
9884 Rename cover_string to disp_string.
bc17a887 9885
4ee88440
MR
98862011-11-01 Martin Rudalics <rudalics@gmx.at>
9887
9888 * window.c (temp_output_buffer_show): Don't use
9889 Vtemp_buffer_show_specifiers.
9890 (Vtemp_buffer_show_specifiers): Remove unused variable.
9891
c2ff3c02
EZ
98922011-10-30 Eli Zaretskii <eliz@gnu.org>
9893
9894 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9895 past the beginning of the current glyph matrix.
9896
58179cce 98972011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
9898
9899 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9900 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9901 HAVE_GTK3 (Bug#9869).
b77a6a7f 9902
3b574623
JD
9903 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9904 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9905
b77a6a7f
JD
9906 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9907
9908 * xterm.c: Declare x_handle_net_wm_state to return int.
9909 (handle_one_xevent): Check if we are iconified but don't have
9910 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9911 (get_current_wm_state): Return non-zero if not hidden,
9912 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9913 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9914 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9915 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9916
196e41e4
PE
99172011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9918
9919 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9920 so that this new function doesn't get optimized away by a
9921 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9922
021f2e1a
AS
99232011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9924
9925 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9926
8b058d44
EZ
99272011-10-29 Eli Zaretskii <eliz@gnu.org>
9928
9929 Fix the `xbytecode' command.
9930 * .gdbinit (xprintbytestr): New command.
b50a28de 9931 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
9932 (xbytecode): Print the byte-code string as well.
9933
4452fb80
EZ
99342011-10-29 Kim Storm <storm@cua.dk>
9935
8b058d44
EZ
9936 * alloc.c (which_symbols): New function.
9937
21b72067
AS
99382011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9939
9940 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9941 line. (Bug#9903)
9942
83ed7b5c
GM
99432011-10-29 Glenn Morris <rgm@gnu.org>
9944
9945 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9946 Not clear what it was for, and it causes various bugs. (Bug#9839)
9947
5a7a728b
EZ
99482011-10-28 Eli Zaretskii <eliz@gnu.org>
9949
9950 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9951 possible random value that matches one of those tested as
9952 condition to clear the mouse face.
9953
d3d0842f
CY
99542011-10-28 Chong Yidong <cyd@gnu.org>
9955
9956 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9957
31b39d13
DN
99582011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9959
9960 * window.c (make_window): Initialize phys_cursor_on_p.
9961
9aba6043
SM
99622011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9963
9964 * lisp.h (struct Lisp_Symbol): Update comments.
9965
c20992f4
JB
99662011-10-28 Juanma Barranquero <lekktu@gmail.com>
9967
9968 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9969
db4f02f2
EZ
99702011-10-28 Eli Zaretskii <eliz@gnu.org>
9971
9972 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9973 <oslsachem@gmail.com> for helping to debug this.
9974
9975 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9976 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9977 (g_b_init_get_glyph_outline_w): New static variables.
9978 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9979 (GetGlyphOutlineW_Proc): New typedefs.
9980 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
9981 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9982 New functions.
9983 (w32font_open_internal, compute_metrics):
9984 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
9985 instead of calling the "wide" APIs directly.
9986
9987 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9988
9989 * w32.h (syms_of_w32font): Add prototype.
9990
87e68db4
JB
99912011-10-27 Juanma Barranquero <lekktu@gmail.com>
9992
9993 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9994 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9995 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9996 (Fmove_to_window_line): Doc fix.
9997
435c1d67
CY
99982011-10-27 Chong Yidong <cyd@gnu.org>
9999
10000 * process.c (make_process): Set gnutls_state to NULL.
10001
10002 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10003 non-NULL, regardless of GNUTLS_INITSTAGE.
10004 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10005 an error. Set process slots as soon as we allocate them.
10006
10007 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10008
9c6c6f49
CY
100092011-10-27 Chong Yidong <cyd@gnu.org>
10010
9aba6043
SM
10011 * gnutls.c (emacs_gnutls_deinit): New function.
10012 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
10013 (Fgnutls_deinit, Fgnutls_boot): Use it.
10014
10015 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10016 (deactivate_process): Call emacs_gnutls_deinit.
10017
657d08d3
JB
100182011-10-27 Juanma Barranquero <lekktu@gmail.com>
10019
10020 * image.c (x_create_x_image_and_pixmap):
10021 * w32.c (sys_rename, w32_delayed_load):
10022 * w32font.c (fill_in_logfont):
10023 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10024
5430d399
JB
100252011-10-26 Juanma Barranquero <lekktu@gmail.com>
10026
10027 * w32fns.c (w32_default_color_map): New function,
10028 extracted from Fw32_default_color_map.
a7ef684b 10029 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 10030
fe0055fa
PE
100312011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10032
10033 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10034
e6346438
SM
100352011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10036
10037 * keyboard.c (test_undefined): New function (bug#9751).
10038 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10039
e112cc37
ET
100402011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10041
10042 * sysdep.c (init_sys_modes): Fix the check for the controlling
10043 terminal (Bug#6649).
10044
7b5d6677
EZ
100452011-10-20 Eli Zaretskii <eliz@gnu.org>
10046
10047 * dispextern.h (struct bidi_it): New member next_en_type.
10048
10049 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10050 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10051 current character, check also for next_en_type being WEAK_EN.
10052 (bidi_resolve_weak): Don't enter the expensive loop if the current
10053 position is before next_en_pos. Record the bidi type of the first
10054 non-ET, non-BN character we find, in addition to its position.
10055 (bidi_level_of_next_char): Invalidate next_en_type when
10056 next_en_pos is over-stepped.
10057
7da0b018
PE
100582011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10059
10060 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10061 * editfns.c: Rewrite current-time-zone so that it invokes
10062 the equivalent of (format-time-string "%Z") to get the time zone name.
10063 This fixes a bug when the time zone name contains characters that
10064 need converting from the system time locale to Emacs internal format.
10065 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10066 that patch fixed format-time-string to do the conversion, but
10067 I forgot to fix current-time-zone.
10068 (format_time_string): New function, containing most of
10069 what Fformat_time_string used to contain.
10070 (Fformat_time_string): Rewrite in terms of format_time_string.
10071 This doesn't change this function's behavior.
10072 (current-time-zone): Rewrite to use format_time_string.
10073 This fixes the bug reported by Michael Schierl in
10074 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10075 Jason Rumney's 2007-06-07 change worked around this bug, but
10076 didn't fix it.
10077 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10078
8547b010
EZ
100792011-10-19 Eli Zaretskii <eliz@gnu.org>
10080
10081 * xdisp.c (start_display): If the character at POS is displayed
10082 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
10083 (try_window_reusing_current_matrix): If a line ends in a display
10084 vector or the next line starts in a display vector, continue
10085 redrawing the window even though the character position of
10086 start_row was reached.
8547b010
EZ
10087 (Bug#9771, part 2)
10088
4e948d15
CY
100892011-10-18 Chong Yidong <cyd@gnu.org>
10090
10091 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10092 with nobreak-char-display too.
10093
4787455f
EZ
100942011-10-18 Eli Zaretskii <eliz@gnu.org>
10095
10096 Fix part 3 of bug#9771.
10097 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10098 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10099 non-neutral characters if the current character is a paragraph
10100 separator (a.k.a. Newline). This avoids running the same
10101 expensive loop twice, once when we consume the preceding newline
10102 and the other time when the line actually needs to be displayed.
10103 Avoid the loop when we see neutrals on the base embedding level
10104 following a character whose directionality is the same as the
10105 paragraph's. This avoids running the expensive loop when a line
10106 ends in a long sequence of neutrals, like control characters.
10107 Add assertion against STRONG_AL type. Slightly rearrange code
10108 that determines the type of a neutral given the first non-neutral
10109 that follows it.
10110 (bidi_level_of_next_char): Set next_en_pos to zero when
10111 invalidating its info.
10112
2c91f553
EZ
101132011-10-17 Eli Zaretskii <eliz@gnu.org>
10114
10115 * xdisp.c (push_display_prop): Determine whether to record string
10116 or buffer position by IT->string, not by IT->method. Allow
10117 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
10118 (move_it_vertically_backward): Don't look for character position
10119 immediately after the newline when in a continuation line.
10120 (Bug#9771, part 1)
2c91f553 10121
c7b08b0d
MR
101222011-10-15 Martin Rudalics <rudalics@gmx.at>
10123
10124 * window.c (coordinates_in_window): Rewrite and delabelize
10125 vertical border check. (Bug#5357) (Bug#9618)
10126
6b02f655
SM
101272011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10128
10129 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10130 errors in XSetWindowBorder (bug#9310).
10131
81d40c92
DA
101322011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10133
10134 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10135 avoid crash when xmalloc overrun checking is enabled.
10136
d4172c3b
EZ
101372011-10-13 Eli Zaretskii <eliz@gnu.org>
10138
10139 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10140 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10141 cursor motion with <left> and <right> arrow keys.
10142
10143 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10144 some callers set that themselves.
10145
b00eea75
EZ
101462011-10-12 Eli Zaretskii <eliz@gnu.org>
10147
10148 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10149 display string and the previous row comes from the same string and
10150 is empty. (Bug#9739) (Bug#9738)
10151
8fe012c4
SM
101522011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10153
10154 * doc.c (get_doc_string): Encode file name (bug#9735).
10155
0074aef2
EZ
101562011-10-12 Eli Zaretskii <eliz@gnu.org>
10157
79beb178
EZ
10158 * bidi.c (bidi_level_of_next_char):
10159 * xdisp.c (get_visually_first_element): Remove old incorrect
10160 comments regarding the Unicode Line Separator character.
10161
0074aef2
EZ
10162 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10163
6e4b3fbe
DA
101642011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10165
10166 * alloc.c (Fgc_status): Do not access beyond zombies array
10167 boundary if nzombies > MAX_ZOMBIES.
10168 * alloc.c (dump_zombies): Add missing format specifier.
10169
0324f3af
PE
101702011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10171
b5525cac
PE
10172 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10173 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10174
0324f3af
PE
10175 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10176 Some packages use them to denote characters with modifiers.
10177
e9b5f888
AS
101782011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10179
10180 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10181 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10182 matching a pp-number. Rename parameter var to var1.
10183
127827c0
SM
101842011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10185
10186 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10187
c8fd3bd0
GM
101882011-10-08 Glenn Morris <rgm@gnu.org>
10189
10190 * callint.c (Fcall_interactively): Give a more explicit error for the
10191 'c' case with a non-character input. (Bug#8479)
10192
352ec8ff
EZ
101932011-10-08 Eli Zaretskii <eliz@gnu.org>
10194
03669ccb
EZ
10195 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10196 lines.
7061c986
EZ
10197 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10198 lines that are hscrolled on the left.
03669ccb 10199
352ec8ff
EZ
10200 * dispnew.c (buffer_posn_from_coords): Account for a possible
10201 presence of header-line. (Bug#4426)
10202
a66cfb1c
SM
102032011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10204
6b02f655
SM
10205 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10206 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 10207
7c5ee88e
PE
102082011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10209
10210 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10211 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10212 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10213 this makes Emacs dump core during garbage collection on rare
10214 occasions. sizeof is obviously inferior to offsetof here, so
10215 stick with offsetof.
10216 (GC_POINTER_ALIGNMENT): New macro.
10217 (mark_memory): Omit 3rd (offset) arg; caller changed.
10218 Don't assume EMACS_INT alignment is the same as pointer alignment.
10219
df1bbe5b
SM
102202011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10221
10222 * keyboard.c (read_key_sequence_remapped): New var.
10223 (read_key_sequence): Compute remapping in the right buffer.
10224 (command_loop_1): Use read_key_sequence's remapping directly.
10225
51553db6
SM
102262011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10227
32c1fffd
SM
10228 * dired.c (file_name_completion): Don't expand file name.
10229 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10230 before checking file name handler.
10231
51553db6
SM
10232 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10233 they've been requested explicitly (bug#9591).
10234
b6bd1599 102352011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
10236
10237 * keymap.c (Fsingle_key_description): Use make_specified_string
10238 instead of build_string to build string from push_key_description.
10239 (Bug#5193)
10240
f701dc2a
PE
102412011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10242
4222c55d
PE
10243 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10244 This fixes a Y2038 bug on 64-bit hosts.
10245 * buffer.c (reset_buffer):
10246 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10247 (Fclear_buffer_auto_save_failure):
10248 Use 0, not -1, to represent an unset failure time, since time_t
10249 might not be signed.
10250
f701dc2a
PE
10251 Remove dependency on glibc malloc internals.
10252 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10253 Move back here from lisp.h, but with their new implementations.
10254 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10255 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10256 * charset.c (charset_table_init): New static var.
10257 (syms_of_charset): Use it instead of xmalloc. This removes a
10258 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10259 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10260 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10261 Move back to alloc.c.
10262 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10263 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10264
9ceebf39
JD
102652011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10266
10267 * nsterm.m (windowDidResize): Call x_set_window_size only when
10268 ns_in_resize is true. Otherwise set pixelwidth/height and
10269 call change_frame_size (Bug#9628).
10270
cb993c58
PE
102712011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10272
3930c88b
PE
10273 Port --enable-checking=all to Fedora 14 x86-64.
10274 * charset.c (syms_of_charset): Also account for glibc malloc's
10275 internal overhead when calculating the initial malloc maximum.
10276
cb993c58
PE
10277 Port --enable-checking=all to Fedora 14 x86.
10278 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10279 Move to lisp.h.
10280 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10281 (overrun_check_realloc, overrun_check_free):
10282 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10283 That way, xmalloc returns a properly-aligned pointer even if
10284 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10285 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10286 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10287 into account when calculating the initial malloc maximum.
10288 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10289 Move here from alloc.c, so that charset.c can use it too.
10290 Properly align; the old code wasn't right for common 32-bit hosts
10291 when configured with --enable-checking=all.
10292 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10293 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10294
31bed486
EZ
102952011-09-29 Eli Zaretskii <eliz@gnu.org>
10296
04c70788 10297 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
10298 use EDOM.
10299
fbcaa2f3
EZ
103002011-09-28 Eli Zaretskii <eliz@gnu.org>
10301
10302 * xdisp.c (compute_display_string_end): If there's no display
10303 string at CHARPOS, return -1.
10304
10305 * bidi.c (bidi_fetch_char): When compute_display_string_end
10306 returns a negative value, treat the character as a normal
10307 character not covered by a display string. (Bug#9624)
10308
a239d4e9
JB
103092011-09-28 Juanma Barranquero <lekktu@gmail.com>
10310
10311 * lread.c (Fread_from_string): Fix typo in docstring.
10312
88652fd5
EZ
103132011-09-27 Eli Zaretskii <eliz@gnu.org>
10314
10315 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10316 newline, reseat the iterator instead of bidi-iterating there one
10317 character at a time. (Bug#9610)
32c1fffd
SM
10318 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10319 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 10320
ed497dd4
AS
103212011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10322
10323 * lread.c (readevalloop): Use correct code for NBSP.
10324 (read1): Likewise. (Bug#9608)
10325
b2bf61aa
MA
103262011-09-25 Michael Albinus <michael.albinus@gmx.de>
10327
10328 * dbusbind.c (Fdbus_register_signal): When service is not
10329 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10330
32bbb17c
GM
103312011-09-25 Glenn Morris <rgm@gnu.org>
10332
10333 * buffer.c (truncate-lines): Doc fix.
10334
94e0933e
CY
103352011-09-24 Chong Yidong <cyd@stupidchicken.com>
10336
10337 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10338 (Fset_window_next_buffers): Doc fix.
10339
cddde921
GM
103402011-09-24 Glenn Morris <rgm@gnu.org>
10341
10342 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10343
1260aef1
PE
103442011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10345
25b4bfa0
PE
10346 Fix minor problems found by static checking.
10347 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
10348 * indent.c (Fvertical_motion): Fix == vs = typo.
10349
e3cbd34b
EZ
103502011-09-24 Eli Zaretskii <eliz@gnu.org>
10351
a66cfb1c
SM
10352 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10353 Default value is now t. Doc fix.
6bf7006f 10354
e3cbd34b 10355 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 10356 logic when moving up, not only when moving down. Fix the
e3cbd34b 10357 confusing name and values of the it_overshoot_expected variable;
32c1fffd 10358 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
10359
10360 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10361 CHARPOS is covered by a display string which includes newlines.
10362 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10363 is covered by a display string with embedded newlines.
10364
a3de0cbd
MA
103652011-09-24 Michael Albinus <michael.albinus@gmx.de>
10366
10367 * dbusbind.c (Fdbus_register_signal): Add match rule to
10368 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
10369 (Fdbus_register_method, Vdbus_registered_objects_table):
10370 Fix docstring.
a3de0cbd 10371
b260039d
JM
103722011-09-24 Jim Meyering <meyering@redhat.com>
10373
32c1fffd 10374 do not ignore write error for any output size
b260039d
JM
10375 The previous change was incomplete.
10376 While it makes emacs --batch detect the vast majority of stdout
10377 write failures, errors were still ignored whenever the output size is
10378 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10379 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10380 && echo FAIL: ignored write error
10381 FAIL: ignored write error
10382 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10383 && echo FAIL: ignored write error
10384 FAIL: ignored write error
10385 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10386
8eca8a7c
AS
103872011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10388
10389 * emacs.c (Fkill_emacs): In noninteractive mode exit
10390 non-successfully if a write error occurred on stdout. (Bug#9574)
10391
3341db62
EZ
103922011-09-21 Eli Zaretskii <eliz@gnu.org>
10393
10394 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10395 the xassert test.
10396
10397 * dispextern.h (struct it): Update the comment documenting what
10398 can it->OBJECT be.
10399
8c203dbf
EZ
104002011-09-20 Eli Zaretskii <eliz@gnu.org>
10401
10402 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10403 a display string, extend search for cursor position to end of row.
10404 (find_row_edges): If the row ends in a newline from a display
10405 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10406 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
10407 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10408 non-empty line. Fixes confusing cursor motion with arrow keys at
10409 the beginning of a line that starts with whitespace.
8c203dbf 10410
a4824228
LMI
104112011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10412
10413 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10414 (bug#9493).
10415
33ed493b
CY
104162011-09-18 Chong Yidong <cyd@stupidchicken.com>
10417
10418 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10419 boolean (Bug#9154).
10420
56cd55c8
EZ
104212011-09-18 Eli Zaretskii <eliz@gnu.org>
10422
10423 * xdisp.c (display_line): Record maximum and minimum buffer
10424 positions even if no glyphs were produced (e.g., by a zero-width
10425 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10426 buffer positions that will be removed from the glyph row because
10427 they don't fit.
c02dcedf
EZ
10428 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10429 column is beyond frame width: don't subtract 1 "pixel" when
10430 computing width of the stretch.
3e62b7e0
EZ
10431 (reseat_at_next_visible_line_start): Undo the change made on
10432 2011-09-17 that saved paragraph information and restored it after
10433 the call to `reseat'. (Bug#9545)
56cd55c8 10434
5ed99d36 104352011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
10436
10437 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10438 and turn window cursor on if cleared (Bug#9415).
10439
5ed99d36 104402011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
10441
10442 * search.c (boyer_moore): Take unibyte characters from pattern
10443 literally. (Bug#9458)
10444
9bade7b2
EZ
104452011-09-18 Eli Zaretskii <eliz@gnu.org>
10446
10447 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10448
e5e9d610
PE
104492011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10450
87e4427a
PE
10451 Fix minor problem found by static checking.
10452 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10453 initialized, to pacify gcc -Wuninitialized.
10454
e5e9d610
PE
10455 * fileio.c: Report proper errno when syscall falls.
10456 (Finsert_file_contents): Save and restore errno,
10457 so that report_file_error outputs the correct diagnostic.
10458 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10459
a1674f0b
EZ
104602011-09-18 Eli Zaretskii <eliz@gnu.org>
10461
10462 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10463
fbfb6dd4
EZ
104642011-09-17 Eli Zaretskii <eliz@gnu.org>
10465
10466 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10467 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10468
bb187662
EZ
104692011-09-17 Eli Zaretskii <eliz@gnu.org>
10470
1137e8b8 10471 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 10472 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
10473
10474 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10475 (bidi_find_paragraph_start): Search back for paragraph beginning
10476 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10477 (bidi_move_to_visually_next): Only trigger paragraph-related
10478 computations when the last character is a newline or at EOB, not
10479 just any NEUTRAL_B. (Bug#9470)
10480
bb187662
EZ
10481 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10482 truncated lines if point is covered by a display string. (Bug#9524)
10483
2e621251
PE
104842011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10485
10486 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10487 (cons_to_x_long): New function.
10488 (lisp_data_to_selection_data): Use it. Correct the test for
10489 short-versus-long data; it was negated. Break out of vector
10490 loop, for efficiency, when a long datum is discovered.
10491
91a15bc6
SM
104922011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10493
10494 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10495
b41c3a35
EZ
104962011-09-16 Eli Zaretskii <eliz@gnu.org>
10497
10498 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10499 GCC PR/17406) by declaring this function with external scope.
10500
7812ba2d
PE
105012011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10502
10503 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10504 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10505
cf7edc2a
AS
105062011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10507
10508 * editfns.c (Fformat): Correctly handle text properties on "%%".
10509
bd01620e
EZ
105102011-09-15 Eli Zaretskii <eliz@gnu.org>
10511
10512 * xterm.c (x_draw_composite_glyph_string_foreground):
10513 * w32term.c (x_draw_composite_glyph_string_foreground):
10514 * term.c (encode_terminal_code):
10515 * composite.c (composition_update_it, get_composition_id):
10516 * xdisp.c (get_next_display_element)
10517 (fill_composite_glyph_string): Add comments about special meaning
10518 of TAB characters in a composition.
10519
a02719a3
PE
105202011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10521
10522 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
10523 This occurs when processing a multibyte format.
10524 Problem reported by Wolfgang Jenker.
a02719a3 10525
72589a3c
JB
105262011-09-15 Johan Bockgård <bojohan@gnu.org>
10527
10528 * xdisp.c (try_cursor_movement): Only check for exact match if
10529 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10530
1c14176c
PE
105312011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10532
10533 Remove unused external symbols.
10534 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10535 * xdisp.c (calc_pixel_width_or_height): Now static.
10536 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10537 * indent.c (check_display_width):
10538 * w32term.c: Fix comment to match code.
10539 * xterm.c, xterm.h (x_catching_errors): Remove.
10540
d2eea5b5
PE
105412011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10542
10543 * xselect.c: Use signed conversions more consistently (Bug#9498).
10544 (selection_data_to_lisp_data): Assume incoming selection data are
10545 signed integers, not unsigned. This is to be consistent with
10546 outgoing selection data, which was modified to use signed integers
10547 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10548 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10549 expects long, not unsigned long.
10550
46888499
EZ
105512011-09-14 Eli Zaretskii <eliz@gnu.org>
10552
10553 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10554 computation of loop end. Reported by Johan Bockgård
10555 <bojohan@gnu.org>.
10556
ef8ef9fb
CY
105572011-09-13 Chong Yidong <cyd@stupidchicken.com>
10558
10559 * frame.c (Fother_visible_frames_p): Function deleted.
10560
fa819fed
EZ
105612011-09-12 Eli Zaretskii <eliz@gnu.org>
10562
10563 * indent.c (compute_motion): Process display vector front to back
10564 rather than the other way around. (Bug#2496)
10565
2ba8e008
SM
105662011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10567
10568 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10569
20f53c69
CY
105702011-09-11 Chong Yidong <cyd@stupidchicken.com>
10571
10572 * minibuf.c (Fread_from_minibuffer): Doc fix.
10573
d562d7a4
EZ
105742011-09-11 Eli Zaretskii <eliz@gnu.org>
10575
10576 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10577 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10578
1c4d7f3d
LMI
105792011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10580
10581 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10582 value for non-existent files.
10583
b885bf36
EZ
105842011-09-11 Eli Zaretskii <eliz@gnu.org>
10585
10586 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10587 set its "size" to -1. This will set the modtime_size field of
10588 the corresponding buffer to -1, which is what
10589 verify-visited-file-modtime expects for files that do not exist.
10590 (Bug#9139)
10591
6612f0bf
PE
105922011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10593
10594 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10595 here ...
10596 * lisp.h: ... from here. push_key_description is no longer
10597 defined in keyboard.c, so its declaration should not be in
10598 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10599 logically belongs with push_key_description.
10600
dfb3f755
PE
106012011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10602
10603 * buffer.h: Include <sys/types.h> instead of <time.h>.
10604 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10605 Problem reported by Herbert J. Skuhra.
10606
3134906c
LMI
106072011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10608
10609 * xml.c (parse_region): Make the parsing work for
10610 non-comment-starting XML files again (bug#9144).
10611
8d903f4e
AS
106122011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10613
10614 * image.c (gif_load): Fix calculation of bottom and right corner.
10615 (Bug#9468)
10616
80ad64f4
EZ
106172011-09-10 Eli Zaretskii <eliz@gnu.org>
10618
10619 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10620 redisplay in small windows.
10621
208a048d
EZ
106222011-09-09 Eli Zaretskii <eliz@gnu.org>
10623
10624 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10625
9b1c252e
MR
106262011-09-08 Martin Rudalics <rudalics@gmx.at>
10627
10628 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10629 Operate on live windows only.
10630
2949f33b
JB
106312011-09-08 Juanma Barranquero <lekktu@gmail.com>
10632
10633 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10634
e08dcafd
EZ
106352011-09-07 Eli Zaretskii <eliz@gnu.org>
10636
10637 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10638 only under bidi iteration.
10639
115b96bd
JD
106402011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10641
10642 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10643
c8199d0f
PE
106442011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10645
10646 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10647 Without this fix, the command to link temacs failed due to an
10648 undefined symbol __builtin_isnan. This is because
10649 /usr/include/iso/math_c99.h #defines isnan(x) to
10650 __builtin_isnan(x), but the bundled gcc, which identifies itself
10651 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10652 a __builtin_isnan.
10653 * floatfns.c (isnan): #undef, and then #define to a clone of
10654 what's in data.c.
10655 (Fisnan): Always define, since it's always available now.
10656 (syms_of_floatfns): Always define isnan at the Lisp level.
10657
e39b275c 106582011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
10659
10660 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10661
b2db44d9 106622011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 10663
f4af5137 10664 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
10665 The previous code assumed that file offsets (off_t values) fit in
10666 EMACS_INT variables, which is not true on typical 32-bit hosts.
10667 The code messed up by falsely reporting buffer overflow in cases
10668 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10669 when "big" contains more than 2**29 bytes, even though this
10670 inserts just one byte and does not overflow the buffer.
10671 (Finsert_file_contents): Store file offsets as off_t
10672 values, not as EMACS_INT values. Check for overflow when
10673 converting between EMACS_INT and off_t. When checking for
10674 buffer overflow or for overlap, take the offsets into account.
10675 Don't use EMACS_INT for small values where int suffices.
10676 When checking for overlap, fix a typo: ZV was used where
10677 ZV_BYTE was intended.
10678 (Fwrite_region): Don't assume off_t fits into 'long'.
10679 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10680
ecfc0a49
MA
106812011-09-05 Michael Albinus <michael.albinus@gmx.de>
10682
10683 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10684
6511acf2 106852011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 10686
0999621a 10687 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
10688
10689 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 10690 (esprintf, exprintf, evxprintf): New functions.
62f19c19 10691 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 10692 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
10693 (modify_event_symbol): Do not assume that the length of
10694 name_alist_or_stem is safe to alloca and fits in int.
10695 (Fexecute_extended_command): Likewise for function name and binding.
10696 (Frecursion_depth): Wrap around reliably on integer overflow.
10697 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10698 since some callers pass EMACS_INT values.
10699 (Fsingle_key_description): Don't crash if symbol name contains more
10700 than MAX_ALLOCA bytes.
10701 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10702 (get_minibuffer): Arg is now EMACS_INT, not int.
10703 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 10704 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
10705 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10706
2be7d702
PE
10707 * dbusbind.c (signature_cat): New function.
10708 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
10709 Do not overrun buffer; instead, report string overflow.
10710
9d1df220
PE
10711 * dispnew.c (add_window_display_history): Don't overrun buffer.
10712 Truncate instead; this is OK since it's just a log.
10713
33ef5c64
PE
10714 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10715 even if the time zone offset is outlandishly large.
10716 Don't mishandle offset == INT_MIN.
10717
66c6fdd5
PE
10718 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10719 when creating daemon; the previous buffer-overflow check was incorrect.
10720
d749b01b
PE
10721 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10722 which has the guts of the old verror function.
10723
b5cd1905
PE
10724 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10725 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10726
6e1a67fb
PE
10727 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10728 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 10729 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 10730 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
10731 length of string rather than counting it via multiple sprintfs;
10732 that's simpler and more reliable.
c21721cc
PE
10733 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10734 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10735 sprintf, in case result does not fit in int.
10736
c57b67fc
PE
10737 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10738 (fontset_from_font): Print it.
10739
8a401434
PE
10740 * frame.c (tty_frame_count): Now printmax_t, not int.
10741 (make_terminal_frame, set_term_frame_name): Print it.
10742 (x_report_frame_params): In X, window IDs are unsigned long,
10743 not signed long, so print them as unsigned.
10744 (validate_x_resource_name): Check for implausibly long names,
10745 and don't assume name length fits in 'int'.
10746 (x_get_resource_string): Don't blindly alloca invocation name;
10747 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10748 not fit in int.
10749
6e1a67fb
PE
10750 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10751 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
10752 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10753
0df02bf3
PE
10754 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10755 Use esprintf, not sprintf, in case result does not fit in int.
10756
48e30793
PE
10757 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10758 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10759 it as a large positive number.
10760 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10761 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10762
a66ff6d8
PE
10763 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10764 in case result does not fit in int.
10765
aca216ff
PE
10766 * print.c (float_to_string): Detect width overflow more reliably.
10767 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10768 buffer overrun. Don't assume list length fits in 'int'. Treat
10769 print length of 0 as 0, not as infinity; to be consistent with other
10770 uses of print length in this function. Don't overflow print length
10771 index. Don't assume hash table size fits in 'long', or that
10772 vectorlike size fits in 'unsigned long'.
10773
31c286f7
PE
10774 * process.c (make_process): Use printmax_t, not int, to format
10775 process-name gensyms.
10776
55e5faa1
PE
10777 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10778
80f2e268
PE
10779 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10780 to avoid potential buffer overrun.
10781
670741ab
PE
10782 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10783 if X resource line is longer than 512 bytes.
10784
b7163a50
PE
10785 * xfns.c (x_window): Make sprintf buffer a bit bigger
10786 to avoid potential buffer overrun.
10787
ae58ff1f
PE
10788 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10789
c43c8a6a
PE
10790 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10791
3f8236f4
PE
107922011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10793
53e9fe90 10794 Integer overflow fixes for scrolling, etc.
6511acf2
PE
10795 Without these, Emacs silently mishandles large integers sometimes.
10796 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
10797 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10798
6511acf2
PE
10799 * xdisp.c (try_window_id): Check Emacs fixnum range before
10800 converting to 'int'.
806add1d 10801
6511acf2 10802 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
10803 Check that an Emacs fixnum is in range before assigning it to 'int'.
10804 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10805 values converted from Emacs fixnums.
10806 (Frecenter): Don't wrap around a line count if it is out of 'int'
10807 range; instead, treat it as an extreme value.
10808 (Fset_window_configuration, compare_window_configurations):
10809 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10810
6511acf2
PE
10811 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10812 that can exceed INT_MAX. Check that EMACS_INT value is in range
10813 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
10814 (match_limit): Don't assume that a fixnum can fit in 'int'.
10815
6511acf2 10816 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
10817 exceed INT_MAX.
10818
6511acf2 10819 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
10820 (Fvertical_motion): Don't wrap around LINES values that don't fit
10821 in 'int'. Instead, treat them as extreme values. This is good
10822 enough for windows, which can't have more than INT_MAX lines anyway.
10823
fcb901a7
LMI
108242011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10825
0f2f6b6d
LMI
10826 * Require libxml/parser.h to avoid compilation warning.
10827
fcb901a7
LMI
10828 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10829
10830 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10831 since this reportedly can destroy thread storage.
10832
6e20a0d4
CY
108332011-08-30 Chong Yidong <cyd@stupidchicken.com>
10834
10835 * syntax.c (find_defun_start): Update all cache variables if
10836 exiting early (Bug#9401).
10837
148ae00e
EZ
108382011-08-30 Eli Zaretskii <eliz@gnu.org>
10839
f6cfbd8f
EZ
10840 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10841
148ae00e
EZ
10842 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10843 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10844 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10845
10846 * term.c (tty_append_glyph): New function.
10847 (produce_stretch_glyph): Static function and its prototype deleted.
10848
a66cfb1c
SM
10849 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10850 Add prototypes.
148ae00e 10851
c4a07a4c
PE
108522011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10853
10854 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10855 when checking :margin (Bug#9390).
10856 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 10857 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
10858 so that the name doesn't mislead. All uses changed.
10859
6bc8cd65
JB
108602011-08-28 Johan Bockgård <bojohan@gnu.org>
10861
10862 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10863 set_tty_hooks.
10864
dca4927e
EZ
108652011-08-27 Eli Zaretskii <eliz@gnu.org>
10866
10867 * xdisp.c (move_it_to): Don't bail out early when reaching
10868 position beyond to_charpos, if we are scanning backwards.
10869 (move_it_vertically_backward): When DY == 0, make sure we get to
10870 the first character in the line after the newline.
10871
f2cad773
PE
108722011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10873
10874 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10875 (ccl_driver): Do not generate an out-of-range pointer.
10876 (Fccl_execute_on_string): Remove unnecessary check for
10877 integer overflow, noted by Stefan Monnier in
10878 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10879 Remove a FIXME that didn't need fixing.
10880 Simplify the newly-introduced buffer reallocation code.
10881
0cae2cdb
JB
108822011-08-27 Juanma Barranquero <lekktu@gmail.com>
10883
10884 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10885
5fc295a4 108862011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 10887
70c60eb2 10888 Integer and memory overflow issues (Bug#9196).
726e0ab1 10889
d31850da
PE
10890 * doc.c (get_doc_string): Rework so that
10891 get_doc_string_buffer_size is the actual buffer size, rather than
10892 being 1 less than the actual buffer size; this makes xpalloc more
10893 convenient.
10894
a69fbedb
PE
10895 * image.c (x_allocate_bitmap_record, cache_image):
10896 * xselect.c (Fx_register_dnd_atom):
10897 Simplify previous changes by using xpalloc.
10898
fe5c5d37
PE
10899 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10900 since either will do and ptrdiff_t is convenient with xpalloc.
10901
0065d054
PE
10902 * charset.c (charset_table_size)
10903 (struct charset_sort_data.priority): Now ptrdiff_t.
10904 (charset_compare): Don't overflow if priorities differ greatly.
10905 (Fsort_charsets): Don't assume list length fits in int.
10906 Check for size-calculation overflow when allocating sort data.
10907 (syms_of_charset): Allocate an initial charset table that is
10908 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10909
10910 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10911
10912 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10913 The actual value is always <= INT_MAX, and leaving it unsigned made
10914 overflow checking harder.
10915
10916 * dispextern.h (struct glyph_matrix.rows_allocated)
10917 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10918 with xpalloc. The values are still always <= INT_MAX.
10919
10920 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10921
10922 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10923 (SAFE_NALLOCA): New macro.
10924
10925 * region-cache.c (struct boundary.pos, find_cache_boundary)
10926 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10927 (set_cache_region, invalidate_region_cache)
10928 (revalidate_region_cache, know_region_cache, region_cache_forward)
10929 (region_cache_backward, pp_cache):
10930 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10931 so that ptrdiff_t * can be passed to xpalloc.
10932 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10933 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10934 (pp_cache): Don't assume cache_len fits in int.
10935 * region-cache.h: Adjust extern decls to match.
10936
10937 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10938 EMACS_INT, since either will do, for xpalloc.
10939
10940 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10941 (xnmalloc, xnrealloc, xpalloc): New functions.
10942
726e0ab1
PE
10943 * bidi.c (bidi_shelve_header_size): New constant.
10944 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10945 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10946
51f30bc5 10947 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
10948 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10949 (overlay_strings):
10950 Don't update size of array until after memory allocation succeeds,
10951 because xmalloc/xrealloc may not return.
0065d054
PE
10952 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10953 now that we have proper integer overflow checking.
10954 (record_overlay_string, overlay_strings): Catch overflows when
10955 calculating size of overlay_str_buf.
726e0ab1 10956
0065d054
PE
10957 * callproc.c (Fcall_process): Check for size overflow when
10958 calculating size of args2.
10959 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10960 Normally we prefer signed values, but sticking with ptrdiff_t would
10961 require adding more-complicated checks.
726e0ab1
PE
10962
10963 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10964 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10965 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 10966 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
10967
10968 * character.c (Fstring): Check for size-calculation overflow.
10969
10970 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10971 unnecessary integer overflow. Check for size overflow.
10972 (encode_coding_object): Don't update size until xmalloc succeeds.
10973
10974 * composite.c (get_composition_id): Check for overflow in glyph
10975 length calculations.
10976
10977 Integer and memory overflow fixes for display code.
10978 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10979 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10980 (scrolling_window): Check for overflow in size calculations.
10981 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10982 Don't assume glyph table len fits in int.
10983 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10984 (row_table_size): Now ptrdiff_t, not int.
10985 (scrolling_window): Avoid overflow in size calculations.
10986 Don't update size until allocation succeeds.
10987 * fns.c (concat): Check for overflow in size calculations.
10988 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10989 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10990 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10991
10992 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10993 (get_doc_string): Check for size calculation overflow.
10994 Don't update size until allocation succeeds.
10995 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10996 EMACS_INT, where ptrdiff_t will do.
10997 (Fsubstitute_command_keys): Check for string overflow.
10998
10999 * editfns.c (set_time_zone_rule): Don't assume environment length
11000 fits in int.
11001 (message_length): Now ptrdiff_t, not int.
11002 (Fmessage_box): Don't update size until allocation succeeds.
11003 Don't assume message length fits in int.
11004 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11005
0065d054
PE
11006 * emacs.c (main): Do not reallocate argv, since there is a null at
11007 the end that can be overwritten, and this way there's no need to
11008 worry about size-calculation overflow.
11009 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
11010
11011 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11012 alloc succeeds.
11013 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11014
11015 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11016 (x_set_scroll_bar_width, x_figure_window_size):
11017 Check for integer overflow.
11018 (x_set_alpha): Do not assume XINT fits in int.
11019
11020 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11021 This is for the members text_lines, text_cols, total_lines, total_cols,
11022 where the system imposes an 'int' limit.
11023
11024 * fringe.c (Fdefine_fringe_bitmap):
11025 Don't update size until alloc works.
11026
11027 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11028 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11029
11030 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11031 Check for size-calculation overflow.
11032 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11033 do, as we prefer signed integers.
11034 (id_to_widget.max_size, id_to_widget.used)
11035 (xg_store_widget_in_map, xg_remove_widget_from_map)
11036 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11037 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11038 Use and return ptrdiff_t, not int.
11039 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11040 * gtkutil.h: Change prototypes to match the above.
11041
11042 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11043 are duplicate now that they've been promoted to lisp.h.
11044 (x_allocate_bitmap_record, x_alloc_image_color)
11045 (make_image_cache, cache_image, xpm_load):
11046 Don't update size until alloc is done.
11047 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11048 (x_detect_edges):
3256efce 11049 Check for size calculation overflow.
726e0ab1
PE
11050 (ct_colors_allocated_max): New constant.
11051 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11052 overflow.
3256efce 11053
726e0ab1
PE
11054 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11055 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11056 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11057 Use ptrdiff_t, not int, to count maps.
11058 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
11059 calculations. Don't update size until allocation succeeds.
11060 Redo calculations to avoid overflow.
726e0ab1
PE
11061 * keyboard.h: Change prototypes to match the above.
11062
11063 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11064 to count maps.
11065 (current_minor_maps): Check for size calculation overflow.
11066 * keymap.h: Change prototypes to match the above.
11067
11068 * lread.c (read1, init_obarray): Don't update size until alloc done.
11069
11070 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11071 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11072
726e0ab1
PE
11073 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11074 Now ptrdiff_t, not int.
11075 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11076 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11077
11078 * process.c (Fnetwork_interface_list): Check for overflow
11079 in size calculation.
11080
11081 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11082
11083 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11084 overflow. Don't bother calling xmalloc when xrealloc will do.
11085
11086 * search.c (Freplace_match): Check for size calculation overflow.
11087 (Fset_match_data): Don't assume list lengths fit in 'int'.
11088
11089 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11090 for command line length. Do not attempt to address one before the
11091 beginning of an array, as that's not portable.
11092
11093 * term.c (max_frame_lines): Remove; unused.
11094 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11095 not int.
11096 (encode_terminal_code, calculate_costs): Check for size
11097 calculation overflow.
11098 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11099 table lengths and related sizes. Don't update size until alloc
11100 done. Redo calculations to avoid overflow.
11101 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11102
11103 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11104 subtracting pointers.
11105 (gobble_line): Check for overflow more carefully. Don't update size
11106 until alloc done.
11107
11108 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11109 Don't update size until alloc done.
11110 Redo size calculations to avoid overflow.
11111 Check for size calculation overflow.
0065d054 11112 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
11113
11114 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11115 Use ptrdiff_t, not int, for sizes.
11116 (store_mode_line_noprop_char): Don't update size until alloc done.
11117
0065d054
PE
11118 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11119 Use ptrdiff_t, not int, for sizes.
11120 (Finternal_make_lisp_face, cache_face):
11121 Check for size calculation overflow.
11122 (cache_face): Treat size calculation overflows as if they were
11123 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
11124
11125 * xfns.c (x_encode_text, x_set_name_internal)
11126 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11127 sizes, since they can exceed INT_MAX in size. Check for size
11128 calculation overflow.
11129
0065d054
PE
11130 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11131 (xg_select): Check for size calculation overflow.
726e0ab1
PE
11132 Don't update size until alloc done.
11133
0065d054 11134 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 11135 as sprintf is limited to int lengths.
1d526e2f 11136
252c5ee1
PE
11137 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11138 (X_LONG_MIN): New macros.
864d7ce7
PE
11139 Use them to make the following changes clearer.
11140 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11141 This change doesn't affect the value now, but it may help remind
11142 future maintainers not to raise the value too much later.
11143 (SELECTION_QUANTUM): Remove, replacing with ...
11144 (selection_quantum): ... new function, which avoids overflow.
11145 All uses changed.
11146 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11147 assumption that selection length fits in 'int'.
11148 (x_reply_selection_request, x_handle_selection_request)
11149 (x_get_window_property, receive_incremental_selection)
11150 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11151 (lisp_data_to_selection_data, clean_local_selection_data):
11152 Use ptrdiff_t, not int, to record length of selection.
11153 (x_reply_selection_request, x_get_window_property)
11154 (receive_incremental_selection, x_property_data_to_lisp):
11155 Redo calculations to avoid overflow.
11156 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 11157 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
11158 something.
11159 (x_get_window_property, receive_incremental_selection)
11160 (lisp_data_to_selection_data, x_property_data_to_lisp):
11161 Check for size-calculation overflow.
11162 (x_get_window_property, receive_incremental_selection)
11163 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11164 Don't store size until memory allocation succeeds.
11165 (x_get_window_property): Plug memory leak on memory exhaustion.
11166 Don't double-block input; malloc is safe here. Don't assume 2**34
11167 - 4 fits in unsigned long. Add an xassert to check
11168 XGetWindowProperty overflow. Be more careful about overflow
11169 calculations, and distinguish size from memory overflow better.
11170 (receive_incremental_selection): When tracing, don't assume
11171 unsigned int is less than INT_MAX.
11172 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11173 harmful) conversions of unsigned short to int.
11174 (lisp_data_to_selection_data): Don't assume that integers
11175 in the range -65535 through -1 fit in an X unsigned short.
11176 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11177 result parameters unless successful. Rely on cons_to_unsigned
11178 to report problems with elements; the old code wasn't right anyway.
11179 (x_check_property_data): Check for int overflow; we cannot use
11180 a wider type due to X limits.
11181 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11182
726e0ab1 11183 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 11184
0065d054
PE
11185 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11186 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
11187 (x_color_cells): Don't store size until memory allocation succeeds.
11188 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 11189 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
11190 (x_term_init): Don't assume length fits in int (sprintf is limited
11191 to int size).
bc18e09d 11192
ebfa62c0
PE
11193 Use ptrdiff_t for composition IDs.
11194 * character.c (lisp_string_width):
11195 * composite.c (composition_table_size, n_compositions)
11196 (get_composition_id, composition_gstring_from_id):
11197 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11198 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11199 * window.c (Frecenter):
11200 Use ptrdiff_t, not int, for composition IDs.
11201 * composite.c (get_composition_id): Check for integer overflow.
11202 * composite.h: Adjust prototypes to match the above changes.
11203
d3411f89
PE
11204 Use ptrdiff_t for hash table indexes.
11205 * category.c (hash_get_category_set):
11206 * ccl.c (ccl_driver):
11207 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11208 * coding.c (coding_system_charset_list, detect_coding_system):
11209 * coding.h (struct coding_system.id):
11210 * composite.c (get_composition_id, gstring_lookup_cache):
11211 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11212 * image.c (xpm_get_color_table_h):
11213 * lisp.h (hash_lookup, hash_put):
11214 * minibuf.c (Ftest_completion):
11215 Use ptrdiff_t for hash table indexes, not int (which is too
11216 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11217 32-bit --with-wide-int hosts).
11218
e097a6fa
PE
11219 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11220 Add a FIXME comment about memory leaks.
11221 (syms_of_charset): Don't assume xmalloc returns.
11222
5637687f
PE
11223 Don't assume that stated character widths fit in int.
11224 * character.c (Fchar_width, c_string_width, lisp_string_width):
11225 * character.h (CHAR_WIDTH):
11226 * indent.c (MULTIBYTE_BYTES_WIDTH):
11227 Use sanitize_char_width to avoid undefined and/or bad behavior
11228 with outlandish widths.
a66cfb1c 11229 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
11230 now that we have two such functions. All uses changed.
11231 (sanitize_char_width): New inline function.
11232
a2271ba2
PE
11233 Don't assume that tab-width fits in int.
11234 * character.h (sanitize_width): New inline function.
11235 (SANE_TAB_WIDTH): New macro.
11236 (ASCII_CHAR_WIDTH): Use it.
11237 * indent.c (sane_tab_width): Remove. All uses replaced by
11238 SANE_TAB_WIDTH (current_buffer).
11239 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11240
18c52557
PE
11241 * fileio.c: Integer overflow issues with file modes.
11242 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11243
caeeedc1
PE
11244 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11245 Remove unreachable code.
11246 (read_hex, load_charset_map_from_file): Check for integer overflow.
11247
6df6ae42 11248 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
11249 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11250 (x_send_scroll_bar_event): Likewise. Check that the size does not
11251 exceed limits imposed by XClientMessageEvent, as well as the usual
11252 ptrdiff_t and size_t limits.
11253
b13995db
PE
11254 * keyboard.c: Overflow, signedness and related fixes.
11255 (make_lispy_movement): Use same integer type in forward decl
11256 that is used in the definition.
11257 (read_key_sequence, keyremap_step):
11258 Change bufsize argument back to int, undoing my 2011-03-30 change.
11259 We prefer signed types, and int is wide enough here.
11260 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11261 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11262 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11263 length, not size_t. Use ptrdiff_t for index, not int.
11264 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11265 possibility of integer overflow.
11266
13464394
PE
11267 Overflow, signedness and related fixes for images.
11268
11269 * dispextern.h (struct it.stack[0].u.image.image_id)
11270 (struct_it.image_id, struct image.id, struct image_cache.size)
11271 (struct image_cache.used, struct image_cache.ref_count):
11272 * gtkutil.c (update_frame_tool_bar):
11273 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11274 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11275 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11276 * nsmenu.m (update_frame_tool_bar):
11277 * xdisp.c (calc_pixel_width_or_height):
11278 * xfns.c (image_cache_refcount):
11279 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11280 on typical 64-bit hosts.
11281
11282 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11283 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11284 Omit unnecessary casts to int.
11285 (parse_image_spec): Check that integers fall into 'int' range
11286 when the callers expect that.
11287 (image_ascent): Redo ascent calculation to avoid int overflow.
11288 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11289 (lookup_image): Remove unnecessary tests.
11290 (xbm_image_p): Locals are now of int, not EMACS_INT,
11291 since parse_image_check makes sure they fit into int.
11292 (png_load, gif_load, svg_load_image):
11293 Prefer int to unsigned where either will do.
11294 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
11295 old tiff_error_handler and tiff_warning_handler.
11296 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
11297 stack buffer overflows. It uses only the features of vsnprintf
11298 that are common to both POSIX and native Microsoft.
11299 (tiff_error_handler, tiff_warning_handler): Use it.
11300 (tiff_load, gif_load, imagemagick_load_image):
11301 Don't assume :index value fits in 'int'.
11302 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11303 (imagemagick_load_image): Check that crop parameters fit into
11304 the integer types that MagickCropImage accepts. Don't assume
11305 Vimagemagick_render_type has a nonnegative value. Don't assume
11306 size_t fits in 'long'.
11307 (gs_load): Use printmax_t to print the widest integers possible.
11308 Check for integer overflow when computing image height and width.
11309
c11821d4
EZ
113102011-08-26 Eli Zaretskii <eliz@gnu.org>
11311
11312 * xdisp.c (redisplay_window): Don't force window start if point
11313 will be invisible in the resulting window. (Bug#9324)
11314
0c95fcf7
EZ
113152011-08-25 Eli Zaretskii <eliz@gnu.org>
11316
11317 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11318 the display spec is of the form `(space ...)'.
11319 (handle_display_spec): Return the value returned by
11320 handle_single_display_spec, not just 1 or zero.
11321 (handle_single_display_spec): If the display spec is of the form
11322 `(space ...)', and specifies display in the text area, return 2
11323 rather than 1.
fee65a97 11324 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
11325 accurately, and prefer exact match for point under bidi.
11326 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
11327
11328 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11329 into disp_prop; all users changed.
11330
11331 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11332 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11333 for the text covered by the display property.
11334
e4ed06f1
CY
113352011-08-25 Chong Yidong <cyd@stupidchicken.com>
11336
11337 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11338 Change return value to nil.
11339 (Frecord_buffer): Delete unused function.
11340
f67cdd7f
EZ
113412011-08-24 Eli Zaretskii <eliz@gnu.org>
11342
5980d4c6
EZ
11343 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11344 buffers, return left-to-right.
8610fe8b
EZ
11345 (set_cursor_from_row): Consider candidate row a win if its glyph
11346 represents a newline and point is on that newline. Fixes cursor
11347 positioning on the newline at EOL of R2L text within L2R
11348 paragraph, and vice versa.
11349 (try_cursor_movement): Check continued rows, in addition to
11350 continuation rows. Fixes unwarranted scroll when point enters a
11351 continued line of R2L text within an L2R paragraph, or vice versa.
11352 (cursor_row_p): Consider the case of point being equal to
11353 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11354 from the end of a short line to the beginning of a continued line
11355 of R2L text within L2R paragraph.
11356 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11357 composed characters.
5980d4c6 11358
f67cdd7f
EZ
11359 * bidi.c (bidi_check_type): Use xassert.
11360 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11361 members.
11362
bca633fb
EZ
113632011-08-23 Eli Zaretskii <eliz@gnu.org>
11364
11365 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11366 a character.
11367
4a5885a7
CY
113682011-08-23 Chong Yidong <cyd@stupidchicken.com>
11369
11370 * nsfont.m (ns_otf_to_script): Fix typo.
11371
0902a04e
KH
113722011-08-22 Kenichi Handa <handa@m17n.org>
11373
11374 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11375 extra slot even if the purpose is char-code-property-table.
11376
1a2e6670
EZ
113772011-08-23 Eli Zaretskii <eliz@gnu.org>
11378
8ddde651
EZ
11379 * xdisp.c (redisplay_window): When computing centering_position,
11380 account for the height of the header line. (Bug#8874)
11381
425cc014
EZ
11382 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11383 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11384 candidate is selected by the mouse, and that candidate has a
11385 composed character under the mouse.
11386
1a2e6670
EZ
11387 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11388 coordinates reported by pos-visible-in-window-p for a composed
11389 character in column zero.
11390
8b76d6f8
SM
113912011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11392
11393 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11394
dac347dd
EZ
113952011-08-22 Eli Zaretskii <eliz@gnu.org>
11396
11397 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11398 consider it a hit if to_charpos is anywhere in the range of the
11399 composed buffer positions.
11400
e013fb34
CY
114012011-08-22 Chong Yidong <cyd@stupidchicken.com>
11402
11403 * image.c (gif_load): Don't assume that each subimage has the same
11404 dimensions as the base image. Handle disposal method that is
11405 "undefined" by the gif spec (Bug#9335).
11406
bd1ba3e8
CY
114072011-08-20 Chong Yidong <cyd@stupidchicken.com>
11408
11409 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 11410 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 11411
54a1215b
EZ
114122011-08-19 Eli Zaretskii <eliz@gnu.org>
11413
823564e5
EZ
11414 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11415 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11416 from an Org mode buffer to a Speedbar frame.
11417
54a1215b
EZ
11418 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11419 a composition, take its buffer position from IT->cmp_it.charpos.
11420 Fixes cursor positioning at the beginning of a line that begins
11421 with a composed character.
11422
9778ebcc
EZ
114232011-08-18 Eli Zaretskii <eliz@gnu.org>
11424
0be6ee06
EZ
11425 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11426 character bidirectional type, use STRONG_L instead. Fixes crashes
11427 in a buffer produced by `describe-categories'.
11428
9778ebcc
EZ
11429 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11430 members before the level stack, so they would be saved and
11431 restored when copying iterator state. Fixes incorrect reordering
11432 around TABs covered by display properties.
11433
156bffbe
AS
114342011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11435
6b02f655 11436 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 11437
72ad093b
CY
114382011-08-17 Chong Yidong <cyd@stupidchicken.com>
11439
11440 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
11441 (internal_condition_case_2, internal_condition_case_n):
11442 Remove unnecessary aborts (Bug#9081).
72ad093b 11443
35774242
EZ
114442011-08-17 Eli Zaretskii <eliz@gnu.org>
11445
11446 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11447 has no `load' handler, try opening the file locally. (Bug#9311)
11448
db76dd85
KB
114492011-08-16 Ken Brown <kbrown@cornell.edu>
11450
11451 * gmalloc.c: Expand comment.
11452
b215eee5
EZ
114532011-08-16 Eli Zaretskii <eliz@gnu.org>
11454
11455 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11456 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11457
a4579d33
KB
114582011-08-16 Ken Brown <kbrown@cornell.edu>
11459
11460 Fix memory allocation problems in Cygwin build (Bug#9273).
11461
11462 * unexcw.c ( __malloc_initialized): Declare external variable.
11463 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11464
8b76d6f8
SM
11465 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11466 New variables.
a4579d33
KB
11467 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11468 dumped emacs.
11469 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11470 in the static heap.
11471 [CYGWIN] (special_realloc): New function.
11472 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11473 requests to realloc storage in the static heap.
11474
3ebec551
PE
114752011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11476
11477 * bidi.c (bidi_initialize): Remove unused local.
11478
9fd8be00
EZ
114792011-08-15 Eli Zaretskii <eliz@gnu.org>
11480
6b02f655
SM
11481 * bidimirror.h:
11482 * biditype.h: Remove file.
11483 * makefile.w32-in ($(BLD)/bidi.$(O)):
11484 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
11485
11486 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11487
11488 * chartab.c: Improve commentary for the uniprop_table API.
11489
32413314
EZ
11490 * bidi.c (bidi_paragraph_init): Support zero value of
11491 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
11492 (bidi_initialize): Use uniprop_table instead of including
11493 biditype.h and bidimirror.h.
32413314 11494
9fd8be00
EZ
11495 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11496 coordinates of the iterator when restoring from ppos_it.
11497 (Bug#9296)
11498
5cf2b69b
KH
114992011-08-14 Kenichi Handa <handa@m17n.org>
11500
11501 * process.c (create_process): Call setup_process_coding_systems
72ad093b 11502 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 11503
daf17d00
EZ
115042011-08-14 Eli Zaretskii <eliz@gnu.org>
11505
11506 * xdisp.c (move_it_in_display_line_to): Don't invoke
11507 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11508 ppos_it. Fixes vertical cursor motion when line beginning is
11509 covered by an image. (Bug#9296)
11510
08e3161a
JD
115112011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11512
11513 * nsterm.h (ns_run_ascript): Declare.
11514 (NSAPP_DATA2_RUNASSCRIPT): Define.
11515
11516 * nsfns.m (as_script, as_result, as_status): New static variables.
11517 (ns_run_ascript): New function.
5e617bc2 11518 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
11519 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11520 the event loop. Get status from as_status (Bug#7276).
11521
11522 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11523 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11524 the event loop (Bug#7276).
11525
a3720aa2
AS
115262011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11527
11528 * gnutls.c (QCgnutls_bootprop_priority)
11529 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11530 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11531 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11532 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11533 (QCgnutls_bootprop_verify_hostname_error)
11534 (QCgnutls_bootprop_callbacks_verify): Rename from
11535 Qgnutls_bootprop_..., all uses changed.
11536
11537 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11538 uses changed.
11539
0a0d27fb
PE
115402011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11541
19d5c50c
PE
11542 * xfaces.c (Qframe_set_background_mode): Now static.
11543 * dispextern.h (Qframe_set_background_mode): Remove decl.
11544
0a0d27fb
PE
11545 * process.c (Fnetwork_interface_info): Declare local only if needed.
11546
377538cb
JD
115472011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11548
11549 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11550 (Fnetwork_interface_list): Allocate in increments of bytes instead
11551 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11552 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11553 sockaddr.
11554 (struct ifflag_def): notrailers is smart on OSX.
11555 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11556 Get hardware address with getifaddrs if available.
11557
08fff70c
EZ
115582011-08-12 Eli Zaretskii <eliz@gnu.org>
11559
11560 * xdisp.c (iterate_out_of_display_property): xassert that
11561 IT->position is set to within IT->object's boundaries. Break from
11562 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
11563 when IT->position is set up wrongly due to some bug.
11564 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
11565 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11566 entry. Force push_it to save on the stack the current
11567 buffer/string position, to be restored by pop_it. Fix flags in
11568 the iterator structure wrt the object coming from a display
11569 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11570 properties. (Bug#9284)
11571
7be1c708 115722011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 11573
7be1c708
CY
11574 * fontset.c (fontset_get_font_group): Add proper type checks.
11575 (Bug#9172)
aac0c6e3 11576
7be1c708 115772011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 11578
7be1c708
CY
11579 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11580 and LC_VERSION_MIN_MACOSX.
11581 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11582 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 11583
97bb72a6
EZ
115842011-08-08 Eli Zaretskii <eliz@gnu.org>
11585
11586 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
11587 no-display-properties-and-no-overlays under bidi display.
11588 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 11589 properties and overlays.
97bb72a6 11590
d5617611
CY
115912011-08-08 Chong Yidong <cyd@stupidchicken.com>
11592
37e11a63
CY
11593 * editfns.c (Fset_time_zone_rule): Document relationship with the
11594 setenv function.
11595
d5617611
CY
11596 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11597 the font entity extracted from the cache (Bug#8109).
11598
58872834
CY
115992011-08-07 Chong Yidong <cyd@stupidchicken.com>
11600
11601 * composite.c (autocmp_chars): Don't reset point. That is done by
11602 restore_point_unwind (Bug#5984).
11603
75bfc667
JL
116042011-08-07 Juri Linkov <juri@jurta.org>
11605
11606 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11607 to show the arg `TIME' instead of `TIMEVAL'.
11608
d1410150
EZ
116092011-08-06 Eli Zaretskii <eliz@gnu.org>
11610
11611 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11612 display property strides EOL and includes a newline, as in
11613 longlines-mode. (Bug#9254)
75b771e4
EZ
11614 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11615 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
11616
11617 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11618 is non-zero, even if the data buffer is NULL. Fixes a crash in
11619 vertical-motion with longlines-mode. (Bug#9254)
11620
35928349
EZ
116212011-08-05 Eli Zaretskii <eliz@gnu.org>
11622
ec7cc85b
EZ
11623 * bidi.c <bidi_cache_total_alloc>: Now static.
11624 (bidi_initialize): Initialize bidi_cache_total_alloc.
11625
8b76d6f8 11626 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
11627 cache. (Bug#9221)
11628
11629 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11630 amount allocated this far in `bidi_cache_total_alloc'.
11631 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11632 non-zero, only free the data buffer without restoring the cache
11633 contents. All callers changed.
11634
11635 * dispextern.h (bidi_unshelve_cache): Update prototype.
11636
11637 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11638 (move_it_in_display_line, move_it_to)
11639 (move_it_vertically_backward, move_it_by_lines): Replace the call
11640 to xfree to an equivalent call to bidi_unshelve_cache.
11641 (move_it_in_display_line_to): Fix logic of returning
412b6358 11642 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 11643
e2e2423b
EZ
116442011-08-05 Eli Zaretskii <eliz@gnu.org>
11645
11646 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11647 came from a string character with a `cursor' property. (Bug#9229)
11648
ae9e757a
JD
116492011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11650
11651 * Makefile.in (LIB_PTHREAD): New variable.
11652 (LIBES): Add LIB_PTHREAD (Bug#9216).
11653
11654 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11655 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11656
213bd7f2
AS
116572011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11658
6b02f655 11659 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 11660
99aaf75f
JD
116612011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11662
11663 * xterm.c (x_find_topmost_parent): New function.
11664 (x_set_frame_alpha): Find topmost parent window with
11665 x_find_topmost_parent and set the property there also (bug#9181).
11666 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11667
c74e9d86
PE
116682011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11669
11670 * callproc.c (Fcall_process): Avoid vfork clobbering
11671 the local vars buffer, coding_systems, current_dir.
11672
640c8776
SM
116732011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11674
11675 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11676
f26d0e4c
PE
116772011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11678
8a10d76c
PE
11679 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11680 so that it is not optimized away.
11681
f26d0e4c
PE
11682 * xdisp.c (compute_display_string_pos): Remove unused local.
11683
55439c61
EZ
116842011-08-02 Eli Zaretskii <eliz@gnu.org>
11685
11686 Fix slow cursor motion and scrolling in large buffers with
11687 selective display, like Org Mode buffers. (Bug#9218)
11688
11689 * dispextern.h (struct bidi_it): New member disp_prop_p.
11690
11691 * xdisp.c: Remove one-slot cache of display string positions.
11692 (compute_display_string_pos): Accept an additional argument
5e617bc2 11693 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
11694 for a display string or property. If found, set DISP_PROP_P
11695 non-zero.
11696
11697 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
11698 DISP_PROP_P, and pass it to compute_display_string_pos.
11699 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
11700 non-zero. All callers of bidi_fetch_char changed.
11701
fb33fa43
SM
117022011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11703
11704 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11705
b099e063
DM
117062010-12-03 Don March <don@ohspite.net>
11707
11708 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11709 last character M-[char] is translated to ESC [char] (bug#7541).
11710
5cc7f7af
KH
117112011-08-02 Kenichi Handa <handa@m17n.org>
11712
d0fffa3f 11713 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
11714
11715 * chartab.c (uniprop_table): Make it non-static.
11716
525d5e6e
EZ
117172011-08-01 Eli Zaretskii <eliz@gnu.org>
11718
11719 * xdisp.c (forward_to_next_line_start): Accept additional argument
11720 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11721 on the newline.
11722 (reseat_at_next_visible_line_start): Use the bidi iterator state
11723 returned by forward_to_next_line_start to restore the state of
11724 it->bidi_it after backing up to previous newline. (Bug#9212)
11725
31011111
AS
117262011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11727
11728 * regex.c (re_comp): Protoize.
11729 (re_exec): Fix return type.
11730 (regexec): Fix type of `ret'. (Bug#9203)
11731
476371c4
PE
117322011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11733
e5d76069
PE
11734 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11735 This is needed if max-image-size is a floating-point number.
11736
9a79b20c
AS
117372011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11738
11739 * print.c (print_object): Print empty symbol as ##.
11740
11741 * lread.c (read1): Read ## as empty symbol.
11742
d8c2fa78
AA
117432011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11744
11745 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11746 setting frame foreground color (Bug#9175).
11747 (x_set_background_color): Likewise.
11748
ffe57a7a
AA
11749 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11750 contents (Bug#9176).
11751 (EmacsTooltip -init): Remove bezels and add shadows to
11752 tooltip windows.
11753
bf3492a5
AA
11754 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11755 or scroll bar (Bug#8470).
11756
d55e9c53
AA
11757 * nsfont.m (nsfont_open): Remove assignment to voffset and
11758 unnecessary vars hshink, expand, hd, full_height, min_height.
11759 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11760
11761 * nsterm.h (nsfont_info): Remove voffset field.
11762
d8c2fa78 117632011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
11764
11765 Implement strike-through and overline on NextStep (Bug#8863).
11766
11767 * nsfont.m (nsfont_open): Use underline position provided by font,
11768 instead of hard-coded value of 2.
11769 (nsfont_draw): Call ns_draw_text_decoration instead.
11770
11771 * nsterm.h: Add declaration for ns_draw_text_decoration.
11772
11773 * nsterm.m (ns_draw_text_decoration): New function for drawing
11774 underline, overline, and strike-through.
11775 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11776 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 11777 accommodate underlining, etc.
4843aac3 11778
4cc60b9b
EZ
117792011-07-28 Eli Zaretskii <eliz@gnu.org>
11780
bc7ece87
EZ
11781 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11782 default.
4cc60b9b 11783
476371c4
PE
117842011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11785
66606eea
PE
11786 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11787 Without this fix, if a signal arrives just after memory fills up,
11788 'malloc' might be invoked reentrantly.
11789
476371c4
PE
11790 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11791 In other words, assume that every image size is allowed, on non-X
11792 hosts. This assumption is probably wrong, but it lets Emacs compile.
11793
f3fcc40d
AS
117942011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11795
11796 * regex.c (re_iswctype): Convert return values to boolean.
11797
350c992f
EZ
117982011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11799
11800 * xdisp.c (compute_display_string_pos): Don't use cached display
11801 string position if the buffer had its restriction changed.
11802 (Bug#9184)
11803
5266b4bb
PE
118042011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11805
11806 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11807
2573a837 118082011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 11809
41f55ccd 11810 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 11811
39e378da
PE
11812 * bidi.c: Integer size and overflow fixes.
11813 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11814 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11815 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11816 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11817 (bidi_find_other_level_edge):
11818 Use ptrdiff_t instead of EMACS_INT where either will do.
11819 This works better on 32-bit hosts configured --with-wide-int.
11820 (bidi_cache_ensure_space): Check for size-calculation overflow.
11821 Use % rather than repeated addition, for better worst-case speed.
11822 Don't set bidi_cache_size until after xrealloc returns, because it
11823 might not return.
11824 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
11825 (bidi_cache_ensure_space): Also check that the bidi cache size
11826 does not exceed that of the largest Lisp string or buffer. See Eli
11827 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 11828
5e927815
PE
11829 * alloc.c (__malloc_size_t): Remove.
11830 All uses replaced by size_t. See Andreas Schwab's note
11831 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11832
ca4aa935
PE
11833 * image.c: Improve checking for integer overflow.
11834 (check_image_size): Assume that f is nonnull, since
11835 it is always nonnull in practice. This is one less thing to
11836 worry about when checking for integer overflow later.
11837 (x_check_image_size): New function, which checks for integer
11838 overflow issues inside X.
11839 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11840 This removes the need for a memory_full check.
11841 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11842 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11843 (xbm_read_bitmap_data): Change locals back to 'int', since
11844 their values must fit in 'int'.
11845 (xpm_load_image, png_load, tiff_load):
11846 Invoke x_create_x_image_and_pixmap earlier,
11847 to avoid much needless work if the image is too large.
11848 (tiff_load): Treat overly large images as if
11849 x_create_x_image_and_pixmap failed, not as malloc failures.
11850 (gs_load): Use x_check_image_size.
11851
5f8f9cc2
PE
11852 * gtkutil.c: Omit integer casts.
11853 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11854 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11855
5adf60bc
PE
11856 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11857
c8907a93
PE
11858 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11859 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11860 would wrongly return t on a 64-bit host.
11861
e3c25c68
PE
11862 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11863 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11864 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11865 and therefore cause GCC to emit a bogus diagnostic in some cases.
11866
3f791afe
PE
11867 * image.c: Integer signedness and overflow and related fixes.
11868 This is not an exhaustive set of fixes, but it's time to
11869 record what I've got.
11870 (lookup_pixel_color, check_image_size): Remove redundant decls.
11871 (check_image_size): Don't assume that arbitrary EMACS_INT values
11872 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11873 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11874 (tiff_load, imagemagick_load_image):
11875 Check for overflow in size calculations.
11876 (x_create_x_image_and_pixmap): Remove unnecessary test for
11877 xmalloc returning NULL; that can't happen.
11878 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11879 (xpm_color_bucket): Use better integer hashing function.
11880 (xpm_cache_color): Don't possibly over-allocate memory.
11881 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11882 (gif_memory_source):
11883 Use ptrdiff_t, not int or size_t, to record sizes.
11884 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11885 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11886 either works, as we prefer signed integers.
11887 (tiff_read_from_memory, tiff_write_from_memory):
11888 Return tsize_t, not size_t, since that's what the TIFF API wants.
11889 (tiff_read_from_memory): Don't fail simply because the read would
11890 go past EOF; instead, return a short read.
11891 (tiff_load): Omit no-longer-needed casts.
11892 (Fimagemagick_types): Don't assume size fits into 'int'.
11893
3cc5a532
PE
11894 Improve hashing quality when configured --with-wide-int.
11895 * fns.c (hash_string): New function, taken from sxhash_string.
11896 Do not discard information about ASCII character case; this
11897 discarding is no longer needed.
11898 (sxhash-string): Use it. Change sig to match it. Caller changed.
11899 * lisp.h: Declare it.
11900 * lread.c (hash_string): Remove, since we now use fns.c's version.
11901 The fns.c version returns a wider integer if --with-wide-int is
11902 specified, so this should help the quality of the hashing a bit.
11903
b312a492
PE
11904 * emacs.c: Integer overflow minor fix.
11905 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11906 Define only if GNU_LINUX.
11907 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11908
dfd153ae
PE
11909 * dispnew.c: Integer signedness and overflow fixes.
11910 Remove unnecessary forward decls, that were a maintenance hassle.
11911 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11912 All uses changed.
11913 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11914 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11915 (prepare_desired_row, line_draw_cost):
11916 Use int, not unsigned, where either works.
11917 (save_current_matrix, restore_current_matrix):
11918 Use ptrdiff_t, not size_t, where either works.
11919 (init_display): Check for overflow more accurately, and without
11920 relying on undefined behavior.
11921
a81d11a3
PE
11922 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11923 Remove, replacing with the new symbols in lisp.h. All uses changed.
11924 * fileio.c (make_temp_name):
11925 * filelock.c (lock_file_1, lock_file):
11926 * xdisp.c (message_dolog):
11927 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11928 Use pMd etc. instead.
11929 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11930 replacing the pWIDE etc. symbols removed from editfns.c.
11931
3300e6fd
PE
11932 * keyboard.h (num_input_events): Now uintmax_t.
11933 This is (very slightly) less likely to mess up due to wraparound.
11934 All uses changed.
11935
fd05c7e9
PE
11936 * buffer.c: Integer signedness fixes.
11937 (alloc_buffer_text, enlarge_buffer_text):
11938 Use ptrdiff_t rather than size_t when either will do, as we prefer
11939 signed integers.
11940
903fe15d
PE
11941 * alloc.c: Integer signedness and overflow fixes.
11942 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11943 (__malloc_size_t): Default to size_t, not to int.
11944 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11945 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11946 Prefer ptrdiff_t to size_t when either would do, as we prefer
11947 signed integers.
11948 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11949 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11950 Now const. Initialize with values that are in range even if char
11951 is signed.
11952 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11953 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11954 These functions do the right thing with sizes > 2**32.
11955 (check_depth): Now ptrdiff_t, not int.
11956 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11957 Adjust to new way of storing sizes. Check for size overflow bugs
11958 in rest of code.
11959 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11960 slightly wrong anyway, as it missed one instance of
11961 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11962 (refill_memory_reserve): Omit needless cast to size_t.
11963 (mark_object_loop_halt): Mark as externally visible.
11964
ac82cc6a
PE
11965 * xselect.c: Integer signedness and overflow fixes.
11966 (Fx_register_dnd_atom, x_handle_dnd_message):
11967 Use ptrdiff_t, not size_t, since we prefer signed.
11968 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11969 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11970 x_dnd_atoms_size and x_dnd_atoms_length.
11971
c2d1e36d
PE
11972 * doprnt.c: Prefer signed to unsigned when either works.
11973 * eval.c (verror):
11974 * doprnt.c (doprnt):
11975 * lisp.h (doprnt):
11976 * xdisp.c (vmessage):
11977 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11978 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11979 prefer signed arithmetic to avoid comparison confusion.
11980 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11981 but is a bit tricky.
11982
0e926e56
PE
11983 Assume freestanding C89 headers, string.h, stdlib.h.
11984 * data.c, doprnt.c, floatfns.c, print.c:
11985 Include float.h unconditionally.
11986 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11987 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11988 * regex.c: Likewise for stddef.h, string.h.
11989 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11990 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11991 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11992 (STDC_HEADERS): Remove obsolete defines.
11993 * sysdep.c: Include limits.h unconditionally.
11994
9cfdb3ec
PE
11995 Assume support for memcmp, memcpy, memmove, memset.
11996 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11997 * regex.c (memcmp, memcpy):
11998 Remove; we assume C89 now.
11999
12000 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12001 (__malloc_safe_bcopy): Remove; no longer needed.
12002
cf950e6b 12003 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
12004 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12005 well either way, and we prefer signed to unsigned.
12006
dbf38e02
LMI
120072011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12008
12009 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12010 closes the connection while we're reading (bug#9182).
12011
d6f0886c 120122011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 12013
d6f0886c
JD
12014 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12015 are specified (Bug#9168).
24e0f6b1 12016
2eb1f9e6
PE
120172011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12018
12019 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12020 Found by GCC static checking and --with-wide-int on a 32-bit host.
12021
22381272 120222011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
12023
12024 * xdisp.c (compute_display_string_pos): Fix logic of caching
12025 previous display string position. Initialize cached_prev_pos to
12026 -1. Fixes slow-down at the beginning of a buffer.
12027
f25e39b4
EZ
120282011-07-24 Eli Zaretskii <eliz@gnu.org>
12029
12030 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12031 for attrs[LFACE_FONTSET_INDEX].
12032
04c4b52e
PE
120332011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12034
12035 * xml.c (parse_region): Remove unused local
12036 that was recently introduced.
12037
c1734fbd
EZ
120382011-07-23 Eli Zaretskii <eliz@gnu.org>
12039
be18c5a5
EZ
12040 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12041 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12042
c1734fbd
EZ
12043 * xdisp.c (move_it_in_display_line_to): Record the best matching
12044 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
12045 exit if none of the characters scanned was an exact match.
12046 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
12047 when exact match is impossible due to invisible text, and the
12048 lines are truncated.
12049
a258d627
JD
120502011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12051
12052 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12053 for OSX >= 10.7.
12054
b6d5a689
EZ
120552011-07-22 Eli Zaretskii <eliz@gnu.org>
12056
0f74f785
EZ
12057 Fix a significant slow-down of cursor motion with C-n, C-p,
12058 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12059 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 12060 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
12061 (next_element_from_buffer): Call compute_stop_pos_backwards to
12062 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
12063 base_level_stop.
12064 (reseat): Don't look for prev_stop, as that could mean a very long
12065 run.
12066 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12067 <cached_disp_overlay_modiff>: Cache for last found display string
12068 position.
551918c1 12069 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
12070 about the same buffer in the same area of character positions, and
12071 the buffer wasn't changed since the time the display string
12072 position was cached.
551918c1 12073
b2d0c91a
EZ
120742011-07-22 Eli Zaretskii <eliz@gnu.org>
12075
12076 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12077 is an integer, which is important for empty lines. (Bug#9149)
12078
043604ee
CY
120792011-07-22 Chong Yidong <cyd@stupidchicken.com>
12080
12081 * frame.c (Fmodify_frame_parameters): In tty case, update the
12082 default face if necessary (Bug#4238).
12083
da4adb04
CY
120842011-07-21 Chong Yidong <cyd@stupidchicken.com>
12085
12086 * editfns.c (Fstring_to_char): No need to explain what a character
12087 is in the docstring (Bug#6576).
12088
9abd0532
LMI
120892011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12090
12091 * xml.c (parse_region): Make sure we always return a tree.
12092
36881d16
HK
120932011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12094
12095 * xml.c (parse_region): If a document contains only comments,
12096 return that, too.
12097
1e98674d
LMI
120982011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12099
12100 * xml.c (make_dom): Return comments, too.
12101
590bd467
PE
121022011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12103
12104 Port to OpenBSD.
12105 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12106 and the surrounding thread.
12107 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12108 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12109 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12110 timer goes off.
12111 * s/openbsd.h (BROKEN_SIGIO): Define.
12112 * unexelf.c (unexec) [__OpenBSD__]:
12113 Don't update the .mdebug section of the Alpha COFF symbol table.
12114
f41628b2
LMI
121152011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12116
12117 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12118 (bug#8460).
12119
b59b67c5
PE
121202011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12121
15e3a074
PE
12122 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12123 This fixes some race conditions on the permissions of any newly
12124 created file.
12125
41bed37d
PE
12126 * alloc.c (valid_pointer_p): Use pipe, not open.
12127 This fixes some permissions issues when debugging.
12128
b59b67c5
PE
12129 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12130 If fchown fails to set both uid and gid, try to set just gid,
12131 as that is sometimes allowed. Adjust the file's mode to eliminate
12132 setuid or setgid bits that are inappropriate if fchown fails.
12133
925a6be7
SM
121342011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12135
12136 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12137 to compare Lisp_Objects.
12138 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12139 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12140 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12141
52968808
AS
121422011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12143
0a6a104b
AS
12144 * lread.c (read_integer): Unread even EOF character.
12145 (read1): Likewise. Properly record start position of symbol.
12146
52968808
AS
12147 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12148 symbol character follows.
12149
9e381cdd
PE
121502011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12151
12152 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12153 This works around a problem with the previous change to Fcopy_file.
12154 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12155 and without this change, GCC might complain about discarding
12156 fchown's return value.
12157
b5641435
JB
121582011-07-16 Juanma Barranquero <lekktu@gmail.com>
12159
12160 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12161
a8031457
PE
121622011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12163
12164 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12165
dd889327
LMI
121662011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12167
750c33f7
LMI
12168 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12169 it's used from the C level.
12170
dd889327
LMI
12171 * process.c: Use the same condition for POLL_FOR_INPUT in both
12172 keyboard.c and process.c (bug#1858).
12173
87e86684
LM
121742011-07-09 Lawrence Mitchell <wence@gmx.li>
12175
12176 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12177 (Fgnutls_boot): Use it.
12178
64348f40
AS
121792011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12180
12181 * doc.c (Fsubstitute_command_keys): Revert last change.
12182
1d698799
LMI
121832011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12184
f863868c
LMI
12185 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12186 quotes the next character, and doesn't affect other longer
12187 sequences (bug#8935).
12188
1d698799
LMI
12189 * lread.c (syms_of_lread): Clarify that is isn't only
12190 `eval-buffer' and `eval-defun' that's affected by
12191 `lexical-binding' (bug#8460).
12192
aa4b6df6
EZ
121932011-07-15 Eli Zaretskii <eliz@gnu.org>
12194
12195 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 12196 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 12197
5d856da6
PE
121982011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12199
ad6042bb
PE
12200 Fix minor problems found by static checking.
12201 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12202 (elsz): Now a signed constant, not a size_t var. We prefer signed
12203 types to unsigned, to avoid integer comparison confusion. Without
12204 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12205 "cannot optimize loop, the loop counter may overflow", a symptom
12206 of the confusion.
f00bbb22 12207 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
12208 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12209
6468f31c
LMI
122102011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12211
49080b10
LMI
12212 * search.c (Fre_search_backward): Mention `case-fold-search' in
12213 all the re_search_* functions (bug#8138).
12214
6468f31c
LMI
12215 * keyboard.c (Fopen_dribble_file): Document when the file is
12216 closed (bug#8056).
12217
c965adc5
EZ
122182011-07-14 Eli Zaretskii <eliz@gnu.org>
12219
df9733bf
EZ
12220 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12221 bidi_cache_idx.
12222
0bb23927
EZ
12223 Support bidi reordering of display and overlay strings.
12224 * xdisp.c (compute_display_string_pos)
12225 (compute_display_string_end): Accept additional argument STRING.
12226 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12227 (reseat_to_string): Initialize bidi_it->string.s and
12228 bidi_it->string.schars.
12229 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
12230 NULL (avoids a crash in bidi_paragraph_init).
12231 Initialize itb.string.lstring.
0bb23927
EZ
12232 (init_iterator): Call bidi_init_it only of a valid
12233 buffer position was specified. Initialize paragraph_embedding to
12234 L2R.
12235 (reseat_to_string): Initialize the bidi iterator.
12236 (display_string): If we need to ignore text properties of
12237 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12238 original value of -1 will not work with bidi.)
12239 (compute_display_string_pos): First arg is now struct
12240 `text_pos *'; all callers changed. Support display properties on
12241 Lisp strings.
12242 (compute_display_string_end): Support display properties on Lisp
12243 strings.
12244 (init_iterator, reseat_1, reseat_to_string): Initialize the
12245 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12246 when iterating on a string not from display properties).
640c8776
SM
12247 (compute_display_string_pos, compute_display_string_end):
12248 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
12249 arrow keys.
12250 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
12251 base_level_stop; instead, set base_level_stop to BEGV.
12252 Fixes crashes in vertical-motion.
0bb23927
EZ
12253 (next_element_from_buffer): Improve commentary for when
12254 the iterator is before prev_stop.
12255 (init_iterator): Initialize bidi_p from the default value of
12256 bidi-display-reordering, not from buffer-local value. Use the
12257 buffer-local value only if initializing for buffer iteration.
12258 (handle_invisible_prop): Support invisible properties on strings
12259 that are being bidi-reordered.
12260 (set_iterator_to_next): Support bidi reordering of C strings and
12261 Lisp strings.
12262 (next_element_from_string): Support bidi reordering of Lisp
12263 strings.
12264 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
12265 (display_string): Support display of R2L glyph rows.
12266 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
12267 (init_iterator): Don't initialize it->bidi_p for strings
12268 here.
12269 (reseat_to_string): Initialize it->bidi_p for strings here.
12270 (next_element_from_string, next_element_from_c_string)
12271 (next_element_from_buffer): Add xassert's for correspondence
12272 between IT's object being iterated and it->bidi_it.string
12273 structure.
12274 (face_before_or_after_it_pos): Support bidi iteration.
12275 (next_element_from_c_string): Handle the case of the first string
12276 character that is not the first one in the visual order.
12277 (get_visually_first_element): New function, refactored from common
12278 parts of next_element_from_buffer, next_element_from_string, and
12279 next_element_from_c_string.
12280 (tool_bar_lines_needed, redisplay_tool_bar)
12281 (display_menu_bar): Force left-to-right direction. Add a FIXME
12282 comment for making that be controlled by a user option.
12283 (push_it, pop_it): Save and restore the state of the
12284 bidi iterator. Save and restore the bidi_p flag.
12285 (pop_it): Iterate out of display property for string iteration as
12286 well.
12287 (iterate_out_of_display_property): Support iteration over strings.
12288 (handle_single_display_spec): Set up it->bidi_it for iteration
12289 over a display string, and call bidi_init_it.
12290 (handle_single_display_spec, next_overlay_string)
12291 (get_overlay_strings_1, push_display_prop): Set up the bidi
12292 iterator for displaying display or overlay strings.
12293 (forward_to_next_line_start): Don't use the shortcut if
12294 bidi-iterating.
12295 (back_to_previous_visible_line_start): If handle_display_prop
12296 pushed the iterator stack, restore the internal state of the bidi
12297 iterator by calling bidi_pop_it same number of times.
12298 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12299 and we are bidi-iterating, don't decrement the iterator position;
12300 instead, set the first_elt flag in the bidi iterator, to produce
12301 the same effect.
12302 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12303 (push_display_prop): xassert that we are iterating a buffer.
12304 (push_it, pop_it): Save and restore paragraph_embedding member.
12305 (handle_single_display_spec, next_overlay_string)
12306 (get_overlay_strings_1, reseat_1, reseat_to_string)
12307 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12308 correctly. Don't assume unibyte strings are not bidi-reordered.
12309 (compute_display_string_pos)
12310 (compute_display_string_end): Fix handling the case of C string.
12311 (push_it, pop_it): Save and restore from_disp_prop_p.
12312 (handle_single_display_spec, push_display_prop): Set the
12313 from_disp_prop_p flag.
12314 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12315 (pop_it): Call iterate_out_of_display_property only if we are
12316 popping after iteration over a string that came from a display
12317 property. Fix a typo in popping stretch info. Add an assertion
12318 for verifying that the iterator position is in sync with the bidi
12319 iterator.
12320 (handle_single_display_spec, get_overlay_strings_1)
12321 (push_display_prop): Fix initialization of paragraph direction for
12322 string when that of the parent object is not yet determined.
12323 (reseat_1): Call bidi_init_it to resync the bidi
12324 iterator with IT's position. (Bug#7616)
12325 (find_row_edges): If ROW->start.pos gives position
12326 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12327 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12328 Reset the from_disp_prop_p flag.
12329 (SAVE_IT, RESTORE_IT): New macros.
12330 (pos_visible_p, face_before_or_after_it_pos)
12331 (back_to_previous_visible_line_start)
12332 (move_it_in_display_line_to, move_it_in_display_line)
12333 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12334 (try_scrolling, redisplay_window, display_line): Use them when
12335 saving a temporary copy of the iterator and restoring it back.
12336 (back_to_previous_visible_line_start, reseat_1)
12337 (init_iterator): Empty the bidi cache "stack".
12338 (move_it_in_display_line_to): If iterator ended up at
12339 EOL, but we never saw any buffer positions smaller than
12340 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12341 motion in bidi-reordered lines.
12342 (move_it_in_display_line_to): Record prev_method and prev_pos
12343 immediately before the call to set_iterator_to_next. Fixes cursor
12344 motion in bidi-reordered lines with stretch glyphs and strings
12345 displayed in margins. (Bug#8133) (Bug#8867)
12346 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12347 TO_CHARPOS.
640c8776
SM
12348 (pos_visible_p): Support positions in bidi-reordered lines.
12349 Save and restore bidi cache.
0bb23927
EZ
12350
12351 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12352 (bidi_paragraph_info): Delete unused struct.
12353 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12354 (bidi_cache_start): New variable.
12355 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12356 to zero.
12357 (bidi_cache_fetch_state, bidi_cache_search)
12358 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12359 (bidi_cache_find, bidi_peek_at_next_level)
12360 (bidi_level_of_next_char, bidi_find_other_level_edge)
12361 (bidi_move_to_visually_next): Compare cache index with
12362 bidi_cache_start rather than with zero.
12363 (bidi_fetch_char): Accept new argument STRING; all callers
12364 changed. Support iteration over a string. Support strings with
12365 display properties. Support unibyte strings. Fix the type of
12366 `len' according to what STRING_CHAR_AND_LENGTH expects.
12367 (bidi_paragraph_init, bidi_resolve_explicit_1)
12368 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
12369 (bidi_level_of_next_char, bidi_move_to_visually_next):
12370 Support iteration over a string.
0bb23927
EZ
12371 (bidi_set_sor_type, bidi_resolve_explicit_1)
12372 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12373 can now be zero (for strings); special values 0 and -1 were
12374 changed to -1 and -2, respectively.
12375 (bidi_char_at_pos): New function.
12376 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12377 Call it instead of FETCH_MULTIBYTE_CHAR.
12378 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12379 initialized to valid values.
12380 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12381 values.
12382 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12383 the test for valid cached positions. Fix the logic for looking up
12384 the sentinel state in the cache. GCPRO the Lisp string we are
12385 iterating.
12386 (bidi_push_it, bidi_pop_it): New functions.
12387 (bidi_initialize): Initialize the bidi cache start stack pointer.
12388 (bidi_cache_ensure_space): New function, refactored from part of
12389 bidi_cache_iterator_state. Don't assume the required size is just
12390 one BIDI_CACHE_CHUNK away.
12391 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12392 (bidi_count_bytes, bidi_char_at_pos): New functions.
12393 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12394 always valid if bidi_cache_idx is valid.
12395 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12396 is valid if it's going to be used.
12397 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12398 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
12399 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12400 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
12401 (bidi_find_other_level_edge, bidi_cache_start_stack):
12402 All variables related to cache indices are now EMACS_INT.
c965adc5 12403
0bb23927
EZ
12404 * dispextern.h (struct bidi_string_data): New structure.
12405 (struct bidi_it): New member `string'. Make flag members be 1-bit
12406 fields, and put them last in the struct.
640c8776
SM
12407 (compute_display_string_pos, compute_display_string_end):
12408 Update prototypes.
0bb23927
EZ
12409 (bidi_push_it, bidi_pop_it): Add prototypes.
12410 (struct iterator_stack_entry): New members bidi_p,
12411 paragraph_embedding, and from_disp_prop_p.
12412 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
12413 (bidi_shelve_cache, bidi_unshelve_cache):
12414 Declare prototypes.
0bb23927
EZ
12415
12416 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12417 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12418 and vector-like objects.
12419
12420 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12421 cache around display iteration.
12422
12423 * window.c (Fwindow_end, window_scroll_pixel_based)
12424 (displayed_window_lines, Frecenter): Save and restore the bidi
12425 cache around display iteration.
12426
3bbd2265
LMI
124272011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12428
12429 * editfns.c (Fdelete_region): Clarify the use of the named
12430 parameters (bug#6788).
12431
adc47434
MR
124322011-07-14 Martin Rudalics <rudalics@gmx.at>
12433
12434 * indent.c (Fvertical_motion): Set and restore w->pointm when
12435 saving and restoring the window's buffer (Bug#9006).
12436
837c31f8
LMI
124372011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12438
12439 * editfns.c (Fstring_to_char): Clarify just what is returned
12440 (bug#6576). Text by Eli Zaretskii.
12441
ac389d0c
JB
124422011-07-13 Juanma Barranquero <lekktu@gmail.com>
12443
12444 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12445
0be0ce47
EZ
124462011-07-13 Eli Zaretskii <eliz@gnu.org>
12447
12448 * buffer.c (mmap_find): Fix a typo.
12449
cd18e7e3
JB
124502011-07-13 Johan Bockgård <bojohan@gnu.org>
12451
12452 Fix execution of x selection hooks.
12453 * xselect.c (Qx_lost_selection_functions)
12454 (Qx_sent_selection_functions): New vars.
12455 (syms_of_xselect): DEFSYM them.
12456 (x_handle_selection_request): Pass Qx_sent_selection_functions
12457 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12458 (x_handle_selection_clear,x_clear_frame_selections):
12459 Pass Qx_lost_selection_functions rather than
12460 Vx_lost_selection_functions to Frun_hook_with_args.
12461
47ea7f44
PE
124622011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12463
ac389d0c 12464 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
12465 The old code sometimes used this field without initializing it.
12466
47ea7f44
PE
12467 * alloc.c (gc_sweep): Don't read past end of array.
12468 In theory, the old code could also have corrupted Emacs internals,
12469 though it'd be very unlikely.
12470
bc985c87
AS
124712011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12472
12473 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 12474 argument. (Bug#4026)
bc985c87 12475
0cf34688
LMI
124762011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12477
b3dadd76
LMI
12478 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12479 key" (bug#4257).
12480
0cf34688
LMI
12481 * window.c (Fset_window_start): Doc fix (bug#4199).
12482 (Fset_window_hscroll): Ditto.
12483
270768cd
PE
124842011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12485
077e3dda 12486 Fix minor new problems caught by GCC 4.6.1.
270768cd 12487 * term.c (init_tty): Remove unused local.
490011a6 12488 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 12489 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 12490 not used otherwise.
270768cd 12491
b1f58454
CY
124922011-07-12 Chong Yidong <cyd@stupidchicken.com>
12493
12494 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12495
22b9578d
LMI
124962011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12497
6e70ab07
LMI
12498 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12499 are the mini-buffer and the echo area (bug#3320).
12500
22b9578d
LMI
12501 * term.c (init_tty): Remove support for supdup, c10 and perq
12502 terminals, which are no longer supported (bug#1482).
12503
8974cc9f
JB
125042011-07-10 Johan Bockgård <bojohan@gnu.org>
12505
12506 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12507
a560d974
JD
125082011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12509
12510 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12511 for non-popups (Bug#3642).
12512
1dae0f0a
AS
125132011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12514
268c2c36 12515 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 12516 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
12517 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12518 * cm.c (losecursor): Likewise.
1dae0f0a
AS
12519 * data.c (fmod): Likewise.
12520 * dispnew.c (swap_glyphs_in_rows): Likewise.
12521 * emacs.c (memory_warning_signal): Likewise.
12522 * floatfns.c (float_error): Likewise.
12523 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12524 (otf_open, font_otf_capability, generate_otf_features)
12525 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12526 Likewise.
12527 * image.c (pbm_read_file): Likewise.
12528 * indent.c (string_display_width): Likewise.
12529 * intervals.c (check_for_interval, search_for_interval)
12530 (inc_interval_count, count_intervals, root_interval)
12531 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12532 * lread.c (defalias): Likewise.
268c2c36 12533 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
12534 * regex.c (set_image_of_range_1, set_image_of_range)
12535 (regex_grow_registers): Likewise.
12536 * sysdep.c (strerror): Likewise.
12537 * termcap.c (valid_filename_p, tprint, main): Likewise.
12538 * tparam.c (main): Likewise.
12539 * unexhp9k800.c (run_time_remap, save_data_space)
12540 (update_file_ptrs, read_header, write_header, calculate_checksum)
12541 (copy_file, copy_rest, display_header): Likewise.
12542 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12543 Likewise.
12544 * xdisp.c (check_it): Likewise.
12545 * xfaces.c (register_color, unregister_color, unregister_colors):
12546 Likewise.
12547 * xfns.c (print_fontset_result): Likewise.
12548 * xrdb.c (member, fatal, main): Likewise.
12549
99033785
PE
125502011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12551
12552 Fix minor problems found by static checking (Bug#9031).
12553 * chartab.c (char_table_set_range, map_sub_char_table):
12554 Remove unused locals.
12555 (uniprop_table): Now static.
12556 * composite.c (_work_char): Remove unused static var.
12557
9cb2ac56
JB
125582011-07-09 Juanma Barranquero <lekktu@gmail.com>
12559
12560 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12561
f25661f0
JD
125622011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12563
12564 * gtkutil.c (qttip_cb): Remove code without function.
12565
8278c4fe
EZ
125662011-07-09 Eli Zaretskii <eliz@gnu.org>
12567
12568 * w32.c (pthread_sigmask): New stub.
12569
1692ae2d 125702011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 12571
8a6ebd58 12572 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
12573 sigprocmask is portable only for single-threaded applications, and
12574 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
12575 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12576 (LIBES): Use it.
12577 * callproc.c (Fcall_process):
12578 * process.c (create_process):
12579 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12580 Use pthread_sigmask, not sigprocmask.
123403e4 12581
1b854618
JD
125822011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12583
12584 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12585 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12586 wrong (Bug#8591).
12587
3fe4b549
JD
125882011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12589
0ce7e563
JD
12590 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12591 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12592 (xg_hide_tooltip): Fix comment.
12593
3fe4b549
JD
12594 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12595 in registerServicesMenuSendTypes.
12596 (validRequestorForSendType): Don't check ns_return_types.
12597
12598 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12599 ns_return_type.
12600
5df75e47
JR
126012011-07-08 Jason Rumney <jasonr@gnu.org>
12602
22610910
JR
12603 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12604 SH_SHOW for hidden windows (Bug#5482).
12605
5df75e47
JR
12606 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12607 frame struct members of non-existent frames (Bug#6284).
12608
699c10bd
JD
126092011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12610
4393663b
JD
12611 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12612 variable firstTime not needed on OSX >= 10.6.
12613 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12614 >= 10.5. Use setKnobProportion, setDoubleValue.
12615
12616 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12617 (MAC_OS_X_VERSION_10_5): Define if not defined.
12618 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12619 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12620 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12621
12622 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 12623 cString and lossyCString on OSX >= 10.4.
4393663b 12624
58179cce 12625 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
12626 sizeToFit on OSX >= 10.2.
12627
12628 * nsimage.m (allocInitFromFile): Don't use deprecated method
12629 bestRepresentationForDevice on OSX >= 10.6.
12630
12631 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12632 to avoid warning.
12633
12634 * emacs.c: Declare unexec_init_emacs_zone.
12635
a63e0781
JD
12636 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12637
699c10bd
JD
12638 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12639
12640 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12641 on svcsMenu (Bug#8842).
12642
12643 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12644 ns_return_types.
12645 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12646
12647 * nsterm.m (QUTF8_STRING): Declare.
12648 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12649 (validRequestorForSendType): Return type is (id).
12650 Change indexOfObjectIdenticalTo to indexOfObject.
12651 Check if we have local selection before returning self (Bug#8842).
12652 (writeSelectionToPasteboard): Put local selection into paste board
12653 if we have a local selection (Bug#8842).
12654 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12655
12656 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12657 (ns_get_local_selection): Declare.
12658
54e10184
LMI
126592011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12660
9888ff71
LMI
12661 * keymap.c (describe_map_tree): Don't insert a double newline at
12662 the end of the buffer (bug#1169) and return whether we inserted
12663 something.
12664
54e10184
LMI
12665 * callint.c (Fcall_interactively): Change "reading args" to
12666 "providing args" to try to clarify what it does (bug#1010).
12667
15fa4783
KH
126682011-07-07 Kenichi Handa <handa@m17n.org>
12669
12670 * composite.c (composition_compute_stop_pos): Ignore a static
12671 composition starting before CHARPOS (Bug#8915).
12672
12673 * xdisp.c (handle_composition_prop): Likewise.
12674
a8815b00
EZ
126752011-07-07 Eli Zaretskii <eliz@gnu.org>
12676
12677 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12678 (Bug#9015)
12679
ef7b981d 126802011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
12681
12682 * character.h (unicode_category_t): New enum type.
12683
12684 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12685 (Qchar_code_property_table): New variable.
12686 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12687 (UNIPROP_COMPRESSED_FORM_P): New macros.
12688 (char_table_ascii): Uncompress the compressed values.
12689 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12690 Uncompress the compressed values.
ac389d0c 12691 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
12692 (char_table_ref_and_range): Uncompress the compressed values.
12693 (sub_char_table_set): New arg is_uniprop. Callers changed.
12694 Uncompress the compressed values.
12695 (sub_char_table_set_range): Args changed. Callers changed.
12696 (char_table_set_range): Adjuted for the above change.
12697 (map_sub_char_table): Delete args default_val and parent. Add arg
12698 top. Give decoded values to a Lisp function.
640c8776 12699 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
12700 values to a Lisp function. Gcpro more variables.
12701 (uniprop_table_uncompress)
12702 (uniprop_decode_value_run_length): New functions.
12703 (uniprop_decoder, uniprop_decoder_count): New variables.
12704 (uniprop_get_decoder, uniprop_encode_value_character)
12705 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12706 New functions.
12707 (uniprop_encoder, uniprop_encoder_count): New variables.
12708 (uniprop_get_encoder, uniprop_table)
12709 (Funicode_property_table_internal, Fget_unicode_property_internal)
12710 (Fput_unicode_property_internal): New functions.
12711 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12712 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 12713 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
12714 char-code-property-alist.
12715
640c8776 12716 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
12717 Vunicode_category_table.
12718
640c8776 12719 * font.c (font_range): Adjust for the change of
c805dec0
KH
12720 Vunicode_category_table.
12721
76b397fb
DN
127222011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12723
12724 * m/iris4d.h: Remove file, move contents ...
12725 * s/irix6-5.h: ... here.
12726
22b4128e
PE
127272011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12728
12729 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
12730 * alloc.c (mark_buffer):
12731 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12732 (clone_per_buffer_values): Don't assume that
22b4128e
PE
12733 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12734 This isn't true in general, and it's particularly not true
12735 if Emacs is configured with --with-wide-int.
12736 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12737 New macros, used in the buffer.c change.
12738
869795d6
JD
127392011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12740
12741 * xsettings.c: Use both GConf and GSettings if both are available.
12742 (store_config_changed_event): Add comment.
12743 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12744 (store_tool_bar_style_changed): New functions.
5e617bc2 12745 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
12746 (struct xsettings): Move font inside HAVE_XFT.
12747 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 12748 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 12749 Move inside HAVE_XFT.
640c8776 12750 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
12751 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12752 also.
12753 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 12754 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 12755 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
12756 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12757 (parse_settings): Move check for font inside HAVE_XFT.
12758 (read_settings, apply_xft_settings): Add comment.
12759 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12760 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12761 call store_font_name_changed.
12762 (xft_settings_event): Add comment.
12763 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12764 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12765 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12766 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12767 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
12768 (xsettings_get_system_font, xsettings_get_system_normal_font):
12769 Add comment.
869795d6 12770
d8ed26bd
PE
127712011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12772
12773 Random fixes. E.g., (random) never returned negative values.
12774 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12775 subseconds part to the entropy, as that's a bit more random.
12776 Prefer signed to unsigned, since the signedness doesn't matter and
12777 in general we prefer signed. When given a limit, use a
12778 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12779 latter isn't right if USE_2_TAGS_FOR_INTS.
12780 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12781 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12782
cabf1cac
SM
127832011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12784
12785 * textprop.c (text_property_stickiness):
12786 Obey Vtext_property_default_nonsticky.
12787 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12788 * w32fns.c (syms_of_w32fns):
12789 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12790
6e9b2be9
PE
127912011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12792
12793 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12794 This is more efficient than Ffile_directory_p and avoids a minor race.
12795
90186c68
LMI
127962011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12797
7c301272
LMI
12798 * buffer.c (Foverlay_put): Say what the return value is
12799 (bug#7835).
12800
c4f2d8d4
LMI
12801 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12802 is a directory before asking whether to use the file name
12803 (bug#7564).
ad637907
LMI
12804 (barf_or_query_if_file_exists): Make the "File is a directory"
12805 error be more correct.
c4f2d8d4 12806
90186c68
LMI
12807 * fns.c (Frequire): Remove the mention of the .gz files, since
12808 that's installation-specific, but keep the mention of
12809 `get-load-suffixes'.
12810
da64016e
PE
128112011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12812
12813 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12814 Report string overflow if the output is too long.
12815
7d47b580
JB
128162011-07-04 Juanma Barranquero <lekktu@gmail.com>
12817
a555cb87
JB
12818 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12819 (syms_of_gnutls): Remove duplicate DEFSYM for
12820 Qgnutls_bootprop_verify_hostname_error, an error for
12821 Qgnutls_bootprop_verify_error (which is no longer used).
12822
7d47b580
JB
12823 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12824 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12825 Also (re)move comments that are misplaced or no longer relevant.
12826
1e49bfab
LMI
128272011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12828
12829 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12830
1485f4c0
CY
128312011-07-03 Chong Yidong <cyd@stupidchicken.com>
12832
12833 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12834 and background color parameters if they have been changed.
12835
a9ab721e
LMI
128362011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12837
12838 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12839
cf7cff57
PE
128402011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12841
2e13213d
PE
12842 * xsettings.c (SYSTEM_FONT): Define only when used.
12843 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12844
cf7cff57
PE
12845 * keymap.c (access_keymap_1): Now static.
12846
7a8e04f7
CY
128472011-07-02 Chong Yidong <cyd@stupidchicken.com>
12848
12849 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12850 leave any prefix arg for the up event (Bug#1586).
12851
61352f62
LMI
128522011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12853
69bb1ef7
LMI
12854 * lread.c (syms_of_lread): Mention single symbols defined by
12855 `defvar' or `defconst' (bug#7154).
12856
61352f62 12857 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 12858 (Frequire): Mention get-load-suffixes.
61352f62 12859
28545e04
MR
128602011-07-02 Martin Rudalics <rudalics@gmx.at>
12861
12862 * window.h (window): Remove clone_number slot.
12863 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12864 Remove.
12865 (make_parent_window, make_window, saved_window)
12866 (Fset_window_configuration, save_window_save): Don't deal with
12867 clone numbers.
12868 * buffer.c (Qclone_number): Remove declaration.
12869 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12870
3349e122
SM
128712011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12872
12873 Add multiple inheritance to keymaps.
12874 * keymap.c (Fmake_composed_keymap): New function.
12875 (Fset_keymap_parent): Simplify.
12876 (fix_submap_inheritance): Remove.
12877 (access_keymap_1): New function extracted from access_keymap to handle
12878 embedded parents and handle lists of maps.
12879 (access_keymap): Use it.
12880 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12881 (Fcopy_keymap): Handle embedded parents.
12882 (Fcommand_remapping, define_as_prefix): Simplify.
12883 (Fkey_binding): Simplify.
12884 (syms_of_keymap): Move minibuffer-local-completion-map,
12885 minibuffer-local-filename-completion-map,
12886 minibuffer-local-must-match-map, and
12887 minibuffer-local-filename-must-match-map to Elisp.
12888 (syms_of_keymap): Defsubr make-composed-keymap.
12889 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12890 (parse_menu_item): Trivial simplification.
12891
3279eb87
GM
128922011-07-01 Glenn Morris <rgm@gnu.org>
12893
12894 * Makefile.in (SETTINGS_LIBS): Fix typo.
12895
39cb9e56 128962011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
12897
12898 * coding.c (Fencode_coding_string): Record the last coding system
12899 used, as the function doc string says (bug#8738).
12900
0949d2b6
JD
129012011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12902
12903 * xsettings.c (store_monospaced_changed): Take new font as arg and
12904 check for change against current_mono_font.
12905 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12906 (emacs_settings_constructor, emacs_settings_get_property)
12907 (emacs_settings_set_property, emacs_settings_class_init)
12908 (emacs_settings_init, gsettings_obj): Remove.
12909 (something_changedCB): New function for HAVE_GSETTINGS.
12910 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12911 with value as argument.
12912 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12913 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 12914 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
12915 "changed".
12916
12917 * xgselect.c: Add defined (HAVE_GSETTINGS).
12918 (xgselect_initialize): Ditto.
12919
12920 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12921 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12922 xg_select.
12923
bbc6b304
PE
129242011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12925
12926 * eval.c (struct backtrace): Simplify and port the data structure.
12927 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12928 signed bit field, as this assumption is not portable and it makes
12929 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12930 "char debug_on_exit : 1" as this is not portable either; instead,
12931 use the portable "unsigned int debug_on_exit : 1". Remove unused
12932 member evalargs. Remove obsolete comments about cc bombing out.
12933
9851bfc5
JD
129342011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12935
51bb811f 12936 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
12937 Let HAVE_GSETTINGS override HAVE_GCONF.
12938 (store_monospaced_changed): New function.
12939 (EMACS_SETTINGS): A new type derived from GObject to handle
12940 GSettings notifications.
12941 (emacs_settings_constructor, emacs_settings_get_property)
12942 (emacs_settings_set_property, emacs_settings_class_init):
12943 New functions.
12944 (gsettings_client, gsettings_obj): New variables.
12945 (GSETTINGS_SCHEMA): New define.
12946 (something_changedCB): Call store_monospaced_changed.
12947 (init_gsettings): New function.
12948 (xsettings_initialize): Call init_gsettings.
12949 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12950 to NULL.
12951
640c8776 12952 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
12953 GCONF_CFLAGS/LIBS.
12954
5386012d
MR
129552011-06-29 Martin Rudalics <rudalics@gmx.at>
12956
12957 * window.c (resize_root_window, grow_mini_window)
12958 (shrink_mini_window): Rename Qresize_root_window to
12959 Qwindow_resize_root_window and Qresize_root_window_vertically to
12960 Qwindow_resize_root_window_vertically.
12961
f13e0b08
PE
129622011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12963
12964 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12965
94515237
JB
129662011-06-27 Juanma Barranquero <lekktu@gmail.com>
12967
12968 * makefile.w32-in: Redesign dependencies so they reflect more
12969 clearly which files are directly included by each source file,
12970 and not through other includes.
12971
e43b6e43
MR
129722011-06-27 Martin Rudalics <rudalics@gmx.at>
12973
12974 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12975 (sort_overlays, overlay_strings): When an overlay's clone number
12976 matches the window's clone number process the overlay even if
12977 the overlay's window property doesn't match the current window.
12978
d68443dc
MR
12979 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12980 (Fwindow_hchild): Rename to Fwindow_left_child.
12981 (Fwindow_next): Rename to Fwindow_next_sibling.
12982 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
12983 (resize_window_check): Rename to window_resize_check.
12984 (resize_window_apply): Rename to window_resize_apply.
12985 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12986 (Fdelete_other_windows_internal, resize_frame_windows)
12987 (Fsplit_window_internal, Fdelete_window_internal)
12988 (grow_mini_window, shrink_mini_window)
12989 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 12990
c7e73be5
JD
129912011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12992
12993 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12994 (emacs_fixed_set_min_size): Remove.
12995 (emacs_fixed_new): Take frame as argument.
12996
12997 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12998 (_EmacsFixedPrivate): Remove minwidth/height.
12999 Add struct frame *f.
13000 (emacs_fixed_init): Initialize priv->f.
13001 (get_parent_class, emacs_fixed_set_min_size): Remove.
13002 (emacs_fixed_new): Set priv->f to argument.
13003 (emacs_fixed_get_preferred_width)
13004 (emacs_fixed_get_preferred_height): Use min_width/height from
13005 frames size_hint to set minimum and natural (Bug#8919).
13006 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13007 and use min_width/height from frames size_hint to set
13008 min_width/height (Bug#8919).
13009
13010 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
13011 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13012 Fix indentation.
c7e73be5 13013
cf99dcf8
EZ
130142011-06-26 Eli Zaretskii <eliz@gnu.org>
13015
13016 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13017 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13018 called at ZV.
13019
029529ac
CY
130202011-06-26 Chong Yidong <cyd@stupidchicken.com>
13021
13022 * process.c (wait_reading_process_output): Bypass select if
13023 waiting for a cell while ignoring keyboard input, and input is
13024 pending. Suggested by Jan Djärv (Bug#8869).
13025
7a7ef429
PE
130262011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13027
13028 Use gnulib's dup2 module instead of rolling our own.
13029 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13030
11fdef7d 130312011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
13032
13033 * dispnew.c (scrolling_window): Before scrolling, turn off a
13034 mouse-highlight in the window being scrolled.
13035
cd3520a4
JB
130362011-06-24 Juanma Barranquero <lekktu@gmail.com>
13037
13038 Move DEFSYM to lisp.h and use everywhere.
13039
13040 * character.h (DEFSYM): Move declaration...
13041 * lisp.h (DEFSYM): ...here.
13042
13043 * gnutls.c:
13044 * minibuf.c:
13045 * w32menu.c:
13046 * w32proc.c:
13047 * w32select.c: Don't include character.h.
13048
13049 * alloc.c (syms_of_alloc):
13050 * buffer.c (syms_of_buffer):
13051 * bytecode.c (syms_of_bytecode):
13052 * callint.c (syms_of_callint):
13053 * casefiddle.c (syms_of_casefiddle):
13054 * casetab.c (init_casetab_once):
13055 * category.c (init_category_once, syms_of_category):
13056 * ccl.c (syms_of_ccl):
13057 * cmds.c (syms_of_cmds):
13058 * composite.c (syms_of_composite):
13059 * dbusbind.c (syms_of_dbusbind):
13060 * dired.c (syms_of_dired):
13061 * dispnew.c (syms_of_display):
13062 * doc.c (syms_of_doc):
13063 * editfns.c (syms_of_editfns):
13064 * emacs.c (syms_of_emacs):
13065 * eval.c (syms_of_eval):
13066 * fileio.c (syms_of_fileio):
13067 * fns.c (syms_of_fns):
13068 * frame.c (syms_of_frame):
13069 * fringe.c (syms_of_fringe):
13070 * insdel.c (syms_of_insdel):
13071 * keymap.c (syms_of_keymap):
13072 * lread.c (init_obarray, syms_of_lread):
13073 * macros.c (syms_of_macros):
13074 * msdos.c (syms_of_msdos):
13075 * print.c (syms_of_print):
13076 * process.c (syms_of_process):
13077 * search.c (syms_of_search):
13078 * sound.c (syms_of_sound):
13079 * syntax.c (init_syntax_once, syms_of_syntax):
13080 * terminal.c (syms_of_terminal):
13081 * textprop.c (syms_of_textprop):
13082 * undo.c (syms_of_undo):
13083 * w32.c (globals_of_w32):
13084 * window.c (syms_of_window):
13085 * xdisp.c (syms_of_xdisp):
13086 * xfaces.c (syms_of_xfaces):
13087 * xfns.c (syms_of_xfns):
13088 * xmenu.c (syms_of_xmenu):
13089 * xsettings.c (syms_of_xsettings):
13090 * xterm.c (syms_of_xterm): Use DEFSYM.
13091
4228cf16
TZ
130922011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13093
cd3520a4 13094 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 13095
7fcccf1e
PE
130962011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13097
7efb4e0e
PE
13098 Integer and buffer overflow fixes (Bug#8873).
13099
ff5844ad
PE
13100 * print.c (printchar, strout): Check for string overflow.
13101 (PRINTPREPARE, printchar, strout):
13102 Don't set size unless allocation succeeds.
13103
90532f02
PE
13104 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13105 for sizes. Check for string overflow more accurately.
13106 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13107
6d84508d
PE
13108 * macros.c: Integer and buffer overflow fixes.
13109 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13110 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13111 Use ptrdiff_t, not int, for sizes.
13112 Don't increment bufsize until after realloc succeeds.
13113 Check for size-calculation overflow.
13114 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13115
437b2cb4
PE
13116 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13117
8b9ac8b4
PE
13118 * lread.c: Integer overflow fixes.
13119 (read_integer): Radix is now EMACS_INT, not int,
13120 to improve quality of diagnostics for out-of-range radices.
13121 Calculate buffer size correctly for out-of-range radices.
13122 (read1): Check for integer overflow in radices, and in
13123 read-circle numbers.
82cb60d3
PE
13124 (read_escape): Avoid int overflow.
13125 (Fload, openp, read_buffer_size, read1)
13126 (substitute_object_recurse, read_vector, read_list, map_obarray):
13127 Use ptrdiff_t, not int, for sizes.
13128 (read1): Use EMACS_INT, not int, for sizes.
20270765 13129 Check for size overflow.
8b9ac8b4 13130
7fcccf1e
PE
13131 * image.c (cache_image): Check for size arithmetic overflow.
13132
bfbbd7e7
PE
13133 * lread.c: Integer overflow issues.
13134 (saved_doc_string_size, saved_doc_string_length)
13135 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13136 Now ptrdiff_t, not int.
13137 (read1): Don't assume doc string length fits in int. Check for
13138 out-of-range doc string lengths.
13139 (read_list): Don't assume file position fits in int.
39019e54 13140 (read_escape): Check for hex character overflow.
bfbbd7e7 13141
4e323265
LL
131422011-06-22 Leo Liu <sdl.web@gmail.com>
13143
13144 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13145 Move to minibuffer.el.
13146
85fece3e
PE
131472011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13148
20b84ce9 13149 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
13150 The following patches are for when GLYPH_DEBUG && !XASSERT.
13151 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13152 * dispnew.c (flush_stdout):
13153 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13154 Mark as externally visible.
13155 * dispnew.c (check_window_matrix_pointers): Now static.
13156 * dispnew.c (window_to_frame_vpos):
13157 * xfns.c (unwind_create_frame):
13158 * xterm.c (x_check_font): Remove unused local.
13159 * scroll.c (CHECK_BOUNDS):
13160 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13161 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13162 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13163 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13164 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13165 Now static.
13166 (debug_method_add): Use va_list and vsprintf rather than relying
13167 on undefined behavior with wrong number of arguments.
13168 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13169 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13170 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13171 since we're not interested in debugging glyphs with old libraries.
13172 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13173 GCC 4.6.0's static checking.
13174
0766b489
PE
131752011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13176
31fd4b32
PE
13177 Integer overflow and signedness fixes (Bug#8873).
13178 A few related buffer overrun fixes, too.
13179
b79e8648
PE
13180 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13181
0766b489
PE
13182 * dispextern.h (struct face.stipple):
13183 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13184 (x_bitmap_mask, x_allocate_bitmap_record)
13185 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13186 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13187 (x_create_bitmap_from_xpm_data):
13188 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13189 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13190 (.bitmaps_last):
13191 * xfaces.c (load_pixmap):
13192 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13193 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13194 (.bitmaps_last, struct x_output.icon_bitmap):
13195 Use ptrdiff_t, not int, for bitmap indexes.
13196 (x_allocate_bitmap_record): Check for size overflow.
13197 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13198
b081724f
PE
13199 Use ptrdiff_t, not int, for overlay counts.
13200 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13201 * editfns.c (overlays_around, get_pos_property):
13202 * textprop.c (get_char_property_and_overlay):
13203 * xdisp.c (next_overlay_change, note_mouse_highlight):
13204 * xfaces.c (face_at_buffer_position):
21514da7
PE
13205 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13206 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13207 (Fnext_overlay_change, Fprevious_overlay_change)
13208 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 13209 Use ptrdiff_t, not int, for sizes.
21514da7 13210 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 13211
3de73e5e
PE
13212 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13213
2606c57b
PE
13214 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13215 (x_session_initialize): Do not assume string length fits in int.
13216
aaafe47a
PE
13217 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13218 This is unlikely, but can occur if DPI is outlandish.
13219
2674ddc8 13220 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
13221 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13222
28154962
PE
13223 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13224 * xrdb.c (magic_file_p, search_magic_path):
13225 Omit last arg SUFFIX; it was always 0. All callers changed.
13226 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13227
7de51af5
PE
13228 * xfont.c (xfont_match): Avoid need for strlen.
13229
25ed6cc3
PE
13230 * xfns.c: Don't assume strlen fits in int.
13231 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13232
4eab31dd
PE
13233 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13234 not unsigned long, as we prefer signed integers. All callers changed.
13235 Detect integer overflow in repeat count.
13236 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 13237 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 13238
171e2a58
PE
13239 * termcap.c: Don't assume sizes fit in int and never overflow.
13240 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13241 (gobble_line): Check for size-calculation overflow.
13242
ad39faca 13243 * minibuf.c (Fread_buffer):
6e5bb2dc 13244 * lread.c (intern, intern_c_string):
74ca2eb3
PE
13245 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13246 Don't assume string length fits in int.
13247
52c61c22 13248 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
13249 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13250
b5b8c9e5
PE
13251 * font.c: Don't assume string length fits in int.
13252 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13253 Use ptrdiff_t, not int.
ccd6111c
PE
13254 (font_intern_prop): Don't assume string length fits in int.
13255 Don't assume integer property fits in fixnum.
13256 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 13257
882f0d81 13258 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 13259 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
13260 Reformulate so as not to need the command string.
13261 Invoke gzip -cd rather than gunzip, as it's more portable.
13262 (lock_info_type, lock_file_1, lock_file):
13263 Don't assume pid_t and time_t fit in unsigned long.
13264 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13265 (current_lock_owner): Prefer signed type for sizes.
13266 Use memcpy, not strncpy, where memcpy is what is really wanted.
13267 Don't assume (via atoi) that time_t and pid_t fit in int.
13268 Check for time_t and/or pid_t out of range, e.g., via a network share.
13269 Don't alloca where an auto var works fine.
13270
93f4cf88
PE
13271 * fileio.c: Fix some integer overflow issues.
13272 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13273 Don't assume string length fits in int.
13274 (directory_file_name): Don't assume string length fits in long.
13275 (make_temp_name): Don't assume pid fits in int, or that its print
13276 length is less than 20.
13277
f3e92b69
PE
13278 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13279
1bfdaf10
PE
13280 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13281
35016e9a
PE
13282 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13283
3d1e65a1
PE
13284 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13285 We prefer signed integers, even for size calculations.
13286
0b963a93
PE
13287 * emacs.c: Don't assume string length fits in 'int'.
13288 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13289 (main): Don't invoke strlen when not needed.
13290
573f4b54
PE
13291 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13292 (XD_DEBUG_MESSAGE): Don't waste a byte.
13293
989f33ba
PE
13294 * callproc.c (getenv_internal_1, getenv_internal)
13295 (Fgetenv_internal):
965d34eb
PE
13296 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13297
e4d29b33
PE
13298 * lread.c (invalid_syntax): Omit length argument.
13299 All uses changed. This doesn't fix a bug, but it simplifies the
13300 code away from its former Hollerith-constant appearance, and it's
13301 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 13302 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 13303
eb49b136
PE
13304 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13305 This didn't break anything, but it didn't help either.
13306 It's confusing to put a bogus integer in a place where the actual
13307 value does not matter.
9f62aeb1 13308 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 13309 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 13310
15375a22
PE
13311 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13312 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13313 implementation.
b61cc01c
PE
13314 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13315 We prefer signed types, and the value cannot exceed the EMACS_INT
13316 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
13317 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13318 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13319 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 13320
53b2623d
PE
13321 * indent.c (sane_tab_width): New function.
13322 (current_column, scan_for_column, Findent_to, position_indentation)
13323 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 13324 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 13325
51cab52b 13326 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 13327
f2ed8a70
PE
13328 * lisp.h (lint_assume): New macro.
13329 * composite.c (composition_gstring_put_cache):
13330 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13331
abe80cc6
PE
13332 * editfns.c, insdel.c:
13333 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 13334
b02c740e
PE
13335 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13336
ebc96716
PE
13337 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13338
b4e50fa0 13339 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 13340 Use much-faster test for byte-length change.
311d5d7c 13341 Don't assume string byte-length fits in 'int'.
a4cf38e4 13342 Check that character arg fits in 'int'.
85461888 13343 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 13344
c0c1ee9f
PE
13345 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13346
a498d7f4
PE
13347 * fns.c (concat): Catch string overflow earlier.
13348 Do not rely on integer wraparound.
13349
51cab52b
PE
13350 * dispextern.h (struct it.overlay_strings_charpos)
13351 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
13352 * xdisp.c (forward_to_next_line_start)
13353 (back_to_previous_visible_line_start)
13354 (reseat_at_next_visible_line_start, next_element_from_buffer):
13355 Don't arbitrarily truncate the value of 'selective' to int.
13356
76031fad
PE
13357 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13358
5eb55db9
PE
13359 * composite.c: Don't truncate sizes to 'int'.
13360 (composition_gstring_p, composition_reseat_it)
13361 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
13362 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13363 not EMACS_UINT, for indexes.
5eb55db9 13364
0703a717
PE
13365 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13366
d6202519
PE
13367 * buffer.c: Include <verify.h>.
13368 (struct sortvec.priority, struct sortstr.priority):
8961a454 13369 Now EMACS_INT, not int.
c20998a7 13370 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
13371 (struct sortstr.size, record_overlay_string)
13372 (struct sortstrlist.size, struct sortlist.used):
13373 Don't truncate size to int.
13374 (record_overlay_string): Check for size-calculation overflow.
d6202519 13375 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 13376
d5a19415
JM
133772011-06-22 Jim Meyering <meyering@redhat.com>
13378
029529ac 13379 Don't leak an XBM-image-sized buffer
d5a19415
JM
13380 * image.c (xbm_load): Free the image buffer after using it.
13381
a9041e6c
PE
133822011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13383
13384 Port to Sun C.
13385 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13386 that Sun C diagnosed.
13387 * fns.c (secure_hash): Fix pointer signedness issue.
13388 * intervals.c (static_offset_intervals): New function.
13389 (offset_intervals): Use it.
13390
7f3f739f
LL
133912011-06-21 Leo Liu <sdl.web@gmail.com>
13392
13393 * deps.mk (fns.o):
13394 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13395 sha512.h.
13396
13397 * fns.c (secure_hash): Rename from crypto_hash_function and change
13398 the first arg to accept symbols.
5b66d427 13399 (Fsecure_hash): New primitive.
7f3f739f
LL
13400 (syms_of_fns): New symbols.
13401
76147d94
DD
134022011-06-20 Deniz Dogan <deniz@dogan.se>
13403
13404 * process.c (Fset_process_buffer): Clarify return value in
13405 docstring.
13406
7d7d0045
CY
134072011-06-18 Chong Yidong <cyd@stupidchicken.com>
13408
13409 * dispnew.c (add_window_display_history): Use BVAR.
13410
13411 * xdisp.c (debug_method_add): Use BVAR.
13412 (check_window_end, dump_glyph_matrix, dump_glyph)
13413 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13414
13415 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13416 Likewise.
13417
13418 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13419 check till after the cache is created in init_frame_faces.
13420
ff2bc410
SM
134212011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13422
13423 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13424
28177add
PE
134252011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13426
dd3482fe
PE
13427 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13428 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13429 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13430
393d71f3 13431 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
13432 * fileio.c (Finsert_file_contents):
13433 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13434 Remove the old (too-loose) buffer overflow checks.
13435 They weren't needed, since make_gap checks for buffer overflow.
13436 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13437 The old code merely checked for Emacs fixnum overflow, and relied
13438 on undefined (wraparound) behavior. The new code avoids undefined
13439 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13440
2e6813b0 13441 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
13442 Tune. Don't use wider integers than needed. Don't use alloca.
13443 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 13444
599a9e4f
PE
13445 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13446
99561444
PE
13447 * insdel.c, lisp.h (buffer_overflow): New function.
13448 (insert_from_buffer_1, replace_range, replace_range_2):
13449 * insdel.c (make_gap_larger):
13450 * editfns.c (Finsert_char):
13451 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13452
28177add
PE
13453 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13454
e69dafad
PE
134552011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13456
4baa020d 13457 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 13458
b1c46f02
PE
13459 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13460 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13461
e69dafad
PE
13462 * fileio.c: Don't assume EMACS_INT fits in off_t.
13463 (emacs_lseek): New static function.
13464 (Finsert_file_contents, Fwrite_region): Use it.
13465 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13466
566684ea
PE
13467 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13468
e6966cd6
PE
13469 * fns.c: Don't overflow int when computing a list length.
13470 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13471 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13472 truncation on 64-bit hosts. Check for QUIT every
13473 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13474 faster and is responsive enough.
13475 (Flength): Report an error instead of overflowing an integer.
13476 (Fsafe_length): Return a float if the value is not representable
13477 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 13478 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 13479 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 13480
dd0b0efb
PE
13481 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13482 (header_size, word_size): New constants.
13483 (allocate_vectorlike): Don't check size overflow here.
13484 (allocate_vector): Check it here instead, since this is the only
13485 caller of allocate_vectorlike that could cause overflow.
13486 Check that the new vector's length is representable as a fixnum.
13487
86fe5cfe
PE
13488 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13489 The previous code was bogus. For example, next_almost_prime (32)
13490 returned 39, which is undesirable as it is a multiple of 3; and
13491 next_almost_prime (24) returned 25, which is a multiple of 5 so
13492 why was the code bothering to check for multiples of 7?
13493
80e88859
PE
13494 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13495
4a2f0ad6
PE
13496 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13497
f66c7cf8
PE
13498 Variadic C functions now count arguments with ptrdiff_t.
13499 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13500 Back then I didn't know that the Emacs coding style prefers signed int.
13501 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
13502 were being counted with int, which may truncate counts on 64-bit
13503 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
13504 * lisp.h (struct Lisp_Subr.function.aMANY)
13505 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13506 Arg counts are now ptrdiff_t, not size_t.
13507 All variadic functions and their callers changed accordingly.
13508 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13509 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13510 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13511 * callint.c (Fcall_interactively): Check arg count for overflow,
13512 to avoid potential buffer overrun. Use signed char, not 'int',
13513 for 'varies' array, so that we needn't bother to check its size
13514 calculation for overflow.
13515 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13516 * eval.c (apply_lambda):
13517 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13518 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13519 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13520
a1759b76
PE
13521 * callint.c (Fcall_interactively): Don't use index var as event count.
13522
d96be9fc
PE
13523 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13524 * mem-limits.h (SIZE): Remove; no longer used.
13525
a690a978 13526 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 13527
578c21e6
PE
13528 Remove unnecessary casts.
13529 * xterm.c (x_term_init):
13530 * xfns.c (x_set_border_pixel):
13531 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13532 These aren't needed now that we assume ANSI C.
13533
96f53c6c
PE
13534 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13535 It's more likely to cause problems (due to unsigned overflow)
13536 than to cure them.
13537
83c77d31
PE
13538 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13539
ee2079f1
PE
13540 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13541
6da65536
PE
13542 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13543
7147c4a4
PE
13544 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13545
193e32d9
PE
13546 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13547
e5533da6
PE
13548 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13549
9910e595
PE
13550 GLYPH_CODE_FACE returns EMACS_INT, not int.
13551 * dispextern.h (merge_faces):
13552 * xfaces.c (merge_faces):
01103c44
PE
13553 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13554 Don't assume EMACS_INT fits in int.
9910e595 13555
2638320e
PE
13556 * character.h (CHAR_VALID_P): Remove unused parameter.
13557 * fontset.c, lisp.h, xdisp.c: All uses changed.
13558
045eb8d9
PE
13559 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13560
c1f134b5
PE
13561 * fns.c (concat): Minor tuning based on overflow analysis.
13562 This doesn't fix any bugs. Use int to hold character, instead
13563 of constantly refetching from Emacs object. Use XFASTINT, not
13564 XINT, for value known to be a character. Don't bother comparing
13565 a single byte to 0400, as it's always less.
13566
395fcb93 13567 * floatfns.c (Fexpt):
327eeec8
PE
13568 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13569
abbd3d23
PE
13570 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13571 for characters.
13572
684a03ef
PE
13573 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13574
0fed43f3
PE
13575 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13576 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13577 incorrectly succeed when S was a string, because 4294967386 was
13578 truncated before it was used.
13579
8fd02eb7
PE
13580 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13581 Otherwise, an out-of-range integer could cause undefined behavior
13582 on a 64-bit host.
13583
f8c86b69
PE
13584 * composite.c: Use int, not EMACS_INT, for characters.
13585 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13586 EMACS_INT, for values that are known to be in character range.
13587 This doesn't fix any bugs but is the usual style inside Emacs and
13588 may generate better code on 32-bit machines.
13589
34206dd2
PE
13590 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13591 This is for reasons similar to the recent CHAR_STRING fix.
13592 * charset.c (Fencode_char): Check that character arg is actually
13593 a character. Pass an int to ENCODE_CHAR.
13594 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13595 wider than 'int', as a compile-time check to prevent future regressions
13596 in this area.
13597
c5958d4c 13598 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
13599
13600 Make sure a 64-bit char is never passed to CHAR_STRING.
13601 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13602 by silently ignoring the top 32 bits, allowing some values
13603 that were far too large to be valid characters.
13604 * character.h: Include <verify.h>.
13605 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13606 arguments are no wider than unsigned, as a compile-time check
13607 to prevent future regressions in this area.
13608 * data.c (Faset):
01103c44 13609 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
13610 (Fsubst_char_in_region):
13611 * fns.c (concat):
13612 * xdisp.c (decode_mode_spec_coding):
13613 Adjust to CHAR_STRING's new requirement.
13614 * editfns.c (Finsert_char, Fsubst_char_in_region):
13615 * fns.c (concat): Check that character args are actually
13616 characters. Without this test, these functions did the wrong
13617 thing with wildly out-of-range values on 64-bit hosts.
13618
d37ca623
PE
13619 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13620 These casts should not be needed on 32-bit hosts, either.
13621 * keyboard.c (read_char):
13622 * lread.c (Fload): Remove casts to unsigned.
13623
ea204efb
PE
13624 * lisp.h (UNSIGNED_CMP): New macro.
13625 This fixes comparison bugs on 64-bit hosts.
13626 (ASCII_CHAR_P): Use it.
13627 * casefiddle.c (casify_object):
01103c44 13628 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
13629 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13630 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13631 * dispextern.h (FACE_FROM_ID):
13632 * keyboard.c (read_char): Use UNSIGNED_CMP.
13633
41cb286c
PE
13634 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13635 not to EMACS_INT, to avoid GCC warning.
13636
4a1b9832
PE
13637 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13638
55daad71
PE
13639 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13640 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13641 isn't needed on 32-bit machines.
8f95c75c 13642
01103c44
PE
13643 * buffer.c (Fgenerate_new_buffer_name):
13644 Use EMACS_INT for count, not int.
0ceccced 13645 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
13646
13647 * data.c (Qcompiled_function): Now static.
13648
c6f072e7
PE
13649 * window.c (window_body_lines): Now static.
13650
20ce5912
PE
13651 * image.c (gif_load): Rename local to avoid shadowing.
13652
9c4c5f81
PE
13653 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13654 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13655 * alloc.c (make_save_value): Integer argument is now of type
13656 ptrdiff_t, not int.
13657 (mark_object): Use ptrdiff_t, not int.
13658 * lisp.h (pD): New macro.
13659 * print.c (print_object): Use it.
13660
c0c5c8ae
PE
13661 * alloc.c: Use EMACS_INT, not int, to count objects.
13662 (total_conses, total_markers, total_symbols, total_vector_size)
13663 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
13664 (total_free_floats, total_floats, total_free_intervals)
13665 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
13666 Now EMACS_INT, not int. All uses changed.
13667 (Fgarbage_collect): Compute overall total using a double, so that
13668 integer overflow is less likely to be a problem. Check for overflow
13669 when converting back to an integer.
5a25e253
PE
13670 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13671 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13672 These were 'int' variables that could overflow on 64-bit hosts;
13673 they were never used, so remove them instead of repairing them.
211a0b2a 13674 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
13675 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13676 Previously, this ceilinged at INT_MAX, but that doesn't work on
13677 64-bit machines.
e46bb31a 13678 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 13679
c78baabf 13680 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 13681 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
13682 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13683 when a (possibly-narrower) signed value would do just as well.
13684 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 13685
c9d624c6
PE
13686 * alloc.c: Catch some string size overflows that we were missing.
13687 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13688 for convenience in STRING_BYTES_MAX.
13689 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13690 The definition here is exact; the one in lisp.h was approximate.
13691 (allocate_string_data): Check for string overflow. This catches
13692 some instances we weren't catching before. Also, it catches
13693 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13694 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13695 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 13696
c9d624c6
PE
13697 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13698 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 13699 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 13700
353032ce
PE
13701 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13702
2bccce07
PE
13703 * alloc.c (Fmake_string): Check for out-of-range init.
13704
0ac30604
SM
137052011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13706
13707 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13708
c195f2de
JD
137092011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13710
13711 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13712 xg_get_default_scrollbar_width.
13713
13714 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13715 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13716 (style_changed_cb): Call update_theme_scrollbar_width and call
13717 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13718 all frames (Bug#8505).
13719 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13720 Call gtk_window_set_resizable if HAVE_GTK3.
13721 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13722 and height if HAVE_GTK3 (Bug#8505).
13723 (scroll_bar_width_for_theme): New variable.
13724 (update_theme_scrollbar_width): New function.
13725 (xg_get_default_scrollbar_width): Move code to
13726 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13727 (xg_initialize): Call update_theme_scrollbar_width.
13728
13729 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13730
13731 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13732
e10ac9f1
MR
137332011-06-12 Martin Rudalics <rudalics@gmx.at>
13734
13735 * frame.c (make_frame): Call other_buffer_safely instead of
13736 other_buffer.
13737
13738 * window.c (temp_output_buffer_show): Call display_buffer with
13739 second argument Vtemp_buffer_show_specifiers and reset latter
13740 immediately after the call.
13741 (Vtemp_buffer_show_specifiers): New variable.
13742 (auto_window_vscroll_p, next_screen_context_lines)
13743 (Vscroll_preserve_screen_position): Remove leading asterisks from
13744 doc-strings.
13745
2d3c217e 137462011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 13747
7b7f97e8 13748 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
13749 * buffer.c (Qclone_number): Remove for now, as it's unused.
13750 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13751 (record_buffer): Remove unused local.
13752 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13753 (set_frame_buffer_list): Remove; unused.
13754 * frame.h (other_visible_frames): Remove decl.
13755 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13756 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13757 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13758 if HAVE_GPM.
13759 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13760 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13761 Define only if HAVE_GPM.
13762 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13763 (update_hints_inhibit): Remove; never set. All uses removed.
13764 * widgetprv.h (emacsFrameClassRec): Remove decl.
13765 * window.c (delete_deletable_window): Now returns void, since it
13766 wasn't returning anything.
13767 (compare_window_configurations): Remove unused locals.
13768 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13769 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
13770 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13771 the same widths as pointers. This follows up on the 2011-05-06 patch.
13772 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13773 * xterm.h: Likewise.
13774 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13775
1384b89e
JB
137762011-06-12 Juanma Barranquero <lekktu@gmail.com>
13777
13778 * makefile.w32-in: Update dependencies.
13779 (LISP_H): Add lib/intprops.h.
13780
1100a63c
CY
137812011-06-11 Chong Yidong <cyd@stupidchicken.com>
13782
13783 * image.c (gif_load): Add animation frame delay to the metadata.
13784 (syms_of_image): Use DEFSYM. New symbol `delay'.
13785
6198ccd0
MR
137862011-06-11 Martin Rudalics <rudalics@gmx.at>
13787
13788 * window.c (delete_deletable_window): Re-add.
13789 (Fset_window_configuration): Rewrite to handle dead buffers and
13790 consequently deletable windows.
13791 (window_tree, Fwindow_tree): Remove. Supply functionality in
13792 window.el.
13793 (compare_window_configurations): Simplify code.
13794
b6e3633c
AS
137952011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13796
1ab0dee5
AS
13797 * image.c (imagemagick_load_image): Fix type mismatch.
13798 (Fimagemagick_types): Likewise.
13799
b6e3633c
AS
13800 * window.h (replace_buffer_in_windows): Declare.
13801
9397e56f
MR
138022011-06-11 Martin Rudalics <rudalics@gmx.at>
13803
13804 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13805 Qclone_number. Remove external declaration of Qdelete_window.
13806 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13807 code.
640c8776
SM
13808 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13809 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
13810 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13811 buffer list implementation.
13812 (other_buffer_safely): New function.
13813 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13814 calls to replace_buffer_in_windows and
13815 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13816 if allowed.
13817 (record_buffer): Inhibit quitting and rewrite using quittable
13818 functions. Run Qbuffer_list_update_hook if allowed.
13819 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
13820 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13821 Move switch-to-buffer to window.el.
9397e56f
MR
13822 (bury-buffer): Move to window.el.
13823 (Vbuffer_list_update_hook): New variable.
13824
13825 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13826 section.
13827
13828 * window.h (resize_frame_windows): Move up in code.
13829 (Fwindow_frame): Remove EXFUN.
13830 (replace_buffer_in_all_windows): Remove prototype.
13831 (replace_buffer_in_windows_safely): Add prototype.
13832
13833 * window.c: Declare Qdelete_window static again. Move down
13834 declaration of select_count.
13835 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13836 (Fother_window): Move to window.el.
13837 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13838 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13839 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13840 window.el.
13841 (replace_buffer_in_windows): Implement by calling
13842 Qreplace_buffer_in_windows.
13843 (replace_buffer_in_all_windows): Remove with some functionality
13844 moved into replace_buffer_in_windows_safely.
13845 (replace_buffer_in_windows_safely): New function.
13846 (select_window_norecord, select_frame_norecord): Move in front
13847 of run_window_configuration_change_hook. Remove now obsolete
13848 declarations.
640c8776
SM
13849 (Fset_window_buffer): Rewrite doc-string.
13850 Call Qrecord_window_buffer.
9397e56f
MR
13851 (keys_of_window): Move binding for other-window to window.el.
13852
b50691aa
CY
138532011-06-11 Chong Yidong <cyd@stupidchicken.com>
13854
13855 * dispextern.h (struct image): Replace data member, whose int_val
13856 and ptr_val fields were not used by anything, with a single
13857 lisp_val object.
13858
13859 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13860 (gif_clear_image, gif_load, imagemagick_load_image)
13861 (gs_clear_image, gs_load): Callers changed.
13862
3f754b86
PE
138632011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13864
cca69397
PE
13865 * buffer.h: Include <time.h>, for time_t.
13866 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13867
109e28d0
PE
13868 Fix minor problems found by static checking.
13869
60737f02
PE
13870 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13871
4b66faf3
PE
13872 Make identifiers static if they are not used in other modules.
13873 * data.c (Qcompiled_function, Qframe, Qvector):
13874 * image.c (QimageMagick, Qsvg):
13875 * minibuf.c (Qmetadata):
13876 * window.c (resize_window_check, resize_root_window): Now static.
13877 * window.h (resize_window_check, resize_root_window): Remove decls.
13878
109e28d0
PE
13879 * window.c (window_deletion_count, delete_deletable_window):
13880 Remove; unused.
46a4ce9e
PE
13881 (window_body_lines): Now static.
13882 (Fdelete_other_windows_internal): Mark vars as initialized.
13883 Make sure 'resize_failed' is initialized.
13884 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13885 (resize_window_apply): Remove unused local.
13886 * window.h (delete_deletable_window): Remove decl.
13887
109e28d0 13888 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
13889 (imagemagick_load_image): Fix pointer signedness problem by changing
13890 last arg from unsigned char * to char *. All uses changed.
13891 Also, fix a local for similar reasons.
13892 Remove unused locals. Remove locals to avoid shadowing.
13893 (fn_rsvg_handle_free): Remove; unused.
13894 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 13895 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 13896
3f754b86
PE
13897 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13898
2547adb1
CY
138992011-06-10 Chong Yidong <cyd@stupidchicken.com>
13900
13901 * image.c (gif_load): Fix omitted cast error introduced by
13902 2011-06-06 change.
13903
2c8e37d4
MR
139042011-06-10 Martin Rudalics <rudalics@gmx.at>
13905
13906 * window.h (resize_proportionally, orig_total_lines)
13907 (orig_top_line): Remove from window structure.
13908 (set_window_height, set_window_width, change_window_heights)
13909 (Fdelete_window): Remove prototypes.
13910 (resize_frame_windows): Remove duplicate declaration.
13911
440a42e3
EZ
139122011-06-10 Eli Zaretskii <eliz@gnu.org>
13913
13914 * window.h (resize_frame_windows, resize_window_check)
13915 (delete_deletable_window, resize_root_window)
13916 (resize_frame_windows): Declare prototypes.
13917
13918 * window.c (resize_window_apply): Make definition be "static" to
13919 match the prototype.
13920
562dd5e9
MR
139212011-06-10 Martin Rudalics <rudalics@gmx.at>
13922
13923 * window.c: Remove declarations of Qwindow_size_fixed,
13924 window_min_size_1, window_min_size_2, window_min_size,
13925 size_window, window_fixed_size_p, enlarge_window, delete_window.
13926 Remove static from declaration of Qdelete_window, it's
13927 temporarily needed by Fbury_buffer.
13928 (replace_window): Don't assign orig_top_line and
13929 orig_total_lines.
13930 (Fdelete_window, delete_window): Remove. Window deletion is
13931 handled by window.el.
640c8776
SM
13932 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13933 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
13934 (Fdelete_other_windows): Remove. Deleting other windows is
13935 handled by window.el.
13936 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13937 handled in window.el.
13938 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13939 Window minimum sizes are handled in window.el.
13940 (shrink_windows, size_window, set_window_height)
13941 (set_window_width, change_window_heights, window_height)
13942 (window_width, CURBEG, CURSIZE, enlarge_window)
13943 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13944 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13945 handled in window.el.
13946 (make_dummy_parent): Rename to make_parent_window and give it a
13947 second argument horflag.
13948 (make_window): Don't set resize_proportionally any more.
13949 (Fsplit_window): Remove. Windows are split in window.el.
13950 (save_restore_action, save_restore_orig_size)
13951 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13952 Resize mini windows in window.el.
13953 (grow_mini_window, shrink_mini_window): Implement by calling
13954 Qresize_root_window_vertically, resize_window_check and
13955 resize_window_apply.
640c8776
SM
13956 (saved_window, Fset_window_configuration, save_window_save):
13957 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
13958 resize_proportionally.
13959 (window_min_height, window_min_width): Move to window.el.
13960 (keys_of_window): Move bindings for delete-other-windows,
13961 split-window, delete-window and enlarge-window to window.el.
13962
13963 * buffer.c: Temporarily extern Qdelete_window.
13964 (Fbury_buffer): Temporarily call Qdelete_window instead of
13965 Fdelete_window (Fbury_buffer will move to window.el soon).
13966
13967 * frame.c (set_menu_bar_lines_1): Remove code handling
13968 orig_top_line and orig_total_lines.
13969
13970 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13971 set_window_height but set heights directly.
13972 (change_frame_size_1): Use resize_frame_windows.
13973
13974 * xdisp.c (init_xdisp): Don't use set_window_height but set
13975 heights directly.
13976
640c8776
SM
13977 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13978 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
13979 run_window_configuration_change_hook.
13980
13981 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13982 instead of change_window_heights and run
13983 run_window_configuration_change_hook.
13984
1a13852e
MR
139852011-06-09 Martin Rudalics <rudalics@gmx.at>
13986
13987 * window.c (replace_window): Rename second argument REPLACEMENT to
13988 NEW. New third argument SETFLAG. Rewrite.
13989 (delete_window, make_dummy_parent): Call replace_window with
13990 third argument 1.
13991 (window_list_1): Move down in code.
13992 (run_window_configuration_change_hook): Move set_buffer part
13993 before select_frame_norecord part in order to unwind correctly.
13994 Rename count1 to count.
13995 (recombine_windows, delete_deletable_window, resize_root_window)
13996 (Fdelete_other_windows_internal)
13997 (Frun_window_configuration_change_hook, make_parent_window)
13998 (resize_window_check, resize_window_apply, Fresize_window_apply)
13999 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
14000 (Fdelete_window_internal, Fresize_mini_window_internal):
14001 New functions.
1a13852e
MR
14002 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14003
f3d1777e
MR
140042011-06-08 Martin Rudalics <rudalics@gmx.at>
14005
496e208e
MR
14006 * window.h (window): Add some new members to window structure -
14007 normal_lines, normal_cols, new_total, new_normal, clone_number,
14008 splits, nest, prev_buffers, next_buffers.
14009 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 14010 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 14011
f3d1777e
MR
14012 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14013 Remove.
496e208e
MR
14014 (make_dummy_parent): Set new members of windows structure.
14015 (make_window): Move down in code. Handle new members of window
14016 structure.
14017 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14018 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14019 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14020 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
14021 (Fset_window_next_buffers, Fset_window_clone_number):
14022 New functions.
496e208e
MR
14023 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14024 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14025 Doc-string fixes.
14026 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14027 Argument WINDOW can be now internal window too.
14028 (Fwindow_use_time): Move up in code.
14029 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14030 Rewrite doc-string.
14031 (Fset_window_configuration, saved_window)
14032 (Fcurrent_window_configuration, save_window_save): Handle new
14033 members of window structure.
b9e809c2
MR
14034 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14035 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14036 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14037 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14038 Qget_mru_window, Qresize_root_window,
14039 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14040 Qauto_buffer_name; staticpro them.
f3d1777e 14041
abde8f8c
MR
140422011-06-07 Martin Rudalics <rudalics@gmx.at>
14043
14044 * window.c (Fwindow_total_size, Fwindow_left_column)
14045 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14046 (Fwindow_list_1): New functions.
14047 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
14048 (Fwindow_width, Fscroll_left, Fscroll_right):
14049 Use window_body_cols instead of window_box_text_cols.
14050 (delete_window, Fset_window_configuration):
14051 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
14052 (delete_all_subwindows): Take a window as argument and not a
14053 structure. Rewrite.
190b47e6
MR
14054 (window_loop): Remove handling of GET_LRU_WINDOW and
14055 GET_LARGEST_WINDOW.
14056 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
14057
14058 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
14059 window_box_text_cols. delete_all_subwindows now takes a
14060 Lisp_Object as argument.
abde8f8c 14061
640c8776
SM
14062 * indent.c (compute_motion, Fcompute_motion):
14063 Use window_body_cols instead of window_box_text_cols.
abde8f8c 14064
fa8a67e6
MR
14065 * frame.c (delete_frame): Call delete_all_subwindows with root
14066 window as argument.
14067
a54e3482
DC
140682011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14069
14070 * fns.c (Fputhash): Document return value.
14071
60002bf5
CY
140722011-06-06 Chong Yidong <cyd@stupidchicken.com>
14073
14074 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14075
0c671da6 140762011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 14077
b862a52a 14078 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 14079
be44ca6c
PE
14080 Check for overflow when converting integer to cons and back.
14081 * charset.c (Fdefine_charset_internal, Fdecode_char):
14082 Use cons_to_unsigned to catch overflow.
14083 (Fencode_char): Use INTEGER_TO_CONS.
14084 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14085 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14086 * data.c (long_to_cons, cons_to_long): Remove.
14087 (cons_to_unsigned, cons_to_signed): New functions.
14088 These signal an error for invalid or out-of-range values.
14089 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14090 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14091 * font.c (Ffont_variation_glyphs):
14092 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14093 * lisp.h: Include <intprops.h>.
14094 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14095 (cons_to_signed, cons_to_unsigned): New decls.
14096 (long_to_cons, cons_to_long): Remove decls.
14097 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14098 (Fprimitive_undo): Use CONS_TO_INTEGER.
14099 * xfns.c (Fx_window_property): Likewise.
14100 * xselect.c: Include <limits.h>.
14101 (x_own_selection, selection_data_to_lisp_data):
14102 Use INTEGER_TO_CONS.
14103 (x_handle_selection_request, x_handle_selection_clear)
14104 (x_get_foreign_selection, Fx_disown_selection_internal)
14105 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14106 (lisp_data_to_selection_data): Use cons_to_unsigned.
14107 (x_fill_property_data): Use cons_to_signed.
14108 Report values out of range.
14109
d1f3d2af
PE
14110 Check for buffer and string overflow more precisely.
14111 * buffer.h (BUF_BYTES_MAX): New macro.
14112 * lisp.h (STRING_BYTES_MAX): New macro.
14113 * alloc.c (Fmake_string):
14114 * character.c (string_escape_byte8):
14115 * coding.c (coding_alloc_by_realloc):
14116 * doprnt.c (doprnt):
14117 * editfns.c (Fformat):
14118 * eval.c (verror):
14119 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14120 since they may not be the same number.
14121 * editfns.c (Finsert_char):
14122 * fileio.c (Finsert_file_contents):
14123 Likewise for BUF_BYTES_MAX.
14124
dd52fcea
PE
14125 * image.c: Use ptrdiff_t, not int, for sizes.
14126 (slurp_file): Switch from int to ptrdiff_t.
14127 All uses changed.
14128 (slurp_file): Check that file size fits in both size_t (for
14129 malloc) and ptrdiff_t (for sanity and safety).
14130
7f9bbdbb
PE
14131 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14132 if b->modtime has its maximal value.
14133
dfe18f82
PE
14134 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14135
84acfcf0
PE
14136 Don't assume time_t can fit into int.
14137 * buffer.h (struct buffer.modtime): Now time_t, not int.
14138 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14139 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14140
ccd9a01a
PE
14141 Minor fixes for signed vs unsigned integers.
14142 * character.h (MAYBE_UNIFY_CHAR):
14143 * charset.c (maybe_unify_char):
14144 * keyboard.c (read_char, reorder_modifiers):
14145 XINT -> XFASTINT, since the integer must be nonnegative.
14146 * ftfont.c (ftfont_spec_pattern):
14147 * keymap.c (access_keymap, silly_event_symbol_error):
14148 XUINT -> XFASTINT, since the integer must be nonnegative.
14149 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14150 since it makes no difference and we prefer signed.
14151 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14152 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14153 nonnegative.
14154
d6d100dd
SM
141552011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14156
14157 * window.h (Fwindow_frame): Declare.
14158
2b6148e4
PE
141592011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14160
14161 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14162 (SPARE_MEMORY): Always define.
14163 (LARGE_REQUEST): Remove.
14164 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14165
f230ecc9
MR
141662011-06-06 Martin Rudalics <rudalics@gmx.at>
14167
727e958e
MR
14168 * lisp.h: Move EXFUNS for Fframe_root_window,
14169 Fframe_first_window and Fset_frame_selected_window to window.h.
14170
14171 * window.h: Move EXFUNS for Fframe_root_window,
14172 Fframe_first_window and Fset_frame_selected_window here from
14173 lisp.h.
14174
14175 * frame.c (Fwindow_frame, Fframe_first_window)
14176 (Fframe_root_window, Fframe_selected_window)
14177 (Fset_frame_selected_window): Move to window.c.
14178 (Factive_minibuffer_window): Move to minibuf.c.
14179 (Fother_visible_frames_p): New function.
14180
14181 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14182
f230ecc9
MR
14183 * window.c (decode_window, decode_any_window): Move up in code.
14184 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14185 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
14186 (Fwindow_buffer): Move up and rewrite doc-string.
14187 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14188 (Fwindow_prev): New functions.
727e958e
MR
14189 (Fwindow_frame): Move here from frame.c. Accept any window as
14190 argument.
14191 (Fframe_root_window, Fframe_first_window)
14192 (Fframe_selected_window): Move here from frame.c. Accept frame
14193 or arbitrary window as argument. Update doc-strings.
14194 (Fminibuffer_window): Move up in code.
14195 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
14196 (Fset_frame_selected_window): Move here from frame.c.
14197 Marginal rewrite.
727e958e
MR
14198 (Fselected_window, select_window, Fselect_window): Move up in
14199 code. Minor doc-string fixes.
f230ecc9 14200
4d09bcf6
PE
142012011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14202
14203 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14204 Do not assume that spare memory exists; that assumption is valid
14205 only if SYSTEM_MALLOC.
14206 (LARGE_REQUEST): New macro, so that the issue of large requests
14207 is separated from the issue of spare memory.
14208
810928a2
AS
142092011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14210
172418ad
AS
14211 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14212 format. (Bug#8806)
14213
43f862f7
AS
14214 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14215
810928a2
AS
14216 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14217 before statements.
14218
a059fe24
JD
142192011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14220
14221 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14222
14223 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14224
14225 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14226 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14227
989bf368
JB
142282011-06-05 Juanma Barranquero <lekktu@gmail.com>
14229
14230 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14231
4b80f674
CY
142322011-06-04 Chong Yidong <cyd@stupidchicken.com>
14233
14234 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14235 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
14236 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14237 New error handlers.
4b80f674
CY
14238 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14239 Obey Vx_select_enable_clipboard_manager. Catch errors in
14240 x_clipboard_manager_save (Bug#8779).
14241 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 14242 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 14243
99a33b77 142442011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
14245
14246 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14247
99a33b77 142482011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
14249
14250 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14251 in the current matrix if keep_current_p is non-zero.
14252
8264569d
EZ
142532011-06-04 Eli Zaretskii <eliz@gnu.org>
14254
14255 * bidi.c (bidi_level_of_next_char): Fix last change.
14256
57f97249
EZ
142572011-06-03 Eli Zaretskii <eliz@gnu.org>
14258
fec2107c 14259 Support bidi reordering of text covered by display properties.
57f97249 14260
fec2107c
EZ
14261 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14262 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14263 (bidi_cache_search, bidi_cache_iterator_state)
14264 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
14265 (bidi_level_of_next_char, bidi_move_to_visually_next):
14266 Support character positions inside a run of characters covered by a
fec2107c
EZ
14267 display string.
14268 (bidi_paragraph_init, bidi_resolve_explicit_1)
14269 (bidi_level_of_next_char): Call bidi_fetch_char and
14270 bidi_fetch_char_advance instead of FETCH_CHAR and
14271 FETCH_CHAR_ADVANCE.
14272 (bidi_init_it): Initialize new members.
14273 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14274 definitions.
14275 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14276 instead of using explicit *_CHAR codes.
d6d100dd
SM
14277 (bidi_resolve_explicit, bidi_resolve_weak):
14278 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
14279 bidirectional text is supported only in multibyte buffers.
14280 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14281 it to initialize the frame_window_p member of struct bidi_it.
14282 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14283 (bidi_resolve_explicit, bidi_resolve_weak)
14284 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14285 bidi_it->nchars is non-positive.
14286 (bidi_level_of_next_char): Don't try to lookup the cache for the
14287 next/previous character if nothing is cached there yet, or if we
14288 were just reseat()'ed to a new position.
c40e2fb2 14289
0e14fe90
EZ
14290 * xdisp.c (set_cursor_from_row): Set start and stop points
14291 according to the row's direction when priming the loop that looks
14292 for the glyph on which to display cursor.
14293 (single_display_spec_intangible_p): Function deleted.
14294 (display_prop_intangible_p): Reimplement to call
14295 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
14296 Accept 3 additional arguments needed by handle_display_spec.
14297 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
14298 values: lists, `(when COND...)' forms, etc.
14299 (single_display_spec_string_p): Support property values that are
14300 lists with the argument STRING its top-level element.
14301 (display_prop_string_p): Fix the condition for processing a
14302 property that is a list to be consistent with handle_display_spec.
fec2107c 14303 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
14304 last portion of handle_display_prop.
14305 (compute_display_string_pos): Accept additional argument
14306 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14307 value of a `display' property is a "replacing spec".
14308 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14309 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14310 the display property, but just return a value indicating whether
14311 the display property will replace the characters it covers.
14312 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14313 frame_window_p members of struct bidi_it.
d6d100dd
SM
14314 (compute_display_string_pos, compute_display_string_end):
14315 New functions.
fec2107c
EZ
14316 (push_it): Accept second argument POSITION, where pop_it should
14317 jump to continue iteration.
14318 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 14319
fec2107c
EZ
14320 * keyboard.c (adjust_point_for_property): Adjust the call to
14321 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
14322
14323 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
14324 (bidi_init_it): Update prototypes.
14325 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
14326 (compute_display_string_pos, compute_display_string_end):
14327 Declare prototypes.
fec2107c
EZ
14328 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14329 EMACS_INT.
fc6f18ce 14330
40087514 143312011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 14332
57f53182
PE
14333 Malloc failure behavior now depends on size of allocation.
14334 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14335 * lisp.h: Change signatures accordingly.
14336 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14337 All callers changed. (Bug#8762)
14338
14339 * gnutls.c: Use Emacs's memory allocators.
14340 Without this change, the gnutls library would invoke malloc etc.
14341 directly, which causes problems on non-SYNC_INPUT hosts, and which
14342 runs afoul of improving memory_full behavior. (Bug#8761)
14343 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14344 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14345 xfree instead of the default malloc, realloc, free.
14346 (Fgnutls_boot): No need to check for memory allocation failure,
14347 since xmalloc does that for us.
14348
ac32cd99 14349 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
14350 * category.c (hash_get_category_set):
14351 * ccl.c (ccl_driver):
14352 * charset.c (Fdefine_charset_internal):
14353 * charset.h (struct charset.hash_index):
14354 * composite.c (get_composition_id, gstring_lookup_cache)
14355 (composition_gstring_put_cache):
14356 * composite.h (struct composition.hash_index):
14357 * dispextern.h (struct image.hash):
14358 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14359 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14360 (hashfn_equal, hashfn_user_defined, make_hash_table)
14361 (maybe_resize_hash_table, hash_lookup, hash_put)
14362 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14363 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14364 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14365 * image.c (make_image, search_image_cache, lookup_image)
14366 (xpm_put_color_table_h):
14367 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 14368 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 14369 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 14370 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
14371 * alloc.c (allocate_vectorlike):
14372 Check for overflow in vector size calculations.
14373 * ccl.c (ccl_driver):
14374 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
14375 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14376 need to be updated by these changes.
40087514
PE
14377 * fns.c (make_hash_table, maybe_resize_hash_table):
14378 Check for integer overflow with large hash tables.
0de4bb68
PE
14379 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14380 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14381 (SXHASH_REDUCE): New macro.
14382 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14383 Use it instead of discarding useful hash info with large hash values.
14384 (sxhash_float): New function.
14385 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14386 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
14387 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14388 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
14389 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14390 Adjust signatures to match updated version of code.
14391 (consing_since_gc): Now EMACS_INT, since a single hash table can
14392 use more than INT_MAX bytes.
14393
698d32e2
DN
143942011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14395
14396 Make it possible to build with GCC-4.6+ -O2 -flto.
14397
14398 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14399
fd6fa53f
SM
144002011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14401
14402 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14403 Call minibuffer-inactive-mode.
14404
864db017
JB
144052011-05-31 Juanma Barranquero <lekktu@gmail.com>
14406
14407 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14408 Update dependencies.
14409
2ad0baf4
DN
144102011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14411
14412 * data.c (init_data): Remove code for UTS, this system is not
14413 supported anymore.
14414
4fcc2638
DN
144152011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14416
14417 Don't force ./temacs to start in terminal mode.
14418
14419 * frame.c (make_initial_frame): Initialize faces in all cases, not
14420 only when CANNOT_DUMP is defined.
14421 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14422
c56e0fd5
DN
144232011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14424
14425 * dispnew.c (add_window_display_history): Use const for the string
14426 pointer. Remove declaration, not needed.
14427
333d54da 144282011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 14429
55d4c1b2 14430 Use 'inline', not 'INLINE'.
333d54da 14431 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
14432 * alloc.c, fontset.c (INLINE): Remove.
14433 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14434 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14435 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14436 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14437 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14438
738db178
DN
144392011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14440
14441 Make it possible to run ./temacs.
14442
14443 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14444 syms_of_callproc does the same thing. Remove test for
14445 "initialized", do it in the caller.
14446 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14447
620c53a6
SM
144482011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14449
14450 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14451 (read_minibuf): Use get_minibuffer.
14452 (syms_of_minibuf): Use DEFSYM.
14453 (Qmetadata): New var.
14454 * data.c (Qbuffer): Don't make it static.
14455 (syms_of_data): Use DEFSYM.
14456
e003a292
PE
144572011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14458
14459 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14460 (CCL_CODE_MIN): New macro.
14461
ed008a6d
PE
144622011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14463
3687c2ef
PE
14464 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14465
ed008a6d
PE
14466 * eval.c (Qdebug): Now static.
14467 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14468 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14469 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14470
d66c4c7c
CY
144712011-05-29 Chong Yidong <cyd@stupidchicken.com>
14472
14473 * image.c: Various fixes to ImageMagick code comments.
14474 (Fimagemagick_types): Doc fix.
14475
5fbc2025
PE
144762011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14477
0196f88a
PE
14478 Minor fixes prompted by GCC 4.6.0 warnings.
14479
14480 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14481
5fbc2025
PE
14482 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14483 (x_clipboard_manager_save_all): Move extern decl to ...
14484 * xterm.h: ... here, so that it can be checked for consistency.
14485
1dd3c2d9
CY
144862011-05-29 Chong Yidong <cyd@stupidchicken.com>
14487
14488 * xselect.c (x_clipboard_manager_save_frame)
14489 (x_clipboard_manager_save_all): New functions.
14490 (Fx_clipboard_manager_save): Lisp function deleted.
14491
14492 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14493 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14494
14495 * xterm.h: Update prototype.
14496
5ba6571d
WX
144972011-05-28 William Xu <william.xwl@gmail.com>
14498
14499 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14500 exiting (Bug#8239).
14501
3eaff834
JM
145022011-05-28 Jim Meyering <meyering@redhat.com>
14503
e1900994 14504 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
14505 * fns.c (to_uchar): Define.
14506 (crypto_hash_function): Use it to convert some newly-signed
14507 variables to unsigned, to avoid sign-extension bugs. For example,
14508 without this change, (md5 "truc") would evaluate to
14509 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14510 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 14511 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 14512
0f6990a7
PE
145132011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14514
14515 Integer overflow fixes.
c8a9ca5a 14516
08686060
PE
14517 * dbusbind.c: Serial number integer overflow fixes.
14518 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
14519 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14520 to hold a serial number that is too large for a fixnum.
14521 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14522 Check for serial numbers out of range. Decode any serial number
59568bf0 14523 that was so large that it became a float. (Bug#8722)
08686060 14524
2d1fc3c7
PE
14525 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14526 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14527 Use XFASTINT rather than XUINT when numbers are nonnegative.
14528 (xd_append_arg, Fdbus_method_return_internal):
14529 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14530 arguments, check that Lisp number is nonnegative, rather than
59568bf0 14531 silently wrapping negative numbers around. (Bug#8722)
30217ff0 14532 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 14533 (Bug#8722)
2d1fc3c7 14534
c8a9ca5a
PE
14535 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14536
519e1d69
PE
14537 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14538
6df6ae42 14539 ccl: Add integer overflow checks.
30569699
PE
14540 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14541 (IN_INT_RANGE): New macros.
14542 (ccl_driver): Use them to check for integer overflow when
14543 decoding a CCL program. Many of the new checks are whether XINT (x)
14544 fits in int; it doesn't always, on 64-bit hosts. The new version
14545 doesn't catch all possible integer overflows, but it's an
847044ea 14546 improvement. (Bug#8719)
30569699 14547
c11285dc
PE
14548 * alloc.c (make_event_array): Use XINT, not XUINT.
14549 There's no need for unsigned here.
14550
fdccd48e
PE
14551 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14552 This follows up to the 2011-05-06 change that substituted uintptr_t
14553 for EMACS_INT. This case wasn't caught back then.
14554
37910ab2
PE
14555 Rework Fformat to avoid integer overflow issues.
14556 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14557 now (part of C89). Include <verify.h>.
14558 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14559 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14560 (Fformat): Avoid the prepass trying to compute sizes; it was only
14561 approximate and thus did not catch overflow reliably. Instead, walk
14562 through the format just once, formatting and computing sizes as we go,
14563 checking for integer overflow at every step, and allocating a larger
14564 buffer as needed. Keep track separately whether the format is
14565 multibyte. Keep only the most-recently calculated precision, rather
14566 than them all. Record whether each argument has been converted to
14567 string. Use EMACS_INT, not int, for byte and char and arg counts.
14568 Support field widths and precisions larger than INT_MAX. Avoid
14569 sprintf's undefined behavior with conversion specifications such as %#d
14570 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14571 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14572 formatting out-of-range floating point numbers with int
9173deec 14573 formats. (Bug#8668)
37910ab2 14574
2e6578fb
PE
14575 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14576
0ae6bdee
PE
14577 * data.c: Avoid integer truncation in expressions involving floats.
14578 * data.c: Include <intprops.h>.
14579 (arith_driver): When there's an integer overflow in an expression
14580 involving floating point, convert the integers to floating point
14581 so that the resulting value does not suffer from catastrophic
14582 integer truncation. For example, on a 64-bit host (* 4
14583 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14584 Do not rely on undefined behavior after integer overflow.
14585
de883a70
PE
14586 merge count_size_as_multibyte, parse_str_to_multibyte
14587 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 14588 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
14589 Check for integer overflow.
14590 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14591 since it's now a duplicate of the other. This is more of
14592 a character than a buffer op, so better that it's in character.c.
14593 * fns.c, print.c: Adjust to above changes.
14594
2ff916cb
PE
145952011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14596
14597 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14598
f1b54466
PE
145992011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14600
fb1ac845
PE
14601 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14602 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14603 (x_clipboard_manager_save): Now static.
14604 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14605
f1b54466
PE
14606 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14607 (crypto_hash_function): Now static.
14608 Fix pointer signedness problems. Avoid unnecessary initializations.
14609
a9f737ee
CY
146102011-05-27 Chong Yidong <cyd@stupidchicken.com>
14611
14612 * termhooks.h (Vselection_alist): Make it terminal-local.
14613
14614 * terminal.c (create_terminal): Initialize it.
14615
14616 * xselect.c: Support for clipboard managers.
14617 (Vselection_alist): Move to termhooks.h as terminal-local var.
14618 (LOCAL_SELECTION): New macro.
14619 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14620 (symbol_to_x_atom): Remove gratuitous arg.
14621 (x_handle_selection_request, lisp_data_to_selection_data)
14622 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
14623 (x_own_selection, x_get_local_selection, x_convert_selection):
14624 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
14625 (some_frame_on_display): Delete unused function.
14626 (Fx_own_selection_internal, Fx_get_selection_internal)
14627 (Fx_disown_selection_internal, Fx_selection_owner_p)
14628 (Fx_selection_exists_p): New optional frame arg.
14629 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14630 (x_handle_selection_clear): Don't treat other terminals with the
14631 same keyboard specially. Use the terminal-local Vselection_alist.
14632 (x_clear_frame_selections): Use Frun_hook_with_args.
14633
14634 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14635
14636 * xterm.h: Add support for those atoms.
14637
e067f0c1
CY
146382011-05-26 Chong Yidong <cyd@stupidchicken.com>
14639
14640 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14641 (converted_selections, conversion_fail_tag): New global variables.
14642 (x_selection_request_lisp_error): Free the above.
14643 (x_get_local_selection): Remove unnecessary code.
14644 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
14645 of converted selections stored in converted_selections.
14646 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
14647 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14648 (x_convert_selection): New function.
14649 (x_handle_selection_event): Simplify.
14650 (x_get_foreign_selection): Don't ignore incoming requests while
14651 waiting for an answer; this will fail when we implement
14652 SAVE_TARGETS, and seems unnecessary anyway.
14653 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14654 (Vx_sent_selection_functions): Doc fix.
14655
0f4aebc0
LL
146562011-05-26 Leo Liu <sdl.web@gmail.com>
14657
14658 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14659
e61124cd
YM
146602011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14661
14662 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14663
14664 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14665 for fringe update if it has periodic bitmap.
ac389d0c 14666 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
14667 and fringe_bitmap_periodic_p.
14668
14669 * fringe.c (get_fringe_bitmap_data): New function.
14670 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14671 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14672 row. Mark glyph row for fringe update if periodicity changed.
14673
14674 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14675 for fringe update unless it has periodic bitmap.
14676
f16d9837
KH
146772011-05-25 Kenichi Handa <handa@m17n.org>
14678
14679 * xdisp.c (get_next_display_element): Set correct it->face_id for
14680 a static composition.
14681
e1b90ef6
LL
146822011-05-24 Leo Liu <sdl.web@gmail.com>
14683
14684 * deps.mk (fns.o):
14685 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14686
14687 * fns.c (crypto_hash_function, Fsha1): New function.
14688 (Fmd5): Use crypto_hash_function.
14689 (syms_of_fns): Add Ssha1.
14690
7400048f
PE
146912011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14692
14693 * gnutls.c: Remove unused macros.
14694 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14695 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14696 Remove macros that are defined and never used.
14697 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14698
abb71cf4
CY
146992011-05-22 Chong Yidong <cyd@stupidchicken.com>
14700
14701 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14702 (Fx_get_selection_internal): Minor cleanup.
14703 (Fx_own_selection_internal): Rename arguments for consistency with
14704 select.el.
14705
6307db39
PE
147062011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14707
14708 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14709
f3d4e0a4
CY
147102011-05-22 Chong Yidong <cyd@stupidchicken.com>
14711
14712 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14713
4d8ade89
YM
147142011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14715
14716 * dispnew.c (scrolling_window): Don't exclude the case that the
14717 last enabled row in the desired matrix touches the bottom boundary.
14718
32078c8d
GM
147192011-05-21 Glenn Morris <rgm@gnu.org>
14720
14721 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
14722 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14723 and add some more files.
32078c8d 14724
7285dc67
EZ
147252011-05-20 Eli Zaretskii <eliz@gnu.org>
14726
14727 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14728 report_file_error introduced by the change from 2011-05-07.
14729
89d1bd22
PE
147302011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14731
14732 * systime.h (Time): Define only if emacs is defined.
14733 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14734 where the include path doesn't have X11/X.h by default. See
14735 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14736
cd394be1 147372011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
14738
14739 * composite.c (find_automatic_composition): Fix previous change.
14740
b9704ad9
GM
147412011-05-20 Glenn Morris <rgm@gnu.org>
14742
14743 * lisp.mk: New file, split from Makefile.in.
14744 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14745 (shortlisp): Remove.
14746 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14747
4a720484
GM
147482011-05-19 Glenn Morris <rgm@gnu.org>
14749
14750 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14751 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14752 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14753 (lisp): Set the order to that of loadup.el.
14754 (shortlisp): Make it a copy of $lisp.
14755 (SOME_MACHINE_LISP): Remove.
14756 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14757 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14758
a28d4396
KH
147592011-05-18 Kenichi Handa <handa@m17n.org>
14760
14761 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14762 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14763 (find_automatic_composition): Mostly rewrite for efficiency.
14764
a2b1fa8e
JB
147652011-05-18 Juanma Barranquero <lekktu@gmail.com>
14766
14767 * makefile.w32-in: Update dependencies.
14768
8e1f5610
CS
147692011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14770
14771 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 14772 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 14773
7025ee00 147742011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 14775
cdfa6eab
PE
14776 Fix some integer overflow issues, such as string length overflow.
14777
06d6db33
PE
14778 * insdel.c (count_size_as_multibyte): Check for string overflow.
14779
2b4560a8
PE
14780 * character.c (lisp_string_width): Check for string overflow.
14781 Use EMACS_INT, not int, for string indexes and lengths; in
14782 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14783 the resulting string length overflows an EMACS_INT; instead,
14784 report a string overflow if no precision given. When checking for
14785 precision exhaustion, use a check that cannot possibly have
14786 integer overflow. (Bug#8675)
14787 * character.h (lisp_string_width): Adjust to new signature.
14788
cb93f9be
PE
14789 * alloc.c (string_overflow): New function.
14790 (Fmake_string): Use it. This doesn't change behavior, but saves
14791 a few bytes and will simplify future changes.
14792 * character.c (string_escape_byte8): Likewise.
14793 * lisp.h (string_overflow): New decl.
14794
1a1f3366
PE
14795 Fixups, following up to the user-interface timestamp change.
14796 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14797 for UI timestamps, instead of unsigned long.
9fbd6841
PE
14798 * msdos.c (mouse_get_pos): Likewise.
14799 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
14800 * w32gui.h (Time): Define by including "systime.h" rather than by
14801 declaring it ourselves. (Bug#8664)
14802
d4e3e4d3
PE
14803 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14804 * image.c (clear_image_cache): Likewise.
14805
f6a24d19
PE
14806 * term.c (term_mouse_position): Don't assume time_t wraparound.
14807
08dc5ae6
PE
14808 Be more systematic about user-interface timestamps.
14809 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
14810 and sometimes 'EMACS_UINT', to represent these timestamps.
14811 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
14812 This makes the code easier to follow, and makes it easier to catch
14813 integer overflow bugs such as Bug#8664.
14814 * frame.c (Fmouse_position, Fmouse_pixel_position):
14815 Use Time, not unsigned long, for user-interface timestamps.
14816 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14817 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14818 * keyboard.h (last_event_timestamp): Likewise.
14819 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14820 * menu.h (xmenu_show): Likewise.
14821 * term.c (term_mouse_position): Likewise.
14822 * termhooks.h (struct input_event.timestamp): Likewise.
14823 (struct terminal.mouse_position_hook): Likewise.
14824 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14825 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14826 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14827 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14828 what it was before.
14829 * menu.h, termhooks.h: Include "systime.h", for Time.
14830
8e55734a
PE
14831 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14832 Don't assume that the difference between two unsigned long values
14833 can fit into an integer. At this point, we know button_down_time
14834 <= event->timestamp, so the difference must be nonnegative, so
14835 there's no need to cast the result if double-click-time is
14836 nonnegative, as it should be; check that it's nonnegative, just in
14837 case. This bug is triggered when events are more than 2**31 ms
86db42d2 14838 apart (about 25 days). (Bug#8664)
8e55734a 14839
841f1b75 14840 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 14841 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 14842
3e26f69c
PE
14843 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14844 that always fit in int. Use a sentinel instead of a counter, to
14845 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
14846 * frame.h (struct frame): Use int for menu_bar_items_used
14847 instead of EMACS_INT, since it always fits in int.
3e26f69c 14848
5cc152c0
PE
14849 * menu.c (grow_menu_items): Check for int overflow.
14850
d89eb65e
PE
14851 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14852
5235bd3e
PE
14853 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14854 Before, the code was not consistent. These values cannot exceed
14855 2**31 - 1 so there's no need to make them unsigned.
14856 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14857 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14858 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14859 as modifiers.
14860 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14861
bc827e23
PE
14862 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14863 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14864 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14865 presumably because the widths might not match.
14866
78eb494e
PE
14867 * window.c (size_window): Avoid needless test at loop start.
14868
04f2d78b
CB
148692011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14870
14871 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14872
d2fc7e3d 148732011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
14874
14875 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14876
d2fc7e3d 148772011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
14878
14879 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14880 `width' to `bar_area_x' and `bar_area_width', respectively.
14881 (x_scroll_run): Take account of fringe background extension.
14882
04f2d78b
CB
14883 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14884 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
14885 `bar_area_width', respectively.
14886 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14887 background extension.
14888
79b70037
GM
148892011-05-10 Jim Meyering <meyering@redhat.com>
14890
14891 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14892
2f142cc5
JB
148932011-05-10 Juanma Barranquero <lekktu@gmail.com>
14894
14895 * image.c (Finit_image_library): Return t for built-in image types,
14896 like pbm and xbm. (Bug#8640)
14897
57679c86
AS
148982011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14899
14900 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14901
888c9e86
EZ
149022011-05-07 Eli Zaretskii <eliz@gnu.org>
14903
b0512a1d
EZ
14904 * w32console.c (Fset_screen_color): Doc fix.
14905 (Fget_screen_color): New function.
14906 (syms_of_ntterm): Defsubr it.
14907
7285dc67
EZ
14908 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14909 unlink the temporary file if Fcall_process didn't create it in the
14910 first place.
14911 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14912 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
14913 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14914 cue to call_process_cleanup not to close that handle.
14915
4d3fcc8e
BK
149162011-05-07 Ben Key <bkey76@gmail.com>
14917
14918 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14919 one of two shell specific rules, either bootstrap-temacs-CMD or
14920 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14921 to the previous implementation of the bootstrap-temacs rule.
14922 The bootstrap-temacs-CMD rule is similar to the previous
14923 implementation of the bootstrap-temacs rule except that it
14924 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14925 variable.
14926
14927 These changes, along with some changes to nt/configure.bat,
14928 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14929 earlier fix to add support for --cflags and --ldflags options
14930 that include quotes so that it works whether make uses cmd or
14931 sh as the shell.
14932
b4289b64
MA
149332011-05-06 Michael Albinus <michael.albinus@gmx.de>
14934
14935 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14936 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14937 is a constant.
14938 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14939 a string. Handle both cases.
14940 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14941 (Fdbus_register_method): Use Qinvalid_function.
14942
af4c0e28
JB
149432011-05-06 Juanma Barranquero <lekktu@gmail.com>
14944
14945 * makefile.w32-in: Update dependencies.
14946 (LISP_H): Add inttypes.h and stdin.h.
14947 (PROCESS_H): Add unistd.h.
14948
c51453d9
EZ
149492011-05-06 Eli Zaretskii <eliz@gnu.org>
14950
14951 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14952 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14953
8ff0ac3c 149542011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 14955
4c4b566b
PE
14956 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14957
aab2b9b5
PE
14958 * term.c (vfatal): Remove stray call to va_end.
14959 It's not needed and the C Standard doesn't allow it here anyway.
14960
c378da0b
PE
14961 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14962 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14963
288b08c7
PE
14964 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14965 bytes.
14966
e3601888
PE
14967 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14968
db6c0e74
PE
14969 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14970
dd5963ea
PE
14971 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14972
88c9450f
PE
14973 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14974
2f9442b8
PE
14975 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14976
c032b5f8
PE
14977 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14978 * charset.c (Fdefine_charset_internal): Don't initialize
14979 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 14980 32-bit int (Bug#8600).
a108c10b
PE
14981
14982 * lread.c (read_integer): Be more consistent with string-to-number.
14983 Use string_to_number to do the actual conversion; this avoids
14984 rounding errors and fixes some other screwups. Without this fix,
14985 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14986 (digit_to_number): Move earlier, for benefit of read_integer.
14987 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 14988 not a digit in any supported base. (Bug#8602)
a108c10b 14989
ad5f9eea
PE
14990 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14991
aec1708a
PE
14992 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14993 to match comment at start of function. This also removes a
14994 GCC warning about overflow in a 32+64-bit port.
14995
47be4ab5
PE
14996 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14997
371cac43
PE
14998 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14999 Reported by Stefan Monnier in
15000 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
15001 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15002 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 15003
d01a7826
PE
15004 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15005 (EMACS_UINTPTR): Likewise, with uintptr_t.
15006
7fd47d5c
PE
15007 * lisp.h: Prefer 64-bit EMACS_INT if available.
15008 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15009 on 32-bit hosts that have 64-bit int, so that they can access
15010 large files.
122b0c86
PE
15011 However, temporarily disable this change unless the temporary
15012 symbol WIDE_EMACS_INT is defined.
7fd47d5c 15013
8727937b
PE
15014 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15015
8ac068ac
PE
15016 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15017 This removes an assumption that EMACS_INT and long are the same
15018 width as pointers. The assumption is true for Emacs porting targets
15019 now, but we want to make other targets possible.
15020 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15021 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15022 In the rest of the code, change types of integers that hold casted
15023 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15024 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15025 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15026 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15027 No need to cast type when ORing.
15028 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15029 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15030 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15031 assume EMACS_INT is the same width as char *.
15032 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15033 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15034 Remove no-longer-needed casts.
15035 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15036 (xg_tool_bar_help_callback, xg_make_tool_item):
15037 Use EMACS_INTPTR to hold an integer
15038 that will be cast to void *; this can avoid a GCC warning
15039 if EMACS_INT is not the same width as void *.
15040 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15041 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15042 (current_message_1, set_message_1):
15043 Use a local to convert to proper width without a cast.
15044 * xmenu.c (dialog_selection_callback): Likewise.
15045
ede49d71
PE
15046 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15047 Also, don't assume VALBITS / RAND_BITS is less than 5,
15048 and don't rely on undefined behavior when shifting a 1 left into
15049 the sign bit.
15050 * lisp.h (get_random): Change signature to match.
15051
2f30ecd0
PE
15052 * lread.c (hash_string): Use size_t, not int, for hash computation.
15053 Normally we prefer signed values; but hashing is special, because
15054 it's better to use unsigned division on hash table sizes so that
15055 the remainder is nonnegative. Also, size_t is the natural width
15056 for hashing into memory. The previous code used 'int', which doesn't
15057 retain enough info to hash well into very large tables.
15058 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15059
2a866e7b
PE
15060 * dbusbind.c: Don't possibly lose pointer info when converting.
15061 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15062 Use XPNTR rather than XHASH, so that the high-order bits of
15063 the pointer aren't lost when converting through void *.
15064
51639eac
PE
15065 * eval.c (Fautoload): Don't double-shift a pointer.
15066
92394119
PE
15067 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15068
dbdb9a7c
JB
150692011-05-06 Juanma Barranquero <lekktu@gmail.com>
15070
15071 * gnutls.c (DEF_GNUTLS_FN):
15072 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15073
db7a0b4f
AS
150742011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15075
15076 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15077 marker. (Bug#8610)
15078
cd394be1 150792011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
15080
15081 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15082 New version that can reserve upto 2GB of heap space.
15083
f7ff1b0f 150842011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
15085
15086 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15087
639c109b
TZ
150882011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15089
15090 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15091 `gnutls_certificate_set_x509_key_file'.
15092
d2127135
JB
150932011-05-05 Juanma Barranquero <lekktu@gmail.com>
15094
15095 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15096 Update dependencies.
15097
e968f4f3
JB
150982011-05-04 Juanma Barranquero <lekktu@gmail.com>
15099
15100 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15101 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15102 Remove unused parameter `fildes'.
15103 * process.c (read_process_output, send_process): Don't pass it.
15104
84d358f0
JB
151052011-05-04 Juanma Barranquero <lekktu@gmail.com>
15106
15107 Fix previous change: the library cache is defined in w32.c.
15108 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15109 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15110
0898ca10
JB
151112011-05-04 Juanma Barranquero <lekktu@gmail.com>
15112
15113 Implement dynamic loading of GnuTLS on Windows.
15114
15115 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15116 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15117 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15118 Declare.
15119
15120 * gnutls.c (Qgnutls_dll): Define.
15121 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15122 (gnutls_*): Declare function pointers.
15123 (init_gnutls_functions): New function to initialize function pointers.
15124 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15125 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15126 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15127 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15128 (emacs_gnutls_write, emacs_gnutls_read)
15129 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15130 (Fgnutls_available_p): New function.
15131 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15132 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15133 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15134
15135 * image.c: Include w32.h.
15136 (Vimage_type_cache): Delete.
15137 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15138 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15139 (w32_delayed_load): Move to w32.c.
15140
15141 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15142
15143 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15144 (w32_delayed_load): Move from image.c. When loading a library, record
15145 its filename in the :loaded-from property of the library id.
15146 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15147 Initialize and staticpro them.
15148 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15149
15150 * process.c: Include lisp.h before w32.h, not after.
15151 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15152 instead of gnutls_record_check_pending.
15153
15154 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15155
ff4de4aa
TZ
151562011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15157
15158 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15159 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15160 as passed in.
15161
abe95abb
JD
151622011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15163
15164 * xterm.c (x_set_frame_alpha): Do not set property on anything
15165 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15166
e16e55d4
JB
151672011-05-02 Juanma Barranquero <lekktu@gmail.com>
15168
15169 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15170
bafcf6a5
JB
151712011-05-02 Juanma Barranquero <lekktu@gmail.com>
15172
15173 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15174 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15175 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15176 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15177 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15178 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15179 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15180 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15181 (Qgnutls_bootprop_callbacks_verify): Make static.
15182
e7a6747f
AS
151832011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15184
19ed11ba
AS
15185 * callproc.c: Indentation fixup.
15186
e7a6747f 15187 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
15188 (wait_for_termination, interruptible_wait_for_termination):
15189 Move after wait_for_termination_1.
e7a6747f 15190
1ef14cb4
LMI
151912011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15192
15193 * sysdep.c (interruptible_wait_for_termination): New function
15194 which is like wait_for_termination, but allows keyboard
15195 interruptions.
15196
15197 * callproc.c (Fcall_process): Add (:file "file") as an option for
15198 the STDOUT buffer.
15199 (Fcall_process_region): Ditto.
15200
330d880c
EZ
152012011-04-30 Eli Zaretskii <eliz@gnu.org>
15202
8db90b73
EZ
15203 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15204 rather than `XVECTOR (FOO)->size'.
15205
330d880c
EZ
15206 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15207 inttypes.h, as a gnulib replacement is used if it not available in
15208 system headers.
15209
15cbd324
EZ
152102011-04-21 Eli Zaretskii <eliz@gnu.org>
15211
15212 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15213 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15214 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15215
15216 * coding.c (coding_alloc_by_realloc): Error out if destination
15217 will grow beyond MOST_POSITIVE_FIXNUM.
15218 (decode_coding_emacs_mule): Abort if there isn't enough place in
15219 charbuf for the composition carryover bytes. Reserve an extra
15220 space for up to 2 characters produced in a loop.
15221 (decode_coding_iso_2022): Abort if there isn't enough place in
15222 charbuf for the composition carryover bytes.
15223
152242011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 15225
ae940cca
EZ
15226 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15227 aborting when %lld or %lll format is passed.
15228 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15229 %llo or %llx format is passed. (Bug#8545)
15230
03ab8921
EZ
15231 * window.c (window_scroll_line_based): Use a marker instead of
15232 simple variables to record original value of point. (Bug#7952)
15233
afda1437
EZ
15234 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15235 produced by %s or %c overflows available buffer space. (Bug#8545)
15236
f76dee0c
PE
152372011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15238
15239 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 15240 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 15241
fdc5744d
JB
152422011-04-28 Juanma Barranquero <lekktu@gmail.com>
15243
15244 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15245
638f053a
JB
152462011-04-28 Juanma Barranquero <lekktu@gmail.com>
15247
15248 * keyboard.c (Qdelayed_warnings_hook): Define.
15249 (command_loop_1): Run `delayed-warnings-hook'
15250 if Vdelayed_warnings_list is non-nil.
15251 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15252 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15253
d178f871
EZ
152542011-04-28 Eli Zaretskii <eliz@gnu.org>
15255
15256 * doprnt.c (doprnt): Don't return value smaller than the buffer
15257 size if the message was truncated. (Bug#8545).
15258
b124fd93
JB
152592011-04-28 Juanma Barranquero <lekktu@gmail.com>
15260
15261 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15262 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15263
e810457d
PE
152642011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15265
15266 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15267
ea51cceb
JB
152682011-04-27 Juanma Barranquero <lekktu@gmail.com>
15269
15270 * makefile.w32-in: Update dependencies.
15271
94dcfacf
EZ
152722011-04-27 Eli Zaretskii <eliz@gnu.org>
15273
15274 Improve `doprnt' and its usage. (Bug#8545)
15275 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15276 `format_end'. Remove support for %l as a conversion specifier.
15277 Don't use xrealloc. Improve diagnostics when the %l size modifier
15278 is used. Update the commentary.
15279
15280 * eval.c (verror): Simplify calculation of size_t.
15281
15282 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15283 messages.
15284
f61f41d7
PE
152852011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15286
15287 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15288 change.
15289
96fb4434
PE
152902011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15291
15292 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15293 This makes this file independent of the recent pseudovector change.
15294
671875da 152952011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 15296
69e9b5a3
PE
15297 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15298
b5f869a7 15299 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 15300 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 15301 Remove unused local.
c8926152 15302 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 15303
841a1577 15304 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
15305 GCC 4.6.0 optimizes based on type-based alias analysis.
15306 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
15307 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15308 != &v->size, and therefore "v->size = 1; b->size = 2; return
15309 v->size;" must therefore return 1. This assumption is incorrect
15310 for Emacs, since it type-puns struct Lisp_Vector * with many other
15311 types. To fix this problem, this patch adds a new type struct
f904488f 15312 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
15313 and pseudovectors, and helps optimizing compilers not get fooled
15314 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15315 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
15316 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15317 the size member.
eab3844f
PE
15318 (XSETPVECTYPE): Rewrite in terms of new macro.
15319 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15320 This is a bit clearer, and further avoids the possibility of
15321 undesirable aliasing.
15322 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 15323 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
15324 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15325 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
15326 (ASIZE): Now uses header.size rather than size.
15327 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
15328 to avoid the hassle of writing XVECTOR (foo)->header.size.
15329 (struct vectorlike_header): New type.
eab3844f
PE
15330 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15331 object, to help avoid aliasing.
15332 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15333 (SUBRP): Likewise, since Lisp_Subr is a special case.
15334 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15335 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15336 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 15337 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
15338 changed to be "header.size" and "header.next".
15339 * buffer.h (struct buffer): Likewise.
15340 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15341 * frame.h (struct frame): Likewise.
15342 * process.h (struct Lisp_Process): Likewise.
15343 * termhooks.h (struct terminal): Likewise.
15344 * window.c (struct save_window_data, struct saved_window): Likewise.
15345 * window.h (struct window): Likewise.
15346 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15347 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15348 * buffer.c (init_buffer_once): Likewise.
15349 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15350 special case.
15351 * process.c (Fformat_network_address): Use local var for size,
15352 for brevity.
15353
0df1eac5
PE
15354 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15355
847ab9d1 15356 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
15357 * data.c (atof): Remove decl; no longer used or needed.
15358 (digit_to_number): Move to lread.c.
15359 (Fstring_to_number): Use new string_to_number function, to be
15360 consistent with how the Lisp reader treats infinities and NaNs.
15361 Do not assume that floating-point numbers represent EMACS_INT
15362 without losing information; this is not true on most 64-bit hosts.
15363 Avoid double-rounding errors, by insisting on integers when
15364 parsing non-base-10 numbers, as the documentation specifies.
15365 * lisp.h (string_to_number): New decl, replacing ...
15366 (isfloat_string): Remove.
bc0a5c13 15367 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 15368 (read1): Do not accept +. and -. as integers; this
452f4150
PE
15369 appears to have been a coding error. Similarly, do not accept
15370 strings like +-1e0 as floating point numbers. Do not report
15371 overflow for integer overflows unless the base is not 10 which
15372 means we have no simple and reliable way to continue.
15373 Break out the floating-point parsing into a new
15374 function string_to_number, so that Fstring_to_number parses
15375 floating point numbers consistently with the Lisp reader.
04f2d78b 15376 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
15377 (E_CHAR, EXP_INT): Remove, replacing with ...
15378 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15379 (string_to_number): New function, replacing isfloat_string.
15380 This function checks for valid syntax and produces the resulting
15381 Lisp float number too. Rework it so that string-to-number
bc0a5c13 15382 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
15383 so that overflow for non-base-10 numbers is reported only when
15384 there's no portable and simple way to convert to floating point.
452f4150 15385
67769ffc
PE
15386 * textprop.c (set_text_properties_1): Rewrite for clarity,
15387 and to avoid GCC warning about integer overflow.
15388
c20db43f
PE
15389 * intervals.h (struct interval): Use EMACS_INT for members
15390 where EMACS_UINT might cause problems. See
15391 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15392 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15393 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15394 All uses changed.
37aa2f85
PE
15395 (offset_intervals): Tell GCC not to worry about length overflow
15396 when negating a negative length.
c20db43f 15397
2538aa2f
PE
15398 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15399 (overrun_check_free): Likewise.
15400
f2d3008d
PE
15401 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15402 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15403 word size.
15404
ec8df744
PE
15405 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15406 (gnutls_make_error): Rename local to avoid shadowing.
15407 (gnutls_emacs_global_deinit): ifdef out; not used.
15408 (Fgnutls_boot): Use const for pointer to readonly storage.
15409 Comment out unused local. Fix pointer signedness problems.
15410
640ee02d
PE
15411 * lread.c (openp): Don't stuff size_t into an 'int'.
15412 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15413 about possible signed overflow.
15414
6048fb2a
PE
15415 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15416 (GDK_KEY_g): Don't define if already defined.
15417 (xg_prepare_tooltip): Avoid pointer signedness problem.
15418 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15419
fa3c87e1
PE
15420 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15421 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15422
2172544b
PE
15423 * xfns.c (Fx_window_property): Simplify a bit,
15424 to make a bit faster and to avoid GCC 4.6.0 warning.
15425 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15426
9b821a21
PE
15427 * fns.c (internal_equal): Don't assume size_t fits in int.
15428
3c616cfa
PE
15429 * alloc.c (compact_small_strings): Tighten assertion a little.
15430
c2982e87
PE
15431 Replace pEd with more-general pI, and fix some printf arg casts.
15432 * lisp.h (pI): New macro, generalizing old pEd macro to other
15433 conversion specifiers. For example, use "...%"pI"d..." rather
15434 than "...%"pEd"...".
15435 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 15436 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
15437 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15438 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15439 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15440 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15441 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15442 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15443 64-bit hosts.
15444 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15445 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15446 * print.c (safe_debug_print, print_object): Likewise.
15447 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15448 to int.
6f04d126
PE
15449 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15450 avoiding the 0 flag, which is not portable.
c2982e87
PE
15451 * process.c (Fmake_network_process): Use pI to avoid cast.
15452 * region-cache.c (pp_cache): Likewise.
15453 * xdisp.c (decode_mode_spec): Likewise.
15454 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15455 behavior on 64-bit hosts with printf arg.
6f04d126 15456 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
15457 (x_stop_queuing_selection_requests): Likewise.
15458 (x_get_window_property): Don't truncate byte count to an 'int'
15459 when tracing.
0b432f21 15460
5e073ec7
PE
15461 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15462 here, since it parses constructs like leading '-' and spaces,
15463 which are not wanted; and it overflows with large numbers.
15464 Instead, simply match F[0-9]+, which is what is wanted anyway.
15465
36372bf9
PE
15466 * alloc.c: Remove unportable assumptions about struct layout.
15467 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15468 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15469 (allocate_vectorlike, make_pure_vector): Use the new macros,
15470 plus offsetof, to remove unportable assumptions about struct layout.
15471 These assumptions hold on all porting targets that I know of, but
15472 they are not guaranteed, they're easy to remove, and removing them
15473 makes further changes easier.
15474
0b432f21
PE
15475 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15476 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
15477 (string_overrun_cookie): Now const. Use initializers that
15478 don't formally overflow signed char, to avoid warnings.
000098c1
PE
15479 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15480 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
15481 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15482 multiple of sizeof (EMACS_INT); it need not be, if
15483 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 15484 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 15485
895009e1
JB
154862011-04-26 Juanma Barranquero <lekktu@gmail.com>
15487
15488 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15489
6a7a1b0b
TZ
154902011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15491
15492 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 15493 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
15494 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15495
841a1577 154962011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
15497
15498 * lisp.h (Qdebug): List symbol.
895009e1 15499 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
15500 * keyboard.c (debug-on-event): New variable.
15501 (handle_user_signal): Break into debugger when debug-on-event
15502 matches the current signal symbol.
15503
f2d3ba6f
DN
155042011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15505
15506 * alloc.c (check_sblock, check_string_bytes)
15507 (check_string_free_list): Convert to standard C.
15508
42ce4c63
TZ
155092011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15510
15511 * w32.c (emacs_gnutls_push): Fix typo.
15512
825cd63c
EZ
155132011-04-25 Eli Zaretskii <eliz@gnu.org>
15514
fb11d64d
EZ
15515 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15516 "cast to pointer from integer of different size".
15517
825cd63c
EZ
15518 Improve doprnt and its use in verror. (Bug#8545)
15519 * doprnt.c (doprnt): Document the set of format control sequences
15520 supported by the function. Use SAFE_ALLOCA instead of always
15521 using `alloca'.
15522
15523 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15524 is one byte too soon. Don't use xrealloc; instead xfree and
15525 xmalloc anew.
15526
e061a11b
TZ
155272011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15528
15529 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15530 callbacks stage.
15531
15532 * gnutls.c: Renamed global_initialized to
15533 gnutls_global_initialized. Added internals for the
15534 :verify-hostname-error, :verify-error, and :verify-flags
15535 parameters of `gnutls-boot' and documented those parameters in the
15536 docstring. Start callback support.
9173deec
JB
15537 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15538 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15539 on error. Return error code.
e061a11b
TZ
15540 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15541 (emacs_gnutls_read): Likewise.
15542 (Fgnutls_boot): Return handshake error code.
15543 (emacs_gnutls_handle_error): New function.
15544 (wsaerror_to_errno): Likewise.
15545
15546 * w32.h (emacs_gnutls_pull): Add prototype.
15547 (emacs_gnutls_push): Likewise.
15548
15549 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15550 (emacs_gnutls_push): Likewise.
15551
155522011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15553
15554 * process.c (wait_reading_process_output): Check if GnuTLS
15555 buffered some data internally if no FDs are set for TLS
15556 connections.
15557
15558 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15559 (LIBS): Link to USER_LIBS.
15560 ($(BLD)/gnutls.$(0)): New target.
15561
fa6996bc
EZ
155622011-04-24 Eli Zaretskii <eliz@gnu.org>
15563
eb35682e
EZ
15564 * xdisp.c (handle_single_display_spec): Rename the
15565 display_replaced_before_p argument into display_replaced_p, to
15566 make it consistent with the commentary. Fix typos in the
15567 commentary.
15568
e2ad650c
EZ
15569 * textprop.c (syms_of_textprop): Remove dead code.
15570 (copy_text_properties): Delete obsolete commentary about an
15571 interface that was deleted long ago. Fix typos in the description
15572 of arguments.
15573
1b2de274
EZ
15574 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15575 to changes in oldXMenu/XMenu.h from 2011-04-16.
15576 <menu_help_message, prev_menu_help_message>: Constify.
15577 (IT_menu_make_room): menu->help_text is now `const char **';
15578 adjust.
15579
15580 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15581 to changes in oldXMenu/XMenu.h from 2011-04-16.
15582 (struct XMenu): Declare `help_text' `const char **'.
15583
15584 * xfaces.c <Qunspecified>: Make extern again.
15585
15586 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 15587 required by POSIX.
1b2de274 15588
762b15be
EZ
15589 * doc.c (get_doc_string): Improve the format passed to `error'.
15590
15591 * doprnt.c (doprnt): Improve commentary.
15592
15593 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15594
15595 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15596 them with etags.
15597
f1052e5d
EZ
15598 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15599 changes in globals.h immediately force recompilation.
762b15be
EZ
15600 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15601 $(CURDIR)/s/ms-w32.h.
15602 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 15603
fa6996bc
EZ
15604 * character.c (Fchar_direction): Function deleted.
15605 (syms_of_character): Don't defsubr it.
15606 <char-direction-table>: Deleted.
15607
e6c3da20
EZ
156082011-04-23 Eli Zaretskii <eliz@gnu.org>
15609
15610 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15611 * doprnt.c: Include limits.h.
15612 (SIZE_MAX): New macro.
04f2d78b
CB
15613 (doprnt): Return a size_t value. 2nd arg is now size_t.
15614 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
15615 Improve overflow protection. Support `l' modifier for integer
15616 conversions. Support %l conversion. Don't assume an EMACS_INT
15617 argument for integer conversions and for %c.
15618
15619 * lisp.h (doprnt): Restore prototype.
15620
15621 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15622 $(SRC)/character.h.
15623
15624 * Makefile.in (base_obj): Add back doprnt.o.
15625
15626 * deps.mk (doprnt.o): Add back prerequisites.
15627 (callint.o): Depend on character.h.
15628
15629 * eval.c (internal_lisp_condition_case): Include the handler
15630 representation in the error message.
15631 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15632 when breaking from the loop.
15633
15634 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15635
15636 * callint.c (Fcall_interactively): When displaying error message
15637 about invalid control letter, pass the character's codepoint, not
15638 a pointer to its multibyte form. Improve display of the character
15639 in octal and display also its hex code.
15640
15641 * character.c (char_string): Use %x to display the (unsigned)
15642 codepoint of an invalid character, to avoid displaying a bogus
15643 negative value.
15644
15645 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15646 `error', not SYMBOL_NAME itself.
15647
15648 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15649 character arguments to `error'.
15650
15651 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15652 to `error' in error message about FINAL_CHAR argument. Make sure
15653 FINAL_CHAR is a character, and use %c when it is passed as
15654 argument to `error'.
15655
4ffd0d6b 156562011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
15657
15658 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15659
15660 * w32.c: Include <time.h>.
15661 (sys_localtime): New function.
15662
4ffd0d6b 156632011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
15664
15665 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15666
4ffd0d6b 15667 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 15668
4ffd0d6b 156692011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 15670
4ffd0d6b
GM
15671 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15672 zombies (Bug#8467).
aac0c6e3 15673
04c56954
EZ
156742011-04-19 Eli Zaretskii <eliz@gnu.org>
15675
15676 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15677 gl_state.e_property when gl_state.object is Qt.
15678
15679 * insdel.c (make_gap_larger): Remove limitation of buffer size
15680 to <= INT_MAX.
15681
16a43933
CY
156822011-04-18 Chong Yidong <cyd@stupidchicken.com>
15683
15684 * xdisp.c (lookup_glyphless_char_display)
15685 (produce_glyphless_glyph): Handle cons cell entry in
15686 glyphless-char-display.
15687 (Vglyphless_char_display): Document it.
15688
15689 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15690 glyphless-char-display.
15691
4581706e
CY
156922011-04-17 Chong Yidong <cyd@stupidchicken.com>
15693
15694 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15695
15696 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15697
15698 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15699 definition for no-X builds.
15700
4887c6e2 157012011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 15702
fd35b6f9
PE
15703 Static checks with GCC 4.6.0 and non-default toolkits.
15704
5c1ccb01
PE
15705 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15706
006c5daa
PE
15707 * process.c (keyboard_bit_set): Define only if SIGIO.
15708 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15709 (send_process): Repair possible setjmp clobbering.
15710
efc736d3
PE
15711 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15712
4e2fe2e6
PE
15713 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15714
f97334a2
PE
15715 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15716
4e75f29d
PE
15717 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15718 Define only if needed.
15719
90efadd1
PE
15720 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15721 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 15722 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 15723
3c647824
PE
15724 * dispextern.h (struct redisplay_interface): Rename param
15725 to avoid shadowing.
e264f262 15726 * termhooks.h (struct terminal): Likewise.
761383f4 15727 * xterm.c (xembed_send_message): Likewise.
3c647824 15728
b58c5c4a
PE
15729 * insdel.c (make_gap_smaller): Define only if
15730 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15731
cad59032
PE
15732 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15733 it.
15734
c339dc2e
PE
15735 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15736 so that we aren't warned about unused symbols.
15737
91a3e27b
PE
15738 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15739
399c71d3 15740 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 15741
8ffc96f5
PE
15742 * xfns.c (x_real_positions): Mark locals as initialized.
15743
eef9bc79
PE
15744 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15745
098db9dd
PE
15746 * xterm.c: Fix problems found by static analysis with other toolkits.
15747 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
15748 (x_dispatch_event): Declare static if USE_GTK, and
15749 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 15750 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 15751 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
15752 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15753 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 15754
eb18f6cc
PE
15755 * xmenu.c (menu_help_callback): Pointer type fixes.
15756 Use const pointers when pointing at readonly data. Avoid pointer
15757 signedness clashes.
15758 (FALSE): Remove unused macro.
15759 (update_frame_menubar): Remove unused decl.
15760
1fe72bf8
PE
15761 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15762
60d9e1db
PE
15763 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15764 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15765 (single_menu_item): Rename local to avoid shadowing.
15766
39261c26
PE
15767 * keyboard.c (make_lispy_event): Remove unused local var.
15768
018c5e19
PE
15769 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15770 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15771
63d2b86e
PE
15772 * bitmaps: Change bitmaps from unsigned char back to the X11
15773 compatible char. Avoid the old compiler warnings about
15774 out-of-range initializers by using, for example, '\xab' rather
15775 than 0xab.
15776
aefd87e1
PE
15777 * xgselect.c (xgselect_initialize): Check vs interface
15778 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15779
bf501fb9
PE
15780 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15781
e9829fdf
PE
15782 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15783 to read-only memory.
15784
1086c095
PE
15785 * fns.c (vector): Remove; this old hack is no longer needed.
15786
2baccd04 15787 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 15788 Remove unused var.
dde42981 15789 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 15790
72391843 15791 * xrdb.c (x_load_resources): Omit unused local.
3565b346 15792
436c16df 15793 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 15794 (x_window): Rename locals to avoid shadowing.
dc5ddd85 15795 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 15796
92bb796d 15797 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 15798 (x_term_init): Remove local to avoid shadowing.
92bb796d 15799
764430a3 15800 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
15801
15802 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15803 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15804
d1dfb56c
EZ
158052011-04-16 Eli Zaretskii <eliz@gnu.org>
15806
c4354cb4
EZ
15807 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15808
d1dfb56c
EZ
15809 Fix regex.c, syntax.c and friends for buffers > 2GB.
15810 * syntax.h (struct gl_state_s): Declare character position members
15811 EMACS_INT.
15812
15813 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15814
04f2d78b
CB
15815 * textprop.c (verify_interval_modification, interval_of):
15816 Declare arguments EMACS_INT.
d1dfb56c
EZ
15817
15818 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15819 EMACS_INT.
15820
15821 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15822
15823 * indent.c (Fvertical_motion): Local variable it_start is now
15824 EMACS_INT.
15825
15826 * regex.c (re_match, re_match_2, re_match_2_internal)
15827 (bcmp_translate, regcomp, regexec, print_double_string)
15828 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15829 (re_compile_pattern, re_exec): Declare arguments and local
15830 variables `size_t' and `ssize_t' and return values `regoff_t', as
15831 appropriate.
15832 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15833 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15834 <compile_stack_type>: `size' and `avail' are now `size_t'.
15835
15836 * regex.h <regoff_t>: Use ssize_t, not int.
15837 (re_search, re_search_2, re_match, re_match_2): Arguments that
15838 specify buffer/string position and length are now ssize_t and
15839 size_t. Return type is regoff_t.
15840
613052cd
BK
158412011-04-16 Ben Key <bkey76@gmail.com>
15842
15843 * nsfont.m: Fixed bugs in ns_get_family and
15844 ns_descriptor_to_entity that were caused by using free to
15845 deallocate memory blocks that were allocated by xmalloc (via
15846 xstrdup). This caused Emacs to crash when compiled with
15847 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15848 --enable-checking=xmallocoverrun). xfree is now used to
15849 deallocate these memory blocks.
15850
4170f62f 158512011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 15852
71b41406
PE
15853 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15854
9587a89d
PE
15855 emacs_write: Accept and return EMACS_INT for sizes.
15856 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15857 et seq.
15858 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15859 Accept and return EMACS_INT.
15860 (emacs_gnutls_write): Return the number of bytes written on
15861 partial writes.
15862 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
15863 (emacs_read, emacs_write): Remove check for negative size, as the
15864 Emacs source code has been audited now.
9587a89d
PE
15865 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15866 (emacs_read, emacs_write): Use it.
273a5f82
PE
15867 * process.c (send_process): Adjust to the new signatures of
15868 emacs_write and emacs_gnutls_write. Do not attempt to store
15869 a byte offset into an 'int'; it might overflow.
9587a89d 15870 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 15871
3e047f51
PE
15872 * sound.c: Don't assume sizes fit in 'int'.
15873 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 15874 Return EMACS_INT, not int.
3e047f51 15875 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
15876 Accept EMACS_INT, not int.
15877 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
15878 record read return values.
15879
cc39a9db
BK
158802011-04-15 Ben Key <bkey76@gmail.com>
15881
c9d0ec6d
JB
15882 * keyboard.c (Qundefined): Don't declare static since it is used
15883 in nsfns.m.
15884 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15885 static since they are used in nsfont.m.
cc39a9db 15886
6c60eb9f
SM
158872011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15888
15889 * process.c (Qprocessp): Don't declare static.
15890 * lisp.h (Qprocessp): Declare again.
15891
7990b61a
JB
158922011-04-15 Juanma Barranquero <lekktu@gmail.com>
15893
15894 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15895
5d4cb038
PE
158962011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15897
8bd7b830 15898 Improve C-level modularity by making more things 'static'.
cd64ea1d 15899
e3b27b31
PE
15900 Don't publish debugger-only interfaces to other modules.
15901 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15902 (verify_bytepos, count_markers): Move decls to the only modules
15903 that need them.
15904 * region-cache.h (pp_cache): Likewise.
15905 * window.h (check_all_windows): Likewise.
15906 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15907
5d4cb038
PE
15908 * sysdep.c (croak): Now static, if
15909 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15910 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
15911
15912 * alloc.c (refill_memory_reserve): Now static if
15913 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15914 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 15915
e87b6180
PE
15916 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15917 Define only if USE_LUCID.
15918
ac64929e
PE
15919 * xrdb.c (x_customization_string, x_rm_string): Now static.
15920
6f37259d
PE
15921 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15922 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15923
1683e3ab
PE
15924 * xdisp.c (draw_row_with_mouse_face): Now static.
15925 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15926
de9c2632
PE
15927 * window.h (check_all_windows): Mark externally visible.
15928
2b96acb7
PE
15929 * window.c (window_deletion_count): Now static.
15930
15931 * undo.c: Make symbols static if they're not exported.
15932 (last_undo_buffer, last_boundary_position, pending_boundary):
15933 Now static.
15934
50436f33
PE
15935 * textprop.c (interval_insert_behind_hooks): Now static.
15936 (interval_insert_in_front_hooks): Likewise.
15937
64520e5c
PE
15938 * term.c: Make symbols static if they're not exported.
15939 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15940 (max_frame_lines, tty_set_terminal_modes):
15941 (tty_reset_terminal_modes, tty_turn_off_highlight):
15942 (get_tty_terminal): Now static.
15943 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15944 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 15945 HAVE_WINDOW_SYSTEM.
64520e5c
PE
15946 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15947 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15948
1fa53021
PE
15949 * sysdep.c: Make symbols static if they're not exported.
15950 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15951 Now static.
15952 (sigprocmask_set, full_mask): Remove; unused.
15953 (wait_debugging): Mark as visible.
15954 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15955 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15956
d4b43b22
PE
15957 * syntax.c (syntax_temp): Define only if !__GNUC__.
15958
b7c513d0
PE
15959 * sound.c (current_sound_device, current_sound): Now static.
15960
989b29ad
PE
15961 * search.c (searchbufs, searchbuf_head): Now static.
15962
13a55a78
PE
15963 * scroll.c (scroll_cost): Remove; unused.
15964 * dispextern.h (scroll_cost): Remove decl.
15965
de68a1fc
PE
15966 * region-cache.h (pp_cache): Mark as externally visible.
15967
40ccffa6
PE
15968 * process.c: Make symbols static if they're not exported.
15969 (process_tick, update_tick, create_process, chan_process):
15970 (Vprocess_alist, proc_buffered_char, datagram_access):
15971 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15972 (deactivate_process): Mark defn as static, as well as decl.
15973 * lisp.h (create_process): Remove decl.
15974 * process.h (chan_process, Vprocess_alist): Remove decls.
15975
ad64fc97
PE
15976 * print.c: Make symbols static if they're not exported.
15977 (print_depth, new_backquote_output, being_printed, print_buffer):
15978 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15979 (print_interval, print_number_index, initial_stderr_stream):
15980 Now static.
15981 * lisp.h (Fprinc): Remove decl.
15982 (debug_output_compilation_hack): Mark as externally visible.
15983
adddb265
PE
15984 * sysdep.c (croak): Move decl from here to syssignal.h.
15985 * syssignal.h (croak): Put it here, so the API can be checked when
15986 'croak' is called from dissociate_if_controlling_tty.
15987
1717ede2
PE
15988 * minibuf.c: Make symbols static if they're not exported.
15989 (minibuf_save_list, choose_minibuf_frame): Now static.
15990 * lisp.h (choose_minibuf_frame): Remove decl.
15991
fa5fb2bc
PE
15992 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15993
1e3890d1
PE
15994 * lread.c: Make symbols static if they're not exported.
15995 (read_objects, initial_obarray, oblookup_last_bucket_number):
15996 Now static.
15997 (make_symbol): Remove; unused.
15998 * lisp.h (initial_obarray, make_symbol): Remove decls.
15999
8a1414fa
PE
16000 * keyboard.c: Make symbols static if they're not exported.
16001 (single_kboard, recent_keys_index, total_keys, recent_keys):
16002 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16003 (this_single_command_key_start, echoing, last_auto_save):
16004 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16005 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16006 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16007 (Vlispy_mouse_stem, double_click_count):
16008 Now static.
16009 (force_auto_save_soon): Define only if SIGDANGER.
16010 (ignore_mouse_drag_p): Now static if
16011 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16012 (print_help): Remove; unused.
16013 (stop_character, last_timer_event): Mark as externally visible.
16014 * keyboard.h (ignore_mouse_drag_p): Declare only if
16015 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16016 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16017 * lisp.h (echoing): Remove decl.
16018 (force_auto_save_soon): Declare only if SIGDANGER.
16019 * xdisp.c (redisplay_window): Simplify code, to make it more
16020 obvious that ignore_mouse_drag_p is not accessed if !defined
16021 USE_GTK && !defined HAVE_NS.
16022
93ea6e8f
PE
16023 * intervals.c: Make symbols static if they're not exported.
16024 (merge_properties_sticky, merge_interval_right, delete_interval):
16025 Now static.
16026 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16027
77382fcc
PE
16028 * insdel.c: Make symbols static if they're not exported.
16029 However, leave prepare_to_modify_buffer alone. It's never
16030 called from outside this function, but that appears to be a bug.
16031 (combine_after_change_list, combine_after_change_buffer):
4889fc82 16032 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
16033 (adjust_after_replace_noundo): Remove; unused.
16034 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 16035 (signal_before_change): Remove decls.
77382fcc 16036
9306c32e
PE
16037 * indent.c (val_compute_motion, val_vmotion): Now static.
16038
cd44d2eb
PE
16039 * image.c: Make symbols static if they're not exported.
16040 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16041 if USE_GTK.
16042 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16043 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16044
ad9a7a06
PE
16045 * fringe.c (standard_bitmaps): Now static.
16046 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16047
81626931
PE
16048 * frame.c: Make symbols static if they're not exported.
16049 (x_report_frame_params, make_terminal_frame): Now static.
16050 (get_frame_param): Now static, unless HAVE_NS.
16051 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16052 (x_get_resource_string): Remove; not used.
16053 * frame.h (make_terminal_frame, x_report_frame_params):
16054 (x_get_resource_string); Remove decls.
16055 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16056 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16057
239f9db9
PE
16058 * font.c, fontset.c: Make symbols static if they're not exported.
16059 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16060 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16061 * font.c (font_close_object): Now static.
16062 * font.h (font_close_object): Remove.
16063 * fontset.c (FONTSET_OBJLIST): Remove.
16064 (free_realized_fontset) #if-0 the body, which does nothing.
16065 (face_suitable_for_char_p): #if-0, as it's never called.
16066 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
16067 * xfaces.c (face_at_string_position):
16068 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
16069 since 0 is always ASCII.
16070
dfcf3579
PE
16071 * fns.c (weak_hash_tables): Now static.
16072
5045092b
PE
16073 * fileio.c: Make symbols static if they're not exported.
16074 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16075 (Vwrite_region_annotation_buffers): Now static.
16076
57a96f5c
PE
16077 * eval.c: Make symbols static if they're not exported.
16078 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16079 * lisp.h (backtrace_list): Remove decl.
16080
35f08c38
PE
16081 * emacs.c: Make symbols static if they're not exported.
16082 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16083 (fatal_error_code, fatal_error_signal_hook, standard_args):
16084 Now static.
16085 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16086 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16087 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16088 * lisp.h (fatal_error_signal_hook): Remove decl.
16089 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16090
f44bd759
PE
16091 * editfns.c: Move a (normally-unused) function to its only use.
16092 * editfns.c, lisp.h (get_operating_system_release): Remove.
16093 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16094 worth the hassle of breaking this out.
16095
b532497d
PE
16096 * xterm.c: Make symbols static if they're not exported.
16097 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16098 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16099 (x_destroy_window, x_delete_display):
16100 Now static.
16101 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16102 (x_mouse_leave): Remove; unused.
16103 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16104 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16105 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16106 Remove decls.
16107 (x_mouse_leave): Declare only if WINDOWSNT.
16108 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16109 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16110 USE_X_TOOLKIT.
16111
1675728f
PE
16112 * ftxfont.c: Make symbols static if they're not exported.
16113 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16114 HAVE_FREETYPE.
16115 * font.h (ftxfont_driver): Likewise.
16116
e4cebfca
PE
16117 * xfns.c: Make symbols static if they're not exported.
16118 (x_last_font_name, x_display_info_for_name):
16119 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16120 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16121 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16122 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16123 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16124 (last_show_tip_args): Now static.
16125 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16126 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16127 (x_screen_planes): Remove; unused.
16128 * dispextern.h (x_screen_planes): Remove decl.
16129
5bf46f05
PE
16130 * dispnew.c: Make symbols static if they're not exported.
16131 * dispextern.h (redraw_garbaged_frames, scrolling):
16132 (increment_row_positions): Remove.
16133 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16134 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16135 Now static.
16136 (redraw_garbaged_frames): Remove; unused.
16137
435f4c28
PE
16138 * xfaces.c: Make symbols static if they're not exported.
16139 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16140 Remove decls.
16141 * xterm.h (defined_color): Remove decls.
16142 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16143 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16144 (menu_face_changed_default, defined_color, free_realized_face):
16145 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16146 (ascii_face_of_lisp_face): Remove; unused.
16147
8524aef3
PE
16148 * xdisp.c: Make symbols static if they're not exported.
16149 * dispextern.h (scratch_glyph_row, window_box_edges):
16150 (glyph_to_pixel_coords, set_cursor_from_row):
16151 (get_next_display_element, set_iterator_to_next):
16152 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16153 (show_mouse_face): Remove decls
16154 * frame.h (message_buf_print): Likewise.
16155 * lisp.h (pop_message, set_message, check_point_in_composition):
16156 Likewise.
16157 * xterm.h (set_vertical_scroll_bar): Likewise.
16158 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16159 (message_buf_print, scratch_glyph_row, displayed_buffer):
16160 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16161 (get_next_display_element, show_mouse_face, window_box_edges):
16162 (frame_to_window_pixel_xy, check_point_in_composition):
16163 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16164 (glyph_to_pixel_coords): Remove; unused.
16165
16390cd2
PE
16166 * dired.c (file_name_completion): Now static.
16167
16168 * dbusbind.c (xd_in_read_queued_messages): Now static.
16169
a25f4dfa
PE
16170 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16171 * data.c (circular_list_error): Remove.
16172
14a9c8df
PE
16173 * commands.h (last_point_position, last_point_position_buffer):
16174 (last_point_position_window): Remove decls.
16175 * keyboard.c: Make these variables static.
16176
04f2d78b
CB
16177 * coding.h (coding, code_convert_region, encode_coding_gap):
16178 Remove decls.
74ab6df5
PE
16179 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16180 (iso_code_class, detect_coding, code_convert_region): Now static.
16181 (encode_coding_gap): Remove; unused.
16182
38dfbee1
PE
16183 * chartab.c (chartab_chars, chartab_bits): Now static.
16184
a2cb4e63
PE
16185 * charset.h (charset_iso_8859_1): Remove decl.
16186 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16187 Now static.
16188
127198fd
PE
16189 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16190 * ccl.c (Vccl_program_table): Now static.
16191 (check_ccl_update): Remove; unused.
16192
d85b608f
PE
16193 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16194 * category.h: ... from here.
16195 * category.c (check_category_table, set_category_set): Now static.
16196
31cd66f3
PE
16197 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16198 * lisp.h: Remove these decls.
16199
c358e587
PE
16200 * buffer.c (buffer_count): Remove unused var.
16201
e78aecca
PE
16202 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16203 so that it's not optimized away.
16204 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16205 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16206 exported only to the debugger.
16207
e192d7d3 16208 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 16209 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 16210
92470028
PE
16211 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16212 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16213 was inaccessible from Lisp.
16214 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16215 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16216
244ed907
PE
16217 alloc.c: Import and export fewer symbols, and remove unused items.
16218 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16219 is defined.
16220 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16221 it's not optimized away by whole-program optimization.
16222 (message_enable_multibyte, free_misc): Remove.
16223 (catchlist, handlerlist, mark_backtrace):
16224 Declare only if BYTE_MARK_STACK.
16225 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16226 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16227 (message_enable_multibyte): Remove decl.
16228 (free_misc, interval_free_list, float_block, float_block_index):
16229 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16230 (cons_free_list, last_marked_index):
16231 Now static.
16232 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16233 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16234 (mark_backtrace): Define only if BYTE_MARK_STACK.
16235 * xdisp.c (message_enable_multibyte): Now static.
16236
61c2b50e 16237 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
16238 This makes it easier for human readers (and static analyzers)
16239 to see whether these variables are used from other modules.
16240 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16241 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16242 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16243 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16244 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16245 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16246 * xmenu.c, xselect.c:
16247 Declare Q* vars static if they are not used in other modules.
16248 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16249 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16250 Remove decls of unexported vars.
16251 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16252
95c82688
PE
16253 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16254
16a97296
PE
16255 Make Emacs functions such as Fatom 'static' by default.
16256 This makes it easier for human readers (and static analyzers)
16257 to see whether these functions can be called from other modules.
16258 DEFUN now defines a static function. To make the function external
16259 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
16260 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16261 (Finit_image_library):
16a97296
PE
16262 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16263 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16264 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16265 Remove decls, since these functions are now static.
16266 (Funintern, Fget_internal_run_time): New decls, since these functions
16267 were already external.
95c82688 16268
16a97296
PE
16269 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16270 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16271 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16272 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16273 * keyboard.c, keymap.c, lread.c:
16274 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16275 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16276 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16277 Mark functions with DEFUE instead of DEFUN,
16278 if they are used in other modules.
16279 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16280 decls for now-static functions.
16281 * buffer.h (Fdelete_overlay): Remove decl.
16282 * callproc.c (Fgetenv_internal): Mark as internal.
16283 * composite.c (Fremove_list_of_text_properties): Remove decl.
16284 (Fcomposition_get_gstring): New forward static decl.
16285 * composite.h (Fcomposite_get_gstring): Remove decl.
16286 * dired.c (Ffile_attributes): New forward static decl.
16287 * doc.c (Fdocumntation_property): New forward static decl.
16288 * eval.c (Ffetch_bytecode): New forward static decl.
16289 (Funintern): Remove extern decl; now in .h file where it belongs.
16290 * fileio.c (Fmake_symbolic_link): New forward static decl.
16291 * image.c (Finit_image_library): New forward static decl.
16292 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16293 * intervals.h (Fprevious_property_change):
16294 (Fremove_list_of_text_properties): Remove decls.
16295 * keyboard.c (Fthis_command_keys): Remove decl.
16296 (Fcommand_execute): New forward static decl.
16297 * keymap.c (Flookup_key): New forward static decl.
16298 (Fcopy_keymap): Now static.
16299 * keymap.h (Flookup_key): Remove decl.
16300 * process.c (Fget_process): New forward static decl.
16301 (Fprocess_datagram_address): Mark as internal.
16302 * syntax.c (Fsyntax_table_p): New forward static decl.
16303 (skip_chars): Remove duplicate decl.
16304 * textprop.c (Fprevious_property_change): New forward static decl.
16305 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16306 Now internal.
16307 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16308 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16309
785bbd42
PE
16310 * editfns.c (Fformat): Remove unreachable code.
16311
8b913b57
AS
163122011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16313
16314 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16315 change. (Bug#8496)
16316
a6744a35
EZ
163172011-04-13 Eli Zaretskii <eliz@gnu.org>
16318
16319 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16320 when at ZV. (Bug#8487)
16321
e7974947
AS
163222011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16323
baad03f0
AS
16324 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16325 (Bug#8437)
16326 * keyboard.c (parse_tool_bar_item): Likewise.
16327 * sound.c (sound_cleanup, alsa_close): Likewise.
16328 * termcap.c (tgetent): Likewise.
16329 * xfns.c (x_default_font_parameter): Likewise.
16330 * xsettings.c (read_and_apply_settings): Likewise.
16331
e7974947
AS
16332 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16333 (overrun_check_free): Protoize.
16334
28272684
PE
163352011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16336
16337 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16338 since callers should never pass a negative size.
16339 Change the signature to match that of plain 'read' and 'write'; see
16340 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16341 * lisp.h: Update prototypes of emacs_write and emacs_read.
16342
11997c76
EZ
163432011-04-11 Eli Zaretskii <eliz@gnu.org>
16344
16345 * xdisp.c (redisplay_window): Don't try to determine the character
16346 position of the scroll margin if the window start point w->startp
e896f03c 16347 is outside the buffer's accessible region. (Bug#8468)
11997c76 16348
8a2cbd72
EZ
163492011-04-10 Eli Zaretskii <eliz@gnu.org>
16350
16351 Fix write-region and its subroutines for buffers > 2GB.
16352 * fileio.c (a_write, e_write): Modify declaration of arguments and
16353 local variables to support buffers larger than 2GB.
16354 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16355
16356 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16357 argument, local variables, and return value.
16358
16359 * lisp.h: Update prototypes of emacs_write and emacs_read.
16360
16361 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16362
4073e537 163632011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 16364
1ebfdcb6
PE
16365 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16366
b2ded58d
PE
16367 Fix more problems found by GCC 4.6.0's static checks.
16368
7d66342c
PE
16369 * xdisp.c (vmessage): Use a better test for character truncation.
16370
bbf47d44
PE
16371 * charset.c (load_charset_map): <, not <=, for optimization,
16372 and to avoid potential problems with integer overflow.
9248994d 16373 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 16374 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 16375 * editfns.c (Fformat): Likewise.
1e69125e 16376 * syntax.c (skip_chars): Likewise.
3befa583 16377
e3019616
PE
16378 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16379 This also lets GCC 4.6.0 generate slightly better loop code.
16380
becfa255
PE
16381 * callint.c (Fcall_interactively): <, not <=, for optimization.
16382 (Fcall_interactively): Count the number of arguments produced,
16383 not the number of arguments given. This is simpler and lets GCC
16384 4.6.0 generate slightly better code.
16385
dae0cd48
PE
16386 * ftfont.c: Distingish more carefully between FcChar8 and char.
16387 The previous code passed unsigned char * to a functions like
16388 strlen and xstrcasecmp that expect char *, which does not
16389 conform to the C standard.
16390 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16391 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16392 char * when the C standard requires it.
16393
76032d70
PE
16394 * keyboard.c (read_char): Remove unused var.
16395
eb3f1cc8
PE
16396 * eval.c: Port to Windows vsnprintf (Bug#8435).
16397 Include <limits.h>.
16398 (SIZE_MAX): Define if the headers do not.
16399 (verror): Do not give up if vsnprintf returns a negative count.
16400 Instead, grow the buffer. This ports to Windows vsnprintf, which
16401 does not conform to C99. Problem reported by Eli Zaretskii.
16402 Also, simplify the allocation scheme, by avoiding the need for
16403 calling realloc, and removing the ALLOCATED variable.
16404
70476b54
PE
16405 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16406
12020a9e
PE
16407 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16408 But keep the doprint source code for now, as we might revamp it
16409 and use it again (Bug#8435).
ea6c7ae6
PE
16410 * lisp.h (doprnt): Remove.
16411 * Makefile.in (base_obj): Remove doprnt.o.
16412 * deps.mk (doprnt.o): Remove.
16413
5fdb398c
PE
16414 error: Print 32- and 64-bit integers portably (Bug#8435).
16415 Without this change, on typical 64-bit hosts error ("...%d...", N)
16416 was used to print both 32- and 64-bit integers N, which relied on
16417 undefined behavior.
61bdb816 16418 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
16419 * lisp.h (error, verror): Mark as printf-like functions.
16420 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16421 Report overflow in size calculations when allocating printf buffer.
16422 Do not truncate output string at its first null byte.
16423 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16424 Truncate the output at a character boundary, since vsnprintf does not
16425 do that.
16426 * charset.c (check_iso_charset_parameter): Convert internal
16427 character to string before calling 'error', since %c now has the
16428 printf meaning.
16429 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16430 overflow when computing char to be passed to 'error'. Do not
16431 pass Lisp_Object to 'error'; pass the integer instead.
16432 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16433 formatted with plain %d.
16434
b189fa66
PE
16435 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16436
bff87ef0
PE
16437 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16438
7e2cac20
PE
16439 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16440
ce4d90b5
PE
16441 * xterm.c (x_catch_errors): Remove duplicate declaration.
16442
266c9547
PE
16443 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16444
79c49ad2
PE
16445 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16446
368f4090
JM
164472011-04-10 Jim Meyering <meyering@redhat.com>
16448
16449 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16450 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16451 return ssize_t not "int", and use size_t as the buffer length.
16452 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16453 * gnutls.h: Update declarations.
16454 * process.c (read_process_output): Use ssize_t, to match.
16455 (send_process): Likewise.
16456
a32d4040
CY
164572011-04-09 Chong Yidong <cyd@stupidchicken.com>
16458
16459 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16460
8546720e 164612011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 16462
04f2d78b
CB
16463 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16464 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 16465
8546720e
GM
16466 * xterm.c (handle_one_xevent):
16467 * xmenu.c (create_and_show_popup_menu):
16468 * xselect.c (x_decline_selection_request)
16469 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 16470
0a2f5c1a 164712011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
16472
16473 Fix some uses of `int' instead of EMACS_INT.
16474 * search.c (string_match_1, fast_string_match)
16475 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16476 (scan_buffer, find_next_newline_no_quit)
16477 (find_before_next_newline, search_command, Freplace_match)
16478 (Fmatch_data): Make some `int' variables be EMACS_INT.
16479
16480 * xdisp.c (display_count_lines): 3rd argument and return value now
16481 EMACS_INT. All callers changed.
16482 (pint2hrstr): Last argument is now EMACS_INT.
16483
16484 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16485 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16486 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16487 (decode_coding_utf_16, decode_coding_emacs_mule)
16488 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16489 (decode_coding_ccl, decode_coding_charset)
16490 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16491 (decode_coding_iso_2022, decode_coding_emacs_mule)
16492 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16493 <char_offset, last_offset>: Declare EMACS_INT.
16494 (encode_coding_utf_8, encode_coding_utf_16)
16495 (encode_coding_emacs_mule, encode_invocation_designation)
16496 (encode_designation_at_bol, encode_coding_iso_2022)
16497 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16498 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16499 Declare EMACS_INT.
16500 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16501 (encode_invocation_designation): Last argument P_NCHARS is now
16502 EMACS_INT.
16503 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16504 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16505
16506 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16507 All users changed.
16508
16509 * ccl.c (Fccl_execute_on_string): Declare some variables
16510 EMACS_INT.
16511
8546720e 165122011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
16513
16514 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16515
4e19a977
CS
165162011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16517
16518 * process.c (Fformat_network_address): Doc fix.
16519
87302331
R
165202011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16521
ee7683eb 16522 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 16523
cbb59342
CY
165242011-04-08 Chong Yidong <cyd@stupidchicken.com>
16525
16526 * keyboard.c (read_char): Call Lisp function help-form-show,
16527 instead of using internal_with_output_to_temp_buffer.
16528 (Qhelp_form_show): New var.
e0d38eeb 16529 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
16530
16531 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16532
16533 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16534
e67a13ab
CY
165352011-04-06 Chong Yidong <cyd@stupidchicken.com>
16536
04f2d78b
CB
16537 * process.c (Flist_processes): Remove to Lisp.
16538 (list_processes_1): Delete.
e67a13ab 16539
973f782d
EZ
165402011-04-06 Eli Zaretskii <eliz@gnu.org>
16541
7c106b1e
EZ
16542 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16543
973f782d
EZ
16544 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16545
41cf7d1a 165462011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 16547
ca23cc88
PE
16548 Fix more problems found by GCC 4.6.0's static checks.
16549
f390e2d5
PE
16550 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16551
42eea0d0
PE
16552 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16553
b69769da 16554 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 16555
f9541e84
PE
16556 * xdisp.c (vmessage): Mark as a printf-like function.
16557
13841b55
PE
16558 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16559
c136c10f
PE
16560 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16561
5e2d4a30
PE
16562 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16563 printf-like functions.
16564 (tiff_load): Add casts to remove these marks before passing them
16565 to system-supplied API.
16566
583f48b9
PE
16567 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16568
b25d760e
PE
16569 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16570 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
16571 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16572 directly, rather than having caller test rule sign. This avoids
16573 some unnecessary tests.
16574 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16575 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16576 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 16577
bc7b6697 16578 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 16579 (xfont_open): Avoid unnecessary tests.
bc7b6697 16580
27ccc379
PE
16581 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16582
dcd5c89a
PE
16583 * composite.h, composite.c (composition_gstring_put_cache):
16584 Use EMACS_INT, not int, for length.
16585
b13a45c6
PE
16586 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16587 breaking out part of COMPOSITION_DECODE_RULE.
16588 (COMPOSITION_DECODE_RULE): Use it.
16589 * composite.c (get_composition_id): Remove unused local vars,
16590 by using the new macro.
16591
1e792e4d
PE
16592 * textprop.c (set_text_properties_1): Change while to do-while,
16593 since the condition is always true at first.
16594
dc6c6455 16595 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
16596 (interval_deletion_adjustment): Return unsigned value.
16597 All uses changed.
dc6c6455 16598
aba7731a
PE
16599 * process.c (list_processes_1, create_pty, read_process_output):
16600 (exec_sentinel): Remove vars that were set but not used.
afd4052b 16601 (create_pty): Remove unnecessary "volatile"s.
bc57d757 16602 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 16603 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 16604 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 16605
fdfc4bf3
PE
16606 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16607
fca8fe46 16608 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 16609 (update_syntax_table): Use unsigned instead of int.
fca8fe46 16610
06a0259a 16611 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 16612 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 16613 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 16614
e7b9e80f
PE
16615 * print.c (print_error_message): Avoid int overflow.
16616
56201685
PE
16617 * font.c (font_list_entities): Redo for clarity,
16618 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16619
78834453 16620 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 16621 (font_score): Avoid potential overflow in diff calculation.
78834453 16622
0bc0b309 16623 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 16624 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 16625
e610eaca
PE
16626 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16627
b895abce
PE
16628 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16629 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16630 can always succeed if overflow has undefined behavior.
16631
1f1d9321 16632 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 16633 (wordify): Omit three unnecessary tests.
1f1d9321 16634
c59478bc
PE
16635 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16636 All callers changed. This avoids the need for an unused var.
16637
79b73827
PE
16638 * casefiddle.c (casify_region): Remove var that is set but not used.
16639
a4db5dfe
PE
16640 * dired.c (file_name_completion): Remove var that is set but not used.
16641
43aae36e
PE
16642 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16643
2a47c44d 16644 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 16645 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 16646
a37c69bf
PE
16647 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16648 Check for integer overflow on size calculations.
16649
328ab8e7
PE
16650 * buffer.c (Fprevious_overlay_change): Remove var that is set
16651 but not used.
16652
e5a2a5cb
PE
16653 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16654 Remove vars that are set but not used.
8d84a6eb 16655 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 16656 (timer_check_2): Mark vars as initialized.
e5a2a5cb 16657
a60e5f68
PE
16658 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16659
f661cb61 16660 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 16661 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 16662
f0397f5a
PE
16663 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16664 that are set but not used.
16665
8664db06 16666 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 16667 if XCreateBitmapFromData fails (Bug#8410).
8664db06 16668
6abdaa4a
PE
16669 * xselect.c (x_get_local_selection, x_handle_property_notify):
16670 Remove vars that are set but not used.
16671
0ce7538d 16672 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 16673 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 16674
9ae848fc
PE
16675 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16676 Remove var that is set but not used.
0b918413
PE
16677 (scroll_bar_windows_size): Now size_t, not int.
16678 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16679 Check for overflow.
9ae848fc 16680
a5a62657
PE
16681 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16682 (map_tty_color) [!defined MSDOS]: Likewise.
16683
5c5cdd39
PE
16684 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16685
66ebf983
PE
16686 * coding.c: Remove vars that are set but not used.
16687 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16688 All callers changed.
16689 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16690 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16691 (decode_coding_charset): Remove vars that are set but not used.
16692
1be4d761
PE
16693 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16694 that is set but not used.
16695
47553fa8
PE
16696 * print.c (print_object): Remove var that is set but not used.
16697
1f7196bf 16698 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
16699 The gnulib version avoids calling malloc in the usual case,
16700 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16701 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16702 * filelock.c (current_lock_owner): Likewise.
16703 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16704 * sysdep.c: Include allocator.h, careadlinkat.h.
16705 (emacs_no_realloc_allocator): New static constant.
16706 (emacs_readlink): New function.
fdb61804
PE
16707 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16708 ../lib/careadlinkat.h.
d1fdcab7 16709
f84c17c7
SM
167102011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16711
16712 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16713 first non-nil return value).
16714
ef3862ad
JD
167152011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16716
16717 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16718 if not defined (Bug#8403).
16719
376a7006
JB
167202011-04-02 Juanma Barranquero <lekktu@gmail.com>
16721
16722 * xdisp.c (display_count_lines): Remove parameter `start',
16723 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16724 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16725 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16726 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16727 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16728 and thereabouts. All callers changed.
16729 (get_per_char_metric): Remove parameter `f', unused since
16730 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16731
6ca3801d
JM
167322011-04-02 Jim Meyering <meyering@redhat.com>
16733
16734 do not dereference NULL upon failed strdup
16735 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16736 (ns_get_family): Likewise.
16737
d8e2b5ba
JB
167382011-04-02 Juanma Barranquero <lekktu@gmail.com>
16739
16740 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16741
8c74fcbd
JD
167422011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16743
16744 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16745 later (Bug#8403).
16746
7200d79c
SM
167472011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16748
03408648 16749 Add lexical binding.
7200d79c 16750
03408648
SM
16751 * window.c (Ftemp_output_buffer_show): New fun.
16752 (Fsave_window_excursion):
16753 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16754
16755 * lread.c (lisp_file_lexically_bound_p): New function.
16756 (Fload): Bind Qlexical_binding.
16757 (readevalloop): Remove `evalfun' arg.
16758 Bind Qinternal_interpreter_environment.
16759 (Feval_buffer): Bind Qlexical_binding.
16760 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16761 Mark as dynamic.
16762 (syms_of_lread): Declare `lexical-binding'.
16763
16764 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16765
16766 * keyboard.c (eval_dyn): New fun.
16767 (menu_item_eval_property): Use it.
ca105506
SM
16768
16769 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 16770
03408648
SM
16771 * fns.c (concat, mapcar1): Accept byte-code-functions.
16772
16773 * eval.c (Fsetq): Handle lexical vars.
16774 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16775 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16776 (FletX, Flet): Obey lexical binding.
16777 (Fcommandp): Handle closures.
16778 (Feval): New `lexical' arg.
16779 (eval_sub): New function extracted from Feval. Use it almost
16780 everywhere where Feval was used. Look up vars in lexical env.
16781 Handle closures.
16782 (Ffunctionp): Move from subr.el.
16783 (Ffuncall): Handle closures.
16784 (apply_lambda): Remove `eval_flags'.
16785 (funcall_lambda): Handle closures and new byte-code-functions.
16786 (Fspecial_variable_p): New function.
16787 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16788 but without exporting it to Lisp.
23aba0ea 16789
23aba0ea 16790 * doc.c (Fdocumentation, store_function_docstring):
03408648 16791 * data.c (Finteractive_form): Handle closures.
23aba0ea 16792
03408648
SM
16793 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16794 interactive spec.
ba83908c 16795
04f2d78b
CB
16796 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16797 New byte-codes.
03408648
SM
16798 (exec_byte_code): New function extracted from Fbyte_code to handle new
16799 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 16800
03408648 16801 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 16802
03408648 16803 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 16804
e2abce01
JB
168052011-03-31 Juanma Barranquero <lekktu@gmail.com>
16806
16807 * xdisp.c (redisplay_internal): Fix prototype.
16808
63696a73 168092011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 16810
63696a73 16811 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
16812 (try_scrolling): Use it when setting scroll_limit.
16813 Limit scrolling to 100 screen lines.
63696a73
EZ
16814 (redisplay_window): Even when falling back on "recentering",
16815 position point in the window according to scroll-conservatively,
16816 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16817
16818 (try_scrolling): When point is above the window, allow searching
16819 as far as scroll_max, or one screenful, to compute vertical
16820 distance from PT to the scroll margin position. This prevents
16821 try_scrolling from unnecessarily failing when
16822 scroll-conservatively is set to a value slightly larger than the
16823 window height. Clean up the case of PT below the margin at bottom
16824 of window: scroll_max can no longer be INT_MAX. When aggressive
16825 scrolling is in use, don't let point enter the opposite scroll
16826 margin as result of the scroll.
16827 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
16828 threshold of 100 lines for never-recentering scrolling.
16829
e4cc2dfc
JB
168302011-03-31 Juanma Barranquero <lekktu@gmail.com>
16831
16832 * dispextern.h (move_it_by_lines):
16833 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16834 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16835 (message_log_check_duplicate): Remove parameters `prev_bol' and
16836 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16837 (redisplay_internal): Remove parameter `preserve_echo_area',
16838 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16839
16840 * indent.c (Fvertical_motion):
16841 * window.c (window_scroll_pixel_based, Frecenter):
16842 Don't pass `need_y_p' to `move_it_by_lines'.
16843
1c470562
SM
168442011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16845
44f230aa
SM
16846 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16847 steal a few bits to be more compact.
16848 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16849 Remove unneeded casts.
16850
1c470562
SM
16851 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16852
888adce9
ZK
168532011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16854
16855 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16856 binding" message (bug#7967).
16857
f838ed7b
PE
168582011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16859
77861b95
PE
16860 Fix more problems found by GCC 4.6.0's static checks.
16861
de6dbc14
PE
16862 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16863 Remove unused local var.
16864
f838ed7b
PE
16865 * editfns.c (Fmessage_box): Remove unused local var.
16866
792c7b2b
PE
16867 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16868 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16869 Omit unused local vars.
c499e557 16870 * window.c (shrink_windows): Omit unused local var.
b01a1c29 16871 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
16872 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16873 Omit unused local var.
16874
ba0165e1
PE
16875 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16876 Don't assume string length fits in int.
32ad8845 16877 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 16878 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 16879
3c59b4c9
PE
16880 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16881 instead of alloca (Bug#8344).
16882
a3eed478 16883 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 16884 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 16885
eb4d412d
PE
16886 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16887
1658b401
PE
16888 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16889 concerns.
16890
16891 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16892
16893 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 16894
9a2c6e05
PE
16895 * keyboard.c (syms_of_keyboard): Use the same style as later
16896 in this function when indexing through an array. This also
16897 works around GCC bug 48267.
16898
03d0a109
PE
16899 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16900
44f730c8
PE
16901 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16902
fe75f926
PE
16903 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16904 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16905
ffa8c828
PE
16906 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16907 This avoids undefined behavior on integer overflow, and is a bit
16908 more convenient anyway since it is compared to a size_t variable.
16909
c5101a77
PE
16910 Variadic C functions now count arguments with size_t, not int.
16911 This avoids an unnecessary limitation on 64-bit machines, which
16912 caused (substring ...) to crash on large vectors (Bug#8344).
16913 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16914 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 16915 All variadic functions and their callers changed accordingly.
c5101a77
PE
16916 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16917 * data.c (arith_driver, float_arith_driver): Likewise.
16918 * editfns.c (general_insert_function): Likewise.
16919 * eval.c (struct backtrace.nargs, interactive_p)
16920 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16921 (funcall_lambda, mark_backtrace): Likewise.
16922 * fns.c (concat): Likewise.
16923 * frame.c (x_set_frame_parameters): Likewise.
16924 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16925 0 if not found, not -1. All callers changed.
16926
dd3f25f7
PE
16927 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16928 (stack_copy_size): Now size_t, not int.
16929 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16930
461c2ab9
JB
169312011-03-28 Juanma Barranquero <lekktu@gmail.com>
16932
16933 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16934 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16935 All callers changed.
16936
16937 * lisp.h (multibyte_char_to_unibyte):
16938 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16939 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16940 * character.h (CHAR_TO_BYTE8):
16941 * cmds.c (internal_self_insert):
16942 * editfns.c (general_insert_function):
16943 * keymap.c (push_key_description):
16944 * search.c (Freplace_match):
16945 * xdisp.c (message_dolog, set_message_1): All callers changed.
16946
f6d62986
SM
169472011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16948
16949 * keyboard.c (safe_run_hook_funcall): New function.
16950 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16951 don't set the hook to nil, but remove the offending function instead.
16952 (Qcommand_hook_internal): Remove, unused.
16953 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16954 Vcommand_hook_internal.
16955
16956 * eval.c (enum run_hooks_condition): Remove.
16957 (funcall_nil, funcall_not): New functions.
16958 (run_hook_with_args): Call each function through a `funcall' argument.
16959 Remove `cond' argument, now redundant.
16960 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16961 (Frun_hook_with_args_until_failure): Adjust accordingly.
16962 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16963
1db5b1ad
JB
169642011-03-28 Juanma Barranquero <lekktu@gmail.com>
16965
16966 * dispextern.h (string_buffer_position): Remove declaration.
16967
16968 * print.c (strout): Remove parameter `multibyte', unused since
16969 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16970
16971 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16972 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16973 All callers changed.
16974
16975 * w32.c (_wsa_errlist): Use braces for struct initializers.
16976
16977 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16978 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16979 All callers changed.
16980 (string_buffer_position): Likewise. Also, make static (it's never
16981 used outside xdisp.c).
16982 (cursor_row_p): Remove parameter `w', unused since
16983 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16984 (decode_mode_spec): Remove parameter `precision', introduced during
16985 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16986 All callers changed.
16987
5ffb62aa
JD
169882011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16989
16990 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16991
461c2ab9 169922011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
16993
16994 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16995 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16996 (ns_update_auto_hide_menu_bar): New functions.
16997 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16998 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16999 ns_constrain_all_frames.
17000 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17001 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17002
5c380ffb
JD
170032011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17004
17005 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17006
9af30bdf
GM
170072011-03-27 Glenn Morris <rgm@gnu.org>
17008
17009 * syssignal.h: Replace RETSIGTYPE with void.
17010 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17011 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17012 Replace SIGTYPE with void everywhere.
17013 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17014 * s/template.h (SIGTYPE): Remove commented out definition.
17015
e2abce01
JB
170162011-03-26 Eli Zaretskii <eliz@gnu.org>
17017
17018 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17019 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17020
f868cd8a
JB
170212011-03-26 Juanma Barranquero <lekktu@gmail.com>
17022
59eb0929
JB
17023 * w32.c (read_unc_volume): Use parameter `henum', instead of
17024 global variable `wget_enum_handle'.
17025
17026 * keymap.c (describe_vector): Remove parameters `indices' and
17027 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17028 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17029
f868cd8a
JB
17030 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17031
17032 * keyboard.c (timer_check): Remove parameter `do_it_now',
17033 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17034 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17035 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17036
17037 * keyboard.c (read_char):
17038 * w32menu.c (w32_menu_display_help):
17039 * xmenu.c (show_help_event, menu_help_callback):
17040 Adjust calls to `show_help_echo'.
17041
17042 * gtkutil.c (xg_maybe_add_timer):
17043 * keyboard.c (readable_events):
17044 * process.c (wait_reading_process_output):
17045 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17046
17047 * insdel.c (adjust_markers_gap_motion):
17048 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17049 (gap_left, gap_right): Don't call it.
17050
2ecf6fdb
CY
170512011-03-25 Chong Yidong <cyd@stupidchicken.com>
17052
17053 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17054 incurred during fontification.
17055
6b1f9ba4
JB
170562011-03-25 Juanma Barranquero <lekktu@gmail.com>
17057
17058 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17059 (DEFVAR_PER_BUFFER): Don't pass it.
17060
17061 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17062 (scrolling_window): Don't pass it.
17063
0f4a96b5
JB
170642011-03-25 Juanma Barranquero <lekktu@gmail.com>
17065
17066 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17067
17068 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17069 and `suffix'.
17070 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17071 of variables specific to SELinux and computation of `encoded_absname'.
17072
17073 * image.c (XPutPixel): Remove unused variable `height'.
17074
17075 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17076
17077 * unexw32.c (get_section_info): Remove unused variable `section'.
17078
17079 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17080 (system_process_attributes): Remove unused variable `sess'.
17081 (sys_read): Remove unused variable `err'.
17082
17083 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17084 (w32_wnd_proc): Remove unused variable `isdead'.
17085 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17086 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17087 (x_create_tip_frame): Remove unused variable `tem'.
17088
17089 * w32inevt.c (w32_console_read_socket):
17090 Remove unused variable `no_events'.
17091
17092 * w32term.c (x_draw_composite_glyph_string_foreground):
17093 Remove unused variable `width'.
17094
1149507c
JB
170952011-03-24 Juanma Barranquero <lekktu@gmail.com>
17096
17097 * w32term.c (x_set_glyph_string_clipping):
17098 Don't pass uninitialized region to CombineRgn.
17099
9c88f339
JB
171002011-03-23 Juanma Barranquero <lekktu@gmail.com>
17101
17102 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17103 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17104 (Fx_close_connection): Remove unused variable `i'.
17105
17106 * w32font.c (w32font_draw): Return number of glyphs.
17107 (w32font_open_internal): Remove unused variable `i'.
17108 (w32font_driver): Add missing initializer.
17109
17110 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17111 (fill_in_menu): Remove unused variable `items_added'.
17112
17113 * w32term.c (last_mouse_press_frame): Remove static global variable.
17114 (w32_clip_to_row): Remove unused variable `f'.
17115 (x_delete_terminal): Remove unused variable `i'.
17116
17117 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17118 (NOTHING): Remove unused static global variable.
17119 (uniscribe_check_otf): Remove unused variable `table'.
17120 (uniscribe_font_driver): Add missing initializers.
17121
dee091a3
JD
171222011-03-23 Julien Danjou <julien@danjou.info>
17123
17124 * term.c (Fsuspend_tty, Fresume_tty):
17125 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17126 * window.c (temp_output_buffer_show):
17127 * insdel.c (signal_before_change):
17128 * frame.c (Fhandle_switch_frame):
17129 * fileio.c (Fdo_auto_save):
17130 * emacs.c (Fkill_emacs):
17131 * editfns.c (save_excursion_restore):
17132 * cmds.c (internal_self_insert):
17133 * callint.c (Fcall_interactively):
17134 * buffer.c (Fkill_all_local_variables):
17135 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17136 Use Frun_hooks.
0f4a96b5 17137 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 17138 unconditionally since it does the check itself.
dee091a3 17139
2c520ab5 171402011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 17141
c9c49752
PE
17142 Fix more problems found by GCC 4.5.2's static checks.
17143
8abc3f12
PE
17144 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17145 the first time through the loop, since we know p0 < p1 then.
17146 This also avoids a gcc -Wstrict-overflow warning.
17147
a2d26660
PE
17148 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17149 leading to a memory leak, possible in functions like
17150 load_charset_map_from_file that can allocate an unbounded number
b12ef411 17151 of objects (Bug#8318).
a2d26660 17152
916c72e9
PE
17153 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17154 that could (at least in theory) be that large.
17155
19ab8a18
PE
17156 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17157 This is less likely to overflow, and avoids undefined behavior if
17158 overflow does occur. All callers changed. Use strtoul to scan
17159 for the unsigned long integer.
b7cbbd6f
PE
17160 (pint2hrstr): Simplify and tune code slightly.
17161 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 17162
f0641eff
PE
17163 * scroll.c (do_scrolling): Work around GCC bug 48228.
17164 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17165
7f650bb9
PE
17166 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17167 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
17168 (validate_x_resource_name): Simplify count usage.
17169 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 17170
37dd57d1
PE
17171 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17172 fail (Bug#8306).
81e56e61 17173
699979fc 17174 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 17175
401bf9b4
PE
17176 * process.c (Fmake_network_process): Use socklen_t, not int,
17177 where POSIX says socklen_t is required in portable programs.
17178 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 17179 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
17180 (Fmake_network_process, server_accept_connection):
17181 (wait_reading_process_output, read_process_output):
17182 Likewise.
17183
b93aacde
PE
17184 * process.c: Rename or move locals to avoid shadowing.
17185 (list_processes_1, Fmake_network_process):
17186 (read_process_output_error_handler, exec_sentinel_error_handler):
17187 Rename or move locals.
4dc343ee 17188 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 17189 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 17190 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 17191 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 17192 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 17193
af8a867c 17194 Make tparam.h and terminfo.c consistent.
44f230aa
SM
17195 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17196 Include tparam.h instead, since it declares them.
af8a867c
PE
17197 * cm.h (PC): Remove extern decl; tparam.h now does this.
17198 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17199 * terminfo.c: Include tparam.h, to check interfaces.
17200 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17201 (tparam): Adjust signature to match interface in tparam.h;
17202 this removes some undefined behavior. Check that outstring and len
17203 are zero, which they always are with Emacs.
17204 * tparam.h (PC, BC, UP): New extern decls.
17205
0248044d 17206 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 17207 (xftfont_open): Rename locals to avoid shadowing.
0248044d 17208
8ff096c1 17209 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
17210 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17211 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 17212 (ftfont_list): Remove unused local.
49eaafba
PE
17213 (get_adstyle_property, ftfont_pattern_entity):
17214 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17215 Rename locals to avoid shadowing.
8ff096c1 17216
e2be39f6
PE
17217 * xfont.c (xfont_list_family): Mark var as initialized.
17218
c9735e30
PE
17219 * xml.c (make_dom): Now static.
17220
8f5201ae
PE
17221 * composite.c (composition_compute_stop_pos): Rename local to
17222 avoid shadowing.
b246f932
PE
17223 (composition_reseat_it): Remove unused locals.
17224 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 17225 (composition_update_it): Mark var as initialized.
11b61122
PE
17226 (find_automatic_composition): Mark vars as initialized,
17227 with a FIXME (Bug#8290).
8f5201ae 17228
760fbc2c
PE
17229 character.h: Rename locals to avoid shadowing.
17230 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17231 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17232 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17233 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17234 to avoid shadowing.
17235
ff08eb85
PE
17236 * textprop.c (property_change_between_p): Remove; unused.
17237
fc7bf025
PE
17238 * intervals.c (interval_start_pos): Now static.
17239
235d7abc
PE
17240 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17241
44f230aa
SM
17242 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17243 Rename locals to avoid shadowing.
3e7d6594 17244
50060332
PE
17245 * sound.c (wav_play, au_play, Fplay_sound_internal):
17246 Fix pointer signedness.
d01f234b 17247 (alsa_choose_format): Remove unused local var.
c83b8872
PE
17248 (wav_play): Initialize a variable to 0, to prevent undefined
17249 behavior (Bug#8278).
50060332 17250
c4fc4e30
PE
17251 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17252
918436ed
PE
17253 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17254
c939f91b
PE
17255 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17256 clobbering (Bug#8298).
b9c7f648
PE
17257 * sysdep.c (sys_subshell): Likewise.
17258 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 17259
6bd8c144
PE
17260 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17261 This should get cleaned up, so that child_setup has the
17262 same signature on all platforms.
17263
7710357c 17264 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 17265 (relocate_fd): Rename locals to avoid shadowing.
7710357c 17266
c59da222
CY
172672011-03-22 Chong Yidong <cyd@stupidchicken.com>
17268
17269 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17270 not to be necessary, and produces flickering.
17271
66b87493
GM
172722011-03-20 Glenn Morris <rgm@gnu.org>
17273
17274 * config.in: Remove file.
17275
45b6f6d5
JB
172762011-03-20 Juanma Barranquero <lekktu@gmail.com>
17277
17278 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17279 are now in src/globals.h.
17280 (syms_of_minibuf): Remove spurious & from previous change.
17281
cd394be1 172822011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
17283
17284 * minibuf.c (completing-read-function): New variable.
17285 (completing-read-default): Rename from completing-read.
17286 (completing-read): Call completing-read-function.
17287
b14e3e21
CY
172882011-03-19 Juanma Barranquero <lekktu@gmail.com>
17289
17290 * xfaces.c (Fx_load_color_file):
17291 Read color file from absolute filename (bug#8250).
17292
f2b726e6
JB
172932011-03-19 Juanma Barranquero <lekktu@gmail.com>
17294
17295 * makefile.w32-in: Update dependencies.
17296
09f6ff02
EZ
172972011-03-17 Eli Zaretskii <eliz@gnu.org>
17298
17299 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17300
29a6015a
PE
173012011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17302
a3a6c54e
PE
17303 Fix more problems found by GCC 4.5.2's static checks.
17304
b766f867
PE
17305 * process.c (make_serial_process_unwind, send_process_trap):
17306 (sigchld_handler): Now static.
17307
be02381c
PE
17308 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17309 That way, the code declares only the vars that it needs.
17310 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17311 * s/cygwin.h (PTY_ITERATION): Likewise.
17312 * s/darwin.h (PTY_ITERATION): Likewise.
17313 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17314
57048744
PE
17315 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17316 * process.c (allocate_pty): Don't declare stb unless it's needed.
17317
7914961c 17318 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
17319 (CONSTANTLIM): Remove; unused.
17320 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17321 Define only if needed.
7914961c 17322
b3967b18
PE
17323 * unexelf.c (unexec): Name an expression,
17324 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
17325 Use a different way to cause a compilation error if anyone uses
17326 n rather than nn, a way that does not involve shadowing.
73366a00 17327 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 17328
29a6015a
PE
17329 * deps.mk (unexalpha.o): Remove; unused.
17330
43cfc33e 17331 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 17332 * unexec.h: New file.
ce701a33
PE
17333 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17334 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17335 Depend on unexec.h.
17336 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17337 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17338 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 17339 Change as necessary to match prototype in unexec.h.
ce701a33 17340
01f44d5a
PE
17341 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17342 shadowing.
4f63c6bb 17343 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 17344
a6670b0b
PE
17345 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17346 Rename locals to avoid shadowing.
17347
cef2010d 17348 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 17349 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 17350
d4d7173a
PE
17351 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17352
f08b802a
PE
17353 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17354 warning when compiling print.c.
17355
3ddb0639
PE
17356 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17357 instead of using an uninitialized var.
5ad03b97 17358 (font_sort_entities): Mark var as initialized.
3ddb0639 17359
170a2692
PE
17360 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17361
e663c700
PE
17362 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17363 pointers to constants.
89bc529a 17364 (font_parse_fcname): Remove unused vars.
7b81e2d0 17365 (font_delete_unmatched): Now static.
ea838e10 17366 (font_get_spec): Remove; unused.
13a547c6
PE
17367 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17368 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17369 Rename or move locals to avoid shadowing.
e663c700 17370
2a80c887 17371 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 17372 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 17373
1384fa33 17374 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 17375 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 17376
8b2c52e9
PE
17377 * alloc.c (mark_backtrace): Move decl from here ...
17378 * lisp.h: ... to here, so that it can be checked.
17379
475545b5 17380 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 17381 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
17382 (lisp_indirect_variable): Name an expression,
17383 to avoid gcc -Wbad-function-cast warning.
1faed8ae 17384 (Fdefvar): Rename locals to avoid shadowing.
475545b5 17385
b1349114 17386 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 17387 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 17388 Use const pointer when appropriate.
b1349114 17389
a2928364
PE
17390 * lisp.h (get_system_name, get_operating_system_release):
17391 Move decls here, to check interfaces.
17392 * process.c (get_operating_system_release): Move decl to lisp.h.
17393 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
17394 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17395 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17396 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
17397 (Fformat_time_string, Fencode_time, Finsert_char):
17398 (Ftranslate_region_internal, Fformat):
17399 Rename or remove local vars to avoid shadowing.
9710023e 17400 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 17401
a415e694
PE
17402 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17403 avoid shadowing.
17404
8ef4622d
PE
17405 * lisp.h (eassert): Check that the argument compiles, even if
17406 ENABLE_CHECKING is not defined.
17407
946f9a5b
PE
17408 * data.c (Findirect_variable): Name an expression, to avoid
17409 gcc -Wbad-function-cast warning.
112396d6 17410 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 17411 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
17412 (Fmake_variable_buffer_local, Fmake_local_variable):
17413 Mark variables as initialized.
52746918 17414 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 17415
e5aab7e7 17416 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
17417 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17418 Rename locals to avoid shadowing.
dff45157
PE
17419 (mark_stack): Move local variables into the #ifdef region where
17420 they're used.
7bc26fdb
PE
17421 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17422 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17423 needed otherwise.
17424 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17425 (GC_STRING_CHARS): Remove; not used.
d40d4be1 17426 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 17427
e5aab7e7
PE
17428 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17429 avoids undefined behavior in theory.
17430
4da60324
PE
17431 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17432
88043301
PE
17433 Use functions, not macros, for up- and down-casing (Bug#8254).
17434 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17435 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17436 to use the following functions instead of these macros.
17437 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17438 EMACS_INT, since callers assume the returned value fits in int.
17439 (upcase1): Likewise, for UPCASE_TABLE.
17440 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 17441 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 17442 the race-condition problem in the old DOWNCASE.
88043301 17443
19ed5445
PE
17444 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17445 Rename locals to avoid shadowing.
17446 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
17447 (regex_compile, re_search_2, re_match_2_internal):
17448 Remove unused local vars.
952db0d7
PE
17449 (FREE_VAR): Rewrite so as not to use empty "else",
17450 which gcc can warn about.
da053e48 17451 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
17452 (RETALLOC_IF): Define only if needed.
17453 (WORDCHAR_P): Likewise. This one is never needed, but is used
17454 only in a comment talking about a compiler bug, so put inside
17455 the #if 0 of that comment.
17456 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17457 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17458 Remove; unused.
19ed5445 17459
1f3561e4 17460 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
17461 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17462 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 17463
ded6f8f7
PE
17464 * search.c (simple_search): Remove unused var.
17465
dbd37a95
PE
17466 * dired.c (compile_pattern): Move decl from here ...
17467 * lisp.h: ... to here, so that it can be checked.
17468 (struct re_registers): New forward decl.
17469
7e47afad
PE
17470 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17471
85f24f61
PE
17472 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17473 All uses changed.
17474 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17475 Rename locals to avoid shadowing.
5671df8f 17476 (Fvertical_motion): Mark locals as initialized.
85f24f61 17477
181aa2be 17478 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 17479 (casify_region): Mark local as initialized.
181aa2be 17480
930d429c
PE
17481 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17482
7082eac6
PE
17483 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17484 New macros, so that the caller can use some names other than
17485 gcpro1, gcpro2, etc.
17486 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17487 of the new macros.
17488 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17489 argument, for consistency with GCPRO2_VAR, etc: it is now the
17490 prefix of the variable, not the variable itself. All uses
17491 changed.
38b2c076
PE
17492 * dired.c (directory_files_internal, file_name_completion):
17493 Rename locals to avoid shadowing.
17494
15206ed9
PE
17495 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17496 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17497 dired.c's scmp function, had undefined behavior.
17498 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17499 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17500 * buffer.h: ... to here, because these macros use current_buffer,
17501 and the new implementation with inline functions needs to have
17502 current_buffer in scope now, rather than later when the macros
17503 are used.
17504 (downcase, upcase1): New static inline functions.
17505 (DOWNCASE, UPCASE1): Reimplement using these functions.
17506 This avoids undefined behavior in expressions like
17507 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17508 from race conditions in accessing the global variables
17509 case_temp1 and case_temp2.
17510 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17511 * lisp.h (case_temp1, case_temp2): Remove their decls.
17512 * character.h (ASCII_CHAR_P): Move from here ...
17513 * lisp.h: ... to here, so that the inline functions mentioned
17514 above can use them.
17515
4a6bea26
PE
17516 * dired.c (directory_files_internal_unwind): Now static.
17517
f14b7e14
PE
17518 * fileio.c (file_name_as_directory, directory_file_name):
17519 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17520 Now static.
2893f146
PE
17521 (file_name_as_directory): Use const pointers when appropriate.
17522 (Fexpand_file_name): Likewise. In particular, newdir might
17523 point at constant storage, so make it a const pointer.
fd4ead52 17524 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
17525 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17526 signedness issues.
f839df0c
PE
17527 (Fset_file_times, Finsert_file_contents, auto_save_error):
17528 Rename locals to avoid shadowing.
f14b7e14 17529
5716756e 17530 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
17531 (Ftry_completion, Fall_completions): Rename or remove locals
17532 to avoid shadowing.
5716756e 17533
b4c3046a
PE
17534 * marker.c (bytepos_to_charpos): Remove; unused.
17535
b45db522
PE
17536 * lisp.h (verify_bytepos, count_markers): New decls,
17537 so that gcc does not warn that these functions aren't declared.
17538
85876d07
PE
17539 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17540 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 17541 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 17542 (copy_text): Remove unused local var.
85876d07 17543
03d78a21 17544 * filelock.c (within_one_second): Now static.
b3dd38ab 17545 (lock_file_1): Rename local to avoid shadowing.
03d78a21 17546
5df8f01b
PE
17547 * buffer.c (fix_overlays_before): Mark locals as initialized.
17548 (fix_start_end_in_overlays): Likewise. This function should be
17549 simplified by using pointers-to-pointers, but that's a different
17550 matter.
b1d876f1 17551 (switch_to_buffer_1): Now static.
8f54f30a
PE
17552 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17553 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 17554
a70072c9 17555 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 17556 Fix pointer signedness issue.
edced198
PE
17557 (sys_subshell): Mark local as volatile if checking for lint,
17558 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 17559 (MAXPATHLEN): Define only if needed.
a70072c9 17560
a0977c44
PE
17561 * process.c (serial_open, serial_configure): Move decls from here ...
17562 * systty.h: ... to here, so that they can be checked.
17563
a884fdcc
PE
17564 * fns.c (get_random, seed_random): Move extern decls from here ...
17565 * lisp.h: ... to here, so that they can be checked.
17566
604efe86 17567 * sysdep.c (reset_io): Now static.
b8950c94 17568 (wait_for_termination_signal): Remove; unused.
604efe86 17569
38fc62d9
PE
17570 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17571 (copy_keymap_item, append_key, push_text_char_description):
17572 Now static.
1004a21a 17573 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 17574 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
17575 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17576 (describe_map_tree):
17577 Rename locals to avoid shadowing.
38fc62d9 17578
2f2650da
PE
17579 * keyboard.c: Declare functions static if they are not used elsewhere.
17580 (echo_char, echo_dash, cmd_error, top_level_2):
17581 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
17582 (read_char, kbd_buffer_get_event, make_lispy_position):
17583 (make_lispy_event, make_lispy_movement, apply_modifiers):
17584 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17585 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17586 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 17587 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 17588 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 17589
a053e86c 17590 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
17591 (mark_kboards): Move decl here ...
17592 * alloc.c (mark_kboards): ... from here.
a053e86c 17593
4752793e
PE
17594 * lisp.h (force_auto_save_soon): New decl.
17595
74f10ca7 17596 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
17597 (DEFINE_DUMMY_FUNCTION): New macro.
17598 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17599 Use it.
c03cd23f
PE
17600 (main): Add casts to avoid warnings
17601 if GCC considers string literals to be constants.
74f10ca7 17602
022e70d4
PE
17603 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17604
59d6fe83
PE
17605 * dbusbind.c: Pointer signedness fixes.
17606 (xd_signature, xd_append_arg, xd_initialize):
17607 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17608 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17609 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17610 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17611
78320123
PE
17612 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17613 if GCC considers string literals to be constants.
49cebcca 17614 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 17615
35ac2a97
SM
176162011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17617
fb103ca9
SM
17618 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17619 (print_preprocess, print_object): New macro to fix last change.
17620
35ac2a97
SM
17621 * print.c (print_preprocess): Don't forget font objects.
17622
62973b41
JB
176232011-03-16 Juanma Barranquero <lekktu@gmail.com>
17624
17625 * emacs.c (USAGE3): Doc fixes.
17626
0e48bb22
AS
176272011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17628
17629 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17630 structure.
17631
7684e57b
JB
176322011-03-14 Juanma Barranquero <lekktu@gmail.com>
17633
17634 * lisp.h (VWindow_system, Qfile_name_history):
17635 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17636 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17637 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17638
17639 * w32select.c: Don't #include "keyboard.h".
c96bbc66 17640 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
17641
17642 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17643 * w32console.c (detect_input_pending, read_input_pending)
17644 (encode_terminal_code):
17645 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17646 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17647 (w32_system_caret_y, Qfile_name_history):
17648 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17649 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17650 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17651 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17652 * w32proc.c (Qlocal, report_file_error):
17653 * w32term.c (Vwindow_system, updating_frame):
17654 * w32uniscribe.c (initialized, uniscribe_font_driver):
17655 Remove unneeded extern declarations.
17656
2aa46d6c
CY
176572011-03-14 Chong Yidong <cyd@stupidchicken.com>
17658
c96bbc66 17659 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 17660
cffc6f3b
CY
176612011-03-13 Chong Yidong <cyd@stupidchicken.com>
17662
17663 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17664 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17665 These macros can no longer be used for assignment.
17666
44f230aa
SM
17667 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17668 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
17669 (record_buffer_markers, fetch_buffer_markers): New functions for
17670 recording and fetching special buffer markers.
17671 (set_buffer_internal_1, set_buffer_temp): Use them.
17672
17673 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17674
17675 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17676
17677 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17678 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17679
17680 * xdisp.c (hscroll_window_tree):
17681 (reconsider_clip_changes): Use PT instead of BUF_PT.
17682
d251f04b
EZ
176832011-03-13 Eli Zaretskii <eliz@gnu.org>
17684
17685 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17686 $(EMACS_ROOT)/lib/intprops.h.
17687
f0c77cd1
PE
176882011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17689
3eca4629
PE
17690 Fix more problems found by GCC 4.5.2's static checks.
17691
7c86ee98
PE
17692 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17693 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
17694 (xg_free_frame_widgets): Make it clear that a local variable is
17695 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
17696 (gdk_window_get_screen): Make it clear that this macro is needed
17697 only if USE_GTK_TOOLTIP.
1e5524e7
PE
17698 (int_gtk_range_get_value): New function, which avoids a diagnostic
17699 from gcc -Wbad-function-cast.
17700 (xg_set_toolkit_scroll_bar_thumb): Use it.
17701 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17702 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
17703 (get_utf8_string, xg_get_file_with_chooser):
17704 Rename locals to avoid shadowing.
17705 (create_dialog): Move locals to avoid shadowing.
7c86ee98 17706
41729b81
PE
17707 * xgselect.c (xg_select): Remove unused var.
17708
f0c77cd1
PE
17709 * image.c (four_corners_best): Mark locals as initialized.
17710 (gif_load): Initialize transparent_p to zero (Bug#8238).
17711 Mark another local as initialized.
ec6cf4c6 17712 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 17713
ce0ad53d 17714 * image.c (clear_image_cache): Now static.
d5d5a617 17715 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 17716 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
17717 (x_edge_detection): Remove unnecessary cast that
17718 gcc -Wbad-function-cast diagnoses.
2037898d 17719 (gif_load): Fix pointer signedness.
6ae141d6
PE
17720 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17721 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 17722
33383987 177232011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 17724
d32df629
PE
17725 Improve quality of tests for time stamp overflow.
17726 For example, without this patch (encode-time 0 0 0 1 1
17727 1152921504606846976) returns the obviously-bogus value (-948597
17728 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17729 reports time overflow. See
17730 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
17731 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17732 * editfns.c: Include limits.h and intprops.h.
17733 (TIME_T_MIN, TIME_T_MAX): New macros.
17734 (time_overflow): Move earlier, to before first use.
17735 (hi_time, lo_time): New functions, for an accurate test for
17736 out-of-range times.
17737 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17738 (Fget_internal_run_time): Don't assume time_t fits in int.
17739 (make_time): Use list2 instead of Fcons twice.
17740 (Fdecode_time): More accurate test for out-of-range times.
17741 (check_tm_member): New function.
17742 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
17743 (lisp_time_argument): Don't rely on undefined left-shift and
17744 right-shift behavior when checking for time stamp overflow.
8be6f318 17745
fe31d94c
PE
17746 * editfns.c (time_overflow): New function, refactoring common code.
17747 (Fformat_time_string, Fdecode_time, Fencode_time):
17748 (Fcurrent_time_string): Use it.
17749
8be6f318
PE
17750 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17751 * dired.c (make_time): Move to ...
17752 * editfns.c (make_time): ... here.
17753 * systime.h: Note the move.
17754
09d9db2c 177552011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 17756
126bc0dc
YM
17757 * fringe.c (update_window_fringes): Remove unused variables.
17758
c47cbdfd
YM
17759 * unexmacosx.c (copy_data_segment): Also copy __got section.
17760 (Bug#8223)
17761
7ac80be9
EZ
177622011-03-12 Eli Zaretskii <eliz@gnu.org>
17763
c96bbc66 17764 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
17765 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17766 Constify `char *' arguments and their references according to
17767 prototypes in tparam.h.
17768
ecb0f94d 17769 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 17770
7ac80be9
EZ
17771 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17772 Adapt all references accordingly.
17773
17774 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17775
ef1fd07e
TT
177762011-03-11 Tom Tromey <tromey@redhat.com>
17777
17778 * buffer.c (syms_of_buffer): Remove obsolete comment.
17779
7ef4b50c
EZ
177802011-03-11 Eli Zaretskii <eliz@gnu.org>
17781
17782 * termhooks.h (encode_terminal_code): Declare prototype.
17783
17784 * msdos.c (encode_terminal_code): Don't declare prototype.
17785
17786 * term.c (encode_terminal_code): Now external again, used by
17787 w32console.c and msdos.c.
17788
44f230aa
SM
17789 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17790 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 17791
4b1ec863 177922011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 17793
1714f52b 17794 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 17795
4b1ec863
PE
17796 * fringe.c (update_window_fringes): Mark locals as initialized
17797 (Bug#8227).
17798 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 17799
524c7aa6
PE
17800 * alloc.c (mark_fringe_data): Move decl from here ...
17801 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17802 to check its interface.
17803 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17804
a5c0af81 17805 * fontset.c (free_realized_fontset): Now static.
7519b8cd 17806 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 17807 (fontset_font): Mark local as initialized.
a9a06e0b 17808 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 17809
b4716021
PE
17810 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17811
811e9bac 17812 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 17813 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
17814 (x_own_selection, Fx_disown_selection_internal): Rename locals
17815 to avoid shadowing.
17816 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 17817
7e3ab302
PE
17818 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17819 so that the caller can use some name other than gcpro1.
17820 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
17821 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17822 (Fx_backspace_delete_keys_p):
17823 Use them to avoid shadowing, and rename vars to avoid shadowing.
17824 (x_decode_color, x_set_name, x_window): Now static.
6b437900 17825 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 17826 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
17827 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17828 Remove unused locals.
7e3ab302
PE
17829 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17830 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17831 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17832 macros.
f78faa98 17833
e2b13473
PE
17834 * xterm.h (x_mouse_leave): New decl.
17835
77f23912
PE
17836 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17837 Remove unused functions.
cdf4ba58
PE
17838 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17839 (x_calc_absolute_position): Now static.
7411c686 17840 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 17841 Don't declare local "event" unless it's used.
ed7bf3a5
PE
17842 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17843 unless they are used.
38d0b34a
PE
17844 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17845 (x_fatal_error_signal): Remove; not used.
a6067996
PE
17846 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17847 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17848 (x_error_catcher, x_connection_closed, x_error_handler):
17849 (x_error_quitter, xembed_send_message, x_iconify_frame):
17850 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 17851 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 17852 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 17853
44f230aa
SM
17854 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17855 Rename or move locals to avoid shadowing.
6b463e58 17856 (tty_defined_color, merge_face_heights): Now static.
5967d051 17857 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
17858 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17859 does not deduce is never used uninitialized.
73719eba
PE
17860 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17861 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 17862
426994c3 17863 * terminal.c (store_terminal_param): Now static.
5489860b 17864
032f1620 17865 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 17866 (set_frame_menubar): Remove unused local.
d4323972 17867 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
17868 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17869 since they might point to immutable storage.
281585b0
PE
17870 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17871 since it's unused otherwise.
032f1620 17872
367c19e5 17873 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 17874 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
17875 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17876 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 17877 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
17878 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17879 does not deduce are never used uninitialized.
70739cbe 17880
07b48fa9
PE
17881 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17882
8868a238 17883 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
17884 * window.c (window_loop, size_window):
17885 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 17886
7e5cf297 17887 * window.c (display_buffer): Now static.
d6550a9f
PE
17888 (size_window): Mark variables that gcc -Wuninitialized
17889 does not deduce are never used uninitialized.
a586633d
PE
17890 * window.h (check_all_windows): New decl, to forestall
17891 gcc -Wmissing-prototypes diagnostic.
5b555da1 17892 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 17893
f6095868
PE
17894 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17895 shadowing.
17896 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
17897 Include <limits.h>.
17898 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17899 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
17900 (load_charset_map): Mark variables that gcc -Wuninitialized
17901 does not deduce are never used uninitialized.
53df7c11 17902 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 17903
f38b440c
PE
17904 * coding.c (coding_set_source, coding_set_destination):
17905 Use "else { /* comment */ }" rather than "else /* comment */;"
17906 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
17907 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17908 a block, when the outer 'i' will do.
17909 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17910 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17911 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17912 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17913 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17914 Rename locals to avoid shadowing.
17915 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
17916 * coding.c (emacs_mule_char, encode_invocation_designation):
17917 Now static, since they're not used elsewhere.
413bb2db 17918 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 17919 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
17920 (decode_coding_emacs_mule): Mark variables that gcc
17921 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
17922 (detect_coding_iso_2022): Initialize a local variable that might
17923 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 17924 this initialization is needed. (Bug#8211)
5f58e762
PE
17925 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17926 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17927 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17928 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17929 Remove unused macros.
f38b440c 17930
232b38b9 17931 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 17932 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 17933 * character.c (string_count_byte8): Likewise.
232b38b9 17934
fb90da1b
PE
17935 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17936 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17937
fb93dbc2
PE
17938 * chartab.c (copy_sub_char_table): Now static, since it's not used
17939 elsewhere.
5c156ace
PE
17940 (sub_char_table_ref_and_range, char_table_ref_and_range):
17941 Rename locals to avoid shadowing.
bbcd0949 17942 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 17943
7d3b3862 17944 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 17945 (BIDI_BOB): Remove unused macro.
7d3b3862 17946
6be7d3da
PE
17947 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17948 deduce are never used uninitialized.
c2ed9c8b 17949 * term.c (encode_terminal_code): Likewise.
6be7d3da 17950
75f8807f 17951 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 17952
50938595
PE
17953 * tparam.h: New file.
17954 * term.c, tparam.h: Include it.
17955 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17956 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17957 Move these decls to tparam.h, and make them agree with what
17958 is actually in tparam.c. The previous trick of using incompatible
17959 decls in different modules does not conform to the C standard.
17960 All callers of tparam changed to use tparam's actual API.
17961 * tparam.c (tparam1, tparam, tgoto):
17962 Use const pointers where appropriate.
17963
fbceeba2
PE
17964 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17965 * cm.h (struct cm): Likewise.
17966 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17967 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17968 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17969 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17970 (turn_on_face, init_tty): Likewise.
17971 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 17972
7f3f1250
PE
17973 * term.c (term_mouse_position): Rename local to avoid shadowing.
17974
e6ca6543
PE
17975 * alloc.c (mark_ttys): Move decl from here ...
17976 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17977
c40f8d15
AS
179782011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17979
17980 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17981
cfe0661d
JB
179822011-03-09 Juanma Barranquero <lekktu@gmail.com>
17983
17984 * search.c (compile_pattern_1): Remove argument regp, unused since
17985 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17986 (compile_pattern): Don't pass it.
17987
0afb4571
J
179882011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17989
17990 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17991 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17992 for ! HAVE_GTK3.
17993 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17994
17995 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17996
17997 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17998 gdk_window_get_screen, gdk_window_get_geometry,
17999 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18000 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18001 (xg_get_pixbuf_from_pixmap): New function.
18002 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18003 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18004 Call xg_get_pixbuf_from_pixmap instead of
18005 gdk_pixbuf_get_from_drawable.
18006 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18007 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18008 (xg_check_special_colors): Use GtkStyleContext and its functions
18009 for HAVE_GTK3.
18010 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18011 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18012 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
18013 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18014 Call gtk_widget_get_preferred_size.
0afb4571
J
18015 (xg_frame_resized): gdk_window_get_geometry only takes 5
18016 parameters.
44f230aa
SM
18017 (xg_win_to_widget, xg_event_is_for_menubar):
18018 Call gdk_x11_window_lookup_for_display.
0afb4571
J
18019 (xg_set_widget_bg): New function.
18020 (delete_cb): New function.
895009e1 18021 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 18022 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
18023 (xg_set_background_color): Call xg_set_widget_bg.
18024 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18025 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18026 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18027 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18028 if ! HAVE_GTK3.
18029 (update_frame_tool_bar): Call gtk_widget_hide.
18030 (xg_initialize): Use GDK_KEY_g.
18031
18032 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18033 if ! HAVE_GTK3
18034 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18035
18036 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18037 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18038 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18039
1c2cc4ef
JB
180402011-03-08 Juanma Barranquero <lekktu@gmail.com>
18041
18042 * w32xfns.c (select_palette): Check success of RealizePalette against
18043 GDI_ERROR, not zero.
18044
33383987 18045See ChangeLog.11 for earlier changes.
aac0c6e3
MR
18046
18047;; Local Variables:
18048;; coding: utf-8
aac0c6e3
MR
18049;; End:
18050
2f097256 18051 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
18052
18053 This file is part of GNU Emacs.
18054
18055 GNU Emacs is free software: you can redistribute it and/or modify
18056 it under the terms of the GNU General Public License as published by
18057 the Free Software Foundation, either version 3 of the License, or
18058 (at your option) any later version.
18059
18060 GNU Emacs is distributed in the hope that it will be useful,
18061 but WITHOUT ANY WARRANTY; without even the implied warranty of
18062 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18063 GNU General Public License for more details.
18064
18065 You should have received a copy of the GNU General Public License
18066 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.