* src/lread.c (lisp_file_lexically_bound_p): Handle #! lines.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
757140ff
GM
12012-09-28 Glenn Morris <rgm@gnu.org>
2
3 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
4
a615a3ae
PE
52012-09-27 Paul Eggert <eggert@cs.ucla.edu>
6
7 Check more robustly for timer_settime.
89d17fd0
PE
8 * Makefile.in (LIB_TIMER_TIME): New macro.
9 (LIBES): Add it.
a615a3ae
PE
10 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
11 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
12 call timer_settime.
13
3670daf7
TM
142012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
15
16 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
17
6a586b7f
JB
182012-09-26 Juanma Barranquero <lekktu@gmail.com>
19
20 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
21
41c8bfcf
PE
222012-09-26 Paul Eggert <eggert@cs.ucla.edu>
23
24 * character.h (MAYBE_UNIFY_CHAR): Remove.
25 * charset.c, charset.h (maybe_unify_char): Now static.
26 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
27 Since this stuff is now private to charset.c, there's no need for
28 a public macro and no need to inline by hand.
29
3a880af4
SM
302012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
31 Stefan Monnier <monnier@iro.umontreal.ca>
32 Juanma Barranquero <lekktu@gmail.com>
611b7507 33
3a880af4
SM
34 * profiler.c: New file.
35 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
36 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
37 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
38 * emacs.c (main): Call syms_of_profiler.
39 * alloc.c (Qautomatic_gc): New constant.
40 (MALLOC_PROBE): New macro.
41 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
42 (total_bytes_of_live_objects): New function.
43 (Fgarbage_collect): Use it. Record itself in backtrace_list.
44 Call malloc_probe for the memory profiler.
45 (syms_of_alloc): Define Qautomatic_gc.
46 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
47 race condition.
48 (struct backtrace): Move definition...
49 * lisp.h (struct backtrace): ..here.
50 (Qautomatic_gc, profiler_memory_running): Declare vars.
51 (malloc_probe, syms_of_profiler): Declare functions.
52 * xdisp.c (Qautomatic_redisplay): New constant.
53 (redisplay_internal): Record itself in backtrace_list.
54 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 55
b67238c2
JB
562012-09-25 Juanma Barranquero <lekktu@gmail.com>
57
58 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
59
e26fd2e4
PE
602012-09-25 Paul Eggert <eggert@cs.ucla.edu>
61
62 Prefer POSIX timers if available.
63 They avoid a race if the timer is too close to the current time.
64 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
65 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 66 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 67
eedec3ee
EZ
682012-09-25 Eli Zaretskii <eliz@gnu.org>
69
70 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
71 CHAR_STRING_ADVANCE.
72 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
73 STRING_CHAR_ADVANCE.
74
aa15c6bb
JB
752012-09-25 Juanma Barranquero <lekktu@gmail.com>
76
77 Move Vlibrary_cache to emacs.c and reset before dumping.
78
79 * lisp.h (reset_image_types): Declare.
80 [WINDOWSNT] (Vlibrary_cache): Declare.
81
82 * image.c (reset_image_types): New function.
83
84 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
85 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
86 (Fdump_emacs): Reset Vlibrary_cache and image_types.
87
88 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
89 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
90
91 * w32.h (Vlibrary_cache): Do not declare.
92
54d629be
EZ
932012-09-25 Eli Zaretskii <eliz@gnu.org>
94
16b22fef
EZ
95 * w32proc.c (sys_signal): Handle all signals defined by the
96 MS-Windows runtime, not just SIGCHLD. Actually install the signal
97 handlers for signals supported by Windows. Don't override
98 term_ntproc as the handler for SIGABRT.
99 (sigaction): Rewrite to call sys_signal instead of duplicating its
100 code.
101 (sys_kill): Improve commentary.
102
103 * w32.c (term_ntproc): Accept (and ignore) one argument, for
104 consistency with a signature of a signal handler. All callers
105 changed.
106 (init_ntproc): Accept an argument DUMPING. If dumping, don't
107 install term_ntproc as a signal handler for SIGABRT, as that
108 should be done by the dumped Emacs.
109
110 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
111
112 * w32select.c (term_w32select): Protect against repeated
113 invocation by setting clipboard_owner to NULL after calling
114 DestroyWindow.
115
116 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
117 and term_ntproc to their modified signatures.
118
54d629be
EZ
119 * character.c (char_string, string_char): Remove calls to
120 MAYBE_UNIFY_CHAR. See the discussion starting at
121 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
122 for the details.
123
59f7af81
CY
1242012-09-25 Chong Yidong <cyd@gnu.org>
125
126 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
127
22e8cf4a
SM
1282012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
129
130 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
131 when encountering an unknown bytecode.
132
578098f3
PE
1332012-09-24 Paul Eggert <eggert@cs.ucla.edu>
134
135 image.c, indent.c: Use bool for booleans.
136 * dispextern.h (struct image_type): Members valid_p, load, init
137 now return bool, not int. All uses changed.
138 * image.c: Omit unnecessary static decls.
139 (x_create_bitmap_mask, x_build_heuristic_mask):
140 Return void, not int, since callers don't care about the return value.
141 (x_create_bitmap_mask, define_image_type, valid_image_p)
142 (struct image_keyword, parse_image_spec, image_spec_value)
143 (check_image_size, image_background)
144 (image_background_transparent, x_clear_image_1)
145 (postprocess_image, lookup_image, x_check_image_size)
146 (x_create_x_image_and_pixmap, xbm_image_p)
147 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
148 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
149 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
150 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
151 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
152 (png_image_p, init_png_functions, png_load_body, png_load)
153 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
154 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
155 (init_gif_functions, gif_load, imagemagick_image_p)
156 (imagemagick_load_image, imagemagick_load, svg_image_p)
157 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
158 (gs_load):
159 * nsimage.m (ns_load_image):
160 * nsterm.m (ns_defined_color):
161 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
162 * xfns.c (x_defined_color):
163 * xterm.c (x_alloc_lighter_color_for_widget)
164 (x_alloc_nearest_color_1, x_alloc_nearest_color)
165 (x_alloc_lighter_color):
166 * indent.c (disptab_matches_widthtab, current_column)
167 (scan_for_column, string_display_width, indented_beyond_p)
168 (compute_motion, vmotion, Fvertical_motion):
169 Use bool for booleans.
170
a5f2b6ec
CY
1712012-09-24 Chong Yidong <cyd@gnu.org>
172
173 * chartab.c (Fset_char_table_default): Obsolete function removed.
174
18e27ea8
PE
1752012-09-23 Paul Eggert <eggert@cs.ucla.edu>
176
afea8a8a
PE
177 Move pid_t related decls out of lisp.h.
178 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
179 (interruptible_wait_for_termination):
180 Move these decls from lisp.h to syswait.h, since they use pid_t.
181 Needed on FreeBSD; see Herbert J. Skuhra in
182 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
183 * callproc.c: Include syswait.h.
184
18e27ea8
PE
185 gnutls.c, gtkutil.c: Use bool for boolean.
186 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
187 (emacs_gnutls_handle_error):
188 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
189 (xg_hide_tooltip, xg_create_frame_widgets)
190 (create_dialog, xg_uses_old_file_dialog)
191 (xg_get_file_with_chooser, xg_get_file_with_selection)
192 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
193 (xg_item_label_same_p, xg_update_menubar)
194 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
195 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
196 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
197 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
198 (update_frame_tool_bar, free_frame_tool_bar):
199 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
200 * nsmenu.m (ns_update_menubar):
201 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
202 * xfns.c (Fx_show_tip) [USE_GTK]:
203 Use bool for boolean.
204 * gtkutil.c (xg_update_frame_menubar):
205 * xmenu.c (update_frame_menubar):
206 Return void, not int, since caller ignores return value.
207 * gtkutil.c (xg_change_toolbar_position):
208 Return void, not 1.
209
af0e9f75
JB
2102012-09-23 Juanma Barranquero <lekktu@gmail.com>
211
212 * makefile.w32-in (BLOCKINPUT_H): Remove.
213 (SYSSIGNAL_H): New macro.
214 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
215 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
216 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
217 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
218 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
219 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
220 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
221 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
222 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
223 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
224 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
225 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
226 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
227 ($(BLD)/w32xfns.$(O)): Update dependencies.
228
5101529e
EZ
2292012-09-23 Eli Zaretskii <eliz@gnu.org>
230
231 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
232 fatal_error_backtrace.
233
234 * w32proc.c (sys_kill): Undo last change: don't do anything when
235 invoked to deliver SIGABRT to our own process. This is now
236 handled by emacs_raise.
237
2c3ee0ad
JB
2382012-09-23 Juanma Barranquero <lekktu@gmail.com>
239
240 * w32term.c (w32_read_socket): Remove leftover reference to
241 interrupt_input_pending.
242
62a1d661
PE
2432012-09-23 Paul Eggert <eggert@cs.ucla.edu>
244
245 Do not use SA_NODEFER.
246 Problem reported by Dani Moncayo in
247 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
248 * alloc.c (die):
249 * sysdep.c (emacs_abort): Do not reset signal handler.
250 * emacs.c (terminate_due_to_signal): Reset signal handler here.
251 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
252 wanted even on POSIXish hosts, and it doesn't work on Windows.
253
a0942b9a
JD
2542012-09-23 Jan Djärv <jan.h.d@swipnet.se>
255
256 * xterm.c (x_term_init): Call fixup_locale before and after calling
257 gtk_init (Bug#12392).
258
d07ff9db
CY
2592012-09-23 Chong Yidong <cyd@gnu.org>
260
261 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
262 Vdynamic_library_alist.
263
264 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
265 (Fgnutls_available_p): Caller changed.
266
267 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
268 (Flibxml_parse_xml_region): Likewise.
269
270 * dispextern.h (struct image_type): Remove arg from init function.
271
272 * image.c (Finit_image_library, lookup_image_type)
273 (define_image_type): Remove now-unneeded second arg.
274 (init_xpm_functions, init_png_functions, init_jpeg_functions)
275 (init_tiff_functions, init_gif_functions, init_svg_functions):
276 Arglist and w32_delayed_load calling convention changed.
277 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 278 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 279
4d7e6e51
PE
2802012-09-23 Paul Eggert <eggert@cs.ucla.edu>
281
282 Simplify and avoid signal-handling races (Bug#12471).
283 * alloc.c (die):
284 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
285 Avoid recursive loop if there's a fatal error in the function itself.
286 * atimer.c (pending_atimers):
287 * blockinput.h: Don't include "atimer.h"; no longer needed.
288 (interrupt_input_pending): Remove. All uses removed.
289 pending_signals now counts both atimers and ordinary interrupts.
290 This is less racy than having three separate pending-signal flags.
291 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
292 (input_blocked_p):
293 Rename from their upper-case counterparts BLOCK_INPUT,
294 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
295 INPUT_BLOCKED_P, and turn into functions. All uses changed.
296 This makes it easier to access volatile variables more accurately.
297 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
298 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
299 that's more reliable if the code is buggy and sets
300 interrupt_input_blocked to a negative value. All uses changed.
301 * atimer.c (deliver_alarm_signal):
302 Remove. No need to deliver this to the parent; any thread can
303 handle this signal now. All uses replaced by underlying handler.
304 * atimer.c (turn_on_atimers):
305 * dispnew.c (handle_window_change_signal):
306 * emacs.c (handle_danger_signal):
307 * keyboard.c (kbd_buffer_get_event):
308 Don't reestablish signal handler; not needed with sigaction.
309 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
310 (UNBLOCK_INPUT_TO):
311 Rework to avoid unnecessary accesses to volatile variables.
312 (UNBLOCK_INPUT_TO): Now a function.
313 (totally_unblock_input, unblock_input): New decls.
314 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
315 (init_data): Remove. Necessary stuff now done in init_signal.
316 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
317 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
318 (fatal_error_code): Remove; no longer needed.
319 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
320 it doesn't always backtrace. All uses changed. No need to reset
321 signal to default, since sigaction and/or die does that for us now.
322 Use emacs_raise (FOO), not kill (getpid (), FOO).
323 (main): Check more-accurately whether we're dumping.
324 Move fatal-error setup to sysdep.c
325 * floatfns.c: Do not include "syssignal.h"; no longer needed.
326 * gtkutil.c (xg_get_file_name, xg_get_font):
327 Remove no-longer-needed signal-mask manipulation.
328 * keyboard.c, process.c (POLL_FOR_INPUT):
329 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
330 * keyboard.c (read_avail_input): Remove.
331 All uses replaced by gobble_input.
332 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
333 (kbd_buffer_store_event_hold, gobble_input):
334 (record_asynch_buffer_change) [USABLE_SIGIO]:
335 (store_user_signal_events):
336 No need to mess with signal mask.
337 (gobble_input): If blocking input and there are terminals, simply
338 set pending_signals to 1 and return. All hooks changed to not
339 worry about whether input is blocked.
340 (process_pending_signals): Clear pending_signals before processing
341 them, in case a signal comes in while we're processing.
342 By convention callers now test pending_signals before calling us.
343 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
344 New functions, to support changes to blockinput.h.
345 (handle_input_available_signal): Now extern.
346 (reinvoke_input_signal): Remove. All uses replaced by
347 handle_async_input.
348 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
349 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
350 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
351 Clear sigmask reliably, even if Fsignal returns, which it can.
352 Omit unnecessary accesses to volatile var.
353 (quit_throw_to_read_char): No need to restore sigmask.
354 * keyboard.c (gobble_input, handle_user_signal):
355 * process.c (wait_reading_process_output):
356 Call signal-handling code rather than killing ourselves.
357 * lisp.h: Include <float.h>, for...
358 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
359 (pending_signals): Now volatile.
360 (syms_of_data): Now const if IEEE floating point.
361 (handle_input_available_signal) [USABLE_SIGIO]:
362 (terminate_due_to_signal, record_child_status_change): New decls.
363 * process.c (create_process): Avoid disaster if memory is exhausted
364 while we're processing a vfork, by tightening the critical section
365 around the vfork.
366 (send_process_frame, process_sent_to, handle_pipe_signal)
367 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
368 ignores SIGPIPE.
369 (send_process): No need for setjmp/longjmp any more, since the
370 SIGPIPE stuff is now gone. Instead, report an error if errno
371 is EPIPE.
372 (record_child_status_change): Now extern. PID and W are now args.
373 Return void, not bool. All callers changed.
374 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
375 Remove. All uses removed. This bug should be fixed now in a
376 different way.
377 (wait_for_termination_1): Use waitpid rather than sigsuspend,
378 and record the child status change directly. This avoids the
379 need to futz with the signal mask.
380 (process_fatal_action): Move here from emacs.c.
381 (emacs_sigaction_flags): New function, containing
382 much of what used to be in emacs_sigaction_init.
383 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
384 caught by emacs, to make races less likely.
385 (deliver_process_signal): Rename from handle_on_main_thread.
386 All uses changed.
387 (BACKTRACE_LIMIT_MAX): Now at top level.
388 (thread_backtrace_buffer, threadback_backtrace_pointers):
389 New static vars.
390 (deliver_thread_signal, deliver_fatal_thread_signal):
391 New functions, for more-accurate delivery of thread-specific signals.
392 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
393 (deliver_arith_signal): Handle in this thread, not
394 in the main thread, since it's triggered by this thread.
395 (maybe_fatal_sig): New function.
396 (init_signals): New arg DUMPING so that we can be more accurate
397 about whether we're dumping. Caller changed.
398 Treat thread-specific signals differently from process-general signals.
399 Block all signals while handling fatal error; that's safer.
400 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
401 on IEEE hosts.
402 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
403 Ignore SIGPIPE unless batch.
404 (emacs_backtrace): Output backtrace for the appropriate thread,
405 which is not necessarily the main thread.
406 * syssignal.h: Include <stdbool.h>.
407 (emacs_raise): New macro.
408 * xterm.c (x_connection_signal): Remove; no longer needed
409 now that we use sigaction.
410 (x_connection_closed): No need to mess with sigmask now.
411 (x_initialize): No need to reset SIGPIPE handler here, since
412 init_signals does this for us now.
413
8f4635e9
JD
4142012-09-23 Jan Djärv <jan.h.d@swipnet.se>
415
416 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 417 background rect may be larger (Bug#12245).
8f4635e9 418
3296976d
CY
4192012-09-23 Chong Yidong <cyd@gnu.org>
420
421 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
422
d41e491e
PE
4232012-09-22 Paul Eggert <eggert@cs.ucla.edu>
424
425 * .gdbinit: Just stop at fatal_error_backtrace.
426 See Stefan Monnier's request in
427 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
428 Remove no-longer-used query of system type.
429
c88b867f
CY
4302012-09-22 Chong Yidong <cyd@gnu.org>
431
432 * search.c (Freplace_match): Doc fix (Bug#12325).
433
434 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
435
436 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
437 (Fline_end_position): Doc fix.
438
439 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
440
bb4d86b4
CY
4412012-09-22 Chong Yidong <cyd@gnu.org>
442
443 * dispextern.h (struct image_type): Add new slot, storing a type
444 initialization function.
445
446 * image.c (define_image_type): Call the image initializer function
447 if it is defined. Arguments and return value changed.
448 (valid_image_p, make_image): Callers changed.
449 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
450 (gif_type, imagemagick_type, svg_type, gs_type):
451 Add initialization functions.
bb4d86b4
CY
452 (Finit_image_library): Call lookup_image_type.
453 (CHECK_LIB_AVAILABLE): Macro deleted.
454 (lookup_image_type): Call define_image_type here, rather than via
455 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
456 (syms_of_image): Move define_image_type calls for xbm_type and
457 pbm_type to lookup_image_type.
458
df9685f3
EZ
4592012-09-22 Eli Zaretskii <eliz@gnu.org>
460
461 * keyboard.c (timer_check_2): Move calculation of 'timers' and
462 'idle_timers' from here ...
463 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
464 lists, to avoid infloops when the timer does something stupid,
465 like reinvoke itself with the same or smaller time-out.
466 (Bug#12447)
467
8e17c9ba
MR
4682012-09-22 Martin Rudalics <rudalics@gmx.at>
469
470 * window.c (Fsplit_window_internal): Handle only Qt value of
471 Vwindow_combination_limit separately.
472 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
473 (Vwindow_combination_limit): New default value.
474 Rewrite doc-string.
8e17c9ba 475
589bd69b
EZ
4762012-09-22 Eli Zaretskii <eliz@gnu.org>
477
478 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
479 the new overlay string. (Bug#10159)
480
01108e3f
PE
4812012-09-22 Paul Eggert <eggert@cs.ucla.edu>
482
483 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
484 or that fprintf is async-signal-safe. POSIX doesn't require
485 either assumption.
486
82f8cd94
CY
4872012-09-22 Chong Yidong <cyd@gnu.org>
488
489 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
490 (Bug#8207).
491
3cccbd87
KH
4922012-09-22 Kenichi Handa <handa@gnu.org>
493
494 * composite.c (composition_reseat_it): Handle the case that a
495 grapheme cluster is not covered by a single font (Bug#12352).
496
09c01941
CY
4972012-09-21 Chong Yidong <cyd@gnu.org>
498
499 * image.c (define_image_type): Avoid adding duplicate types to
500 image_types (Bug#12463). Suggested by Jörg Walter.
501
acfa068f 5022012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
503
504 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
505 (print_load_command_name): Add case LC_DATA_IN_CODE.
506 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
507
acfa068f 5082012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
509
510 * eval.c (Frun_hook_with_args_until_success)
511 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
512
acfa068f 5132012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
514
515 * fileio.c (Ffile_selinux_context): Only call freecon when
516 lgetfilecon succeeded.
517 (Fset_file_selinux_context): Likewise. (Bug#12444)
518
acfa068f 5192012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
520
521 * xdisp.c (try_window_reusing_current_matrix): Under bidi
522 reordering, locate the cursor by calling set_cursor_from_row; if
523 that fails, clear the desired glyph matrix before returning a
524 failure indication to the caller. Fixes leaving garbled display
525 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
526 (compute_stop_pos_backwards): Fix a typo that caused crashes while
527 scrolling through multibyte text.
aa36e4d2 528
e99f70c8
SM
5292012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
530
531 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
532 calling mark_vectorlike since that's the one that marks the window.
533 (mark_discard_killed_buffers): Mark the final cdr.
534 * window.h (struct window): Move prev/next_buffers to the
535 non-standard fields.
536 * window.c (make_window): Initialize prev/next_buffers manually.
537
f75beb47
PE
5382012-09-20 Paul Eggert <eggert@cs.ucla.edu>
539
540 Omit unused arg EXPECTED from socket hooks.
541 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
542 * nsterm.m (ns_term_init):
543 * termhooks.h (struct terminal.read_socket_hook):
544 * w32inevt.c (w32_console_read_socket):
545 * w32term.c (w32_read_socket):
546 * xterm.c (XTread_socket):
547 Omit unused arg EXPECTED. All callers changed.
548 (store_user_signal_events): Return void, not int, since callers no
549 longer care about the return value. All uses changed.
550
b019b76a
JB
5512012-09-20 Juanma Barranquero <lekktu@gmail.com>
552
553 * w32gui.h (XParseGeometry): Do not declare.
554
05642592
PE
5552012-09-19 Paul Eggert <eggert@cs.ucla.edu>
556
e4bce92a
PE
557 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
558 Ignore 'expected'. See Eli Zaretskii in
559 <http://bugs.gnu.org/12471#8> (last line).
560
05642592
PE
561 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
562 (XParseGeometry): Now static. Substitute extremal values for
563 values that are out of range.
564
e543ae91
JD
5652012-09-19 Jan Djärv <jan.h.d@swipnet.se>
566
567 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
568
569 * nsfns.m (XParseGeometry): Remove.
570 (Fx_create_frame): Call x_set_offset to correctly interpret
571 top_pos in geometry.
572
3a880af4 573 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
574 (Fx_parse_geometry): If there is a space in string, call
575 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
576
45ba16c7
EZ
5772012-09-17 Eli Zaretskii <eliz@gnu.org>
578
c8b9f1bc
EZ
579 * search.c (scan_buffer): Use character positions in calls to
580 region_cache_forward and region_cache_backward, not byte
581 positions. (Bug#12196)
582
b4c932a2
EZ
583 * w32term.c (w32_read_socket): Set pending_signals to 1, like
584 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
585
45ba16c7
EZ
586 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
587 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
588 emacs_blocked_malloc, now deleted.
589
eeceac93
PE
5902012-09-17 Paul Eggert <eggert@cs.ucla.edu>
591
592 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
593 The workaround was for improving performance on Solaris 2.4, but
594 is getting in the way now. Emacs will still work if someone is
595 still running Solaris 2.4 in a museum somewhere; Sun dropped
596 support for Solaris 2.4 in 2003.
597 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
598 * process.c (create_process) [HAVE_WORKING_VFORK]:
599 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
600 since Emacs no longer uses vfork on that platform.
601
78f83752
GM
6022012-09-17 Glenn Morris <rgm@gnu.org>
603
604 * emacs.c: Use COPYRIGHT.
605
634b8cac
PE
6062012-09-16 Paul Eggert <eggert@cs.ucla.edu>
607
0caaedb1
PE
608 Remove configure's --without-sync-input option (Bug#12450).
609 When auditing signal-handling in preparation for cleaning it up,
610 I found that SYNC_INPUT has race conditions and would be a real
611 pain to fix. Since it's an undocumented and deprecated
612 configure-time option, now seems like a good time to remove it.
613 Also see <http://bugs.gnu.org/11080#16>.
614 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
615 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
616 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
617 (malloc_hysteresis):
618 (check_depth) [XMALLOC_OVERRUN_CHECK]:
619 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
620 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
621 (dont_register_blocks, bytes_used_when_reconsidered)
622 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
623 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
624 [!SYSTEM_MALLOC && !SYNC_INPUT]:
625 Remove. All uses removed.
626 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
627 implementation, one that depends on whether the new macro
628 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
629 is defined.
630 * atimer.c (run_timers, handle_alarm_signal):
631 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
632 (handle_async_input, process_pending_signals)
633 (handle_input_available_signal, init_keyboard):
634 * nsterm.m (ns_read_socket):
635 * process.c (wait_reading_process_output):
636 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
637 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
638 (emacs_write):
639 * xterm.c (XTread_socket):
640 Assume SYNC_INPUT.
641 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
642 * eval.c (handling_signal): Remove. All uses removed.
643 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
644 All uses replaced with the SYNC_INPUT version.
645 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
646 Remove decls.
647 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
648 Now static.
649
634b8cac
PE
650 * font.c (Ffont_shape_gstring): Remove unused local.
651
83da1b55
GM
6522012-09-16 Glenn Morris <rgm@gnu.org>
653
518650a5
GM
654 * Makefile.in (clean): No longer run nextstep's clean.
655
83da1b55
GM
656 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
657 (ns_frag): Remove.
658 (ns-app): Move here from ns.mk, and simplify.
659 (clean): Simplify nextstep entry.
660 * ns.mk: Remove file.
661
85a43e2e
KH
6622012-09-17 Kenichi Handa <handa@gnu.org>
663
664 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
665 not covert the last few charactes.
666
ba13e616 6672012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
668
669 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
670 here, but just check the validity of glyphs in the glyph-string.
671
a8c729af
MR
6722012-09-16 Martin Rudalics <rudalics@gmx.at>
673
3a880af4
SM
674 * window.c (Fwindow_parameter, Fset_window_parameter):
675 Accept any window as argument (Bug#12452).
a8c729af 676
c077c059
JD
6772012-09-16 Jan Djärv <jan.h.d@swipnet.se>
678
679 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
680 to ns_term_init to avoid memory leak.
681
682 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
683 explicit retain/release.
684 (ns_term_init): Only allow one display. Initialize outerpool and
685 ns_*_types.
686
39a57ad0
PE
6872012-09-15 Paul Eggert <eggert@cs.ucla.edu>
688
689 Port _setjmp fix to POSIXish hosts as well as Microsoft.
690 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
691 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
692 the Microsoft problem in a different way, by altering ../nt/config.nt.
693
7105c8cb
EZ
6942012-09-15 Eli Zaretskii <eliz@gnu.org>
695
696 * w32xfns.c:
697 * w32uniscribe.c:
698 * w32term.c:
699 * w32select.c:
700 * w32reg.c:
701 * w32proc.c:
702 * w32menu.c:
703 * w32inevt.c:
704 * w32heap.c:
705 * w32font.c:
706 * w32fns.c:
707 * w32console.c:
708 * w32.c:
709 * w16select.c: Remove inclusion of setjmp.h, as it is now included
710 by lisp.h. This completes removal of setjmp.h inclusion
711 erroneously announced in the previous commit. (Bug#12446)
712
713 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
714 more accurate.
715
716 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
717 not defined as a macro. The latter happens on MS-Windows.
718 (Bug#12446)
719
0328b6de
PE
7202012-09-15 Paul Eggert <eggert@cs.ucla.edu>
721
722 Port better to POSIX hosts lacking _setjmp (Bug#12446).
723 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 724 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
725 only reason for the instance was because "lisp.h" was included.
726 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
727 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
728 and _longjmp with the new symbols. Emacs already uses _setjmp if
729 available, so this change affects only POSIXish hosts that have
730 sigsetjmp but not _setjmp, such as some versions of Solaris and
731 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
732 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
733 (png_load_body) [HAVE_PNG]:
734 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
735 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
736 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
737 since PNG requires jmp_buf. This is the only exception to the
738 general rule that we now use sys_setjmp and sys_longjmp.
739 This exception is OK since this code does not change the signal
740 mask or longjmp out of a signal handler.
741
2af03429
PE
7422012-09-14 Paul Eggert <eggert@cs.ucla.edu>
743
744 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
745 Include "syssignal.h", for 'main_thread'.
746
2f294edf
DA
7472012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
748
749 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
750 * insdel.c (replace_range, replace_range_2):
751 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
752 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
753 Remove redundant check before calling offset_intervals.
754
6b533e9c
MR
7552012-09-14 Martin Rudalics <rudalics@gmx.at>
756
757 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
758 current buffer (Bug#12387).
759
2a7931e3
JB
7602012-09-14 Juanma Barranquero <lekktu@gmail.com>
761
762 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
763
c18e885b
PE
7642012-09-13 Paul Eggert <eggert@cs.ucla.edu>
765
766 Use a more backwards-compatible timer format (Bug#12430).
767 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
768 vector element, not from the 4th, since PSECS is now at the end.
769 (Fcurrent_idle_time): Doc fix.
770
d59a1afb
DA
7712012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
772
773 Function to mark objects and remove killed buffers at once.
774 * alloc.c (discard_killed_buffers): Rename to ...
775 (mark_discard_killed buffers) ... new name. Add marking
776 of remaining objects. Fix comment. Adjust users.
777 (mark_object): Do not touch frame buffer lists here.
778 * frame.c (delete_frame): Reset frame buffer lists here.
779
5f0cb45a
PE
7802012-09-13 Paul Eggert <eggert@cs.ucla.edu>
781
8ea47e3a
PE
782 Better workaround for GNOME bug when --enable-gcc-warnings.
783 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
784 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
785 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
786
4a4bbad2
PE
787 Simplify SIGIO usage (Bug#12408).
788 The code that dealt with SIGIO was crufty and confusing, e.g., it
789 played tricks like "#undef SIGIO" but these tricks were not used
790 consistently. Simplify mostly by not #undeffing standard symbols,
791 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
792 or not as we please) rather than "defined SIGIO" (standard symbol
793 that we probably shouldn't #undef).
794 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
795 Modules that need it can include it.
796 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
797 * dispextern.h (ignore_sigio): New decl.
798 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
799 unconditionally, since it's now a no-op if !USABLE_SIGIO.
800 * emacs.c (shut_down_emacs):
801 * keyboard.c (kbd_buffer_store_event_hold):
802 Use ignore_sigio rather than invoking 'signal' directly.
803 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
804 for FIONREAD.
805 (FIONREAD, SIGIO): Do not #undef.
806 (tty_read_avail_input): Use #error rather than a syntax error.
807 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
808 for I_PIPE, used by SETUP_SLAVE_PTY.
809 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
810 * sysdep.c (croak): Remove; no longer needed. This bit of
811 temporary code, with Fred N. Fish's comment that it's temporary,
812 has been in Emacs since at least 1992!
813 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
814 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
815 * syssignal.h (croak): Remove decl.
816 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
817 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
818 now that we're termios-only.
819 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
820 * term.c (dissociate_if_controlling_tty): Use #error rather than
821 a run-time error.
822
5f0cb45a
PE
823 Work around GCC and GNOME bugs when --enable-gcc-warnings.
824 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
825 to work around GNOME bug 683906.
826 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
827 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
828 This works around GCC bug 54561.
829
40bce90b
PE
8302012-09-12 Paul Eggert <eggert@cs.ucla.edu>
831
832 More fixes for 'volatile' and setjmp/longjmp.
833 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
834 * image.c (struct png_load_context) [HAVE_PNG]: New type.
835 (png_load_body) [HAVE_PNG]:
836 (jpeg_load_body) [HAVE_JPEG]:
837 New function, with most of the old parent function's body.
838 (png_load) [HAVE_PNG]:
839 (jpeg_load) [HAVE_JPEG]:
840 Invoke the new function, to avoid longjmp munging our locals.
841 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
842 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
843 longjmp is passed 2, as the C standard doesn't guarantee this.
844 Instead, store the failure code into mgr->failure_code.
845
bfeae2cf
SM
8462012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
847
848 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
849 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
850 (syms_of_keyboard): Remove support for unread-command-char.
851
8099e36b
EZ
8522012-09-12 Eli Zaretskii <eliz@gnu.org>
853
854 * w32proc.c (sys_kill): If PID is our process ID and the signal is
855 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
856 violation. (Bug#12426)
857
92547ff9
PE
8582012-09-12 Paul Eggert <eggert@cs.ucla.edu>
859
860 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
861
45b82ad0
SM
8622012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
863
864 * eval.c: Add `inhibit-debugger'.
865 (Qinhibit_debugger): New symbol.
866 (call_debugger): Bind it instead of Qdebug_on_error.
867 (maybe_call_debugger): Test Vinhibit_debugger.
868 (syms_of_eval): Define inhibit-debugger.
869 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
870 (syms_of_xdisp): Remove inhibit-debug-on-message.
871
5779a1dc
PE
8722012-09-11 Paul Eggert <eggert@cs.ucla.edu>
873
50f2e553
PE
874 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
875 If a nonvolatile local variable is written before a _longjmp to
876 the frame containing the variable, and is read after the _longjmp,
877 the value read is indeterminate. Some local variables of type
878 'struct handler' and 'struct catchtag' are used in this way, so
879 mark each of their slots as volatile if the slot can be set before
880 _longjmp and read afterwards.
881 * lisp.h (struct handler): var and chosen_clause are now volatile.
882 (struct catchtag): val, next, and pdlcount are now volatile.
883
ae1d87e2
PE
884 * bidi.c (bidi_push_it, bidi_pop_it):
885 * fns.c (copy_hash_table):
886 * image.c (define_image_type):
887 * keyboard.c (kbd_buffer_store_event_hold):
888 * process.c (Fprocess_send_eof):
889 * xfaces.c (x_create_gc) [HAVE_NS]:
890 * xgselect.c (xg_select):
891 Prefer assignment to memcpy when either will do.
892
5779a1dc
PE
893 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
894 Use pointer-to-a-pointer to simplify and avoid a NILP check each
895 time an item is removed. No need to mark this function 'inline';
896 the compiler knows better than we do.
897
c4c9756b
JD
8982012-09-11 Jan Djärv <jan.h.d@swipnet.se>
899
900 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
901 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
902 to change_frame_size (Bug#12388).
903 (windowDidResize:): Pass YES to updateFrameSize.
904
905 * nsterm.h: Add delay parameter to updateFrameSize.
906
d73e321c
DA
9072012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
908
909 Discard killed buffers from deleted window and frame objects.
910 This reduces an amount of references to killed buffers and
911 helps GC to reclaim them faster.
912 * alloc.c (discard_killed_buffers): New function.
913 (mark_object): Use it for deleted windows and frames.
914 (mark_object): If symbol's value is set up for a killed buffer
915 or deleted frame, restore it's global binding.
916 * data.c (swap_in_global_binding): Add GC notice.
917 (swap_in_symval_forwarding): Use convenient set_blv_where.
918 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
919 * window.h: ... to here.
920
e578f381
DA
9212012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
922
923 Convenient macro to check whether the buffer is live.
924 * buffer.h (BUFFER_LIVE_P): New macro.
925 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
926 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
927
3057e615
YM
9282012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
929
930 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
931 composition cases (Bug#12364).
932
933 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
934 overhang of succeeding glyphs overlapping box cursor.
935
936 * w32term.c (x_draw_glyph_string): Likewise.
937
6fda35f2
PE
9382012-09-11 Paul Eggert <eggert@cs.ucla.edu>
939
c990426a
PE
940 Simplify, document, and port floating-point (Bug#12381).
941 The porting part of this patch fixes bugs on non-IEEE platforms
942 with frexp, ldexp, logb.
943 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
944 Now static.
945 * floatfns.c: Simplify discussion of functions that Emacs doesn't
946 support, by removing commented-out code and briefly listing the
947 C89 functions excluded. The commented-out stuff was confusing
948 maintenance, e.g., we thought we needed cbrt but it was commented out.
949 (logb): Remove decl; no longer needed.
950 (isfinite): New macro, if not already supplied.
951 (isnan): Don't replace any existing macro.
952 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
953 are present on all C89 platforms.
954 (Ffrexp): Do not special-case zero, as frexp does the right thing
955 for that case.
956 (Flogb): Do not use logb, as it doesn't have the desired meaning
957 on hosts that use non-base-2 floating point. Instead, stick with
958 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
959 frexp, to avoid getting an unspecified result.
960
6fda35f2
PE
961 * xdisp.c (Qinhibit_debug_on_message): Now static.
962
16130a58
JD
9632012-09-10 Jan Djärv <jan.h.d@swipnet.se>
964
965 * nsterm.m (ns_update_begin): Set clip path to whole view by using
966 NSBezierPath (Bug#12131).
967
d105a573
CY
9682012-09-10 Chong Yidong <cyd@gnu.org>
969
970 * fns.c (Fdelq, Fdelete): Doc fix.
971
ff55dfe8
PE
9722012-09-10 Paul Eggert <eggert@cs.ucla.edu>
973
974 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
975 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
976
e7032e7c
SM
9772012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
978
979 * lisp.h (make_lisp_ptr): New macro to replace XSET.
980 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
981 Use it.
982
e9957956
EZ
9832012-09-09 Eli Zaretskii <eliz@gnu.org>
984
aba05ce9
EZ
985 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
986 left fringe if the window has a left margin. This avoids leaving
987 traces of the cursor because its leftmost pixel is not drawn over.
988
e9957956
EZ
989 * dispnew.c (update_window_line): When the left margin area of a
990 screen line is updated, set the redraw_fringe_bitmaps_p flag of
991 that screen line. (Bug#12277)
992
f6196b87
PE
9932012-09-09 Paul Eggert <eggert@cs.ucla.edu>
994
995 Assume C89 or later for math functions (Bug#12381).
996 This simplifies the code, and makes it a bit smaller and faster,
997 and (most important) makes it easier to clean up signal handling
998 since we can stop worring about floating-point exceptions in
999 library code. That was a problem before C89, but the problem
1000 went away many years ago on all practical Emacs targets.
1001 * data.c, image.c, lread.c, print.c:
1002 Don't include <math.h>; no longer needed.
1003 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1004 might be autoconfigured, as that never happens.
1005 * data.c (fmod):
1006 * doprnt.c (DBL_MAX_10_EXP):
1007 * print.c (DBL_DIG):
1008 Remove. C89 or later always defines these.
1009 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1010 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1011 (arith_error, domain_error, domain_error2):
1012 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1013 no longer needed -- we simply return what C returns. All uses removed.
1014 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1015 the wrapped code.
1016 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1017 Remove. All uses expanded, as these macros are no longer used
1018 more than once and are now more trouble than they're worth.
1019 (Ftan): Use tan, not sin / cos.
1020 (Flogb): Assume C89 frexp.
1021 (fmod_float): Assume C89 fmod.
1022 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1023 (init_floatfns): Remove. All uses removed.
1024
9d7f1863
JD
10252012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1026
1027 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1028 compositeToPoint for OSX < 10.6 (Bug#12390).
1029
eabf0404
PE
10302012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1031
1032 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1033 This produces more-accurate results.
1034
0b3b1d23
JD
10352012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1036
1037 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1038 changes (Bug#12088).
1039
6dcef6ec
CY
10402012-09-08 Chong Yidong <cyd@gnu.org>
1041
1042 * syntax.c (Fstring_to_syntax): Doc fix.
1043
aa7d57c5
JD
10442012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1045
1046 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1047 in the internal border.
1048 (x_set_window_size): Remove static variables and their usage.
1049 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
1050 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1051 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
1052 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1053 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1054 (ns_fix_rect_ibw): Remove.
1055 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1056 (ns_dumpglyphs_box_or_relief): Ditto.
1057 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1058 adjustment.
1059 (ns_dumpglyphs_image): Ditto.
fc0c31f8 1060 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
1061 border adjustment.
1062 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1063 their usage. Add fringe_extended_p and its use as in other terms.
1064 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1065 scroll bar was removed.
1066 (updateFrameSize): New function.
1067 (windowDidResize): Move code to updateFrameSize and call it.
1068
1069 * nsterm.h (EmacsView): Add updateFrameSize.
1070
1a5432bc
CY
10712012-09-07 Chong Yidong <cyd@gnu.org>
1072
b4f5313e
CY
1073 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1074
1a5432bc
CY
1075 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1076
1a4f1e9b
PE
10772012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1078
1079 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
1080 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1081 Problem introduced when merging patches. Noted by Eli Zaretskii in
1082 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
1083 * floatfns.c: Comment fix.
1084 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1085 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1086 and anyway the declaration is harmless even if SIGDANGER is not defined.
1087 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1088 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1089 source files not surprisingly expected syssignal.h to define, or
1090 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1091 Include <sys/ioctl.h>, for FIONREAD.
1092 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1093 This eliminates a problem whereby other files mysteriously had
1094 to include "syssignal.h" before including "systty.h" if they
1095 wanted to use "#ifdef SIGIO".
1096
bc8000ff
EZ
10972012-09-07 Eli Zaretskii <eliz@gnu.org>
1098
3e6d6928
EZ
1099 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1100
1101 * w32.c (sigemptyset): Empty the set.
1102 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1103
bc8000ff
EZ
1104 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1105
b4fa72f2
DA
11062012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1107
1108 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1109 (mark_object): Likewise for frame objects.
1110
30730c93
PE
11112012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1112
1113 * syssignal.h (handle_on_main_thread): Always declare,
1114 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1115 This ports to platforms without HAVE_PTHREAD.
1116
2fe28299
PE
11172012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1118
1119 Signal-handler cleanup (Bug#12327).
1120 Emacs's signal handlers were written in the old 4.2BSD style with
1121 sigblock and sigmask and so forth, and this led to some
1122 inefficiencies and confusion. Rewrite these to use
1123 pthread_sigmask etc. without copying signal sets around. Also,
1124 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1125 'signal', and instead use functions that do not attempt to take
1126 over the system name space. This patch causes Emacs's text
1127 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1128 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1129 Do not include <signal.h> or "syssignal.h", as these
1130 modules do not use signals.
1131 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1132 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1133 Do not include <signal.h>, as "syssignal.h" does that for us now.
1134 * atimer.c (sigmask_atimers): New function.
1135 (block_atimers, unblock_atimers): New functions,
1136 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1137 All uses replaced.
1138 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1139 no longer needed here.
1140 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 1141 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
1142 * sysdep.c (struct save_signal): New member 'action', replacing
1143 old member 'handler'.
1144 (save_signal_handlers, restore_signal_handlers):
1145 Use sigaction instead of 'signal' to save and restore.
1146 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1147 New function. All users of 'signal' modified to use set_sighandler
1148 if they're writeonly, and to use sys_signal if they're read+write.
1149 (emacs_sigaction_init, forwarded_signal): New functions.
1150 (sys_signal): Remove. All uses replaced by calls to sigaction
1151 and emacs_sigaction_init, or by direct calls to 'signal'.
1152 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1153 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1154 all uses replaced by pthread_sigmask etc. calls.
1155 * syssignal.h: Include <signal.h>.
1156 (emacs_sigaction_init, forwarded_signal): New decls.
1157 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1158 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1159 (sigmask, sys_sigmask): Remove; no longer needed.
1160 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1161 (sigblock, sigunblock, sigfree):
1162 (sigsetmask) [!defined sigsetmask]:
1163 Remove. All uses replaced by pthread_sigmask.
1164 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1165 no longer need to be replaced, and its typical old uses
1166 are now done via emacs_sigaction_init and sigaction.
1167 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1168 (sys_sigdel): Remove; unused.
1169 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1170
0216c128
EZ
11712012-09-06 Eli Zaretskii <eliz@gnu.org>
1172
1173 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1174 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1175
c752cfa9
DA
11762012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1177
1178 Explicitly mark buffer_defaults and buffer_local_symbols.
1179 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1180 mark_local_symbols here.
1181 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1182 since special buffers aren't marked here any more.
1183 (allocate_buffer): Chain new buffer with all_buffers here...
1184 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1185 not here.
1186 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1187 (syms_of_buffer): Remove staticpro of the above.
1188 (init_buffer_once): Set names for buffer_defaults and
1189 buffer_local_symbols.
1190
a864ef14
PE
11912012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1192
1193 Use bool for booleans in font-related modules.
1194 * font.c (font_intern_prop, font_style_to_value)
1195 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1196 (generate_otf_features, font_check_otf_features, font_check_otf)
1197 (font_match_p, font_list_entities, font_at):
1198 * fontset.c (fontset_id_valid_p, reorder_font_vector
1199 (fontset_find_font, Fset_fontset_font)
1200 (face_suitable_for_char_p) [0]:
1201 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1202 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1203 (m17n_flt_initialized, ftfont_shape_by_flt):
1204 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1205 * nsfont.m (nsfont_draw):
1206 * w32font.c (w32font_draw):
1207 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1208 Use bool for booleans.
1209 * font.h: Adjust to above API changes.
1210 (struct font, struct font_driver, struct font_driver_list):
1211 Use bool for booleans.
1212 (struct font): Remove useless member encoding_type.
1213 All users removed.
1214 * fontset.c, xftfont.c: Omit unnecessary static decls.
1215
0699fc18
DA
12162012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1217
1218 * alloc.c (mark_object): Revert window marking code
1219 since it's unsafe for the Fset_window_configuration.
1220
20ef56db
PE
12212012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1222
2fe28299 1223 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
1224 Be more systematic about preserving errno whenever a signal
1225 handler returns, even if it's not in the main thread. Do this by
1226 renaming signal handlers to distinguish between signal delivery
1227 and signal handling. All uses changed.
1228 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1229 * data.c (deliver_arith_signal): Rename from arith_error.
1230 * dispnew.c (deliver_window_change_signal): Rename from
1231 window_change_signal.
1232 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1233 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1234 * keyboard.c (deliver_input_available_signal): Rename from
1235 input_available_signal.
1236 (deliver_user_signal): Rename from handle_user_signal.
1237 (deliver_interrupt_signal): Rename from interrupt_signal.
1238 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1239 (deliver_child_signal): Rename from sigchld_handler.
1240 * atimer.c (handle_alarm_signal):
1241 * data.c (handle_arith_signal):
1242 * dispnew.c (handle_window_change_signal):
1243 * emacs.c (handle_fatal_signal, handle_danger_signal):
1244 * keyboard.c (handle_input_available_signal):
1245 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1246 * process.c (handle_pipe_signal, handle_child_signal):
1247 New functions, with the actual signal-handling code taken from the
1248 original respective signal handlers, sans the sporadic attempts to
1249 preserve errno, since that's now done by handle_on_main_thread.
1250 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1251 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1252 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1253 Move to sysdep.c.
1254 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1255 Move initialization of main_thread to sysdep.c's init_signals.
1256 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1257 our usage, and simplifies the mainline code.
1258 (record_child_status_change): New static function, as a helper
1259 for handle_child_signal, and with most of the old child handler's
1260 contents.
1261 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1262 (handle_child_signal): Use the above.
1263 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1264 Moved here from emacs.c.
1265 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1266 code moved here from emacs.c's main function.
1267 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
1268 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1269 This lets callers save and restore errno properly.
20ef56db 1270
e3ccf108
DA
12712012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1272
1273 Remove redundant or unused things here and there.
1274 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1275 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1276 * editfns.c (Fcompare_buffer_substrings): Likewise.
1277 * frame.h (struct terminal, struct font_driver_list):
1278 Remove redundant declarations.
1279 * window.h (Qleft, Qright): Likewise.
1280
697e1e39
DA
12812012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1282
1283 Do not mark objects from deleted buffers, windows and frames.
1284 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1285 (mark_object): Likewise for windows and frames.
1286
c1ca42ca
DA
12872012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1288
1289 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1290 buffer_defaults and buffer_local_symbols as valid objects.
1291 Return special value to denote them.
1292
014d93be
PE
12932012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1294
f75d7a91
PE
1295 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1296 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1297 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1298 (file_name_absolute_p, Fsubstitute_in_file_name):
1299 (check_executable, check_writable, Ffile_accessible_directory_p)
1300 (Fset_file_selinux_context, Fdefault_file_modes)
1301 (Finsert_file_contents, choose_write_coding_system)
1302 (Fwrite_region, build_annotations, a_write, e_write)
1303 (Fdo_auto_save):
1304 * filelock.c (boot_time_initialized, get_boot_time)
1305 (get_boot_time_1, lock_file_1, within_one_second):
1306 * floatfns.c (in_float):
1307 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1308 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1309 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1310 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1311 * window.c (compare_window_configurations):
1312 Use bool for booleans.
1313 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1314 (Fdefault_file_modes): Now mode_t, not int, for modes.
1315 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1316 (internal_delete_file): Now returns void, not a (boolean) int,
1317 since nobody was looking at the return value.
1318 * lisp.h, window.h: Adjust to above API changes.
1319
014d93be
PE
1320 * xdisp.c (set_message): Simplify and reindent last change.
1321
776f29e1
JB
13222012-09-05 Juanma Barranquero <lekktu@gmail.com>
1323
1324 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1325
7f7e0167
LI
13262012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1327
1328 * eval.c (call_debugger): Make the function non-static so that we
1329 can call it from set_message.
1330
1331 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1332 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1333
cf29dd84
PE
13342012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1335
1336 Give more-useful info on a fatal error (Bug#12328).
1337 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1338 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1339 of doing the work ourselves.
1340 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1341 do most of the work.
1342 (fatal_error_backtrace): New function, taken from the guts
1343 of the old fatal_error_signal, but with a new option to output
1344 a backtrace.
1345 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1346 info about the signal than just its number.
1347 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1348 * sysdep.c: Include <execinfo.h>
1349 (emacs_backtrace): New function, taken partly from the previous
1350 code of the 'die' function.
1351 (emacs_abort): Call fatal_error_backtrace rather than abort.
1352
972debf2
SM
13532012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1354
1355 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1356 eager (load-time) macro-expansion.
1357 * lisp.mk (lisp): Add macroexp.
1358
1088b922
PE
13592012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1360
1361 Simplify redefinition of 'abort' (Bug#12316).
1362 Do not try to redefine the 'abort' function. Instead, redo
1363 the code so that it calls 'emacs_abort' rather than 'abort'.
1364 This removes the need for the NO_ABORT configure-time macro
1365 and makes it easier to change the abort code to do a backtrace.
1366 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1367 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1368 Remove; sysdep.c's emacs_abort now takes its place.
1369 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1370 'abort' changed to use 'emacs_abort'.
1371 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1372 (abort) [!defined abort]: Rename to ...
1373 (emacs_abort): ... new name.
1374 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1375 the place of the old 'abort' in emacs.c.
1376 * w32.c, w32fns.c (abort): Do not #undef.
1377 * w32.c (emacs_abort): Rename from w32_abort.
1378
30934d33
EZ
13792012-09-04 Eli Zaretskii <eliz@gnu.org>
1380
1381 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1382 offsets[j].dv, since the y axis of the screen coordinates points
1383 down, while the y axis of the font definition coordinates points
1384 up. This fixes display of Arabic diacritics such as KASRA and
1385 KASRATAN. (Bug#11860)
1386
af26b72c
PE
13872012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1388
1389 Be more systematic about _setjmp vs setjmp.
1390 * alloc.c (test_setjmp, mark_stack):
1391 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1392 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1393 (png_load, my_error_exit, jpeg_load):
1394 * process.c (send_process_trap, send_process):
1395 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1396 The underscored versions are up to 30x faster on some hosts.
1397 Formerly, the code used setjmp+longjmp sometimes and
1398 _setjmp+_longjmp at other times, with no particular reason to
1399 prefer setjmp+longjmp.
1400
26d4541d
PE
14012012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1402
d42f4f0f 1403 Fix minor problem found by static checking.
26d4541d 1404 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 1405
c5e28e39
MR
14062012-09-03 Martin Rudalics <rudalics@gmx.at>
1407
1408 * buffer.c (Fdelete_all_overlays): New function.
1409
3eab3ca9
CY
14102012-09-03 Chong Yidong <cyd@gnu.org>
1411
1412 * gtkutil.c: Add extern decl for Qxft.
1413
c04889f8
PE
14142012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1415
1882aa38
PE
1416 * emacs.c, eval.c: Use bool for boolean.
1417 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1418 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1419 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1420 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1421 (main, decode_env_path, Fdaemon_initialized):
1422 * eval.c (call_debugger, Finteractive_p, interactive_p):
1423 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1424 (maybe_call_debugger, Fbacktrace):
1425 * process.c (read_process_output, exec_sentinel):
1426 Use bool for booleans.
1427 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1428 All callers changed.
1429 * eval.c (interactive_p): Omit always-true boolean argument
1430 EXCLUDE_SUBRS_P. All callers changed.
1431 * dispextern.h, lisp.h: Reflect above API changes.
1432 * firstfile.c (dummy): Use the address of 'main', whose signature
1433 won't change, instead of the address of 'initialize', whose
1434 signature just changed from int to bool.
1435 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1436 * msdos.c (fatal_error_in_progress): ... from here.
1437 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1438 of incrementing it.
1439 (redisplay_internal, unwind_redisplay): Simply clear
1440 REDISPLAYING_P when unwinding, instead of saving its previous,
1441 always-false value and then restoring it.
1442
a411ac43
PE
1443 Clean up some extern decls.
1444 Mostly, this hoists extern decls out of .c files and into .h files.
1445 That way, we're more likely to catch errors if the interfaces change.
1446 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1447 declare xg_mark_data.
1448 * dispextern.h (x_frame_parm_handlers):
1449 * font.h (Qxft):
1450 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1451 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1452 (Qultra_bold, Qoblique, Qitalic):
1453 Move extern decl here from .c file.
1454 * alloc.c (xg_mark_data) [USE_GTK]:
1455 * doc.c (Qclosure):
1456 * eval.c (Qlexical_binding):
1457 * fns.c (time) [!HAVE_UNISTD_H]:
1458 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1459 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1460 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1461 * lread.c (Qinternal_interpreter_environment):
1462 * minibuf.c (Qbuffer):
1463 * process.c (QCfamily, QCfilter):
1464 * widget.c (free_frame_faces):
1465 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1466 * xfont.c (x_clear_errors):
1467 * xterm.c (x_frame_parm_handlers):
1468 Remove now-redundant extern decls.
1469 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1470 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1471 Now static.
1472 * xfaces.c: Remove unnecessary static decls.
1473 * xterm.c (updating_frame): Remove decl of nonexistent object.
1474
c04889f8
PE
1475 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1476 when building globals.h, as the objects that are not built on
1477 this host are not needed to compile C files on this host.
1478
8b339673
JD
14792012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1480
1481 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1482
1483 * frame.h: Add missing prototype for x_wm_set_size_hint.
1484
a08d4ba7
PE
14852012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1486
1487 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1488 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1489 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1490 (Fsubstitute_command_keys):
1491 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1492 (save_excursion_save, save_excursion_restore)
1493 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1494 (format_time_string, general_insert_function)
1495 (make_buffer_string, make_buffer_string_both)
1496 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1497 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1498 (copy_text, insert_1, insert_1_both, insert_from_string)
1499 (insert_from_string_before_markers, insert_from_string_1)
1500 (insert_from_buffer, insert_from_buffer_1, replace_range)
1501 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1502 (del_range_2, modify_region):
1503 * intervals.c (intervals_equal, balance_possible_root_interval)
1504 (adjust_intervals_for_insertion, merge_properties_sticky)
1505 (graft_intervals_into_buffer, lookup_char_property)
1506 (adjust_for_invis_intang, set_point_both)
1507 (get_property_and_range, compare_string_intervals)
1508 (set_intervals_multibyte_1, set_intervals_multibyte):
1509 * keyboard.c (decode_timer):
1510 Use bool for boolean.
1511 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1512 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1513
48c948de
CY
15142012-09-02 Chong Yidong <cyd@gnu.org>
1515
1516 * keymap.c (push_key_description): Print M-TAB as C-M-i
1517 (Bug#11758).
1518
6c49a40b
JB
15192012-09-02 Juanma Barranquero <lekktu@gmail.com>
1520
1521 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1522 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1523 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1524 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1525 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1526 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1527 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1528
4dfbd238
EZ
15292012-09-01 Eli Zaretskii <eliz@gnu.org>
1530
7e510e28
EZ
1531 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1532 more than one grapheme cluster passed to the shaper: compute the
1533 offset adjustment values separately for each cluster. (Bug#11860)
1534
4dfbd238
EZ
1535 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1536 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1537 about implicit conversions from integer to pointer.
1538
86571ae0
DC
15392012-09-01 Daniel Colascione <dancol@dancol.org>
1540
1541 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1542 system used too early.
1543
0e23ef9d
PE
15442012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1545
1546 Better seed support for (random).
1547 * emacs.c (main): Call init_random.
1548 * fns.c (Frandom): Set the seed from a string argument, if given.
1549 Remove long-obsolete Gentzel cruft.
1550 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1551 (init_random): New function.
1552
17a2cbbd
DC
15532012-09-01 Daniel Colascione <dancol@dancol.org>
1554
1555 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1556 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1557 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1558 x_wm_set_size_hint, x_query_colors, x_real_positions,
1559 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1560 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1561 all of which have been moved to common code.
1562
1563 * xfaces.c: Include TERM_HEADER instead of listing all possible
1564 window-system headers.
1565
1566 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1567 to match header.
1568
1569 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1570 directly accessing frame internals.
1571
f18cbb28 1572 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
1573 globals_of_w32font.
1574
1575 * process.c: Include TERM_HEADER instead of listing all possible
1576 window-system headers.
1577
3a880af4
SM
1578 * nsterm.h: Remove declarations now in frame.h.
1579 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
1580
1581 * menu.c: Include TERM_HEADER instead of listing all possible
1582 window-system headers.
1583
1584 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1585 window system.
1586
1587 * keyboard.c: Include TERM_HEADER instead of listing all possible
1588 window-system headers.
1589
1590 * image.c: Include TERM_HEADER instead of listing all possible
1591 window-system headers. Declare Vlibrary_cache when compiling for
1592 Windows.
1593
1594 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1595 window system declarations.
1596
1597 * frame.h: Move common functions here: set_frame_menubar,
1598 x_set_window_size, x_sync, x_get_focus_frame,
1599 x_set_mouse_position, x_set_mouse_pixel_position,
1600 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1601 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1602 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1603 x_activate_menubar, x_real_positions, x_bitmap_icon,
1604 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1605 and x_query_colors.
1606
1607 * frame.c: Include TERM_HEADER instead of listing all possible
1608 window-system headers.
1609
1610 * font.c: Include TERM_HEADER instead of listing all possible
1611 window-system headers.
1612
1613 * emacs.c: Include TERM_HEADER.
1614
f18cbb28
EZ
1615 * dispnew.c: Include TERM_HEADER instead of listing all possible
1616 window-system headers.
17a2cbbd 1617
f18cbb28 1618 * ccl.h: Include character.h.
17a2cbbd
DC
1619
1620 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1621 the current window system; include in list of objects to link into
1622 Emacs.
1623
c650a5de
DA
16242012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1625
1626 Remove mark_ttys function and fix tty_display_info initialization.
1627 * lisp.h (mark_ttys): Remove prototype.
1628 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1629 to mark_ttys because all possible values of 'top_frame' slot are
1630 the frames which are reachable from Vframe_list.
1631 * term.c (mark_ttys): Remove.
1632 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1633
4e0f6479
DA
16342012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1635
1636 Change struct frame bitfields from unsigned char to unsigned.
1637 * frame.h (struct frame): Change type of 'display_preempted',
1638 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1639 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1640 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1641 bitfields from unsigned char to unsigned.
1642
8b96a52c
DA
16432012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1644
1645 Remove unused member of struct x_output and struct w32_output.
1646 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1647 * w32term.h (struct w32_output): Likewise.
1648
b4444c8a
JD
16492012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1650
1651 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1652 does not become zero (Bug#12234).
1653
b98521db
PE
16542012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1655
1656 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1657 for GCC 4.7.1 x86-64.
1658
31d02438
GM
16592012-08-30 Glenn Morris <rgm@gnu.org>
1660
1661 * lread.c (init_lread): For out-of-tree builds, only add the
1662 source directory's site-lisp dir to the load-path if it exists,
1663 consistent with in-tree builds. (Bug#12302)
1664
7f8941d8
JD
16652012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1666
1667 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 1668 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
1669 (windowShouldClose:): Set window_closed.
1670 (dealloc): New member, free button_values.
fc0c31f8
JB
1671 (process_dialog:): Make member function. Remove window argument,
1672 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
1673 in button_values.
1674 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 1675 with tag. Remove return self, declare return value as void.
7f8941d8
JD
1676 (addString:row:): Remove return self, declare return value as void.
1677 (addSplit): Remove return self, declare return value as void.
1678 (clicked:): Remove return self, declare return value as void.
fc0c31f8 1679 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
1680 (initFromContents:isQuestion:): Adjust call to process_dialog.
1681 Code formatting change.
1682 (timeout_handler:): Set timer_fired to YES.
1683 (runDialogAt:): Set timer_fired to NO.
1684 Handle click on close button as quit.
1685
1686 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1687 Add window_closed and button_values. Add void as return value for
1688 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1689 Add process_dialog as new member.
1690
eada0861 16912012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 1692
eada0861
GM
1693 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1694 is not one of the heaps we manage. (Bug#12242)
1695
16962012-08-28 Glenn Morris <rgm@gnu.org>
1697
1698 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1699
457294dd
MR
17002012-08-28 Martin Rudalics <rudalics@gmx.at>
1701
1702 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
1703 auto-buffer-name window parameter. Install revision of reverted
1704 fix.
457294dd 1705
4f2daf31
DA
17062012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1707
1708 Do not allow to set major mode for a dead buffer.
1709 * buffer.c (Fset_buffer_major_mode): Signal an error
1710 if the buffer is dead.
1711 (Fother_buffer, other_buffer_safely): Remove redundant
1712 nested declaration.
1713
66322887
DA
17142012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1715
1716 Always use set_buffer_if_live to restore original buffer at unwind.
1717 * buffer.h (record_unwind_current_buffer): New function.
1718 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1719 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1720 * undo.c, window.c: Adjust users.
1721 * buffer.c (set_buffer_if_live): Fix comment.
1722
a3d794a1
DA
17232012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1724
1725 Fix usage of set_buffer_internal.
1726 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1727 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1728 * coding.c (decode_coding): Omit redundant test.
1729 * fileio.c (decide_coding_unwind): Likewise.
1730 * fns.c (secure_hash): Likewise.
1731 * insdel.c (modify_region): Likewise.
1732 * keyboard.c (command_loop_1): Likewise.
1733 * print.c (PRINTFINISH): Likewise.
1734 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1735
59ea14cd
PE
17362012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1737
1738 * dispnew.c: Use bool for boolean.
1739 (frame_garbaged, display_completed, delayed_size_change)
1740 (fonts_changed_p, add_window_display_history)
1741 (add_frame_display_history, verify_row_hash)
1742 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1743 (row_equal_p, realloc_glyph_pool)
1744 (allocate_matrices_for_frame_redisplay)
1745 (showing_window_margins_p)
1746 (adjust_frame_glyphs_for_frame_redisplay)
1747 (build_frame_matrix_from_leaf_window, make_current)
1748 (mirrored_line_dance, mirror_line_dance, update_frame)
1749 (update_window_tree, update_single_window)
1750 (check_current_matrix_flags, update_window, update_text_area)
1751 (update_window_line, set_window_update_flags, scrolling_window)
1752 (update_frame_1, scrolling, buffer_posn_from_coords)
1753 (do_pending_window_change, change_frame_size)
1754 (change_frame_size_1, sit_for):
1755 Use bool for boolean.
1756 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1757 and remove last int (actually boolean) argument, which was always 0.
1758 All callers changed.
1759 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1760 * dispextern.h (struct composition_it): Use bool for boolean.
1761 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1762 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1763 * dired.c (file_name_completion):
1764 Use bool for boolean. (This was missed in an earlier change.)
1765
95072a94
MR
17662012-08-27 Martin Rudalics <rudalics@gmx.at>
1767
1768 * window.c (Fset_window_configuration): Revert first part of
1769 last change.
1770
0f19feff
JD
17712012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1772
1773 * nsterm.h (NSPanel): New class variable dialog_return.
1774
3a880af4
SM
1775 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
1776 Initialize dialog_return.
0f19feff
JD
1777 (windowShouldClose:): Use stop instead of stopModalWithCode.
1778 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1779 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1780 event.
1781 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1782 modal loop returns.
1783
f10fe38f
PE
17842012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1785
de1339b0
PE
1786 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1787 * composite.c (find_composition, composition_gstring_p)
1788 (composition_reseat_it, find_automatic_composition):
1789 * data.c (let_shadows_buffer_binding_p)
1790 (let_shadows_global_binding_p, set_internal, make_blv)
1791 (Fmake_variable_buffer_local, Fmake_local_variable)
1792 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1793 (cons_to_signed, arith_driver):
1794 * dbusbind.c (xd_in_read_queued_messages):
1795 * dired.c (directory_files_internal, file_name_completion):
1796 Use bool for booleans.
1797 * dired.c (file_name_completion):
1798 * process.h (fd_callback):
1799 Omit int (actually boolean) argument. It wasn't being used.
1800 All uses changed.
1801 * composite.h, lisp.h: Reflect above API changes.
1802
f10fe38f
PE
1803 * cmds.c, coding.c: Use bool for booleans.
1804 * cmds.c (move_point, Fself_insert_command):
1805 * coding.h (struct composition status, struct coding_system):
1806 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1807 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1808 (emacs_mule_char, decode_coding_emacs_mule)
1809 (encode_coding_emacs_mule, detect_coding_iso_2022)
1810 (decode_coding_iso_2022, encode_invocation_designation)
1811 (encode_designation_at_bol, encode_coding_iso_2022)
1812 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1813 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1814 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1815 (encode_coding_raw_text, detect_coding_charset)
1816 (decode_coding_charset, encode_coding_charset, detect_eol)
1817 (detect_coding, get_translation_table, produce_chars)
1818 (consume_chars, reused_workbuf_in_use)
1819 (make_conversion_work_buffer, code_conversion_save)
1820 (decode_coding_object, encode_coding_object)
1821 (detect_coding_system, char_encodable_p)
1822 (Funencodable_char_position, code_convert_region)
1823 (code_convert_string, code_convert_string_norecord)
1824 (Fset_coding_system_priority):
1825 * fileio.c (Finsert_file_contents):
1826 Use bool for booleans.
1827 * coding.h, lisp.h: Reflect above API changes.
1828 * coding.c: Remove unnecessary static function decls.
1829 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1830 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1831 not a boolean 'int', since callers never look at the return value.
1832 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1833 * coding.h (decoding_buffer_size, encoding_buffer_size)
1834 (emacs_mule_string_char): Remove unused extern decls.
1835 (struct iso_2022_spec, struct coding_system):
1836 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1837 (struct emacs_mule_spec): Remove unused field 'full_support'.
1838 All initializations removed.
1839 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1840
5474c384
DA
18412012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1842
f10fe38f 1843 Fix spare memory change (Bug#12286).
5474c384
DA
1844 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1845 (valid_lisp_object_p): Likewise.
1846
c4b6914d
MR
18472012-08-27 Martin Rudalics <rudalics@gmx.at>
1848
1849 * window.c (Fset_window_configuration): Record any window's old
1850 buffer if it's replaced (see Bug#8789). If the new current
1851 buffer doesn't appear in the selected window, go to its old
1852 point (Bug#12208).
1853
35aaa1ea
DA
18542012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1855
1856 Special MEM_TYPE_SPARE to denote reserved memory.
1857 * alloc.c (enum mem_type): New memory type.
1858 (refill_memory_reserve): Use new type for spare memory.
1859 This prevents live_cons_p and live_string_p from incorrect
1860 detection of uninitialized objects from spare memory as live.
1861
6af64513
PE
18622012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1863
8b2e00a3
PE
1864 Spelling fixes.
1865 * Makefile.in (.PHONY): versioclean -> versionclean.
1866
b52d6985
PE
1867 Remove unused external symbols.
1868 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1869 * window.c (Qwindow_valid_p, decode_valid_window):
1870 Now static, not extern.
1871 * data.c (Qinterval): Remove; unused.
1872 (syms_of_data): Do not define 'interval'.
1873 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1874 * window.h (decode_valid_window):
1875 Remove decls.
1876
d5172d4f
PE
1877 * character.c, charset.c, chartab.c: Use bool for booleans.
1878 * character.c (lisp_string_width, string_count_byte8)
1879 (string_escape_byte8):
1880 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1881 (load_charset_map_from_file, map_charset_chars)
1882 (Fdefine_charset_internal, define_charset_internal)
1883 (Fdeclare_equiv_charset, find_charsets_in_text)
1884 (Ffind_charset_region, char_charset, Fiso_charset):
1885 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1886 (sub_char_table_set, sub_char_table_set_range)
1887 (char_table_set_range, optimize_sub_char_table)
1888 (map_sub_char_table):
1889 Use bool for boolean.
1890 * character.c (str_to_unibyte): Omit last boolean argument; it was
1891 always 0. All callers changed.
1892 * character.h, charset.h: Adjust to match previous changes.
1893 * character.h (char_printable_p): Remove decl of nonexistent function.
1894 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1895 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1896 are all boolean, so make them single-bit bitfields.
1897
6af64513
PE
1898 * lisp.h (ASET): Remove attempt to detect side effects.
1899 It was meant to be temporary and it often doesn't work,
1900 because when IDX has side effects the behavior of IDX==IDX
1901 is undefined. See Stefan Monnier in
1902 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1903
e1f29348
BR
19042012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1905
1906 * lisp.h (functionp): New function (extracted from Ffunctionp).
1907 (FUNCTIONP): Use it.
1908 * eval.c (Ffunctionp): Use it.
1909
17c05d74
PE
19102012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1911
0f46bc75
PE
1912 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1913 as that's faster and simpler than static storage. Don't bother
1914 with the g_main_context_query overhead if g_main_context_pending
1915 says no events are pending.
1916 (gfds, gfds_size): Remove these static vars.
1917 (xgselect_initialize): Remove; no longer needed.
1918 All uses and decls removed.
1919
ee4c0f69
PE
1920 * emacs.c (fatal_error_signal_hook): Remove.
1921 All uses removed. This leftover from old code was always 0.
1922
17c05d74
PE
1923 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1924 * casefiddle.c (casify_object, casify_region):
1925 * casetab.c (set_case_table):
1926 * category.c, category.h (word_boundary_p):
1927 * category.h (CHAR_HAS_CATEGORY):
1928 Use bool for booleans, instead of int.
1929
391ceac5
EZ
19302012-08-25 Eli Zaretskii <eliz@gnu.org>
1931
1932 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
1933
2f221583
PE
19342012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1935
f4a681b0
PE
1936 On assertion failure, print backtrace if available.
1937 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
1938 (die) [ENABLE_CHECKING]: Print a backtrace if available.
1939 * Makefile.in (LIB_EXECINFO): New macro.
1940 (LIBES): Use it.
1941
2f221583
PE
1942 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
1943 * bytecode.c (exec_byte_code):
1944 * callint.c (check_mark, Fcall_interactively):
1945 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
1946 (getenv_internal, sync_process_alive, call_process_exited):
1947 * lisp.h (USE_SAFE_ALLOCA):
1948 Use bool for booleans, instead of int.
1949 * lisp.h, process.h: Adjust prototypes to match above changes.
1950 * callint.c (Fcall_interactively): Don't assume the mark's
1951 offset fits in 'int'.
1952
37ef52bb
PE
19532012-08-24 Paul Eggert <eggert@cs.ucla.edu>
1954
1955 * buffer.c, buffer.h: Use bool for boolean.
1956 * buffer.c (reset_buffer_local_variables)
1957 (buffer_lisp_local_variables, Fset_buffer_modified_p)
1958 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1959 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1960 (overlay_touches_p, overlay_strings, Foverlay_put)
1961 (report_overlay_modification, call_overlay_mod_hooks):
1962 (mmap_enlarge, mmap_set_vars):
1963 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1964 Use bool for booleans, instead of int.
1965 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1966 since the 1-or-0 return value is always ignored anyway.
1967 (mmap_initialized_p):
1968 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
1969 * buffer.h, lisp.h: Adjust prototypes to match above changes.
1970
2cc21167
PE
19712012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1972
1973 * bidi.c: Use bool for boolean.
1974 This is a bit more readable, and makes the text segment of bidi.o
1975 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
1976 Presumably it's faster too.
1977 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
1978 Now bool.
1979 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1980 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
1981 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
1982 (bidi_explicit_dir_char, bidi_level_of_next_char)
1983 (bidi_find_other_level_edge, bidi_move_to_visually_next):
1984 Use bool for booleans, instead of int.
1985 * dispextern.h (bidi_init_it, bidi_paragraph_init)
1986 (bidi_unshelve_cache): Adjust decls to match code.
1987
7db4ddf4
MR
19882012-08-23 Martin Rudalics <rudalics@gmx.at>
1989
1990 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
1991 argument.
1992
b1bb8011
PE
19932012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1994
1995 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
1996 * atimer.h: Include <stdbool.h>.
1997
ff687885
DN
19982012-08-22 Dan Nicolaescu <dann@gnu.org>
1999
2000 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2001 compile time tests instead of run time tests on systems that do
2002 not use them.
2003 (FRAME_MAC_P): Remove leftover from deleted code.
2004 * frame.c (syms_of_frame): Remove leftover from deleted code.
2005
4ce7a138
JD
20062012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2007
2008 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2009
d733ec6d
PE
20102012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2011
2012 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2013 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 2014 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
2015 (fontset_add): Return void, for FONTSET_ADD.
2016
d0d2d26f
PE
20172012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2018
fce31d69
PE
2019 * alloc.c: Use bool for booleans.
2020 (gc_in_progress, abort_on_gc)
2021 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2022 (dont_register_blocks) [GC_MALLOC_CHECK]:
2023 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2024 (check_string_bytes, make_specified_string, memory_full)
2025 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2026 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2027 (mark_stack, valid_pointer_p, make_pure_string)
2028 (Fgarbage_collect, survives_gc_p, gc_sweep):
2029 Use bool for booleans, instead of int.
2030 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2031 Remove unused local.
2032 * alloc.c (PURE_POINTER_P):
2033 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2034 * editfns.c (Fformat):
2035 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2036 (Fdo_auto_save):
2037 * fns.c (sweep_weak_table):
2038 * lisp.h (suppress_checking, push_message, survives_gc_p)
2039 (make_pure_string, gc_in_progress, abort_on_gc):
2040 * lread.c (readchar, read1):
2041 * print.c (Fprin1_to_string):
2042 * xdisp.c (push_message):
2043 Use bool for booleans affected directly or indirectly by
2044 alloc.c's changes.
2045
d0d2d26f
PE
2046 Make recently-introduced setters macros.
2047 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2048 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2049 (set_fontset_default, set_fontset_fallback): Rename from their
2050 upper-case counterparts, and make them functions rather than macros.
2051 This is more consistent with the other recently-introduced setters.
2052 These don't need to be inline, since they're local.
2053
d18e2bb6
JD
20542012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2055
2056 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2057 the loop (Bug#12247).
2058
1b9d9d16
PE
20592012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2060
2061 * lisp.h (vcopy): Use memcpy rather than our own loop.
2062 This fixes a performance regression introduced by the recent
2063 addition of vcopy. This means 'vcopy' will need to be modified
2064 for a copying collector, but that's OK. Also, tighten the
2065 checking in the assertion.
2066
b2f09701
EZ
20672012-08-21 Eli Zaretskii <eliz@gnu.org>
2068
2069 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2070 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2071 non-base glyph for the width of the base character, according to
e1f29348
BR
2072 what x_draw_composite_glyph_string_foreground expects.
2073 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
2074 expectations, to produce correct width of the composed character.
2075 Reverse the sign of the DU offset produced by ScriptPlace.
2076
9b994fed
PE
20772012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2078
2079 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2080
086ca913
DA
20812012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2082
2083 Avoid direct writes to contents member of struct Lisp_Vector.
2084 * lisp.h (vcopy): New function to copy data into vector.
2085 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2086 * fns.c (Ffillarray): Use ASET.
2087 * keyboard.c (timer_check_2): Use AREF and ASET.
2088 (append_tool_bar_item, Frecent_keys): Use vcopy.
2089 * lread.c (read_vector): Use ASET.
2090 * msdos.c (Frecent_doskeys): Use vcopy.
2091 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2092 (Finternal_merge_in_global_face): Use ASET and vcopy.
2093 * xfont.c (xfont_list_pattern): Likewise.
2094
5481664a
MR
20952012-08-21 Martin Rudalics <rudalics@gmx.at>
2096
2097 * window.c (Fwindow_point): For the selected window always return
2098 the position of its buffer's point.
2099 (Fset_window_point): For the selected window always go in its
2100 buffer to the specified position.
2101
6d470bdd
DA
21022012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2103
2104 Setter macros for fontsets.
2105 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2106 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2107 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2108 Adjust users.
2109
24564fe1
GM
21102012-08-20 Glenn Morris <rgm@gnu.org>
2111
2112 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2113 Don't assume that `ln -f' works.
2114
0a05a035
EZ
21152012-08-20 Eli Zaretskii <eliz@gnu.org>
2116
2117 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2118 and later about non-assignments with no effect. See discussion at
2119 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2120 details.
2121
e46f2325
DA
21222012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2123
2124 Inline setter functions for Lisp_Objects slots of struct specbinding.
2125 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2126 Adjust users.
2127
734fbd86
MR
21282012-08-20 Martin Rudalics <rudalics@gmx.at>
2129
2130 * window.c (select_window): Always make selected window's buffer
2131 current.
2132
f1a95992
DA
21332012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2134
2135 Use AREF and ASET for docstrings of category tables.
2136 * category.h (CATEGORY_DOCSTRING): Use AREF.
2137 (SET_CATEGORY_DOCSTRING): Use ASET.
2138 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2139
e83064be
DA
21402012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2141
2142 Inline setter functions for hash table members.
2143 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2144 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2145 (set_hash_key_and_value, set_hash_index, set_hash_next)
2146 (set_hash_hash): New functions.
2147 * charset.c, fns.c: Adjust users.
2148
4ce60d2e
DA
21492012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2150
2151 Inline getter and setter functions for per-buffer values.
2152 * buffer.h (per_buffer_default, set_per_buffer_default)
2153 (per_buffer_value, set_per_buffer_value): New functions.
2154 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2155 * buffer.c, data.c: Adjust users.
2156
c06c9690
JB
21572012-08-20 Juanma Barranquero <lekktu@gmail.com>
2158
2159 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2160
32bd4250
PE
21612012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2162
bad03192 2163 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
2164 as gnulib does this if the system doesn't.
2165 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
2166 Remove declaration. MS-Windows declares it on stdlib.h which is
2167 included by conf_post.h.
b69a6d22
PE
2168 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2169 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2170 * vm-limit.c: Include <unistd.h>, for 'environ'.
2171
22d7feb2
PE
2172 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2173 (start_of_data): Remove decl; mem-limits.h provides it.
2174
32bd4250
PE
2175 * xdisp.c (handle_invisible_prop): Make it a bit faster
2176 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2177
450809af
CY
21782012-08-19 Chong Yidong <cyd@gnu.org>
2179
2180 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2181 ends (Bug#3874).
2182
9e677988
AS
21832012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2184
6b1319ce
AS
2185 * .gdbinit: Use call instead of set when calling a function in the
2186 inferior.
2187
9e677988
AS
2188 * data.c (set_internal): Don't use set_blv_found.
2189 (Fkill_local_variable): Likewise.
2190
d7191076
AA
21912012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2192
2193 * nsfont.m (ns_ascii_average_width): Ensure the string
2194 ascii_printable is initialized with a null-terminated character
2195 array. Otherwise, it can contain undesired extra characters.
2196
e757f1c6
PE
21972012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2198
2199 port new setting code to Sun C 5.8 2005/10/13
2200 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2201 Return void, not Lisp_Object. Otherwise, the compiler
2202 complains about (A?B:C) where B is void and C is Lisp_Object
2203 when compiling CHAR_TABLE_SET, due to the recent change to
2204 the API of sub_char_table_set_contents.
2205
a999ce26
CY
22062012-08-18 Chong Yidong <cyd@gnu.org>
2207
2208 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2209 for the string case (Bug#3874).
2210
3f22b86f
PE
22112012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2212
39eb03f1
PE
2213 * buffer.h (BSET): Remove (Bug#12215).
2214 Replace all uses with calls to new setter functions.
2215 (bset_bidi_paragraph_direction, bset_case_canon_table)
2216 (bset_case_eqv_table, bset_directory, bset_display_count)
2217 (bset_display_time, bset_downcase_table)
2218 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2219 (bset_last_selected_window, bset_local_var_alist)
2220 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2221 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2222 (bset_width_table):
2223 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2224 (bset_auto_fill_function, bset_auto_save_file_format)
2225 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2226 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2227 (bset_cache_long_line_scans, bset_case_fold_search)
2228 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2229 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2230 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2231 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2232 (bset_header_line_format, bset_indicate_buffer_boundaries)
2233 (bset_indicate_empty_lines, bset_invisibility_spec)
2234 (bset_left_fringe_width, bset_major_mode, bset_mark)
2235 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2236 (bset_name, bset_overwrite_mode, bset_pt_marker)
2237 (bset_right_fringe_width, bset_save_length)
2238 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2239 (bset_scroll_up_aggressively, bset_selective_display)
2240 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2241 (bset_word_wrap, bset_zv_marker):
2242 * category.c (bset_category_table):
2243 * syntax.c (bset_syntax_table):
2244 New setter functions.
2245
6a09a33b
PE
2246 * process.h (PSET): Remove (Bug#12215).
2247 Replace all uses with calls to new setter functions.
2248 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2249 (PROCESS_INLINE): New macro.
2250 (pset_childp): New setter function.
2251 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2252 * process.c (PROCESS_INLINE):
2253 Define to EXTERN_INLINE, so that the corresponding functions
2254 are compiled into code.
2255 (pset_buffer, pset_command, pset_decode_coding_system)
2256 (pset_decoding_buf, pset_encode_coding_system)
2257 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2258 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2259 (pset_type, pset_write_queue): New setter functions.
2260
e8c17b81
PE
2261 * window.h (WSET): Remove (Bug#12215).
2262 Replace all uses with calls to new setter functions.
2263 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2264 (WINDOW_INLINE): New macro.
2265 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2266 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2267 (wset_total_lines, wset_vertical_scroll_bar)
2268 (wset_window_end_pos, wset_window_end_valid)
2269 (wset_window_end_vpos): New setter functions.
2270 * window.c (WINDOW_INLINE):
2271 Define to EXTERN_INLINE, so that the corresponding functions
2272 are compiled into code.
2273 (wset_combination_limit, wset_dedicated, wset_display_table)
2274 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2275 (wset_new_normal, wset_new_total, wset_next_buffers)
2276 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2277 (wset_prev_buffers, wset_right_fringe_width)
2278 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2279 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2280 (wset_window_parameters):
2281 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2282 (wset_column_number_displayed, wset_region_showing):
2283 New setter functions.
2284
3f22b86f
PE
2285 * termhooks.h (TSET): Remove (Bug#12215).
2286 Replace all uses with calls to new setter functions.
2287 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2288 (TERMHOOKS_INLINE): New macro.
2289 (tset_charset_list, tset_selection_alist): New setter functions.
2290 * terminal.c (TERMHOOKS_INLINE):
2291 Define to EXTERN_INLINE, so that the corresponding functions
2292 are compiled into code.
2293 (tset_param_alist): New setter function.
2294
742af32f
PE
22952012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2296
15dbb4d6
PE
2297 * keyboard.h (KSET): Remove (Bug#12215).
2298 Replace all uses with calls to new setter functions.
2299 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2300 (KEYBOARD_INLINE): New macro.
2301 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2302 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2303 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2304 New setter functions.
2305 * keyboard.c (KEYBOARD_INLINE):
2306 Define to EXTERN_INLINE, so that the corresponding functions
2307 are compiled into code.
2308 (kset_echo_string, kset_kbd_queue)
2309 (kset_keyboard_translate_table, kset_last_prefix_arg)
2310 (kset_last_repeatable_command, kset_local_function_key_map)
2311 (kset_overriding_terminal_local_map, kset_real_last_command)
2312 (kset_system_key_syms): New setter functions.
2313
f00af5b1
PE
2314 * frame.h (FSET): Remove (Bug#12215).
2315 Replace all uses with calls to new setter functions.
2316 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2317 (FRAME_INLINE): New macro.
2318 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2319 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2320 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2321 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2322 (fset_param_alist, fset_root_window, fset_scroll_bars)
2323 (fset_selected_window, fset_title, fset_tool_bar_items)
2324 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2325 * frame.c (FRAME_INLINE):
2326 Define to EXTERN_INLINE, so that the corresponding functions
2327 are compiled into code.
2328 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2329
0c94c8d6
PE
2330 A few more naming-convention fixes for getters and setters.
2331 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2332 and rename from buffer_overlays_set_before.
2333 (set_buffer_overlays_after): Move here from buffer.h, and rename
2334 from buffer_overlays_set_after.
2335 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2336 All uses changed.
2337 (set_buffer_intervals): Rename from buffer_set_intervals.
2338 * intervals.c (set_interval_object): Move here from intervals.h,
2339 and rename from interval_set_object.
2340 (set_interval_left): Move here from intervals.h, and rename from
2341 interval_set_left.
2342 (set_interval_right): Move here from intervals.h, and rename from
2343 interval_set_right.
2344 (copy_interval_parent): Move here from intervals.h, and rename from
2345 interval_copy_parent.
2346 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2347 (set_interval_plist): Rename from interval_set_plist.
2348 Return void, not Lisp_Object, since no caller uses the result.
2349 * lisp.h (string_intervals): Rename from string_get_intervals.
2350 (set_string_intervals): Rename from string_set_intervals.
2351
34dabdb7
PE
2352 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2353 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 2354 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
2355 All uses changed. See the end of
2356 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2357
742af32f
PE
2358 * lisp.h (CSET): Remove (Bug#12215).
2359 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2360 (set_char_table_purpose): New functions,
2361 replacing CSET. All uses changed. For example, replace
2362 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 2363 "set_char_table_parent (char_table, parent);".
742af32f
PE
2364 The old version was confusing because it used the same name
2365 'parent' for two different things.
2366
a04e2c62
DA
23672012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2368
2369 Functions to get and set Lisp_Object fields of buffer-local variables.
2370 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2371 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2372 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2373 * data.c, eval.c, frame.c: Adjust users.
2374
383dcbf9
CY
23752012-08-17 Chong Yidong <cyd@gnu.org>
2376
2377 * xfaces.c (merge_face_vectors): If the target font specfies a
2378 font spec, make the font's attributes take precedence over
2379 directly-specified attributes.
2380 (merge_face_ref): Recognize :font.
2381
44386687
DA
23822012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2383
2384 Do not use memcpy for copying intervals.
2385 * intervals.c (reproduce_interval): New function.
2386 (reproduce_tree, reproduce_tree_obj): Use it.
2387 (reproduce_tree_obj): Remove prototype.
2388
927c7216
PE
23892012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2390
2391 * lisp.h (duration_to_sec_usec): Remove unused decl.
2392
93044f7b
AA
23932012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2394
2395 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2396 to an allocated instance of NSString, not to the class itself.
2397
9851e4a5
JB
23982012-08-17 Juanma Barranquero <lekktu@gmail.com>
2399
2400 * makefile.w32-in (C_CTYPE_H): New macro.
2401 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2402 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2403 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2404
620f13b0
PE
24052012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2406
2407 Use ASCII tests for character types.
2408 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2409 * xfns.c, xterm.c:
2410 Don't include <ctype.h>; was not needed.
2411 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2412 * sysdep.c, xfaces.c:
2413 Include <c-ctype.h> instead of <ctype.h>.
2414 * nsterm.m: Include <c-ctype.h>.
2415 * charset.c (read_hex):
2416 * doc.c (Fsnarf_documentation):
2417 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2418 (DRIVE_LETTER) [DOS_NT]:
2419 (Ffile_name_directory, Fexpand_file_name)
2420 (Fsubstitute_in_file_name):
2421 * font.c (font_parse_xlfd, font_parse_fcname):
2422 * frame.c (x_set_font_backend):
2423 * gtkutil.c (xg_get_font):
2424 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2425 * nsimage.m (hexchar):
2426 * nsterm.m (ns_xlfd_to_fontname):
2427 * sysdep.c (system_process_attributes):
2428 * xfaces.c (hash_string_case_insensitive):
2429 Use C-locale tests instead of locale-specific tests for character
2430 types, since we want the ASCII interpretation here, not the
2431 interpretation suitable for whatever happens to be the current locale.
2432
52162052
MR
24332012-08-16 Martin Rudalics <rudalics@gmx.at>
2434
2435 Consistently check windows for validity/liveness
2436 (Bug#11984, Bug#12025, Bug#12026).
2437 * lisp.h (CHECK_VALID_WINDOW): New macro.
2438 * window.c (decode_window): Rename to decode_live_window.
2439 (decode_valid_window, Fwindow_valid_p): New functions.
2440 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2441 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2442 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2443 (Fwindow_prev_sibling, Fwindow_combination_limit)
2444 (Fset_window_combination_limit, Fwindow_use_time)
2445 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2446 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2447 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2448 (Fwindow_hscroll, Fset_window_hscroll)
2449 (Fwindow_redisplay_end_trigger)
2450 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2451 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2452 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2453 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2454 (Fwindow_end, Fset_window_point, Fset_window_start)
2455 (Fpos_visible_in_window_p, Fwindow_line_height)
2456 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2457 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2458 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2459 (Fset_window_parameter, Fwindow_display_table)
2460 (Fset_window_display_table, Fdelete_other_windows_internal)
2461 (Fset_window_buffer, Fset_window_new_total)
2462 (Fset_window_new_normal, Fdelete_window_internal)
2463 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2464 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2465 (Fwindow_scroll_bars): Check whether argument window is a valid or
2466 live window. Update doc-strings.
2467 (syms_of_window): New symbol Qwindow_valid_p.
2468 * keyboard.c (Fposn_at_x_y): Check whether argument
2469 frame_or_window denotes a valid window.
2470
2751c80f
DA
24712012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2472
2473 Fix previous char table change.
2474 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2475 * chartab.c (optimize_sub_char_table): Likewise.
2476
032a42c8
CY
24772012-08-16 Chong Yidong <cyd@gnu.org>
2478
a2d19368
CY
2479 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2480
032a42c8
CY
2481 * xfont.c (xfont_open):
2482 * xftfont.c (xftfont_open): Set the font's max_width field.
2483
2484 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2485 min_width to space_width and average_width to the average over
2486 printable ASCII characters.
2487 (ns_char_width): Code cleanup.
2488 (ns_ascii_average_width): New utility function.
2489
2490 * font.h (struct font): Update comments.
2491
a098c930
DA
24922012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2493
032a42c8 2494 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
2495 * lisp.h (CSET): New macro.
2496 (char_table_set_extras, char_table_set_contents)
2497 (sub_char_table_set_contents): New function.
2498 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2499 * syntax.c: Adjust users.
2500
8be3a09c
SM
25012012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2502
2503 * eval.c (eval_sub): Bind lexical-binding.
2504 * lread.c (Qlexical_binding): Make non-static.
2505
ac4845a6
JD
25062012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2507
ddee6515
JD
2508 * nsmenu.m (popupSession): Remove.
2509 (pop_down_menu): Remove endModalSession.
2510 (timeout_handler:): New method.
2511 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2512 Call runModalForWindow. Check timer_fired when it returns.
2513 If not set, cancel timer and break out of loop.
2514 Otherwise loop again, with a new timeout.
2515
2516 * nsterm.m: Include fcntl.h if present.
2517 (fd_entry, t_readfds, inNsSelect): Remove.
2518 (select_writefds, select_valid, select_timeout, selfds)
2519 (select_mutex, apploopnr): Add.
2520 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2521 Otherwise call kbd_buffer_store_event.
2522 (ns_send_appdefined): Remove release of fd_entry.
2523 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2524 Increment and decrement apploopnr.
2525 (ns_select): If no file descriptors, just do a NSTimer.
2526 Otherwise copy read/write masks and start select thread (fd_handler).
2527 Start main loop and wait for application defined event.
2528 Inform select thread to stop selecting after main loop is exited.
2529 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 2530 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
2531 (fd_handler:): Loop forever, wait for info from the main thread
2532 to either start or stop selecting. When select returns, send
2533 and appdefined event.
2534 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2535 If not call kbd_buffer_store_event.
2536
2537 * nsterm.h (EmacsApp): fd_handler takes id argument.
2538 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2539
ac4845a6
JD
2540 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2541
eb424fe3
EZ
25422012-08-15 Eli Zaretskii <eliz@gnu.org>
2543
2544 * region-cache.c (move_cache_gap): Update gap_len using the actual
2545 growth of the boundaries array. Do not change cache_len.
2546 (Bug#12196)
2547
4e6a86c6
DA
25482012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2549
2550 Generalize and cleanup font subsystem checks.
2551 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
2552 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2553 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 2554
5bf192ca
DA
25552012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2556
2557 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2558
f2045622
CY
25592012-08-15 Chong Yidong <cyd@gnu.org>
2560
8be3a09c
SM
2561 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2562 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2563 extract the font descriptor instead of just the font name.
2564 In that case, return a font spec instead of a string.
f2045622
CY
2565 (x_last_font_name): Move to this file from xfns.c.
2566
2567 * xfns.c (Fx_select_font): The return value can also be a font
2568 spec. Move x_last_font_name management to gtkutil.c.
2569
2570 * xfaces.c: Make font weight and style symbols non-static.
2571
7f6feb56
SM
25722012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2573
2574 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2575 (bug#12117).
2576
fecbd8ff
SM
25772012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2578
2579 * alloc.c (Fgarbage_collect): Use plural form consistently.
2580
9b8d5165
EZ
25812012-08-14 Eli Zaretskii <eliz@gnu.org>
2582
2583 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2584 iteration through the command loop. Fixes a problem whereby mouse
2585 movements are ignored until the first mouse click.
2586
f5d9e83a
PE
25872012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2588
2589 Use bool, not int, for Lisp booleans.
2590 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2591 makes Emacs a bit smaller and presumably a bit faster.
2592 * lisp.h: Include <stdbool.h>.
2593 (struct Lisp_Boolfwd, defvar_bool):
2594 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2595 * regex.c [!emacs]: Include <stdbool.h>.
2596 (false, true): Remove; <stdbool.h> does this for us now.
2597
55802e4a
CY
25982012-08-14 Chong Yidong <cyd@gnu.org>
2599
4abcdac8
CY
2600 * character.c (Fcharacterp): Doc fix (Bug#12076).
2601
2602 * data.c (Findirect_variable): Doc fix (Bug#11040).
2603
55802e4a
CY
2604 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2605
2606 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 2607 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 2608
8e99d072
BR
26092012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2610
2611 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2612 (bug#12022).
2613
08908aca
MR
26142012-08-14 Martin Rudalics <rudalics@gmx.at>
2615
2616 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2617 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2618 * minibuf.c (choose_minibuf_frame, read_minibuf):
2619 * w32fns.c (x_create_tip_frame):
2620 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2621 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2622
56120d6f
PE
26232012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2624
2625 * intervals.c (offset_intervals): Remove obsolete comment.
2626
67b77c0b
AS
26272012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2628
2629 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2630
f48b82fd
GR
26312012-08-14 Gergely Risko <gergely@risko.hu>
2632
2633 * coding.c (decode_coding): Record buffer modification before
2634 disabling undo_list (Bug#11773).
2635
fd318b54
DA
26362012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2637
2638 Revert and cleanup some recent overlay changes.
2639 * buffer.h (enum overlay_type): Remove.
2640 (buffer_get_overlays, buffer_set_overlays): Likewise.
2641 (buffer_set_overlays_before, buffer_set_overlays_after):
2642 New function. Adjust users.
2643 (unchain_both): Add eassert.
2644
41a62dd9
DA
26452012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2646
2647 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2648
5884c324
PE
26492012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2650
2651 * gtkutil.c (xg_mark_data): Don't assume C99.
2652
ca06f160
JD
26532012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2654
2655 * gtkutil.c (xg_frame_tb_info): New struct.
2656 (TB_INFO_KEY): New define.
2657 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2658 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2659 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2660 if not present.
2661 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 2662 is up to date. Otherwise store new data.
ca06f160
JD
2663 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2664
7864a3f7
DA
26652012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2666
2667 Use KSET for write access to Lisp_Object members of struct kboard.
2668 * keyboard.h (KSET): New macro.
2669 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2670 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2671 * xterm.c: Adjust users.
2672
4c31be61
DA
26732012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2674
2675 Use BSET for write access to Lisp_Object members of struct buffer.
2676 * buffer.h (BSET): New macro.
2677 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2678 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2679 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2680 * window.c, xdisp.c, xfns.c: Adjust users.
2681
14ae4239
BT
26822012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2683
2684 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2685
32bcadb4
JD
26862012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2687
3d29b2ce 2688 * nsterm.m (not_in_argv): New function.
fc0c31f8 2689 (application:openFile, application:openTempFile:):
3d29b2ce
JD
2690 (application:openFileWithoutUI:, application:openFiles:): Open file
2691 if not_in_argv returns non-zero (bug#12171).
2692
32bcadb4 2693 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
2694 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2695 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
2696 (xg_get_font_name): Use those functions/macros here.
2697 Reported by Frans Oilinki <moilinki@gmail.com>.
2698
9ff9402d 26992012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
2700
2701 * unexmacosx.c (copy_data_segment): Copy initialized data in
2702 statically linked libraries from input file rather than memory.
2703
db74a5fc
YM
2704 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2705 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2706 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2707
25e65510
GM
27082012-08-10 Glenn Morris <rgm@gnu.org>
2709
2710 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2711 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2712
7961135c
DA
27132012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2714
2715 Fix last change to allow compilation with low optimization levels.
2716 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2717 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2718
42b3a444
DA
27192012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2720
2721 Use common inline syntax in intervals.h.
2722 * intervals.h (INTERVALS_INLINE): New macro.
2723 Change all users from LISP_INLINE.
2724
9fb0c957
DA
27252012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2726
2727 Define Qnone once for all platforms.
2728 * frame.c (Qnone): Define here.
2729 (syms_of_frame): DEFSYM it.
2730 * lisp.h (Qnone): New declaration.
2731 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2732 * xfns.c: Remove duplication. Adjust users.
2733
65e8ee52
DA
27342012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2735
2736 Remove unused macros from intervals.h.
2737 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2738 * intervals.c: Adjust comment.
2739
9b855fd6
EZ
27402012-08-10 Eli Zaretskii <eliz@gnu.org>
2741
2742 * w32fns.c <w32_unicode_gui>: New static variable.
2743 (globals_of_w32fns): Initialize it according to os_subtype.
2744 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2745 testing os_subtype.
2746
39cb9e56 27472012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
2748 Eli Zaretskii <eliz@gnu.org>
2749
2750 Fix bug #10299 with Unicode characters sent by customized
2751 keyboards created by MSKLC.
2752 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2753 (w32_init_class): Use it to initialize the Emacs class with either
2754 ANSI or Unicode API calls.
2755 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2756 later.
2757 (w32_wnd_proc): If the character code sent by WM_CHAR or
2758 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2759 original message. Call DefWindowProcW on NT and later.
2760
9374581a
GM
27612012-08-10 Glenn Morris <rgm@gnu.org>
2762
4b94e8cf
GM
2763 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2764
9374581a
GM
2765 * lisp.h (DIRECTORY_SEP): Let configure set it.
2766
a2752828
DA
27672012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2768
2769 Use TSET for write access to Lisp_Object slots of struct terminal.
2770 * termhooks.h (TSET): New macro.
2771 * coding.c, terminal.c, xselect.c: Adjust users.
2772
cc92c454
SM
27732012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2774
2775 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2776 the failing expression, include them in the error message.
2777 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2778 * lisp.h (internal_condition_case_n): Update declaration.
2779
4cb3e6b3
DA
27802012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2781
2782 Inline functions to examine and change buffer overlays.
2783 * buffer.c (unchain_both): New function.
2784 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2785 (buffer_has_overlays): New function.
2786 (enum overlay_type): New enum.
2787 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2788 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2789
8707c1e5
DA
27902012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2791
2792 Inline functions to examine and change buffer intervals.
2793 * alloc.c (mark_interval_tree): Remove.
2794 (MARK_INTERVAL_TREE): Simplify.
2795 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2796 * intervals.c (buffer_balance_intervals): New function.
2797 (graft_intervals_into_buffer): Adjust indentation.
2798 (set_intervals_multibyte): Simplify.
2799 * buffer.h (BUF_INTERVALS): Remove.
2800 (buffer_get_intervals, buffer_set_intervals): New function.
2801 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2802 * intervals.c, textprop.c: Adjust users.
2803
ad8c997f
DA
28042012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2805
2806 Inline functions to examine and change string intervals.
2807 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2808 (string_get_intervals, string_set_intervals): New function.
2809 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2810 * lread.c, print.c, textprop.c: Adjust users.
2811
32ac3a6b
GM
28122012-08-08 Glenn Morris <rgm@gnu.org>
2813
2814 * lisp.mk (lisp): Remove language/persian.elc.
2815
77c7bcb1
DA
28162012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2817
2818 Cleanup intervals.
2819 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2820 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
2821 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2822 Adjust comment. Move under #if 0.
77c7bcb1
DA
2823 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2824 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2825
9c08a8d4
DA
28262012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2827
2828 Check total length of intervals with eassert.
2829 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2830 * intervals.c: Change all users to eassert.
2831
26d16b35
EZ
28322012-08-07 Eli Zaretskii <eliz@gnu.org>
2833
14ae4239
BT
2834 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2835 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
2836 INTERNAL_FIELD in Lisp_Cons.
2837
c644523b
DA
28382012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2839
2840 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2841 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2842 name since all xname users are fixed long time ago. Do not
2843 use INTERNAL_FIELD.
2844 (set_symbol_name, set_symbol_function, set_symbol_plist):
2845 (set_symbol_next, set_overlay_plist): New function.
2846 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2847 (struct Lisp_Overlay): Likewise.
2848 (CVAR, MVAR, SVAR): Remove.
2849 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2850 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2851 * xterm.c: Adjust users.
2852 * .gdbinit: Change to use name field of struct Lisp_Symbol
2853 where appropriate.
2854
6a3d20cc
DA
28552012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2856
2857 Basic functions to set Lisp_Object and pointer slots of intervals.
2858 * intervals.h (interval_set_parent, interval_set_object):
2859 (interval_set_left, interval_set_right, interval_set_plist):
2860 (interval_copy_parent): New function.
2861 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
2862 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2863 Adjust indentation.
6a3d20cc
DA
2864 (INTERVAL_SIZE): Remove. Adjust users.
2865 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2866
4d2b044c
DA
28672012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2868
2869 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2870 * process.h (PGET): Remove.
2871 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2872 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2873
d3d50620
DA
28742012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2875
2876 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2877 * window.h (WGET): Remove.
2878 (struct window): Do not use INTERNAL_FIELD.
2879 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2880 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2881 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2882 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2883 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2884 Adjust users.
2885
d10a51dc
CY
28862012-08-07 Chong Yidong <cyd@gnu.org>
2887
2888 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2889 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2890 (Fdelete_window_internal): Signal an error if the window is not on
2891 a live frame (Bug#12025).
2892
e69b0960
DA
28932012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2894
2895 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2896 * frame.h (FGET): Remove.
2897 (struct frame): Do not use INTERNAL_FIELD.
2898 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2899 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2900 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2901 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2902
25a20a3a
JB
29032012-08-06 Juanma Barranquero <lekktu@gmail.com>
2904
2905 * w32.c: Silence compiler warnings.
2906 (map_w32_filename): Remove unused variable `is_fat'.
2907 (chase_symlinks): Add parentheses around expression.
2908
1c6f11f4
GM
29092012-08-06 Glenn Morris <rgm@gnu.org>
2910
1db4583a
GM
2911 * sysdep.c: Respect BROKEN_GETWD.
2912
1c6f11f4
GM
2913 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2914 Let configure handle it.
2915 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2916
2b90362b
DA
29172012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2918
2919 Use GCALIGNMENT where appropriate.
2920 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2921 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2922 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2923
5f50daf2
EZ
29242012-08-06 Eli Zaretskii <eliz@gnu.org>
2925
14ae4239
BT
2926 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2927 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 2928
cbcc7007
SM
29292012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
2930
2931 * buffer.h (struct buffer): Revert `indirections' to a simple int;
2932 that should be sufficient for everyone.
2933
4d365fa4
JD
29342012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2935
2936 * keyboard.c (timer_check_2): Add break so timer_check returns next
2937 timeout.
2938
dd86bd82
DA
29392012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2940
2941 Fix Windows build errors introduced after converting to WGET and WSET.
2942 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
2943 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2944
054e1668
JD
29452012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2946
2947 * nsterm.m (ns_frame_rehighlight): Use FSET.
2948
2949 * nsmenu.m (ns_update_menubar): Use FSET.
2950
21238f11
DA
29512012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2952
2953 Separate read and write access to Lisp_Object slots of Lisp_Process.
2954 * process.h (PGET, PSET): New macros similar to AREF and ASET.
2955 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2956
077288cf
DA
29572012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2958
2959 Separate read and write access to Lisp_Object slots of struct window.
2960 * window.h (WGET, WSET): New macros similar to AREF and ASET.
2961 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2962 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2963 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2964 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2965 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2966 Adjust users.
2967
71688bd7
DA
29682012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2969
2970 Fix Windows build errors introduced after converting to FGET and FSET.
2971 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
2972 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
2973 (w32_judge_scroll_bars): Change to use FSET.
2974 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2975
f99bac93
DA
29762012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2977
2978 Fix replacement typo.
2979 * window.c (replace_window): Set root_window instead of
2980 selected_window. This fixes a total window subsystem
2981 malfunction reported by Bastien Guerry <bzg@gnu.org>.
2982
8c2a0f2d
GM
29832012-08-06 Glenn Morris <rgm@gnu.org>
2984
2985 * lisp.mk (lisp): Add language/persian.elc.
2986
edd74c35
DA
29872012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2988
2989 Separate read and write access to Lisp_Object slots of struct frame.
2990 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
2991 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2992 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2993 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2994 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2995
8671676c
AS
29962012-08-05 Andreas Schwab <schwab@linux-m68k.org>
2997
2998 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
2999
663e2b3f
DA
30002012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3001
3002 Generalize common compile-time constants.
3003 * lisp.h (header_size, bool_header_size, word_size): Now here.
3004 (struct Lisp_Vector): Add comment.
3005 (struct Lisp_Bool_Vector): Move up to define handy constants.
3006 (VECSIZE, PSEUDOVECSIZE): Simplify.
3007 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3008 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3009 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3010 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3011 * xfont.c, xmenu.c: Use word_size where appropriate.
3012
d32e47af
LM
30132012-08-05 Lawrence Mitchell <wence@gmx.li>
3014
3015 * search.c (Freplace_match): Treat \? in the replacement text
3016 literally (Bug#8161).
3017
e5d9c0d1
CY
30182012-08-05 Chong Yidong <cyd@gnu.org>
3019
3020 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3021 * frame.c (Vdelete_frame_functions):
3022 * emacs.c (Vkill_emacs_hook): Doc fix.
3023
8da0576b
EZ
30242012-08-04 Eli Zaretskii <eliz@gnu.org>
3025
3026 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3027 --with-x-toolkit=no builds.
3028 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3029
02676e5d
CY
30302012-08-04 Chong Yidong <cyd@gnu.org>
3031
3032 * syntax.c (Fmodify_syntax_entry): Doc fix.
3033
97147da9
EZ
30342012-08-04 Eli Zaretskii <eliz@gnu.org>
3035
76151e2c
EZ
3036 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3037 * w32.c (init_environment): Change the default values of many
3038 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
3039 them into environment when they were not already defined.
3040 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 3041 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
3042 (check_windows_init_file): Now external, not static.
3043 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
3044 called when Vload_path is already set up.
3045
3046 * w32.h (check_windows_init_file): Add prototype.
3047
3048 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3049 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3050 compatibility with Posix platforms.
3051 (main): Move the call to check_windows_init_file to here from
3052 w32.c.
3053 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3054 any, in the DEFALT argument into the root of the Emacs build or
3055 installation tree, as appropriate.
3056
3057 * callproc.c (init_callproc_1): Call decode_env_path instead of
3058 doing its equivalent by hand.
3059 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3060 the code that sets Vexec_path run on MS-Windows.
3061
3062 * lread.c (init_lread): Add comments to #ifdef's.
3063
97147da9
EZ
3064 * msdos.c (dos_set_window_size, IT_update_begin)
3065 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3066 instead of direct references.
3067
185ee146
PE
30682012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3069
3070 Export DEFAULT_REHASH_* to GDB.
3071 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3072 Now constants, not macros.
3073
8834c57a
PE
30742012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3075
98c6f1e3
PE
3076 Remove unnecessary casts involving pointers.
3077 These casts are no longer needed now that we assume C89 or later,
3078 since they involve casting to or from void *.
3079 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3080 (make_pure_float, make_pure_vector):
3081 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3082 * macros.c (Fstart_kbd_macro):
3083 * menu.c (find_and_return_menu_selection):
3084 * minibuf.c (read_minibuf_noninteractive):
3085 * sysdep.c (closedir):
3086 * xdisp.c (x_produce_glyphs):
3087 * xfaces.c (compare_fonts_by_sort_order):
3088 * xfns.c (x_real_positions, select_visual):
3089 * xselect.c (x_stop_queuing_selection_requests)
3090 (x_get_window_property, x_get_window_property_as_lisp_data):
3091 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3092 Remove unnecessary pointer casts.
3093 * alloc.c (record_xmalloc): New function.
3094 * lisp.h (record_xmalloc): New decl.
3095 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3096 more like a function. This is because the pointer cast is not
3097 needed. All uses changed.
3098 * print.c (print_string, print_error_message): Avoid length recalc.
3099
8834c57a
PE
3100 Improve fix for macroexp crash with debugging (Bug#12118).
3101 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3102 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3103 not supposed to be invoked from the garbage collector.
3104 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3105 (gc_aset): New function, which is like ASET but can be
3106 used in the garbage collector.
3107 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3108 (set_hash_index): Use it instead of ASET.
3109
6dad7178
EZ
31102012-08-03 Eli Zaretskii <eliz@gnu.org>
3111
3112 Support symlinks on latest versions of MS-Windows.
3113 * w32.c: Include winioctl.h and aclapi.h.
3114 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3115 (revert_to_self): Forward declarations of static functions.
3116 <static BOOL g_b_init_get_security_info>:
3117 <g_b_init_create_symbolic_link>: New static flags.
3118 (globals_of_w32): Initialize them to zero.
3119 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3120 (map_w32_filename): Improve commentary. Simplify switch.
3121 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3122 headers (most versions of MinGW w32api don't).
3123 (get_security_info, create_symbolic_link)
3124 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3125 New functions.
3126 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3127 in the argument file name.
3128 (sys_access): Call unc_volume_file_attributes only if
3129 GetFileAttributes fails with network-related error codes.
3130 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3131 have the required privileges.
14ae4239 3132 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
3133 get_file_security_desc.
3134 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
3135 with addition of handling of symlinks and support for 'lstat'.
3136 If possible, get file's attributes and security information by
6dad7178
EZ
3137 handle, not by name. Produce S_IFLNK bit for symlinks, when
3138 called from 'lstat'.
3139 (stat, lstat): New functions, call 'stat_worker'.
3140 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3141 symlinks when the underlying filesystem supports them.
3142
f162bcc3
PE
31432012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3144
79ea6c20
PE
3145 Fix macroexp crash on Windows with debugging (Bug#12118).
3146 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3147 checking subscripts; problem introduced with the recent
3148 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3149 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3150 since it's used in non-static inline functions now.
3151
c0ce93fd
PE
3152 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3153 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 3154
f162bcc3
PE
3155 Use C99-style 'extern inline' if available.
3156 * buffer.h (BUFFER_INLINE):
3157 * category.h (CATEGORY_INLINE):
3158 * character.h (CHARACTER_INLINE):
3159 * charset.h (CHARSET_INLINE):
3160 * composite.h (COMPOSITE_INLINE):
3161 * dispextern.h (DISPEXTERN_INLINE):
3162 * lisp.h (LISP_INLINE):
3163 * systime.h (SYSTIME_INLINE):
3164 New macro, replacing 'static inline' in this header.
3165 * buffer.h, category.h, character.h, charset.h, composite.h:
3166 * dispextern.h, lisp.h, systime.h:
3167 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3168 * alloc.c (LISP_INLINE):
3169 * buffer.c (BUFFER_INLINE):
3170 * category.c (CATEGORY_INLINE):
3171 * character.c (CHARACTER_INLINE):
3172 * charset.c (CHARSET_INLINE):
3173 * composite.c (COMPOSITE_INLINE):
3174 * dispnew.c (DISPEXTERN_INLINE):
3175 * sysdep.c (SYSTIME_INLINE):
3176 Define to EXTERN_INLINE, so that the corresponding functions
3177 are compiled into code.
3178 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3179 (INLINE_HEADER_END): New macros.
3180 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3181 since it's used in non-static inline functions now.
a8333d03 3182 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 3183
837b365b
GM
31842012-08-02 Glenn Morris <rgm@gnu.org>
3185
d66b744d
GM
3186 * s/: Remove empty directory.
3187
837b365b
GM
3188 * s/ms-w32.h: Move to ../nt/inc.
3189 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3190 Update for new ms-w32.h location.
3191
13294f95
PE
31922012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3193
3194 Port to Solaris 8.
3195 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3196
90df0db3
GM
31972012-08-02 Glenn Morris <rgm@gnu.org>
3198
3199 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3200 hard-coding the path separator.
3201
4939150c
PE
32022012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3203
3204 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3205 This how ASET and AREF are supposed to work, and makes
3206 it easier to think about future improvements. See
3207 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3208 * charset.h (set_charset_attr): New function.
3209 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3210 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3211 (aref_addr): New function. All uses of &AREF(...) changed.
3212 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3213 (set_hash_index): New functions. All lvalue-style uses of
3214 HASH_KEY etc. changed.
3215 * keyboard.c (set_prop): New function. All lvalue-style uses
3216 of PROP changed.
3217
947b2afd
AA
32182012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3219
3220 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3221 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3222 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3223 * nsfns.m (ns_set_name_as_filename): Likewise.
3224 * nsmenu.m (ns_update_menubar): Likewise.
3225 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3226
4f5d0325
EZ
32272012-08-01 Eli Zaretskii <eliz@gnu.org>
3228
2008beae
EZ
3229 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3230 Adapt to latest changes in field names of the corresponding Lisp
288479f6 3231 objects.
2008beae 3232
4f5d0325
EZ
3233 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3234
fe3cc771
GM
32352012-08-01 Glenn Morris <rgm@gnu.org>
3236
3237 * s/msdos.h: Remove file.
3238 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3239 * Makefile.in (S_FILE): Remove.
3240 (config_h): Remove S_FILE.
3241
c90acc54
JB
32422012-08-01 Juanma Barranquero <lekktu@gmail.com>
3243
3244 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3245 Remove; moved to nt/config.nt.
3246
d8a05828
DA
32472012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3248
3249 Use INTERNAL_FIELD for conses and overlays.
3250 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3251 Remove obsolete comment.
3252 (MVAR): New macro.
3253 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3254 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3255
8271d590
DA
32562012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3257
3258 Use INTERNAL_FIELD for symbols.
3259 * lisp.h (SVAR): New macro. Adjust users.
3260 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3261 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3262
3193acd2
DA
32632012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3264
3265 Use INTERNAL_FIELD for processes.
3266 * process.h (PVAR): New macro. Adjust style.
3267 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3268 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3269
3a45383a
DA
32702012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3271
3272 Use INTERNAL_FIELD for windows.
3273 * window.h (WVAR): New macro.
3274 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3275 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3276 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3277 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3278 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3279 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3280
c1dbc63c
PE
32812012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3282
3283 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3284
5c0c0e8a
GM
32852012-08-01 Glenn Morris <rgm@gnu.org>
3286
3287 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3288 Move to configure.ac.
3289
552a99b4
JB
32902012-08-01 Juanma Barranquero <lekktu@gmail.com>
3291
3292 * makefile.w32-in (CONFIG_H): Update dependencies.
3293 (CONF_POST_H): New macro.
3294
3295 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3296
8d8e2dfe
GM
32972012-07-31 Glenn Morris <rgm@gnu.org>
3298
bc96620a
GM
3299 * Makefile.in (S_FILE): No longer set by configure.
3300
476b1b2d
GM
3301 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3302 is available.
3303 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3304
b2c7a106
GM
3305 * process.h (NULL_DEVICE):
3306 * emacs.c (SEPCHAR):
3307 * editfns.c (USER_FULL_NAME): Let configure set them.
3308
d53d062a
GM
3309 * s/README, s/template.h: Remove files.
3310
4515017f
GM
3311 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3312
8d8e2dfe
GM
3313 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3314 Move to configure.ac.
3315
5b20b3cc
EZ
33162012-07-31 Eli Zaretskii <eliz@gnu.org>
3317
1e0afd9a
EZ
3318 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3319 resulting renaming of 'struct frame' members.
3320
5b20b3cc
EZ
3321 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3322
3323 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3324 after introduction of FVAR.
3325
f1310128
JD
33262012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3327
79e721e0
JD
3328 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3329
3330 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3331 instead of compositeToPoint.
3332 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3333
8d7c7eed 3334 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 3335
e34f7f79
DA
33362012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3337
3338 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3339 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 3340 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
3341 (BVAR): Change to use INTERNAL_FIELD.
3342 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3343 (KVAR): Change to use INTERNAL_FIELD.
3344 * frame.h (FVAR): New macro.
3345 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
3346 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3347 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3348 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
3349 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3350
c09bfb2f
DA
33512012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3352
3353 Miscellaneous fixes for non-default X toolkits.
3354 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3355 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3356 Move under #ifdef USE_LUCID.
3357 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3358 definition and usage to avoid warnings.
3359
14c114ae
JD
33602012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3361
3362 * nsterm.m (openFiles): Fix previous checkin.
3363
3bd21e82
PE
33642012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3365
3366 * indent.c (compute_motion): Remove unused local.
3367
c1529ded
GM
33682012-07-31 Glenn Morris <rgm@gnu.org>
3369
400d5621
GM
3370 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3371
268e2432
GM
3372 * conf_post.h [USG5_4]:
3373 Move remaining contents of s/usg5-4-common.h here.
3374 * s/usg5-4-common.h: Remove file.
3375
7552f3ee
GM
3376 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3377 * s/irix6-5.h: Remove file.
3378
6a381852
GM
3379 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3380 * s/darwin.h: Remove file.
3381
c1529ded
GM
3382 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3383 * s/hpux10-20.h: Remove file, which is now empty.
3384
b429a4ee
GM
33852012-07-30 Glenn Morris <rgm@gnu.org>
3386
3387 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3388 * Makefile.in (config_h): Add conf_post.h.
3389 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3390
adff3182
JD
33912012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3392
3393 * nsterm.m (ns_do_open_file): New variable.
b9031d69 3394 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
3395 (openFile, openTempFile, openFileWithoutUI, openFiles):
3396 Open files only if ns_do_open_file.
adff3182 3397
c32af1e4
PE
33982012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3399
7393bcbb
PE
3400 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3401 This no-op macro hasn't been needed for many years.
3402 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3403
c32af1e4
PE
3404 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3405 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3406 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3407 gdb_make_enums_visible.
3408 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3409 (DIRECTORY_SEP): Now a constant, not a macro.
3410
302fc036
EZ
34112012-07-30 Eli Zaretskii <eliz@gnu.org>
3412
3413 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3414 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3415
3416 * w32term.c <w32_keyboard_codepage>: Renamed from
3417 keyboard_codepage and now external. All users changed.
3418
3419 * w32term.h: Add declaration of w32_keyboard_codepage.
3420
3421 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3422 the codepage to translate keys to Unicode. If this argument is
3423 -1, use the value returned by GetConsoleCP. All callers changed.
3424
88fb40b4
PE
34252012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3426
0aee6912
PE
3427 Update .PHONY listings in makefiles.
3428 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3429 bootstrap-clean, distclean, maintainer-clean, versioclean,
3430 extraclean, frc.
3431
88fb40b4
PE
3432 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3433 This is a bit clearer. Fix some commentary typos.
3434
0a763bd1
GM
34352012-07-30 Glenn Morris <rgm@gnu.org>
3436
32bac6d6
GM
3437 * s/netbsd.h: Let configure include signal.h if needed.
3438 Remove file, which is now empty.
3439
b65e7c46
GM
3440 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3441 Let configure set them.
3442 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3443 No more need to undefine.
0a763bd1 3444
169304bd
AS
34452012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3446
3447 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3448 non-single-byte char when adding meta modifier. (Bug#12090)
3449
6cd7a139
DA
34502012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3451
3452 Convert safe_call to use variable number of arguments.
3453 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3454 (safe_call2): Fix comment.
3455 * lisp.h (safe_call): Adjust prototype.
3456 * coding.c (encode_coding_object): Change to use safe_call2.
3457 * xfaces.c (merge_face_heights): Change to use safe_call1.
3458
d34d6ffc
GM
34592012-07-30 Glenn Morris <rgm@gnu.org>
3460
7b8a48e4 3461 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 3462 does that unconditionally. Remove file, which is now empty.
7b8a48e4 3463
d34d6ffc
GM
3464 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3465 Remove empty files.
3466
03a660a6
PE
34672012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3468
3469 Export to GDB most of lisp.h's remaining object-like macros.
3470 * lisp.h (min, max): Move earlier, because they're used earlier now.
3471 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3472 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3473 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3474 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3475 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3476 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3477 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3478 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3479 Now constants, for GDB. They need not be macros.
3480 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3481 Now constants, for GDB, as well as macros, for static initializers.
3482 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3483 Move to after the definition of struct Lisp_Char_Table,
3484 since the former now needs that type defined.
3485 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3486 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3487 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3488 New enums, for gdb_make_enums_visible.
3489 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 3490 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
3491 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3492 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3493 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3494 enum maxargs, enum MAX_ALLOCA.
3495 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3496 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3497 no longer needed, now that they are done in lisp.h.
3498
e499d0ee
DA
34992012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3500
3501 Cleanup string bytes checking.
3502 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3503 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3504 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3505 (check_sblock, compact_small_strings): Simplify.
3506
d5040d2d
PE
35072012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3508
3509 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3510 These macros are confusing and no longer need to be defined, as
3511 the enum values now suffice. All uses replaced with definiens.
3512 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3513
7f259ae6
JB
35142012-07-29 Juanma Barranquero <lekktu@gmail.com>
3515
3516 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3517 ($(BLD)/w32console.$(O)): Update dependencies.
3518
7e63e0c3
DA
35192012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3520
3521 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3522 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3523 time. Adjust users.
3524 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3525
ffd817eb
JD
35262012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3527
3528 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3529 setting sitelisp (Bug#12010).
3530
417a7a0e
EZ
35312012-07-29 Eli Zaretskii <eliz@gnu.org>
3532
14ae4239 3533 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
3534
3535 * w32heap.c (cache_system_info):
3536 * w32.c (sys_rename):
3537 * w32proc.c (find_child_console, sys_kill): All users changed.
3538
387d4d92
PE
35392012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3540
3541 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3542
55a6cca6
EZ
35432012-07-29 Eli Zaretskii <eliz@gnu.org>
3544
3545 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3546
dbcf001c
DA
35472012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3548
3549 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
3550 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3551 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 3552
e2688e4a
DA
35532012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3554
3555 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3556 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3557 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3558 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3559 (replace_range, replace_range_2, del_range_2): Change to eassert.
3560 * marker.c (byte_char_debug_check): Adjust style.
3561
b46a6a83
PE
35622012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3563
3564 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3565 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3566 long-ago-commented-out code that talks about "WIN32".
3567 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3568 All uses changed.
3569
e32a5799
PE
35702012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3571
3572 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3573 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3574 Simplify by using alignof.
3575 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3576 * lisp.h: Include <stdalign.h>.
3577 (GCALIGNMENT): New macro and constant.
3578 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3579 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3580 (stdalign): New macro, if not already defined.
3581
df81cd29
EZ
35822012-07-28 Eli Zaretskii <eliz@gnu.org>
3583
01bd1b0d
EZ
3584 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3585 * w32inevt.c: Include w32inevt.h.
3586 (w32_read_console_input): New inline function, calls either
3587 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3588 w32_console_unicode_input.
3589 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3590 (w32_kbd_patch_key, key_event): Use the codepage returned by
3591 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3592 (key_event): use uChar.UnicodeChar only if
3593 w32_console_unicode_input is non-zero.
3594
3595 * w32console.c: Include w32heap.h.
3596 <w32_console_unicode_input>: New global variable.
3597 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3598 family of Windows, zero otherwise.
3599
3600 * w32inevt.h: Declare w32_console_unicode_input.
3601
df81cd29
EZ
3602 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3603 --without-x. (Bug#11742)
3604
c20fdd9e
PE
36052012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3606
3607 Adjust GDB to reflect pvec_type changes (Bug#12036).
3608 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
3609 2012-07-04 changes to pseudovector representation.
3610 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 3611
32770973 36122012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
3613
3614 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3615 bus address.
3616 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3617
3438fe21
EZ
36182012-07-27 Eli Zaretskii <eliz@gnu.org>
3619
bcfbc9de
EZ
3620 * alloc.c (listn): Fix the order the arguments are consed onto the
3621 list.
3622
3438fe21
EZ
3623 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3624 enumeration constants, as PURE and HEAP are too general, and clash
3625 with other headers and sources, such as gmalloc.c and the
3626 MS-Windows system headers. All users changed.
3627
eeaea515
DA
36282012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3629
3630 Revert last save_excursion_save and save_excursion_restore changes.
3631 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3632 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3633
073c88c2
DA
36342012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3635
3636 Fix recently-introduced typos in Windows port.
3637 Reported by Martin Rudalics <rudalics@gmx.at>.
3638 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 3639 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 3640
4706125e
PE
36412012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3642
3643 Improve GDB symbol export (Bug#12036).
3644 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3645 arms of an 'if', not using conditional expressions; otherwise GDB
3646 complains about the types in the unevaluated arm when the argument
3647 is an integer literal.
3648 (xgetint): Simplify expression.
3649 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3650 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3651 Zaretskii in <http://bugs.gnu.org/12036#13>.
3652 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3653 needed now that we have gdb_make_enums_visible.
3654 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3655 (enum enum_USE_LSB_TAG):
3656 New enum types, packaging up enums that need to be exported to GDB.
3657
694b6c97
DA
36582012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3659
3660 Utility function to make a list from specified amount of objects.
3661 * lisp.h (enum constype): New datatype.
3662 (listn): New prototype.
3663 * alloc.c (listn): New function.
3664 (Fmemory_use_count, syms_of_alloc): Use it.
3665 * buffer.c (syms_of_buffer): Likewise.
3666 * callint.c (syms_of_callint): Likewise.
3667 * charset.c (define_charset_internal): Likewise.
3668 * coding.c (syms_of_coding): Likewise.
3669 * keymap.c (syms_of_keymap): Likewise.
3670 * search.c (syms_of_search): Likewise.
3671 * syntax.c (syms_of_syntax): Likewise.
3672 * w32.c (init_environment): Likewise.
3673 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3674 * xdisp.c (syms_of_xdisp): Likewise.
3675 * xfns.c (syms_of_xfns): Likewise.
3676
6195f384
DA
36772012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3678
3679 Fast save_excursion_save and save_excursion_restore.
3680 * lisp.h (struct Lisp_Excursion): New data type.
3681 (PVEC_EXCURSION): New pseudovector type.
3682 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3683 to deal with it. Adjust comments.
3684 (init_marker, attach_marker): New prototype.
3685 (unchain_marker): Adjust prototype.
3686 * marker.c (attach_marker): Change to global.
3687 (init_marker): New function.
3688 * alloc.c (Fmake_marker, build_marker): Use it.
3689 (build_marker): More easserts.
3690 (mark_object): Handle struct Lisp_Excursion.
3691 * editfns.c (save_excursion_save, save_excursion_restore):
3692 Reimplement to use struct Lisp_Excursion. Add comments.
3693
5eceb8fb
PE
36942012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3695
3696 Fix export of symbols to GDB (Bug#12036).
3697 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3698 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3699 emacs.c, as this is a more-suitable home. Had this been done earlier
3700 the fix for 12036 would have avoided some of the problems noted in
3701 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3702 would have been more obvious.
562157c8
PE
3703 * emacs.c: Do not include <verify.h>; no longer needed.
3704 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
3705 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3706 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3707 Remove; now done in lisp.h.
3708 * lisp.h (PUBLISH_TO_GDB): New macro.
3709 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3710 (DATA_SEG_BITS): Use it.
3711 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3712 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3713 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3714 not be usable in #if. This simplifies things.
3715
d6749401
JB
37162012-07-26 Juanma Barranquero <lekktu@gmail.com>
3717
3718 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3719
1781b9e9
PE
37202012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3721
d89518db 3722 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
3723 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3724 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3725 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3726 Adjust to changes in lisp.h and emacs.c, by using
3727 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3728 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3729 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3730 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3731 instead of gdb_valbits.
3732 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3733 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3734 instead of gdb_array_mark_flag.
3735 (xboolvector): Get size from $->size, not $->header.size.
3736 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3737 (xreload, hook-run, hookpost-run): Remove.
3738 * emacs.c: Include <verify.h>.
3739 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3740 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3741 Remove.
3742 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3743 (gdb_USE_LSB_TAG): New enum constants.
3744 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3745 Also define these as enum constants, so they're visible to GDB.
3746 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3747 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3748 as constants, so they're visible to GDB.
3749 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3750 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3751 Now enum constants, not macros, so they're visible to GDB.
3752 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3753 more convenient now. All uses changed.
3754 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3755 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3756
3628596a
DA
37572012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3758
3759 Explicitly free restriction data that are not needed anymore.
3760 * editfns.c (save_restriction_restore): Free restriction data.
3761
7abaf5cc
SM
37622012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3763
3764 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3765 add argument, tune behavior, and adjust all callers.
3766
71f88e00
PE
37672012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3768
3769 Use typedef for EMACS_INT, EMACS_UINT.
3770 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3771 than macros. This simplifies debugging in the usual case, since
3772 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3773 and it allows expressions involving EMACS_INT casts.
3774 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3775
57ec3034
JD
37762012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3777
3778 * nsterm.m (ns_read_socket): Return early if there is a modal
3779 window (Bug#12043).
3780
8137e7b3
MR
37812012-07-25 Martin Rudalics <rudalics@gmx.at>
3782
3783 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3784 that FOCUS-FRAME can be omitted.
3785
04e9897c
DA
37862012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3787
3788 Adjust buffer text indirection counters at the end of Fkill_buffer.
3789 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3790 buffer is definitely dead. This should really fix an issue reported
3791 by Christoph Scholtes again. (Bug#12007).
3792 (init_buffer_once): Initialize indirection counters of
3793 buffer_defaults and buffer_local_symbols (for sanity and safety).
3794
8a0484e1
EZ
37952012-07-24 Eli Zaretskii <eliz@gnu.org>
3796
3797 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3798 and continuation glyphs on tooltip frames, leave them at zero.
3799 Avoids continued lines in tooltips. (Bug#11832)
3800
fa691a83
DA
38012012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3802
3803 Simplify copy_overlay.
04e9897c 3804 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
3805 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3806
436bc8e0
EZ
38072012-07-23 Eli Zaretskii <eliz@gnu.org>
3808
3809 * print.c (print_object): Don't crash when a frame's name is nil
3810 or invalid. (Bug#12025)
3811
3812 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3813 it signals an error when a tooltip frame is being created.
3814
d7a7fda3
DA
38152012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3816
3817 Cleanup miscellaneous objects allocation and initialization.
3818 * alloc.c (allocate_misc): Change to static. Add argument to
3819 specify the subtype. Adjust comment and users.
3820 (build_overlay): New function.
3821 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3822 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3823 (allocate_misc): Remove prototype.
3824 (build_overlay): Add prototype.
3825
38262012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
3827
3828 Swap buffer text indirection counters in Fbuffer_swap_text.
3829 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3830 This avoids crash reported by Christoph Scholtes at
3831 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3832
9d7fa573
JD
38332012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3834
3835 * nsmenu.m (Popdown_data): New struct.
3836 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3837 free Popdown_data.
3838 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3839 (initWithContentRect): Make imgView and contentView non-static
3840 and autorelease them. Also autorelease img and matrix (Bug#12005).
3841 (dealloc): Remove (Bug#12005).
3842
0dd6d66d
DA
38432012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3844
3845 Adjust consing_since_gc when objects are explicitly freed.
3846 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3847 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3848 (free_cons, free_misc): Subtract object size from consing_since_gc.
3849
d36d71df
DA
38502012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3851
3852 Simplify and cleanup markers positioning code.
3853 * marker.c (attach_marker): More useful eassert.
3854 (live_buffer, set_marker_internal): New function.
3855 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3856 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3857
fb9ea40f
PE
38582012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3859
3860 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3861 as it's limited by the amount of memory, not by INT_MAX.
3862
2d5c5f7d
EZ
38632012-07-21 Eli Zaretskii <eliz@gnu.org>
3864
07fb592e
EZ
3865 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3866 in special-event-map. See the discussion at
3867 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3868 for the reasons.
3869
37a9eac8 3870 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
3871 info.dwItemData. Fixes crashes on 64-bit Windows.
3872 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 3873
c4328746
JD
38742012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3875
fc0c31f8 3876 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 3877 (conversationIdentifier): Return value is NSInteger.
784051c4 3878 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 3879
6e5d1c12
CY
38802012-07-21 Chong Yidong <cyd@gnu.org>
3881
3882 * window.c (decode_any_window): Signal an error if the window is
3883 on a dead frame (Bug#11984).
3884
9928463d
DA
38852012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3886
3887 Add indirection counting to speed up Fkill_buffer.
3888 * buffer.h (struct buffer): New member.
3889 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3890 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3891 base buffer indirection counter.
3892 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3893 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3894 through buffer list if indirection counter is 0.
3895
f8643a6b
DA
38962012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3897
3898 Extend the value returned by Fgarbage_collect with heap statistics.
3899 * alloc.c (Qheap): New symbol.
3900 (syms_of_alloc): DEFSYM it.
3901 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3902 (Fmemory_free): Remove.
3903 (syms_of_alloc): Don't defsubr it.
3904 * buffer.c (Fcompact_buffer): Remove.
3905 (syms_of_buffer): Don't defsubr it.
3906
dac616ff
DA
39072012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3908
3909 Make maybe_gc inline.
3910 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3911 * lisp.h (consing_since_gc, gc_relative_threshold)
3912 (memory_full_cons_threshold): Revert declaration.
3913 (maybe_gc): Remove prototype, define as inline.
3914 * alloc.c: Remove old commented-out code.
3915 (consing_since_gc, gc_relative_threshold)
3916 (memory_full_cons_threshold): Revert to global.
3917 (maybe_gc): Remove.
3918
d7ea76b4
DA
39192012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3920
3921 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3922 * lisp.h (build_unibyte_string): New function.
3923 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3924 * sysdep.c, w32fns.c, xfns.c: Use it.
3925 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3926 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3927 Adjust users accordingly.
3928 * font.h (font_open_by_name): Adjust prototype.
3929
765e61e3
DA
39302012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3931
3932 Cleanup calls to Fgarbage_collect.
3933 * lisp.h (maybe_gc): New prototype.
3934 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3935 Remove declarations.
3936 * alloc.c (maybe_gc): New function.
3937 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3938 Make them static.
3939 * bytecode.c (MAYBE_GC): Use maybe_gc.
3940 * eval.c (eval_sub, Ffuncall): Likewise.
3941 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
3942 to avoid dependency from auto-save feature.
3943
52b852c7
PE
39442012-07-19 Paul Eggert <eggert@cs.ucla.edu>
3945
3946 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
3947 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
3948 'for_each_per_buffer_object_at'.
3949 All uses changed. It's better to use upper-case for macros that
3950 cannot be implemented as functions, to give the reader a clue
3951 that they're special.
3952
5db81e33
SM
39532012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
3954
3955 * alloc.c (Fgarbage_collect): Tweak docstring.
3956
5b835e1d
DA
39572012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3958
3959 Tweak the value returned from Fgarbage_collect again.
3960 * alloc.c (Fgarbage_collect): New return value, as confirmed in
3961 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3962 Adjust documentation.
3963 (total_vector_bytes): Rename to total_vector_slots, adjust
3964 accounting.
3965 (total_free_vector_bytes): Rename to total_free_vector_slots,
3966 adjust accounting.
3967 (Qstring_bytes, Qvector_slots): New symbols.
3968 (syms_of_alloc): DEFSYM them.
3969
9cd47b72
DA
39702012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3971
3972 Buffer compaction primitive which may be used from Lisp.
3973 * buffer.c (compact_buffer, Fcompact_buffer): New function.
3974 (syms_of_buffer): Register Fcompact_buffer.
3975 * alloc.c (Fgarbage_collect): Use compact_buffer.
3976 * buffer.h (compact_buffer): New prototype.
3977 (struct buffer_text): New member.
3978
d17337e5
DA
39792012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3980
3981 New macro to iterate over all buffers, miscellaneous cleanups.
3982 * lisp.h (all_buffers): Remove declaration.
3983 * buffer.h (all_buffers): Add declaration, with comment.
3984 (for_each_buffer): New macro.
3985 * alloc.c (Fgarbage_collect, mark_object): Use it.
3986 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
3987 (init_buffer): Likewise.
3988 * data.c (Fset_default): Likewise.
3989 * coding.c (code_conversion_restore): Remove redundant check
3990 for dead buffer.
3991 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
3992
60cfd278
AS
39932012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3994
3995 Fix bug that created negative-length intervals.
3996 * intervals.c (merge_interval_right, merge_interval_left):
3997 Do not zero out this interval if it is absorbed by its children,
3998 as this interval's total length doesn't change in that case. See
3999 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4000
d06714cb
PE
40012012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4002
83713154
PE
4003 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4004 when invoking (make-bool-vector N t) and N is a positive
4005 multiple of 8 -- the last 8 bits were mistakenly cleared.
4006
d06714cb
PE
4007 Remove some struct layout assumptions in bool vectors.
4008 * alloc.c (bool_header_size): New constant.
4009 (header_size, word_size): Move earlier, as they're now used earlier.
4010 Use 'word_size' in a few more places, where it's appropriate.
4011 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4012 padding before the data member of a bool vector.
4013 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4014 than doing the check by hand with an abort ().
4015
464d5a5e
SM
40162012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4017
5fbc0409
SM
4018 * eval.c (Fdefvar): Don't check constants since we only set the var if
4019 it's not yet defined anyway (bug#11904).
4020
464d5a5e
SM
4021 * lisp.h (last_undo_boundary): Declare new var.
4022 * keyboard.c (command_loop_1): Set it.
4023 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4024 were auto-added by the command loop (bug#11774).
4025
8dc2e44a
AS
40262012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4027
4028 * w32font.c (Qsymbol): Remove local definition.
4029 (syms_of_w32font): Don't DEFSYM it.
4030
169925ec
DA
40312012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4032
4033 Fix sweep_vectors to handle large bool vectors correctly.
4034 * alloc.c (sweep_vectors): Account total_vector_bytes for
4035 bool vectors larger than VBLOCK_BYTES_MAX.
4036
5fbfb018
CY
40372012-07-18 Chong Yidong <cyd@gnu.org>
4038
4039 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4040 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4041
3ab6e069
DA
40422012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4043
4044 Return more descriptive data from Fgarbage_collect.
4045 Suggested by Stefan Monnier in
4046 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4047 * alloc.c (bounded_number): New function.
4048 (total_buffers, total_vectors): New variable.
4049 (total_string_size): Rename to total_string_bytes, adjust users.
4050 (total_vector_size): Rename to total_vector_bytes, adjust users.
4051 (sweep_vectors): Account total_vectors and total_vector_bytes.
4052 (Fgarbage_collect): New return value. Adjust documentation.
4053 (gc_sweep): Account total_buffers.
4054 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4055 (VECTOR_SIZE): Remove.
4056 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4057 (Qinterval, Qmisc): New symbols.
4058 (syms_of_data): Initialize them.
4059 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4060 (Qcons, Qbuffer): New declarations.
4061
6d02fe5b
PE
40622012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4063
4064 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4065 Round up, not down. Improve doc.
4066
b7ffe040
DA
40672012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4068
4069 Restore old code in allocate_string_data to avoid Faset breakage.
4070 Reported by Julien Danjou <julien@danjou.info> in
4071 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4072 * alloc.c (allocate_string_data): Restore old code with minor
4073 adjustments, fix comment to explain this subtle issue.
4074
4dc7c8d5
SM
40752012-07-17 Eli Zaretskii <eliz@gnu.org>
4076
4077 Remove FILE_SYSTEM_CASE.
4078 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4079
4080 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4081 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4082 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4083 call-process-region passes it through expand-file-name.
4084
4085 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4086
40872012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4088
4089 Fix crash when creating indirect buffer (Bug#11917)
4090 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4091 Don't handle unbound variables specially if non-zero.
4092 (Fbuffer_local_variables): Pass zero.
4093 (clone_per_buffer_values): Pass non-zero.
4094
40952012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4096
4097 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4098 to make the loop interruptible.
4099
41002012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4101
4102 * gnutls.c (emacs_gnutls_handshake): Only retry if
4103 GNUTLS_E_INTERRUPTED.
4104
cce7fefc
DA
41052012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4106
4107 Cleanup and convert miscellaneous checks to eassert.
4108 * alloc.c (mark_interval): Fix comment, partially rephrase
4109 old comment from intervals.h (see below).
4110 * intervals.c (find_interval, adjust_intervals_for_insertion)
4111 (delete_interval, adjust_intervals_for_deletion)
4112 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4113 Convert to eassert.
4114 (adjust_intervals_for_insertion, make_new_interval):
4115 Remove obsolete and unused code.
4116 * intervals.h (struct interval): Remove obsolete comment.
4117 * textprotp.c (erase_properties): Remove unused code.
4118 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4119 (Fremove_list_of_text_properties): Convert to eassert.
4120
9ea10cc3
CY
41212012-07-17 Chong Yidong <cyd@gnu.org>
4122
4123 * editfns.c (Finsert_char): Doc fix.
4124
3900d5de
DA
41252012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4126
4127 Fix previous change to make Fmemory_free always accurate.
4128 * alloc.c (make_interval): Update total_free_intervals.
4129 (make_float): Likewise for total_free_floats.
4130 (free_cons, Fcons): Likewise for total_free_conses.
4131 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4132 Likewise for total_free_vector_bytes.
4133 (Fmake_symbol): Likewise for total_free_symbols.
4134 (bytes_free): Remove.
4135
7098646f
DA
41362012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4137
4138 Simple free memory accounting feature.
4139 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4140 (sweep_vectors): Accumulate size of free vectors.
4141 (Fgarbage_collect): Setup bytes_free.
4142 (Fmemory_free): New function.
4143 (syms_of_alloc): Register it.
4144
22657b40
DA
41452012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4146
4147 Cleanup overlays checking.
4148 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4149 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4150 eassert and OVERLAYP.
4151 (sort_overlays): Change to use OVERLAYP.
4152
ddfc8813
RK
41532012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4154
4155 * editfns.c (Finsert_char): Make it interactive, and make the
4156 second arg optional. Copy interactive spec and docstring from
4157 ucs-insert.
4158
7c26cf3c
PE
41592012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4160
4161 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4162 Unlike the other wrapped functions, fabs has an unspecified
4163 effect on errno.
4164
5d127af9
JD
41652012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4166
4167 * nsterm.m (keyDown): Interpret flags without left/right bits
4168 as the left key (Bug#11670).
4169
6a0dd1d7
DA
41702012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4171
4172 Remove empty and useless init functions.
4173 * lisp.h (init_character_once, init_fns, init_image)
4174 (init_filelock, init_sound): Remove prototype.
4175 * character.c (init_character_once): Remove.
4176 * filelock.c (init_filelock): Likewise.
4177 * fns.c (init_fns): Likewise.
4178 * image.c (init_image): Likewise.
4179 * sound.c (init_sound): Likewise.
4180 * emacs.c (main): Adjust accordingly.
4181
7a6136fd
DA
41822012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4183
4184 * gtkutil.h: Tiny cleanups.
4185 (use_old_gtk_file_dialog): Remove useless declaration.
4186 (xg_uses_old_file_dialog): Add suggested const attribute.
4187
ce811ad9
EZ
41882012-07-15 Eli Zaretskii <eliz@gnu.org>
4189
4190 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4191 (bidi_paragraph_init): Use it to limit search forward for a strong
4192 directional character in abnormally large paragraphs full of
4193 neutral or weak characters. (Bug#11943)
4194
c9adfeaa
SF
41952012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4196
4197 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4198 the toolbar (Bug#9451).
4199 (xg_make_tool_item): Give the widget event box a transparent
4200 background.
4201
fff62aa9
DA
42022012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4203
4204 Cleanup basic allocation variables and functions.
4205 * alloc.c (ignore_warnings, init_intervals, init_float)
4206 (init_cons, init_symbol, init_marker): Remove.
4207 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4208 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4209 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4210 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4211 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4212 (staticidx, init_alloc_once, init_strings, free_ablock):
4213 Remove redundant initialization.
4214 * fns.c (init_weak_hash_tables): Remove.
4215 * lisp.h (init_weak_hash_tables): Remove prototype.
4216
9730daca
DA
42172012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4218
4219 Use zero_vector where appropriate.
4220 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4221 accordingly.
4222 * lisp.h (zero_vector): New declaration.
4223 * font.c (null_vector): Remove.
4224 (syms_of_font): Remove initialization and staticpro.
4225 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4226 * keymap.c (Faccessible_keymaps): Likewise.
4227
2e2d2a13
LL
42282012-07-15 Leo Liu <sdl.web@gmail.com>
4229
4230 * fringe.c: Fix typo in comments.
4231
cd276f6e
LL
42322012-07-14 Leo Liu <sdl.web@gmail.com>
4233
4234 * fringe.c: Add a new bitmap exclamation-mark.
4235
5a1131d9
EZ
42362012-07-14 Eli Zaretskii <eliz@gnu.org>
4237
4238 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4239
4240 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4241 (HAVE_MENUS): Don't define, defined by editing config.in with
4242 msdos/sed2v2.inp.
4243 (GMALLOC_INHIBIT_VALLOC): Don't define.
4244 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4245
22e983b7
JB
42462012-07-14 Juanma Barranquero <lekktu@gmail.com>
4247
4248 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4249
5b3f250f
GM
42502012-07-14 Glenn Morris <rgm@gnu.org>
4251
4252 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4253 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4254 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4255
33d63ff4
GM
42562012-07-13 Glenn Morris <rgm@gnu.org>
4257
5b633342
GM
4258 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4259
33d63ff4
GM
4260 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4261 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4262
b55b9f85
JD
42632012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4264
0dc8cf50
JD
4265 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4266 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4267 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4268 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4269 where appropriate.
4270 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4271 as boolean expression.
4272 (x_set_window_size): Remove unused variable toolbar.
4273 (ns_get_color_default, ns_mod_to_lisp): Remove.
4274 (ns_mouse_position): Remove unused variables xchar and ychar.
4275 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4276 (ns_set_vertical_scroll_bar): Remove unused variable count.
4277 (ns_delete_terminal): Remove unused variable i.
4278 (ns_term_init): Remove unused variables r, g and b.
4279 (mouseDown): Remove unused variable window.
4280 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4281 (initFrameFromEmacs): Remove unused variable vbextra.
4282 (mouseEntered): Remove unused variables p and dpyinfo.
4283 (mouseExited): Remove unused variables p and r.
4284 (ns_define_frame_cursor, ns_clear_frame_area)
4285 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4286 (menuDown): Assign [sender tag] to variable and cast the variable.
4287
4288 * nsterm.h (menuDown): Add id as type to argument sender.
4289 (ns_display_info_for_name): Add Lisp_Object argument.
4290 (ns_term_init): Add Lisp_Object argument.
4291 (ns_map_event_to_object): Add void argument.
4292 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4293 prototype with arguments and only declare if __OBJC__.
4294 (nxatoms_of_nsselect): Add void argument.
4295 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4296 (ns_alloc_autorelease_pool): Add void argument.
4297 (ns_release_autorelease_pool): Add void* argument.
4298 (ns_get_defaults_value): Add const char* argument.
4299
4300 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4301 (initFromContents): Use SSDATA where appropriate.
4302 (ns_update_menubar): Add braces to ambigous if-else.
4303 (initWithTitle): Put () around assignment in if statement.
4304 (ns_menu_show): Remove unused variables window and keymap.
4305 (update_frame_tool_bar): Remove unused variable selected_p.
4306 (initWithContentRect): Remove unused variable this_cmd_name.
4307
4308 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4309 appropriate.
4310 (setXBMColor): Remove unused variable len.
4311 (setPixmapData): Put () around assignment in loop statement.
4312
4313 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4314 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4315 where appropriate.
4316 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4317 around assignment in loop statement.
4318 (nsfont_open): Remove unused variable i.
4319 (nsfont_open): Remove unused variable len.
4320 (nsfont_draw): Remove unused variable cs.
4321
4322 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4323 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4324 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4325 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4326 (Fns_font_name, Fns_perform_service)
4327 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4328 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4329 (ns_set_name): Remove unused variable view.
4330 (x_set_menu_bar_lines): Remove unused variable olines.
4331 (x_set_tool_bar_lines): Remove unused variable root_window.
4332 (Fns_list_colors): Put () around assignment in while statement.
4333 (Fns_perform_service): Remove unused variable len.
4334 (Fns_display_usable_bounds): Remove unused variable top.
4335 (syms_of_nsfns): Remove unused variable i.
4336
b55b9f85
JD
4337 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4338 memcpy (Bug#11907).
4339
ed9265fc 43402012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
4341
4342 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4343 and free it with DestroyExceptionInfo (Bug#11558).
4344
ef099b57
JB
43452012-07-13 Juanma Barranquero <lekktu@gmail.com>
4346
4347 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4348 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4349 Set here, not in nt/config.nt.
4350
ea814a5d
EZ
43512012-07-13 Eli Zaretskii <eliz@gnu.org>
4352
4353 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4354 cursor overflow into the last glyph on display line when the right
4355 fringe is off. (Bug#11832)
4356
1a952767
PE
43572012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4358
4359 * xdisp.c (produce_special_glyphs): Now static.
4360 * dispextern.h (produce_special_glyphs): Remove decl.
4361
983188fd
GM
43622012-07-13 Glenn Morris <rgm@gnu.org>
4363
8d7c7eed 4364 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
4365 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4366
983188fd
GM
4367 * s/usg5-4-common.h (USG, USG5):
4368 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4369 * s/sol2-6.h (SOLARIS2):
4370 * s/irix6-5.h (IRIX6_5):
4371 * s/hpux10-20.h (USG, USG5, HPUX):
4372 * s/gnu-linux.h (USG, GNU_LINUX):
4373 * s/freebsd.h (BSD_SYSTEM):
4374 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4375 * s/cygwin.h (CYGWIN):
4376 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4377 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4378
d1e68667 43792012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
4380
4381 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 4382
6de0e799
GM
43832012-07-13 Glenn Morris <rgm@gnu.org>
4384
739ae010
GM
4385 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4386
dbee5793
GM
4387 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4388
6de0e799
GM
4389 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4390 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4391
b82da769
GM
43922012-07-12 Glenn Morris <rgm@gnu.org>
4393
4fae5a7a 4394 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
4395
4396 * process.c (init_process_emacs): Rename from init_process.
4397 The old name is also the name of a Mach system call.
4398 * lisp.h, emacs.c: Update for this name change.
4399 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4400 longer needed.
4401
5a979817
EZ
44022012-07-12 Eli Zaretskii <eliz@gnu.org>
4403
4404 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4405 memmove call that removes glyphs covered by the left truncation
4406 glyph. Improve commentary.
4407 (display_line): Fix display of continuation glyphs on GUI frames
4408 when the right fringe is turned off and variable-size fonts are
4409 used in the window. Move the code that appends a stretch glyph to
4410 produce_special_glyphs, so that it could be used for truncation
4411 and continuation glyphs alike.
4412 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4413 glyph of a suitably computed width, to align the special glyphs at
4414 the window margin. Code moved from display_line. (Bug#11832)
4415
3e91a053
GM
44162012-07-12 Glenn Morris <rgm@gnu.org>
4417
ba9e4b84
GM
4418 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4419
4420 * s/gnu-linux.h, s/hpux10-20.h:
4421 Do not unconditionally define HAVE_XRMSETDATABASE.
4422
3e91a053
GM
4423 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4424
b300b1f4
PE
44252012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4426
4427 Fix typos that broke OS X build.
4428 Reported by Randal L. Schwartz in
4429 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4430 * nsterm.m (ns_timeout): Add missing local decl.
4431 (ns_get_color): snprintf -> sprintf, to fix typo.
4432
6e777848
GM
44332012-07-12 Glenn Morris <rgm@gnu.org>
4434
3f922c37
GM
4435 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4436 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4437 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4438 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4439
0ab7b23a
GM
4440 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4441 Move PTY_OPEN to configure.
4442
6e777848
GM
4443 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4444 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4445 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4446
4a7edc24
DA
44472012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4448
4449 Use empty_unibyte_string where applicable.
4450 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4451 * lread.c (read1): Likewise.
4452 * xsettings.c (syms_of_xsettings): Likewise.
4453
308aab79
GM
44542012-07-12 Glenn Morris <rgm@gnu.org>
4455
42bd1719
GM
4456 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4457 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
4458 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4459 * s/hpux10-20.h (RUN_TIME_REMAP):
4460 * s/bsd-common.h (TABDLY): Move to configure.
4461
4462 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4463
4464 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4465
ea0bbd17 4466 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 4467 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
4468
4469 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 4470
308aab79
GM
4471 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4472 * s/template.h: Move NARROWPROTO to configure.
4473
ee1cf5cf
GM
44742012-07-11 Glenn Morris <rgm@gnu.org>
4475
30fe9bf4
GM
4476 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4477 unused since 2011-01-17 change to systty.h.
4478
ee1cf5cf
GM
4479 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4480 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4481 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4482
63e47e07
PE
44832012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4484
4485 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4486
c43fb4c3
GM
44872012-07-11 Glenn Morris <rgm@gnu.org>
4488
4489 * s/darwin.h, s/gnu-linux.h, s/template.h:
4490 Move INTERRUPT_INPUT to configure.
4491
e8df9267
DA
44922012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4493
4494 Minor adjustments to interning code.
4495 * lisp.h (intern, intern_c_string): Redefine as static inline
4496 wrappers for intern_1 and intern_c_string_1, respectively.
4497 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
4498 * lread.c (intern_1, intern_c_string_1, oblookup):
4499 Simplify Vobarray checking.
e8df9267
DA
4500 * font.c (font_intern_prop): Likewise. Adjust comment.
4501 * w32font.c (intern_font_name): Likewise.
4502
34348bd4
AS
45032012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4504
d96a1e0c
AS
4505 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4506
34348bd4
AS
4507 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4508 of Fcar/Fcdr if possible.
4509 * font.c (check_otf_features): Likewise.
4510 * fontset.c (Fnew_fontset): Likewise.
4511 * gnutls.c (Fgnutls_boot): Likewise.
4512 * minibuf.c (read_minibuf): Likewise.
4513 * msdos.c (IT_set_frame_parameters): Likewise.
4514 * xmenu.c (Fx_popup_dialog): Likewise.
4515 * w32menu.c (Fx_popup_dialog): Likewise.
4516
c8add24e
GM
45172012-07-11 Glenn Morris <rgm@gnu.org>
4518
4b575b3c
GM
4519 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4520 since nothing has defined it on these platforms.
4521
09f4e3b0
GM
4522 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4523 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4524
172bedef
GM
4525 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4526 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4527 Move CLASH_DETECTION to configure.
4528
249685df
GM
4529 * s/gnu.h: Remove file, which is now empty.
4530
c8add24e
GM
4531 * s/gnu.h, s/gnu-linux.h:
4532 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4533
b41253a3
JW
45342012-07-11 John Wiegley <johnw@newartisans.com>
4535
4536 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4537 function attribute, so we only use it if it exists in the
4538 compiler.
4539
d923b542
DA
45402012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4541
4542 Avoid call to strlen in fast_c_string_match_ignore_case.
4543 * search.c (fast_c_string_match_ignore_case): Change to use
4544 length argument. Adjust users accordingly.
4545 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4546
5ebbef1d
PE
45472012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4548
bb352260
PE
4549 Assume mkdir, rmdir.
4550 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4551 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4552
57054ddd
PE
4553 Assume rename.
4554 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4555
b747d3f7
PE
4556 Assume perror.
4557 * s/hpux10-20.h (HAVE_PERROR): Remove.
4558 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4559 Remove dummy definition, as this problem was obsolete long ago.
4560
5ebbef1d
PE
4561 Assume strerror.
4562 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4563
984e7f30
DA
45642012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4565
4566 Avoid calls to strlen in font processing functions.
4567 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
4568 (font_open_by_name): Change to use length argument.
4569 Adjust users accordingly.
d923b542
DA
4570 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4571 Adjust prototypes.
4572 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4573 Change to return ptrdiff_t.
984e7f30
DA
4574 (xfont_list_pattern, xfont_match): Use length returned by
4575 xfont_decode_coding_xlfd.
4576 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4577
20e94fdd
GM
45782012-07-11 Glenn Morris <rgm@gnu.org>
4579
9d596af3
GM
4580 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4581 Move DONT_REOPEN_PTY to configure.
4582
20e94fdd
GM
4583 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4584 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4585
e99a530f
PE
45862012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4587
22ffb973
PE
4588 Remove "#define unix" that is no longer needed (Bug#11905).
4589 * s/aix4-2.h (unix): Remove; no longer needed.
4590
e9a9ae03
PE
4591 EMACS_TIME simplification (Bug#11875).
4592 This replaces macros (which typically do not work in GDB)
4593 with functions, typedefs and enums, making the code easier to debug.
4594 The functional style also makes code easier to read and maintain.
4595 * systime.h: Include <sys/time.h> on all hosts, not just if
4596 WINDOWSNT, since 'struct timeval' is needed in general.
4597 (EMACS_TIME): Now a typedef, not a macro.
4598 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4599 not macros.
4600 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4601 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4602 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4603 (EMACS_TIME_LE): Now functions, not macros.
4604 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4605 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4606 which are not functions. All uses rewritten to use:
4607 (make_emacs_time): New function.
4608 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4609 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4610 not functions. All uses rewritten to use the following, respectively:
4611 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4612 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 4613 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
4614 * fileio.c (Fcopy_file):
4615 * xterm.c (XTflash): Get the current time closer to when it's used.
4616 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4617
ffacb126
PE
4618 * bytecode.c (targets): Suppress -Woverride-init warnings.
4619
e99a530f
PE
4620 Simplify by avoiding confusing use of strncpy etc.
4621 * doc.c (Fsnarf_documentation):
4622 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4623 * frame.c (Fmake_terminal_frame):
4624 * gtkutil.c (get_utf8_string):
4625 * lread.c (openp):
4626 * nsmenu.m (ns_update_menubar):
4627 * regex.c (regerror):
4628 Prefer memcpy to strncpy and strncat when either will do.
4629 * fileio.c (Fsubstitute_in_file_name):
4630 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4631 (menu_separator_name_p):
4632 * nsmenu.m (ns_update_menubar):
4633 Prefer memcmp to strncmp when either will do.
4634 * nsterm.m: Include <ftoastr.h>.
4635 (ns_get_color):
4636 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4637 Prefer snprintf to strncpy.
4638 * nsterm.m (ns_term_init):
4639 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4640 * nsterm.m (ns_term_init):
4641 Avoid the need for strncpy, by using build_string or
4642 make_unibyte_string directly. Use dtoastr, not snprintf.
4643 * process.c (Fmake_network_process): Diagnose service names that
4644 are too long, rather than silently truncating them or creating
4645 non-null-terminated names.
4646 (Fnetwork_interface_info): Likewise, for interface names.
4647 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4648 Prefer sprintf to strncat.
4649 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4650 Prefer vsnprintf to vsprintf + strncpy.
4651
c59592b3
GM
46522012-07-10 Glenn Morris <rgm@gnu.org>
4653
4654 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4655 Clarify fallback case.
4656
7d7bbefd
DA
46572012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4658
4659 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4660 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4661 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 4662 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
4663 where argument type is known to be a Lisp_Cons.
4664
3a4c8000
TT
46652012-07-10 Tom Tromey <tromey@redhat.com>
4666
4667 * bytecode.c (BYTE_CODE_THREADED): New macro.
4668 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4669 (enum byte_code_op): New type.
4670 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4671 (exec_byte_code): Use them. Use token threading when applicable.
4672
2a0213a6
DA
46732012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4674
4675 Optimize pure C strings initialization.
4676 * lisp.h (make_pure_string): Fix prototype.
4677 (build_pure_c_string): New function, defined as static inline. This
4678 provides a better opportunity to optimize away calls to strlen when
4679 the function is called with compile-time constant argument.
4680 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4681 argument, adjust users accordingly. Use build_pure_c_string where
4682 appropriate.
4683 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4684 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4685 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4686
cb1caeaf
DA
46872012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4688
4689 Avoid calls to strlen in miscellaneous functions.
4690 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4691 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4692 * lread.c (openp): Likewise.
4693
c293e30c
DA
46942012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4695
4696 Avoid calls to strlen in path processing functions.
4697 * fileio.c (file_name_as_directory): Add comment. Change to add
4698 srclen argument and return the length of result. Adjust users
4699 accordingly.
4700 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
4701 swap 1st and 2nd arguments to obey the common convention.
4702 Adjust users accordingly.
c293e30c
DA
4703 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4704
9e059e3f
GM
47052012-07-10 Glenn Morris <rgm@gnu.org>
4706
d02eb359
GM
4707 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4708 Move PENDING_OUTPUT_COUNT definition to configure.
4709
882cf227
GM
4710 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4711 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4712 * s/gnu.h (DATA_START): Move definitions to configure.
4713
af6e839f
GM
4714 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4715 We include usg5-4-common.h, which defines them both.
4716
40289a12
GM
4717 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4718 O_RDONLY already includes it).
4719
9e059e3f
GM
4720 Stop ns builds setting the EMACSLOADPATH environment variable.
4721 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4722 Now it does not set EMACSLOADPATH, just returns the load-path string.
4723 * nsterm.h: Update accordingly.
4724 * lread.c [HAVE_NS]: Include nsterm.h.
4725 (init_lread) [HAVE_NS]: Use ns_load_path.
4726 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4727
7c4e8ec0
GM
47282012-07-09 Glenn Morris <rgm@gnu.org>
4729
d4f600ff
GM
4730 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4731 since the included bsd-common.h does so.
4732
cbb31951
GM
4733 Stop ns builds setting the EMACSPATH environment variable.
4734 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4735 (ns_init_paths): Do not set EMACSPATH.
4736 * nsterm.h (ns_exec_path): Add it.
4737 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4738 Use ns_exec_path.
4739
7c4e8ec0
GM
4740 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4741
26bccfae
PE
47422012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4743
a0bee46f
PE
4744 * process.c (wait_reading_process_output): 'waitchannels' was unset
4745 when read_kbd || !NILP (wait_for_cell); fix this.
4746
5994c183
PE
4747 Add GCC-style 'const' attribute to functions that can use it.
4748 * character.h (char_resolve_modifier_mask):
4749 * keyboard.h (make_ctrl_char):
4750 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4751 (init_character_once, next_almost_prime, init_fns, init_image)
4752 (flush_pending_output, init_sound):
4753 * mem-limits.h (start_of_data):
4754 * menu.h (finish_menu_items):
4755 Add ATTRIBUTE_CONST.
4756 * emacs.c (DEFINE_DUMMY_FUNCTION):
4757 Declare the dummy function with ATTRIBUTE_CONST.
4758 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4759 Add decls with ATTRIBUTE_CONST.
4760
26bccfae
PE
4761 Minor improvements to make_formatted_string.
4762 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4763 where int is good enough, as vsprintf returns an int.
4764 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4765
a8290ec3
DA
47662012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4767
4768 Use make_formatted_string to avoid double length calculation.
4769 * lisp.h (make_formatted_string): New prototype.
4770 * alloc.c (make_formatted_string): New function.
4771 * buffer.c (Fgenerate_new_buffer_name): Use it.
4772 * dbus.c (syms_of_dbusbind): Likewise.
4773 * editfns.c (Fcurrent_time_zone): Likewise.
4774 * filelock.c (get_boot_time): Likewise.
4775 * frame.c (make_terminal_frame, set_term_frame_name)
4776 (x_report_frame_params): Likewise.
4777 * image.c (gs_load): Likewise.
4778 * minibuf.c (get_minibuffer): Likewise.
4779 * msdos.c (dos_set_window_size): Likewise.
4780 * process.c (make_process): Likewise.
4781 * xdisp.c (ensure_echo_area_buffers): Likewise.
4782 * xsettings.c (apply_xft_settings): Likewise.
4783
d01ba2f1
GM
47842012-07-09 Glenn Morris <rgm@gnu.org>
4785
4786 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4787 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4788 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4789 * nsterm.h (ns_etc_directory): Add it.
4790 * callproc.c [HAVE_NS]: Include nsterm.h.
4791 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4792
f1f924b6
DA
47932012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4794
4795 Move marker debugging code under MARKER_DEBUG.
4796 * marker.c (MARKER_DEBUG): Move marker debugging code under
4797 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4798 for bootstrap with --enable-checking (~3x slowdown reported
4799 by Juanma Barranquero <lekktu@gmail.com>).
4800 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4801
ab531b66
PE
48022012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4803
4804 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4805 See <http://bugs.gnu.org/11825#29>.
4806
c4b3bc8a
EZ
48072012-07-08 Eli Zaretskii <eliz@gnu.org>
4808
4809 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4810 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
4811 (display_line): Add commentary about displaying truncation glyphs
4812 on GUI frames.
4813 (produce_special_glyphs): Move here from term.c.
4814
4815 * term.c (produce_special_glyphs): Move to xdisp.c.
4816
4817 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4818 section.
c4b3bc8a 4819
b676b881
AS
48202012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4821
f17c5273
AS
4822 * xdisp.c (display_line): Avoid warning about implicit declaration
4823 of FRAME_FONT.
4824
298819b9
AS
4825 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4826
b676b881
AS
4827 * lisp.h: Remove empty conditional.
4828
6045c4fd
PE
48292012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4830
b3350bf9
PE
4831 * lread.c (load_path_check): Now static.
4832
6045c4fd
PE
4833 Fix some minor --with-ns problems found by static checking.
4834 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4835 (x_set_font) [!HAVE_X_WINDOWS]:
4836 * image.c (xpm_load_image) [HAVE_NS]:
4837 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4838 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4839 Remove unused local.
4840 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4841 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4842 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4843 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4844 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4845 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4846 Fix pointer signedness problem.
4847 * xfaces.c (FRAME_X_FONT_TABLE):
4848 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4849
929e7845
GM
48502012-07-07 Glenn Morris <rgm@gnu.org>
4851
4852 * lread.c (load_path_check): New function, split from init_lread.
4853 (init_lread): Reorganize. Motivation:
4854 If EMACSLOADPATH is set, check/warn about that rather than the
4855 defaults, which we are not going to use. Hence we can remove
4856 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4857 Don't warn if site-lisp directories are missing.
4858 If not installed, start from a blank load-path, since
4859 PATH_LOADSEARCH refers to the eventual installation directories.
4860
58dd0aa4
EZ
48612012-07-07 Eli Zaretskii <eliz@gnu.org>
4862
4863 Support truncation and continuation glyphs on GUI frames, when
4864 fringes are disabled. (Bug#11832)
4865 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
4866 continuation glyphs even if on GUI frames.
4867 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
4868 or both, are absent.
4869 (start_display, move_it_in_display_line_to): Handle the case of a
4870 GUI frame without a fringe to display continuation or truncation
4871 glyphs.
4872 (insert_left_trunc_glyphs): Support GUI frames: make sure
4873 truncation glyphs overwrite enough glyphs from the current line to
4874 have sufficient space in pixels.
4875 (display_line): Support truncation and continuation glyphs on GUI
4876 frames. If some spare pixels are left on the line after inserting
4877 the truncation glyphs, fill that space with a stretch glyph of a
4878 suitably computed width.
4879
4880 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4881 produce_glyphs, to support GUI sessions.
4882
31571fd7
PE
48832012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4884
5a16b9bc
PE
4885 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4886
f3047c75
PE
4887 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4888
31571fd7
PE
4889 Do not require float-time's arg to fit in time_t (Bug#11825).
4890 This works better on hosts where time_t is unsigned, and where
4891 float-time is applied to the (negative) difference between two times.
4892 * editfns.c (decode_time_components): Last arg is now double *,
4893 not int *, and means to store all the result as a double, without
4894 worrying about whether the seconds part fits in time_t.
4895 All callers changed.
4896 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4897 All callers changed.
4898 (Ffloat_time): Do not fail merely because the specified time falls
4899 outside of time_t range.
4900
4516fbef
GM
49012012-07-07 Glenn Morris <rgm@gnu.org>
4902
4903 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4904 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4905 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4906
07adc2c6
JB
49072012-07-07 Juanma Barranquero <lekktu@gmail.com>
4908
4909 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4910 Update dependencies.
4911
4912 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4913
fd573f31
PE
49142012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4915
fee5959d
PE
4916 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4917 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4918 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4919 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4920 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4921 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4922
fd573f31
PE
4923 * xfont.c (compare_font_names): Redo to omit the need for casts.
4924
ddadbc0e
AS
49252012-07-06 Andreas Schwab <schwab@linux-m68k.org>
4926
fca8d6b6
AS
4927 * xfns.c (Fx_change_window_property): Doc fix.
4928 * w32fns.c (Fx_change_window_property): Doc fix.
4929
ddadbc0e
AS
4930 * w32fns.c (Fx_window_property): Accept the same arguments as the
4931 X Windows version. Doc fix.
4932 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
4933
ed9265fc 49342012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
4935 Eli Zaretskii <eliz@gnu.org>
4936
4937 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
4938 Windows-specific code from nt/config.nt moved here.
4939 Obsolete settings removed.
4940
216ee680
PE
49412012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4942
4943 * process.c: Avoid unnecessary calls to gettime.
4944 (wait_reading_process_output): Don't get the time of day
4945 when gobbling data immediately and not waiting, as there's no need
4946 for it in that case. This removes a FIXME.
4947
bdd091e4
JD
49482012-07-06 Jan Djärv <jan.h.d@swipnet.se>
4949
4950 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
4951 is defined (Bug#11768).
4952
9d44f8ce
DA
49532012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4954
4955 Fix marker debugging code.
4956 * marker.c (byte_char_debug_check): Do not perform the check
4957 if buffer is not multibyte.
090bd7cb
JB
4958 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4959 Call byte_char_debug_check with correct arguments.
9d44f8ce 4960
90fc4786
DA
49612012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4962
4963 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
4964 * marker.c (byte_char_debug_check, count_markers):
4965 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
4966 (byte_debug_flag): Remove.
4967 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4968 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
4969
7b7ae965
DA
49702012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4971
4e57b342
DA
4972 Avoid code repetition in marker-related functions.
4973 * marker.c (attach_marker): New function.
4974 (Fset_marker, set_marker_restricted, set_marker_both)
4975 (set_marker_restricted_both): Use it.
4976 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
4977 Consistently rename charno to charpos.
4978 (marker_position): Add eassert.
4979 (marker_byte_position): Convert to eassert.
4980
49812012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4982
4983 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 4984 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 4985 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 4986
657924ff
DA
49872012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4988
4989 Introduce fast path for the widely used marker operation.
4990 * alloc.c (build_marker): New function.
4991 * lisp.h (build_marker): New prototype.
4992 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
4993 * composite.c (autocmp_chars): Likewise.
4994 * editfns.c (buildmark): Remove.
4995 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
4996 (save_restriction_save): Use build_marker.
4997 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
4998 * window.c (save_window_save): Likewise.
4999
041a49a6
DA
50002012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5001
5002 Do not use Fdelete_overlay in delete_all_overlays
5003 to avoid redundant calls to unchain_overlay.
5004 * buffer.c (drop_overlay): New function.
5005 (delete_all_overlays, Fdelete_overlay): Use it.
5006 * minibuf.c (get_minibuffer): Fix comment.
5007
7dca65a4
PE
50082012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5009
5010 Port to OpenBSD 5.1 amd64.
5011 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5012 This is needed for OpenBSD, and should be harmless on all BSD systems.
5013 Also, include <sys/sysctl.h>, as it should be available on all
5014 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5015 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5016 use p_pid member, not kp_proc.pid.
5017
8eb876e2
GM
50182012-07-06 Glenn Morris <rgm@gnu.org>
5019
5020 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5021
38182d90
PE
50222012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5023
5024 More xmalloc and related cleanup.
5025 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5026 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5027 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5028 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5029 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5030 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5031 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5032 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5033 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5034 * xterm.c:
5035 Omit needless casts involving void * pointers and allocation.
5036 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5037 as the former is more robust if P's type is changed.
5038 Prefer xzalloc to xmalloc + memset 0.
5039 Simplify malloc-or-realloc to realloc.
5040 Don't worry about xmalloc returning a null pointer.
5041 Prefer xstrdup to xmalloc + strcpy.
5042 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5043 growing it.
5044 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5045 alloca of a constant.
5046
6dd5a677
EZ
50472012-07-05 Eli Zaretskii <eliz@gnu.org>
5048
5049 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5050 hscroll is larger than the line width. Fixes long and futile
5051 looping inside extend_face_to_end_of_line (on a TTY) producing
5052 glyphs that are not needed and thrown away.
5053
6b312f0f
DA
50542012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5055
5056 * marker.c (set_marker_restricted_both): Simplify by using
5057 clip_to_bounds.
5058
f520ef9b
PE
50592012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5060
5061 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5062
383b7c95
JD
50632012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5064
5065 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5066 not defined (Bug#11768).
5067 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5068 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5069 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5070 followed by gtk_box_set_homogeneous (Bug#11768).
5071 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
5072 (update_theme_scrollbar_width, xg_create_scroll_bar):
5073 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
5074 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5075 (is_box_type): New function (Bug#11768).
5076 (xg_tool_item_stale_p): Call is_box_type.
5293d758 5077 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
5078 with default display (Bug#11768).
5079
d6e7bf45
EZ
50802012-07-05 Eli Zaretskii <eliz@gnu.org>
5081
5082 * xdisp.c (window_hscroll_limited): New function.
5083 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5084 coordinates when window's hscroll is set to insanely large
5085 values. (Bug#11857)
5086
431391ec
JB
50872012-07-05 Juanma Barranquero <lekktu@gmail.com>
5088
5089 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5090 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5091
23f86fce
DA
50922012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5093
5094 Cleanup xmalloc.
5095 * lisp.h (xzalloc): New prototype. Omit needless casts.
5096 * alloc.c (xzalloc): New function. Omit needless casts.
5097 * charset.c: Omit needless casts. Convert all calls to
5098 xmalloc with following memset to xzalloc.
5099 * dispnew.c: Likewise.
5100 * fringe.c: Likewise.
5101 * image.c: Likewise.
5102 * sound.c: Likewise.
5103 * term.c: Likewise.
5104 * w32fns.c: Likewise.
5105 * w32font.c: Likewise.
5106 * w32term.c: Likewise.
5107 * xfaces.c: Likewise.
5108 * xfns.c: Likewise.
5109 * xterm.c: Likewise.
5110 * atimer.c: Omit needless casts.
5111 * buffer.c: Likewise.
5112 * callproc.c: Likewise.
5113 * ccl.c: Likewise.
5114 * coding.c: Likewise.
5115 * composite.c: Likewise.
5116 * doc.c: Likewise.
5117 * doprnt.c: Likewise.
5118 * editfns.c: Likewise.
5119 * emacs.c: Likewise.
5120 * eval.c: Likewise.
5121 * filelock.c: Likewise.
5122 * fns.c: Likewise.
5123 * gtkutil.c: Likewise.
5124 * keyboard.c: Likewise.
5125 * lisp.h: Likewise.
5126 * lread.c: Likewise.
5127 * minibuf.c: Likewise.
5128 * msdos.c: Likewise.
5129 * print.c: Likewise.
5130 * process.c: Likewise.
5131 * region-cache.c: Likewise.
5132 * search.c: Likewise.
5133 * sysdep.c: Likewise.
5134 * termcap.c: Likewise.
5135 * terminal.c: Likewise.
5136 * tparam.c: Likewise.
5137 * w16select.c: Likewise.
5138 * w32.c: Likewise.
5139 * w32reg.c: Likewise.
5140 * w32select.c: Likewise.
5141 * w32uniscribe.c: Likewise.
5142 * widget.c: Likewise.
5143 * xdisp.c: Likewise.
5144 * xmenu.c: Likewise.
5145 * xrdb.c: Likewise.
5146 * xselect.c: Likewise.
5147
0497dc44
PE
51482012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5149
5150 * fileio.c (time_error_value): Check the right error number.
5151 Problem reported by Troels Nielsen in
5152 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5153
356e7178
PE
51542012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5155
4e71fd89
PE
5156 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5157 This should be fixed in a better way; see Eli Zaretskii in
5158 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5159 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5160
f0941253
PE
5161 * fileio.c (time_error_value): Rename from special_mtime.
5162 The old name's problems were noted by Eli Zaretskii in
5163 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5164
065c9eb4
PE
5165 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5166 This variable's comment says Emacs needs at least one GDB-visible
5167 symbol of type enum pvec_type, to work around GDB problems.
5168 The symbol's value doesn't matter.
5169
356e7178
PE
5170 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5171 that causes compilation to fail on pre-C99 compilers.
5172
ed9265fc 51732012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
5174
5175 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5176 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5177
3884d954
DA
51782012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5179
d209e2fb 5180 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
5181 headers for buffer_defaults and buffer_local_symbols.
5182 Reported by Juanma Barranquero <lekktu@gmail.com>.
5183
ee28be33
SM
51842012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5185
5186 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5187 * lisp.h (enum pvec_type): Use fewer bits.
5188 (PSEUDOVECTOR_SIZE_BITS): New constant.
5189 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5190 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5191 change in pvec_type.
5192 (PSEUDOVECTOR_TYPEP): New macro.
5193 (TYPED_PSEUDOVECTORP): Use it.
5194 * fns.c (internal_equal): Adapt code to extract pvectype.
5195 * emacs.c (gdb_pvec_type): Update type.
5196 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5197 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5198 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5199 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5200 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5201 abusing vector->header.next.nbytes.
5202 (live_vector_p): Use PVEC_TYPE.
5203 (mark_object): Adapt code to extract pvectype. Use switch.
5204
c7f2cd7f
PE
52052012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5206
5207 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5208 Tighten new eassert a bit.
5209
8ce70ed2
DA
52102012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5211
5212 Fix compilation with --enable-gcc-warnings and -O1
5213 optimization level.
5214 * doprnt.c (doprnt): Change type of tem to int, initialize
5215 to avoid compiler warning. Add eassert.
5216 * search.c (simple_search): Initialize match_byte to avoid
5217 compiler warning. Add eassert.
5218
dea7f1e5
PE
52192012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5220
24a212eb
PE
5221 Avoid weird behavior with large horizontal scrolls.
5222 Without this change, for example, large hscroll values would
5223 mess up Emacs's display on Fedora 15 x86, presumably due to
5224 overflows in int calculations in the display code.
5225 Also, if buffers had long lines, Emacs would freeze.
5226 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5227 (set_window_hscroll): New function, containing the old guts of
5228 Fset_window_hscroll. Return the clipped value.
5229 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5230 This avoids the need to check against PTRDIFF_MAX.
5231
dea7f1e5
PE
5232 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5233
76046526
DA
52342012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5235
5236 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5237
39adff0d
PE
52382012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5239
63807d47
PE
5240 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5241 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5242 since GCC 4.4.6 issues a bogus warning for them.
5243
39adff0d
PE
5244 Fix bugs in file timestamp newness comparisons.
5245 * fileio.c (Ffile_newer_than_file_p):
5246 * lread.c (Fload): Use full timestamp resolution of files,
5247 not just the 1-second resolution, so that files that are only
5248 slightly newer still count as newer.
5249 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5250 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5251
dbeed9a6
PE
52522012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5253
5254 * fileio.c: Improve handling of file time marker. (Bug#11852)
5255 (special_mtime): New function.
5256 (Finsert_file_contents, Fverify_visited_file_modtime):
5257 Use it to set special mtime values consistently.
5258
636334d6
AS
52592012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5260
5261 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5262 marker for non-existing file. (Bug#11852)
5263
e2017fe2
GM
52642012-07-03 Glenn Morris <rgm@gnu.org>
5265
5266 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5267 and did not make it into globals.h).
5268
404dbd37
TT
52692012-07-03 Tom Tromey <tromey@redhat.com>
5270
5271 * window.c (Fset_window_margins, Fset_window_fringes)
5272 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5273 * textprop.c (Fprevious_property_change): No longer static.
5274 * syntax.c (Fsyntax_table_p): No longer static.
5275 * process.c (Fget_process, Fprocess_datagram_address): No longer
5276 static.
5277 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5278 * keyboard.c (Fcommand_execute): No longer static.
5279 Remove EXFUN.
5280 * insdel.c (Fcombine_after_change_execute): No longer static.
5281 * image.c (Finit_image_library): No longer static.
5282 * fileio.c (Fmake_symbolic_link): No longer static.
5283 * eval.c (Ffetch_bytecode): No longer static.
5284 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
5285 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5286 No longer static.
404dbd37
TT
5287 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5288 static.
5289 * dired.c (Ffile_attributes): No longer static.
5290 * composite.c (Fcomposition_get_gstring): No longer static.
5291 * callproc.c (Fgetenv_internal): No longer static.
5292
5293 * ccl.h: Remove EXFUNs.
5294 * buffer.h: Remove EXFUNs.
5295 * dispextern.h: Remove EXFUNs.
5296 * intervals.h: Remove EXFUNs.
5297 * fontset.h: Remove EXFUN.
5298 * font.h: Remove EXFUNs.
5299 * dosfns.c (system_process_attributes): Remove EXFUN.
5300 * keymap.h: Remove EXFUNs.
5301 * lisp.h: Remove EXFUNs.
5302 * w32term.h: Remove EXFUNs.
5303 * window.h: Remove EXFUNs.
5304 * xsettings.h: Remove EXFUN.
5305 * xterm.h: Remove EXFUN.
5306
8e4fd1e1
GM
53072012-07-03 Glenn Morris <rgm@gnu.org>
5308
5309 * lisp.h (Frandom): Make it visible to C.
5310 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5311 buffer for invisible buffers. (Bug#1229)
5312
ca95b3eb
DA
53132012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5314
5315 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5316 values which aren't power of 2.
14ae4239
BT
5317 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5318 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
5319 accordingly.
5320
7555c33f
SM
53212012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5322
5323 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5324
5325 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5326
d12e8f5a
DA
53272012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5328
5329 * alloc.c (allocate_vector_block): Remove redundant
5330 calls to mallopt if DOUG_LEA_MALLOC is defined.
5331 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5332 avoid calls to mallopt if zero_vector is returned.
5333
296094c3
DA
53342012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5335
5336 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5337 is enabled, avoid dereferencing NULL current_sblock if
5338 running undumped.
5339
36429c89
DA
53402012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5341
5342 Cleanup basic buffer management.
5343 * buffer.h (struct buffer): Change layout to use generic vector
5344 marking code. Fix some comments. Change type of 'clip_changed'
5345 to bitfield. Remove unused #ifndef old.
5346 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5347 (GET_OVERLAYS_AT): Fix indentation.
5348 (for_each_per_buffer_object_at): New macro.
5349 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5350 (Fbuffer_local_variables): Use it.
5351 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5352 * alloc.c (allocate_buffer): Adjust to match new layout of
5353 struct buffer. Fix comment.
5354 (mark_overlay): New function.
5355 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5356 Lisp area of struct buffer.
5357 (mark_object): Use it. Adjust marking of misc objects
5358 and related comments.
5359
3b3e4cac
PE
53602012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5361
5362 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5363 wrapper that is not needed because the wrapped code is a no-op (zero
5364 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5365 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5366
cf5c0175
DA
53672012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5368
5369 * alloc.c (mark_buffer): Simplify. Remove prototype.
5370 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 5371 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
5372 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5373 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 5374
ca26824c
GM
53752012-06-30 Glenn Morris <rgm@gnu.org>
5376
2e4c5312
GM
5377 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5378
ca26824c
GM
5379 * epaths.in (PATH_SITELOADSEARCH): New.
5380 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5381 This is rather than relying on --enable-locallisppath elements
5382 having "site-lisp" in their names. (Bug#10208#25, 11658)
5383
0d23c240
EZ
53842012-06-30 Eli Zaretskii <eliz@gnu.org>
5385
c9240d7a
EZ
5386 * w32proc.c (sys_select): Accept and ignore one more argument.
5387
5388 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5389
0d23c240 5390 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 5391 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
5392
5393 * sysdep.c: Don't include dos.h and dosfns.h.
5394
5395 * process.c (sys_select):
5396 * msdos.c (sys_select): Accept one more argument and ignore it.
5397
5398 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5399 adapt data types and code to that.
5400
5401 * dosfns.c:
5402 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5403 which clashes with the gnulib function of the same name.
5404
af5a5a98
AS
54052012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5406
c5e4379c
AS
5407 * font.c (font_style_to_value, font_style_symbolic)
5408 (font_prop_validate_style): Add type checks for values in
5409 font_style_table.
5410
af5a5a98
AS
5411 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5412 argument.
5413 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5414 uses.
5415
8d38f461
EZ
54162012-06-29 Eli Zaretskii <eliz@gnu.org>
5417
2e5a6631
EZ
5418 * xdisp.c (try_window_id): Undo last change.
5419
8d38f461
EZ
5420 * w32.c (getwd): Adjust commentary about startup_dir.
5421 (init_environment): Always call sys_access, even in non-MSVC
5422 builds. Don't chdir to the directory of the Emacs executable.
5423 This undoes code from 1997 which was justified by the need to
5424 "avoid conflicts when removing and renaming directories". But its
5425 downside was that every relative file name was being interpreted
5426 relative to the directory of the Emacs executable, which can never
5427 be TRT. In particular, it broke sys_access when called with
5428 relative file names.
5429 (sys_access): Map GetLastError to errno.
5430
2af3565e
DA
54312012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5432
5433 * window.h (struct window): Change type of 'fringes_outside_margins'
5434 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 5435 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
5436 Adjust comment.
5437 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5438 to ptrdiff_t.
5439
c8d3a25c 54402012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 5441
c8d3a25c
GM
5442 * gnutls.c (emacs_gnutls_handshake):
5443 Add QUIT to make the loop interruptible.
57570cd3 5444
c8d3a25c 54452012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 5446
c8d3a25c
GM
5447 * charset.c (init_charset): Make lack of etc/charsets fatal.
5448
3e984ee8
DA
54492012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5450
5451 * editfns.c (region_limit): Fix type mismatch.
5452
ef884f23
DA
54532012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5454
5455 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5456 undefined. Convert from xassert to eassert.
5457 * nsmenu.m: Convert from xassert to eassert.
5458 * nsterm.m: Likewise.
5459
7d7e0027
SM
54602012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5461
5462 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5463
aa754e6a
PE
54642012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5465
5466 Avoid integer overflow on scroll-left and scroll-right.
5467 * window.c (HSCROLL_MAX): New macro.
5468 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5469 overflow when requested scroll falls outside ptrdiff_t range.
5470
80b00b08
DA
54712012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5472
5473 * window.h (struct window): Change type of 'hscroll',
5474 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5475 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5476 Adjust users accordingly.
5477 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5478 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5479 from EMACS_INT to ptrdiff_t.
5480 (make_window): Omit redundant initialization.
5481
62b2bcf6
JB
54822012-06-28 Juanma Barranquero <lekktu@gmail.com>
5483
5484 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5485
45942c7d
DA
54862012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5487
5488 * window.h (struct window): Change type of 'use_time' and
5489 'sequence_number' from Lisp_Object to int.
5490 * frame.c (make_frame): Adjust users accordingly.
5491 * print.c (print_object): Likewise.
5492 * window.c (select_window, Fwindow_use_time, make_parent_window)
5493 (make_window): Likewise.
5494
e509cfa6
DA
54952012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5496
5497 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5498 enabled with --enable-checking=[all,glyphs] configure option.
5499 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5500 adjust comments accordingly.
5501 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5502 undefined, adjust comments accordingly.
5503 * image.c: Likewise.
5504 * scroll.c: Likewise.
5505 * w32fns.c: Likewise.
5506 * w32term.c: Likewise.
5507 * xdisp.c: Likewise.
5508 * xfaces.c: Likewise.
5509 * xfns.c: Likewise.
5510 * xterm.c: Likewise.
5511
a54e2c05
DA
55122012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5513
5514 Generalize run-time debugging checks.
5515 * dispextern.h (XASSERTS): Remove.
5516 * fontset.c (xassert): Remove.
5517 Convert from xassert to eassert.
5518 * alloc.c: Convert from xassert to eassert.
5519 * bidi.c: Likewise.
5520 * dispnew.c: Likewise.
5521 * fns.c: Likewise.
5522 * fringe.c: Likewise.
5523 * ftfont.c: Likewise.
5524 * gtkutil.c: Likewise.
5525 * image.c: Likewise.
5526 * keyboard.c: Likewise.
5527 * menu.c: Likewise.
5528 * process.c: Likewise.
5529 * scroll.c: Likewise.
5530 * sound.c: Likewise.
5531 * term.c: Likewise.
5532 * w32console.c: Likewise.
5533 * w32fns.c: Likewise.
5534 * w32term.c: Likewise.
5535 * window.c: Likewise.
5536 * xdisp.c: Likewise.
5537 * xfaces.c: Likewise.
5538 * xfns.c: Likewise.
5539 * xselect.c: Likewise.
5540 * xterm.c: Likewise.
5541
1ec4b7b2
SM
55422012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5543
5544 * fns.c (maybe_resize_hash_table): Output message when growing the
5545 purify-hashtable.
5546
2014308a
DA
55472012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5548
5549 * alloc.c (allocate_string_data): Remove dead code.
5550 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5551 avoid GCC warning about unused macro.
5552
246155eb
DA
55532012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5554
5555 * alloc.c (allocate_string): Omit intervals initialization.
5556 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5557 as in make_pure_string and make_pure_c_string.
5558
43184b7b
DA
55592012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5560
d209e2fb 5561 * alloc.c (allocate_string): Fix last change.
43184b7b 5562
3fe6dd74
DA
55632012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5564
d209e2fb 5565 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
5566 to memset, add explicit initialization where appropriate.
5567
1ba6038a
GM
55682012-06-27 Glenn Morris <rgm@gnu.org>
5569
5570 * lisp.mk (lisp): Remove paths.elc.
5571
c89926a5
CY
55722012-06-27 Chong Yidong <cyd@gnu.org>
5573
5574 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5575
ed6b3510
JW
55762012-06-26 John Wiegley <johnw@newartisans.com>
5577
1ec4b7b2 5578 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
5579 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5580
ed6b3510
JW
5581 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5582 when building with Clang.
5583
8edd4a2b
SM
55842012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5585
5586 * eval.c (Fapply): Allow calling it with a single argument.
5587
f6f62d1b
EZ
55882012-06-26 Eli Zaretskii <eliz@gnu.org>
5589
5590 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5591 _stricmp and _strnicmp.
5592 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5593
62efea5e
DA
55942012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5595
5596 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5597 allocated window.
5598 (allocate_process): Likewise for new process.
8edd4a2b 5599 (allocate_terminal): Change to use offsetof.
62efea5e
DA
5600 (allocate_frame): Likewise.
5601 * frame.c (make_frame): Omit redundant initialization.
5602 * window.c (make_parent_window): Use memset.
5603 (make_window): Omit redundant initialization.
5604 * process.c (make_process): Omit redundant initialization.
5605 * terminal.c (create_terminal): Likewise.
5606
42997f4d
DA
56072012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5608
5609 * term.c (delete_tty): Remove redundant call to memset.
5610
1130ecfc
DA
56112012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5612
5613 * alloc.c: Remove build_string.
5614 * lisp.h: Define build_string as static inline. This provides
5615 a better opportunity to optimize away calls to strlen when the
5616 function is called with compile-time constant argument.
5617 * image.c (imagemagick_error): Convert to build_string.
5618 * w32proc.c (sys_spawnve): Likewise.
5619 * xterm.c (x_term_init): Likewise.
5620
cf38a720
PE
56212012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5622
99027bdd
PE
5623 Use sprintf return value instead of invoking strlen on result.
5624 In the old days this wasn't portable, since some sprintf
5625 implementations returned char *. But they died out years ago and
5626 Emacs already assumes sprintf returns int.
5627 Similarly for float_to_string.
5628 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5629 * ccl.c (ccl_driver):
5630 * character.c (string_escape_byte8):
5631 * data.c (Fnumber_to_string):
5632 * doprnt.c (doprnt):
5633 * print.c (print_object):
5634 * xdisp.c (message_dolog):
5635 * xfns.c (syms_of_xfns):
5636 Use sprintf or float_to_string result to avoid need to call strlen.
5637 * data.c (Fnumber_to_string):
5638 Use make_unibyte_string, since the string must be ASCII.
5639 * lisp.h, print.c (float_to_string): Now returns int length.
5640 * term.c (produce_glyphless_glyph):
5641 Use sprintf result rather than recomputing it.
5642
cf38a720
PE
5643 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5644 * Makefile.in (ALL_CFLAGS):
5645 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5646 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5647
3511c784
DA
56482012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5649
0a08eb21 5650 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
5651 strcasecmp if available.
5652 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5653
fb7da12e
AS
56542012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5655
5656 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5657 Avoid comma operator.
5658 * menu.c (push_submenu_start, push_submenu_end)
5659 (push_left_right_boundary, push_menu_pane): Likewise.
5660 * msdos.c (dos_rawgetc): Likewise.
5661
afa2ffd8
DA
56622012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5663
5664 * xfns.c (xic_create_fontsetname): Remove redundant calls
5665 to memset.
5666
b3b4476b
PE
56672012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5668
4495ff38
PE
5669 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5670 sprintf already null-terminates its output.
5671
b3b4476b
PE
5672 * xfns.c (x_window): Remove redundant cast.
5673
b00876c9
DA
56742012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5675
5676 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5677 `const char *' to `char *' to avoid compiler warning.
5678
d188e26b
PE
56792012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5680
885d1d74
PE
5681 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5682 instead of truncating it to 63 (admittedly a generous limit).
5683
d188e26b
PE
5684 * process.c: Fix spelling and caps in comments.
5685
e2f560b1
DN
56862012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5687
e86db54b 5688 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
5689 * sysdep.c (setpgrp): Remove definition, not used in this file.
5690
7583a3a1
JB
56912012-06-24 Juanma Barranquero <lekktu@gmail.com>
5692
5693 * makefile.w32-in: Update dependencies.
5694
696056c2
EZ
56952012-06-24 Eli Zaretskii <eliz@gnu.org>
5696
5697 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5698 (SYSTIME_H): Add nt/inc/sys/time.h.
5699
5700 * systime.h [WINDOWSNT]: Include sys/time.h.
5701
5702 * s/ms-w32.h (struct timespec): Definition moved from
5703 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5704
845ca893
PE
57052012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5706
5707 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5708 * buffer.h (buffer_slot_type_mismatch):
5709 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5710 * eval.c (unwind_to_catch):
5711 * image.c (my_png_error, my_error_exit):
5712 * keyboard.c (quit_throw_to_read_char, user_error)
5713 (Fexit_recursive_edit, Fabort_recursive_edit):
5714 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5715 (wrong_type_argument, buffer_overflow, __executable_start)
5716 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5717 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5718 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5719 (fatal):
5720 (child_setup) [!DOS_NT]:
5721 * lread.c (end_of_file_error, invalid_syntax):
5722 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5723 * puresize.h (pure_write_error):
5724 * search.c (matcher_overflow):
5725 * sound.c (sound_perror, alsa_sound_perror):
5726 * sysdep.c, syssignal.h (croak):
5727 * term.c (maybe_fatal, vfatal):
5728 * textprop.c (text_read_only):
5729 * undo.c (user_error):
5730 * unexmacosx.c (unexec_error):
5731 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5732 Use _Noreturn rather than NO_RETURN.
5733 No need for separate decl merely because of _Noreturn.
5734 * sound.c (sound_warning, parse_sound):
5735 Remove unnecessary forward decls.
5736
f1dd8073
PE
57372012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5738
5739 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5740 * lisp.h (WAIT_READING_MAX): New macro.
5741 * dispnew.c (Fsleep_for, sit_for):
5742 * keyboard.c (kbd_buffer_get_event):
5743 * process.c (Faccept_process_output):
5744 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5745 This improves on the previous patch, which introduced a bug
5746 when time_t is unsigned and as wide as intmax_t.
5747 See <http://bugs.gnu.org/9000#51>.
5748
b82c1755
EZ
57492012-06-23 Eli Zaretskii <eliz@gnu.org>
5750
5751 * dispnew.c (sit_for, Fsleep_for):
5752 * keyboard.c (kbd_buffer_get_event):
5753 * process.c (Faccept_process_output): Avoid compiler warnings when
5754 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5755
ca300656
JB
57562012-06-23 Juanma Barranquero <lekktu@gmail.com>
5757
049ec95b
JB
5758 * makefile.w32-in: Update dependencies.
5759
ca300656
JB
5760 * w32.c (ltime): Add return type and declare static.
5761 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5762
db7b8d06
PE
57632012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5764
5765 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5766 Privately reported by Herbert J. Skuhra.
5767 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5768 All uses changed.
5769 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5770 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5771
0bd8297f
EZ
57722012-06-23 Eli Zaretskii <eliz@gnu.org>
5773
96512555
EZ
5774 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5775 last argument of make_unibyte_string.
5776
0bd8297f
EZ
5777 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5778 language ID in the event parameters.
5779
5780 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5781 event.code, not the obscure "character set ID".
5782
63def6b6
CY
57832012-06-23 Chong Yidong <cyd@gnu.org>
5784
5785 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5786
e8a02204
EZ
57872012-06-23 Eli Zaretskii <eliz@gnu.org>
5788
388cdec0
EZ
5789 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5790 * w32.c (fdutimens): New function.
5791
5792 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5793
5794 * s/ms-w32.h (pselect): Redirect to sys_select.
5795
5796 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5797
e8a02204
EZ
5798 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5799 in the logic of incrementing and decrementing the value of
5800 use_relocatable_buffers.
5801
d054f3fb
PE
58022012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5803
5804 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5805 Privately reported by Herbert J. Skuhra.
5806 [__FreeBSD__]: Remove "*/" typo after "#include".
5807 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5808 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5809 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5810 Don't assume EMACS_TIME and struct timeval are the same type.
5811
d35af63c
PE
58122012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5813
5814 Support higher-resolution time stamps (Bug#9000).
5815 The time stamps are only nanosecond-resolution at the C level,
5816 since that's the best that any real-world system supports now.
5817 But they are picosecond-resolution at the Lisp level, as that's
5818 easy, and leaves room for future OS improvements.
5819
5820 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5821 (LIBES): Use it.
5822
5823 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5824 Don't get current time unless it's needed.
5825
5826 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5827 now provides it if it's absent.
5828 (start_atimer): Port to higher-res time stamps.
5829 Check for time stamp overflow. Don't get current time more
5830 often than is needed.
5831
5832 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5833 Include systime.h, not time.h.
5834 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5835
5836 * dired.c: Include stat-time.h.
5837 (Ffile-attributes): File times now have higher resolution.
5838
5839 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5840 (struct image): Timestamp now has higher resolution.
5841
5842 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5843 has at least microseconds now. All uses removed.
5844 (update_frame, update_single_window, update_window, update_frame_1)
5845 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 5846 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
5847
5848 * editfns.c (time_overflow): Now extern.
5849 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5850 (float-time, Fformat_time_string, Fcurrent_time_string)
5851 (Fcurrent_time_zone): Accept and generate higher-resolution
5852 time stamps.
5853 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5854 (decode_time_components, lisp_seconds_argument): New functions.
5855 (make_time): Now static.
5856 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5857 Report an error if the time is invalid, rather than having the caller
5858 do that.
5859
5860 * fileio.c: Include <stat-time.h>
5861 (Fcopy_file): Copy higher-resolution time stamps.
5862 Prefer to set the time stamp via a file descriptor if that works.
5863 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5864 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5865 (Fvisited_file_modtime, Fset_visited_file_modtime):
5866 Support higher-resolution time stamps.
5867
5868 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5869
5870 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5871
5872 * image.c (prepare_image_for_display, clear_image_cache)
5873 (lookup_image): Port to higer-resolution time stamps.
5874
5875 * keyboard.c (start_polling, bind_polling_period):
5876 Check for time stamp overflow.
5877 (read_char, kbd_buffer_get_event, timer_start_idle)
5878 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5879 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5880 Port to higher-resolution time stamps. Do not assume time_t is signed.
5881 (decode_timer): New function. Timers are now vectors of length 9,
5882 not 8, to accommodate the picosecond component.
5883 (timer_check_2): Use it.
5884
5885 * nsterm.m (select_timeout, timeval_subtract): Remove.
5886 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5887 as they're a bit more accurate and handle overflow better.
5888 (ns_select): Change prototype to be compatible with pselect.
5889 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5890 * nsterm.h (ns_select): Adjust prototype.
5891
5892 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5893 us-resolution time stamps.
5894 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5895
5896 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5897
5898 * lisp.h (time_overflow): New decl.
5899 (wait_reading_process_output): First arg is now intmax_t, not int,
5900 to accommodate larger waits.
5901
5902 * process.h (struct Lisp_Process.read_output_delay):
5903 Now counts nanoseconds, not microseconds.
5904 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5905 EMACS_HAS_USECS.
5906 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5907 (wait_reading_process_output):
5908 Port to ns-resolution time stamps.
5909 (Faccept_process_output, wait_reading_process_output):
5910 Check for time stamp overflow. Do not assume time_t is signed.
5911 (select_wrapper): Remove; we now use pselect.
5912 (Fprocess_attributes): Now generates ns-resolution time stamps.
5913
5914 * sysdep.c: Include utimens.h. Don't include utime.h
5915 or worry about struct utimbuf; gnulib does that for us now.
5916 (gettimeofday): Remove; gnulib provides a substitute.
5917 (make_timeval): New function.
5918 (set_file_times): Now sets ns-resolution time stamps.
5919 New arg FD; all uses changed.
5920 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5921 (system_process_attributes):
5922 Now returns ns-resolution time stamp. All uses changed.
5923 Check for time stamp overflow.
5924
5925 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5926 provides a substitute now.
5927
5928 * systime.h: Include timespec.h rather than sys/time.h and time.h,
5929 since it guarantees struct timespec.
5930 (EMACS_TIME): Now struct timespec, so that we can support
5931 ns-resolution time stamps.
5932 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
5933 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
5934 (EMACS_USECS): Remove.
5935 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
5936 so multiply the arg by 1000 before storing it.
5937 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
5938 New macros.
5939 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
5940 Port to ns-resolution time stamps.
5941 (EMACS_TIME_NEG_P): Remove; replaced by....
5942 (EMACS_TIME_SIGN): New macro.
5943 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
5944 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
5945 (set_file_times, make_time, lisp_time_argument): Adjust signature.
5946 (make_timeval, make_lisp_time, decode_time_components): New decls.
5947 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
5948 that it mishandled time_t overflow. You can't compare by subtracting!
5949 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
5950 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
5951
5952 * term.c: Include <sys/time.h>.
5953 (timeval_to_Time): New function, for proper overflow wraparound.
5954 (term_mouse_position, term_mouse_click): Use it.
5955
5956 * undo.c (record_first_change): Support higher-resolution time stamps
5957 in the undo buffer.
5958 (Fprimitive_undo): Use them when restoring time stamps.
5959
5960 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5961 (w32_get_internal_run_time):
5962 Port to higher-resolution Emacs time stamps.
5963 (ltime): Now accepts single 64-bit integer, as that's more convenient
5964 for callers.
5965
5966 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
5967
5968 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
5969 for compatibility with pselect. Support ns-resolution time stamps.
5970
5971 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
5972
5973 * xselect.c (wait_for_property_change, x_get_foreign_selection):
5974 Check for time stamp overflow, and support ns-resolution time stamps.
5975
5976 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
5977 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
5978 (timeval_subtract): Remove; no longer needed.
5979 (XTflash, XTring_bell, x_wait_for_event):
5980 Port to ns-resolution time stamps. Don't assume time_t is signed.
5981
b6a92dfe
CY
59822012-06-22 Chong Yidong <cyd@gnu.org>
5983
5984 * xdisp.c (x_consider_frame_title): Revert last change.
5985
d251c37c
EZ
59862012-06-22 Eli Zaretskii <eliz@gnu.org>
5987
5988 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
5989 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
5990 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
5991 staticidx goes up to 1597 out of 1600 = 0x640.)
5992
f10deafb
PE
59932012-06-20 Paul Eggert <eggert@cs.ucla.edu>
5994
5995 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
5996 Otherwise, the umask might be mistakenly 0 while handling input signals.
5997
ec6de1e2
SM
59982012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
5999
6000 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6001
28be1ada
DA
60022012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6003
6004 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6005 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6006 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6007 access to `contents' member of Lisp_Vector objects with AREF and ASET
6008 where appropriate.
6009
c6bf3022
CY
60102012-06-19 Chong Yidong <cyd@gnu.org>
6011
6012 * frame.c (delete_frame): When selecting a frame on a different
6013 text terminal, do not alter the terminal's top-frame.
6014
6015 * xdisp.c (format_mode_line_unwind_data): Record the target
6016 frame's selected window and its terminal's top-frame.
6017 (unwind_format_mode_line): Restore them.
6018 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6019 Callers changed.
6020 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6021 since tty frames can be explicitly named.
6022 (prepare_menu_bars): Likewise.
6023
6024 * term.c (Ftty_top_frame): New function.
6025
defd4196
PE
60262012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6027
6028 Port byte-code-meter to modern targets.
6029 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6030 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 6031 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
6032 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6033 (METER_1, METER_2): Simplify.
6034
1053a871
SM
60352012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6036
6037 * data.c (Fdefalias): Return `symbol' (bug#11686).
6038
b7e8d081
MR
60392012-06-18 Martin Rudalics <rudalics@gmx.at>
6040
6041 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
6042 gets killed during executing of this function (Bug#11665).
6043 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
6044 (Vkill_buffer_query_functions): In doc-string say that functions
6045 run by this hook should not change the current buffer.
6046
7ea2b339
PE
60472012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6048
6049 Fix recently-introduced process.c problems found by static checking.
6050 * process.c (write_queue_push, write_queue_pop, send_process):
6051 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6052 (write_queue_pop): Fix pointer signedness problem.
6053 (send_process): Remove unused local.
6054
96a313a1
CY
60552012-06-17 Chong Yidong <cyd@gnu.org>
6056
6057 * xdisp.c (redisplay_internal): No need to redisplay terminal
6058 frames that are not on top.
6059
20ca2e94
TN
60602012-06-17 Troels Nielsen <bn.troels@gmail.com>
6061
6062 * process.c (make_process): Initialize write_queue.
6063 (write_queue_push, write_queue_pop): New functions.
6064 (send_process): Use them to maintain correct ordering of process
6065 writes (Bug#10815).
6066
9a900ca9
PE
60672012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6068
310fbfa8
PE
6069 * lisp.h (eassert): Assume C89 or later.
6070 This removes the need for CHECK.
6071 (CHECK): Remove. Its comments about always evaluating its
6072 argument were confusing, as 'eassert' typically does not evaluate
6073 its argument.
6074
27bb1ca4
PE
6075 * coding.c (produce_chars): Use ptrdiff_t, not int.
6076
9a900ca9
PE
6077 * xterm.c (x_draw_underwave): Check for integer overflow.
6078 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6079
41b7f8bc 60802012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
6081
6082 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6083 referenced (Bug#11583).
6084
9b0e3eba
AA
60852012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6086
6087 Implement wave-style variant of underlining.
6088 * dispextern.h (face_underline_type): New enum.
6089 (face): Add field for underline type.
6090 * nsterm.m (ns_draw_underwave): New function.
6091 (ns_draw_text_decoration): Use it.
6092 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6093 New functions.
6094 (x_draw_glyph_string): Use them.
6095 * xfaces.c (Qline, Qwave): New Lisp objects.
6096 (check_lface_attrs, merge_face_ref)
1053a871
SM
6097 (Finternal_set_lisp_face_attribute, realize_x_face):
6098 Handle wave-style underline face attributes.
9b0e3eba
AA
6099 * xterm.c (x_draw_underwave): New function.
6100 (x_draw_glyph_string): Use it.
6101
0fb52f11
JB
61022012-06-16 Juanma Barranquero <lekktu@gmail.com>
6103
6104 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6105 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6106 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6107 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6108 ($(BLD)/w32select.$(O)): Update dependencies.
6109
e5560ff7
AS
61102012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6111
6112 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6113 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6114 * character.c (_fetch_multibyte_char_p): Remove.
6115 * alloc.c: Include "character.h" before "buffer.h".
6116 * bidi.c: Likewise.
6117 * buffer.c: Likewise.
6118 * bytecode.c: Likewise.
6119 * callint.c: Likewise.
6120 * callproc.c: Likewise.
6121 * casefiddle.c: Likewise.
6122 * casetab.c: Likewise.
6123 * category.c: Likewise.
6124 * cmds.c: Likewise.
6125 * coding.c: Likewise.
6126 * composite.c: Likewise.
6127 * dired.c: Likewise.
6128 * dispnew.c: Likewise.
6129 * doc.c: Likewise.
6130 * dosfns.c: Likewise.
6131 * editfns.c: Likewise.
6132 * emacs.c: Likewise.
6133 * fileio.c: Likewise.
6134 * filelock.c: Likewise.
6135 * font.c: Likewise.
6136 * fontset.c: Likewise.
6137 * fringe.c: Likewise.
6138 * indent.c: Likewise.
6139 * insdel.c: Likewise.
6140 * intervals.c: Likewise.
6141 * keyboard.c: Likewise.
6142 * keymap.c: Likewise.
6143 * lread.c: Likewise.
6144 * macros.c: Likewise.
6145 * marker.c: Likewise.
6146 * minibuf.c: Likewise.
6147 * nsfns.m: Likewise.
6148 * nsmenu.m: Likewise.
6149 * print.c: Likewise.
6150 * process.c: Likewise.
6151 * regex.c: Likewise.
6152 * region-cache.c: Likewise.
6153 * search.c: Likewise.
6154 * syntax.c: Likewise.
6155 * term.c: Likewise.
6156 * textprop.c: Likewise.
6157 * undo.c: Likewise.
6158 * unexsol.c: Likewise.
6159 * w16select.c: Likewise.
6160 * w32fns.c: Likewise.
6161 * w32menu.c: Likewise.
6162 * window.c: Likewise.
6163 * xdisp.c: Likewise.
6164 * xfns.c: Likewise.
6165 * xmenu.c: Likewise.
6166 * xml.c: Likewise.
6167 * xselect.c: Likewise.
6168
2f07e6af
EZ
61692012-06-16 Eli Zaretskii <eliz@gnu.org>
6170
1053a871
SM
6171 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6172 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 6173 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
6174 row.
6175 (handle_face_prop): Use chunk-relative overlay string index when
6176 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
6177 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6178 the rightmost. (Bug#11720)
2f07e6af 6179
29b83cec
AS
61802012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6181
6182 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6183 (CATEGORY_MEMBER): Enforce 1/0 value.
6184 * category.c (_temp_category_set): Remove.
6185
4c5501e9
EZ
61862012-06-16 Eli Zaretskii <eliz@gnu.org>
6187
6188 * window.c (Fdelete_other_windows_internal)
6189 (Fdelete_window_internal): Don't access frame's mouse highlight
6190 info of the initial frame. (Bug#11677)
6191
2b570124
PE
61922012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6193
e93864f9
PE
6194 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6195 Assume USE_2_TAGS_FOR_INTS.
6196 (xreload): Adjust $tagmask width to match recent lisp.h change.
6197
2b570124
PE
6198 Simplify lisp.h in minor ways that should not affect code.
6199 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6200 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6201 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6202 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6203 (INTTYPEBITS): New macro, for clarity.
6204 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
6205 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6206 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
6207 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6208 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6209
81755f69
JB
62102012-06-13 Juanma Barranquero <lekktu@gmail.com>
6211
6212 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6213
16192a57
GM
62142012-06-13 Glenn Morris <rgm@gnu.org>
6215
6216 * s/bsd-common.h (BSD4_3):
6217 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6218
646b5f55
AS
62192012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6220
6221 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6222 instead of union.
6223 (XLI, XIL): Define.
1053a871
SM
6224 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6225 Use them.
6226 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 6227 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 6228 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
6229 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6230 * frame.c (delete_frame): Remove outdated comment.
6231 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6232 USE_LISP_UNION_TYPE.
6233 (Fw32_unregister_hot_key): Likewise.
6234 (Fw32_toggle_lock_key): Likewise.
6235 * w32menu.c (add_menu_item): Likewise.
6236 (w32_menu_display_help): Use XIL instead of checking
6237 USE_LISP_UNION_TYPE.
6238 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6239 (init_heap): Likewise.
6240 * w32term.c (w32_read_socket): Update comment.
6241
1d3823c9
GM
62422012-06-13 Glenn Morris <rgm@gnu.org>
6243
c62ff706
GM
6244 * s/usg5-4-common.h, src/s/unixware.h:
6245 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6246
1d3823c9
GM
6247 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6248
bfe3e0a2
PE
62492012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6250
6251 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6252 * alloc.c (make_number) [!defined make_number]:
6253 Remove, as lisp.h always defines this now.
6254 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6255 (roundup_size): Verify that it is a power of 2.
6256 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6257 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6258 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6259 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6260 USE_LSB_TAG now is always defined to be either 0 or 1.
6261 All uses changed.
6262 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6263 code works fine either way, and efficiency is not a concern here,
6264 as the union type is for debugging, not for production.
6265 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6266 Use an inline function on all platforms when using the union type,
6267 since this is simpler and 'static inline' can be used portably
6268 within Emacs now.
6269 (LISP_INITIALLY_ZERO): New macro.
6270 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6271 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6272
45fa9c0f
GM
62732012-06-12 Glenn Morris <rgm@gnu.org>
6274
b4492cba
GM
6275 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6276
6277 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 6278
45fa9c0f
GM
6279 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6280 Move BROKEN_SIGIO to configure.
6281
6282 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6283 Move NO_TERMIO to configure.
6284
0e25d334
CY
62852012-06-12 Chong Yidong <cyd@gnu.org>
6286
6287 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6288 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6289 MagickExportImagePixels is undefined.
6290
43682bb6
PE
62912012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6292
6293 * image.c (imagemagick_load_image): Remove unused label.
6294
a9be7d2b
GM
62952012-06-11 Glenn Morris <rgm@gnu.org>
6296
6297 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6298 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6299 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6300 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6301
3017f87f
SM
63022012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6303
6304 * alloc.c (make_byte_code): New function.
6305 (Fmake_byte_code): Use it. Don't purify here.
6306 * lread.c (read1): Use it as well to avoid extra allocation.
6307
1b9b4cf4
CY
63082012-06-11 Chong Yidong <cyd@gnu.org>
6309
6310 * image.c (imagemagick_load_image): Implement transparency.
6311
95988fcf
AS
63122012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6313
6314 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6315 account for preceding backslashes. (Bug#11663)
6316
cd4eb164
CY
63172012-06-09 Chong Yidong <cyd@gnu.org>
6318
6319 * term.c: Support italics in capable terminals (Bug#9652).
6320 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6321 (turn_on_face): Output using TS_enter_italic_mode if available.
6322 Don't handle unused blinking and alt-charset cases.
6323 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6324 and tty_alt_charset_p cases.
6325 (tty_capable_p, init_tty): Support italics.
6326
6327 * termchar.h (struct tty_display_info): Add field for italics.
6328 Remove unused blink field.
6329
6330 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6331 Handle slant.
6332
6333 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6334 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6335 tty_alt_charset_p. Add tty_italic_p.
6336
ff88beb8
MA
63372012-06-09 Michael Albinus <michael.albinus@gmx.de>
6338
6339 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6340 dbus_type_is_basic if available.
6341 (xd_extract_signed, xd_extract_unsigned): Rename from
6342 extract_signed and extract_unsigned, respectively. Adapt callers.
6343
44286096
CY
63442012-06-09 Chong Yidong <cyd@gnu.org>
6345
1682701f
CY
6346 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6347
44286096
CY
6348 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6349 case (Bug#9752).
6350
d86feb17
PE
63512012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6352
6353 * xdisp.c (vmessage): Treat frame message as multibyte.
6354 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6355 would generate the diagnostic "Making \302\247 buffer-local while
6356 let-bound!".
6357
d5c20fe8
EZ
63582012-06-08 Eli Zaretskii <eliz@gnu.org>
6359
6360 * dispnew.c (showing_window_margins_p): Undo last change, which
6361 was done due to an inadvertent commit.
6362 (adjust_frame_glyphs_for_frame_redisplay): Do call
6363 showing_window_margins_p.
6364
513749ee
SM
63652012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6366
6367 * eval.c (Fmake_var_non_special): New primitive.
6368 (syms_of_eval): Defsubr it.
6369 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6370
d4a8f5c1
JB
63712012-06-08 Juanma Barranquero <lekktu@gmail.com>
6372
6373 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6374 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6375
8bbbc977
EZ
63762012-06-08 Eli Zaretskii <eliz@gnu.org>
6377
6378 * alloc.c (allocate_vectorlike): Fix last change.
6379
f3372c87
DA
63802012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6381
6382 Block-based vector allocation of small vectors.
6383 * lisp.h (struct vectorlike_header): New field `nbytes',
6384 adjust comment accordingly.
6385 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 6386 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
6387 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6388 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6389 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6390 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6391 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6392 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6393 (roundup_size): New constant.
6394 (struct vector_block): New data type.
6395 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 6396 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
6397 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6398 (sweep_vectors): New functions.
6399 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 6400 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
6401 or equal to VBLOCK_BYTES_MAX.
6402 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6403 (init_alloc_once): Add call to init_vectors.
6404
4f18a4ed
SM
64052012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6406
6407 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6408
86f158bc
PE
64092012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6410
6411 * doprnt.c (doprnt): Truncate multibyte char correctly.
6412 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6413 would mishandle a string argument "Xc" if X was a multibyte
6414 character of length 2: it would truncate after X's first byte
6415 rather than including all of X.
6416
c5cfcbe0
CY
64172012-06-06 Chong Yidong <cyd@gnu.org>
6418
6419 * buffer.c (word_wrap): Doc fix.
6420
c05cf390
PE
64212012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6422
6423 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6424
0c3461de
GM
64252012-06-03 Glenn Morris <rgm@gnu.org>
6426
6427 * xdisp.c (tool-bar-style): Doc fix.
6428
c71232db
UM
64292012-06-03 Ulrich Müller <ulm@gentoo.org>
6430
6431 * Makefile.in (PAXCTL): Define.
6432 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6433 binary via PaX flags if the paxctl utility is available.
6434 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6435 Restore PaX flags to their default. (Bug#11398)
6436
383f7350
CY
64372012-06-03 Chong Yidong <cyd@gnu.org>
6438
6439 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6440 buffer (Bug#11226).
6441
5f2c76c6
CY
64422012-06-03 Chong Yidong <cyd@gnu.org>
6443
6444 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6445 (note_mode_line_or_margin_highlight): If there is no help echo,
6446 use mode-line-default-help-echo. Handle the case where the mouse
6447 position is past the end of the mode line string.
6448
6449 * buffer.c (buffer_local_value_1): New function, split from
6450 Fbuffer_local_value; can return Qunbound.
6451 (Fbuffer_local_value): Use it.
6452 (Vmode_line_format): Docstring tweaks.
6453
773d47f6
PE
64542012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6455
6456 * sysdep.c (system_process_attributes): Improve comment.
6457
f2d6a3df
SM
64582012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6459
6460 * keyboard.c: Export real-this-command to Elisp.
6461 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6462 and DEFVAR it. Update all users.
6463
63810350
PE
64642012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6465
7bd5c1f4
PE
6466 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6467
63810350
PE
6468 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6469 Convert pctcpu and pctmem to Lisp float properly.
6470 Let the compiler fold better, as 100.0/0x8000 is exact.
6471
a2821611
AS
64722012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6473
6474 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6475 cons_block.
6476
5fceba1d
PE
64772012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6478
6479 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6480
c98ff5dd
DA
64812012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6482
6483 For a 'struct window', replace some Lisp_Object fields to
6484 bitfields where appropriate, remove unused fields.
6485 * window.h (struct window): Remove unused 'last_mark_x' and
6486 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6487 change it's type from Lisp_Object to bitfield.
6488 Change type of 'force_start', 'optional_new_start',
6489 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 6490 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 6491
ca34e0be
PE
64922012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6493
6494 Pacify gcc -Wdouble-precision when using Xaw.
6495 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6496 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6497 Use 'float' consistently, rather than 'float' in most places
6498 and 'double' in a couple of places.
6499
efc00ab1 65002012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
6501
6502 * xdisp.c (handle_stop): Detect whether we have overlay strings
6503 loaded by testing it->current.overlay_string_index to be
6504 non-negative, instead of checking whether n_overlay_strings is
6505 positive. (Bug#11587)
6506
efc00ab1 65072012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
6508
6509 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6510
6511 * doc.c (Fsubstitute_command_keys): Doc fix.
6512
efc00ab1 65132012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
6514
6515 * search.c (search_buffer): Remove calls to
6516 r_alloc_inhibit_buffer_relocation, as it is now called by
6517 maybe_unify_char, which was the cause of relocation of buffer text
6518 in bug#11519.
6519
efc00ab1 65202012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
6521
6522 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6523 for the duration of call to load_charset, to avoid problems with
6524 callers of maybe_unify_char that access buffer text through C
6525 pointers.
6526
6527 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6528 decrement the inhibition flag, instead of just setting or
6529 resetting it.
6530
ba93a187
PE
65312012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6532
6533 Remove obsolete '#define static' cruft.
6534 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6535 This #undef was "temporary" in 2000; it is no longer needed
6536 now that '#define static' has gone away.
6537 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6538 (gray_bitmap_bits): Remove; no longer needed.
6539 All uses replaced with definiens.
6540 * xterm.c: Include "bitmaps/gray.xbm".
6541
9e4bf381
PE
65422012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6543
6544 Clean up __executable_start, monstartup when --enable-profiling.
6545 The following changes affect the code only when profiling.
6546 * dispnew.c (__executable_start): Rename from safe_bcopy.
6547 Define only on platforms that need it.
6548 * emacs.c: Include <sys/gmon.h> when profiling.
6549 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6550 (__executable_start): Remove decl, since lisp.h does it now.
6551 (safe_bcopy): Remove decl; no longer has that name.
6552 (main): Coalesce #if into single bit of code, for simplicity.
6553 Cast pointers to uintptr_t, since standard libraries want integers
6554 and not pointers.
6555 * lisp.h (__executable_start): New decl.
6556
32d72c2f
GM
65572012-05-31 Glenn Morris <rgm@gnu.org>
6558
6559 * image.c (Fimagemagick_types): Doc fix.
6560
baac5bc7
JM
65612012-05-30 Jim Meyering <meyering@redhat.com>
6562
6563 * callproc.c (Fcall_process_region): Include directory component
6564 in mkstemp error message (Bug#11586).
6565
72cb32cf
PE
65662012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6567
6568 * alloc.c, lisp.h (make_pure_vector): Now static.
6569
61b108cc
SM
65702012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6571
6572 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6573 Move to byte-run.el.
6574 (Fautoload): Do the hash-doc more carefully.
6575 * data.c (Fdefalias): Purify definition, except for keymaps.
6576 (Qdefun): Move from eval.c.
6577 * lisp.h (Qdefun): Remove.
6578 * lread.c (read1): Tiny simplification.
6579
471fe23d
TN
65802012-05-29 Troels Nielsen <bn.troels@gmail.com>
6581
934f3f58 6582 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
6583 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6584 Bug#9642, but explicitly check that the buffer the overlay would
6585 be moved to is live and rearrange lines to make sure that errors
6586 will not put the overlay in an inconsistent state.
6587 (Fdelete_overlay): Cosmetics.
6588
85d0efd1
EZ
65892012-05-28 Eli Zaretskii <eliz@gnu.org>
6590
6591 * w32term.c (my_bring_window_to_top): New function.
6592 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
6593 could be different from the original one.
6594 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
6595 (Bug#11513)
6596
6597 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6598 by calling BringWindowToTop.
6599
6600 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6601 (WM_EMACS_END): Increase by one.
6602
da92a98c
PE
66032012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6604
6605 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6606 This avoids undefined behavior that might cause the eassert
6607 to not catch an out-of-range value.
6608
74d1f848
JB
66092012-05-28 Juanma Barranquero <lekktu@gmail.com>
6610
6611 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6612 Update dependencies.
6613
9e1a06fc
EZ
66142012-05-27 Eli Zaretskii <eliz@gnu.org>
6615
6616 * bidi.c (bidi_mirror_char): Fix last change.
6617
f3dd7312
AS
66182012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6619
6620 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6621 when referring to sectname field in printf format.
6622
81899c91
PE
66232012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6624
57b81a9f
PE
6625 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6626 Only r_alloc_inhibit_buffer_relocation needed to be added;
6627 the others were already declared.
6628
81899c91
PE
6629 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6630 before checking whether it's out of range. Put the check inside
6631 eassert. See
6632 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6633
33017faf 66342012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
6635
6636 * callproc.c (Fcall_process): Restore a line that was accidentally
6637 commented out in the 2011-02-13 change (bug#11547).
6638
33017faf 66392012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
6640
6641 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6642 defined on ralloc.c.
6643
6644 * buffer.c [REL_ALLOC]: Remove prototypes of
6645 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6646 they are now on lisp.h.
6647
6648 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6649
6650 * search.c (search_buffer): Use it to inhibit relocation of buffer
6651 text while re_search_2 is doing its job, because re_search_2 is
6652 passed C pointers to buffer text. (Bug#11519)
6653
23415acf
EZ
6654 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6655 Update value to 24.
6656
44e27368
EZ
6657 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6658 state after an additional call to move_it_in_display_line_to, keep
6659 the values of it->max_ascent and it->max_descent found for the
6660 entire line.
6661 (pos_visible_p): Revert the comparison against bottom_y to what it
6662 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6663 (Bug#11464)
6664
c1892f11
PE
66652012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6666
6667 Fix coding-related core dumps with gcc -ftrapv.
6668 The code was computing A - B, where A and B are pointers, and B is
6669 random garbage. This can lead to core dumps on platforms that
6670 have special pointer registers, and it also leads to core dumps on
6671 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6672 A - B only when B is initialized properly.
6673 * coding.c (coding_set_source, coding_set_destination): Return void.
6674 (coding_change_source, coding_change_destinations): New functions,
6675 with the old behaviors of coding_set_source and coding_set_destination.
6676 All callers that need an offset changed to use these new functions.
6677
eb7afdad
GM
66782012-05-26 Glenn Morris <rgm@gnu.org>
6679
6680 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6681
f12fdf02
EZ
66822012-05-26 Eli Zaretskii <eliz@gnu.org>
6683
53a63be6 6684 Extend mouse support on W32 text-mode console.
61b108cc
SM
6685 * xdisp.c (draw_row_with_mouse_face):
6686 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 6687
eb3f6f01 6688 * w32console.c: Include window.h.
61b108cc
SM
6689 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6690 New functions.
eb3f6f01
EZ
6691 (initialize_w32_display): Initialize mouse-highlight data.
6692
53a63be6
EZ
6693 * w32inevt.c: Include termchar.h and window.h.
6694 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6695 moves, call note_mouse_highlight. If help_echo changed, call
6696 gen_help_event to produce help-echo message in the echo area.
6697 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6698 highlight info.
6699
4cfd81f6
PE
67002012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6701
6702 * lread.c (read1): Simplify slightly to avoid an overflow warning
6703 with GCC 4.7.0 on x86-64.
6704
4446092a
EZ
67052012-05-26 Eli Zaretskii <eliz@gnu.org>
6706
6707 * bidi.c (bidi_mirror_char): Revert last change: an int is
6708 definitely wide enough here.
6709
42b2a986 67102012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 6711
42b2a986 6712 Fix integer width and related bugs (Bug#9874).
eb106a49 6713 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
6714 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6715 (string_bytes, check_sblock, allocate_string_data):
6716 (compact_small_strings, Fmake_bool_vector, make_string)
6717 (make_unibyte_string, make_multibyte_string)
6718 (make_string_from_bytes, make_specified_string)
6719 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6720 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6721 (mark_vectorlike):
6722 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6723 (allocate_pseudovector):
6724 Use int, not EMACS_INT, where int is wide enough.
6725 (inhibit_garbage_collection, Fgarbage_collect):
6726 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6727 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6728 int might not be wide enough.
6729 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6730 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6731 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6732 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6733 (bidi_level_of_next_char, bidi_move_to_visually_next):
6734 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6735 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6736 (Fkill_buffer, Fset_buffer_major_mode)
6737 (advance_to_char_boundary, Fbuffer_swap_text)
6738 (Fset_buffer_multibyte, overlays_at, overlays_in)
6739 (overlay_touches_p, struct sortvec, record_overlay_string)
6740 (overlay_strings, recenter_overlay_lists)
6741 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6742 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6743 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6744 (Foverlay_recenter, last_overlay_modification_hooks_used)
6745 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6746 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
6747 (validate_region): Omit unnecessary test for b <= e,
6748 since that's guaranteed by the previous test.
d311d28c
PE
6749 (adjust_overlays_for_delete): Avoid pos + length overflow.
6750 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6751 (report_overlay_modification):
6752 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6753 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6754 Omit pointer cast, which isn't needed anyway, and doesn't work
6755 after the EMACS_INT -> ptrdiff_t change.
02481186 6756 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
6757 * buffer.h: Adjust decls to match defn changes elsewhere.
6758 (struct buffer_text, struct buffer):
6759 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6760 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
6761 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6762 not int, to avoid needless 32-bit limit on 64-bit hosts.
6763 (exec_byte_code): Use tighter memory-full test, one that checks
6764 for alloca overflow. Don't compute the address of the object just
6765 before an array, as that's not portable. Use EMACS_INT, not
6766 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
6767 * callint.c (Fcall_interactively):
6768 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6769 * callproc.c (call_process_kill, Fcall_process):
6770 Don't assume pid_t fits into an Emacs fixnum.
6771 (call_process_cleanup, Fcall_process, child_setup):
6772 Don't assume pid_t fits into int.
6773 (call_process_cleanup, Fcall_process, delete_temp_file)
6774 (Fcall_process_region):
6775 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6776 (Fcall_process): Simplify handling of volatile integers.
6777 Use int, not EMACS_INT, where int will do.
6778 * casefiddle.c (casify_object, casify_region, operate_on_word)
6779 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6780 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6781 (casify_object): Avoid integer overflow when overallocating buffer.
6782 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 6783 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
6784 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6785 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6786 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6787 integers are now checked earlier. All uses replaced with XINT.
6788 (ccl_driver):
6789 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6790 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
6791 (ccl_driver, Fregister_code_conversion_map):
6792 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
6793 (resolve_symbol_ccl_program): Check that vector header is in range.
6794 Always copy the vector, so that we can check its contents reliably
6795 now rather than having to recheck each instruction as it's being
6796 executed. Check that vector words fit in 'int'.
6797 (ccl_get_compiled_code, Fregister_ccl_program)
6798 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6799 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6800 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6801 contents are in range.
6802 (Fccl_execute_on_string): Check that status is in range.
6803 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6804 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6805 Accept and return EMACS_INT, not int, because callers can pass values
6806 out of 'int' range.
6807 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6808 (multibyte_chars_in_text, parse_str_as_multibyte)
6809 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6810 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6811 (string_escape_byte8, Fget_byte):
6812 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 6813 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
6814 avoid mishandling large integers.
6815 * character.h: Adjust decls to match defn changes elsewhere.
6816 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6817 (Ffind_charset_region):
6818 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6819 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6820 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 6821 Don't assume fixnum fits in int.
d311d28c
PE
6822 (load_charset_map_from_vector, Fmap_charset_chars):
6823 Remove now-unnecessary CHECK_NATNUMs.
6824 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
6825 Don't rely on undefined behavior with signed left shift overflow.
6826 Don't assume unsigned int fits into fixnum, or that fixnum fits
6827 into unsigned int. Don't require max_code to be a valid fixnum;
6828 that's not true for gb10830 4-byte on a 32-bit host. Allow
6829 invalid_code to be a cons, for the same reason. Require code_offset
6830 to be a character. Avoid int overflow if max_char is close
6831 to INT_MAX.
6832 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6833 this is intended anyway and avoids some undefined behavior.
6834 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6835 INDEX_TO_CODE_POINT, as that's what it expects.
6836 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
6837 * charset.h (DECODE_CHAR): Return int, not unsigned;
6838 this is what was intended anyway, and it avoids undefined behavior.
6839 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6840 integer-overflow issues.
6841 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6842 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6843 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
6844 * chartab.c (Fmake_char_table, Fset_char_table_range)
6845 (uniprop_get_decoder, uniprop_get_encoder):
6846 Don't assume fixnum fits in int.
6847 * cmds.c (move_point): New function, that does the gist of
6848 Fforward_char and Fbackward_char, but does so while checking
6849 for integer overflow more accurately.
c96e5d6a 6850 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
6851 (Fforward_line, Fend_of_line, internal_self_insert)
6852 (internal_self_insert):
6853 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6854 Fix a FIXME, by checking for integer overflow when calculating
6855 target_clm and actual_clm.
6856 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 6857 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
6858 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6859 (coding_alloc_by_making_gap, alloc_destination)
6860 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6861 (encode_coding_utf_16, detect_coding_emacs_mule)
6862 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6863 (detect_coding_iso_2022, decode_coding_iso_2022)
6864 (encode_invocation_designation, encode_designation_at_bol)
6865 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6866 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6867 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6868 (encode_coding_ccl, encode_coding_raw_text)
6869 (detect_coding_charset, decode_coding_charset)
6870 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6871 (produce_composition, produce_charset, produce_annotation)
6872 (decode_coding, handle_composition_annotation)
6873 (handle_charset_annotation, consume_chars, decode_coding_gap)
6874 (decode_coding_object, encode_coding_object, detect_coding_system)
6875 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6876 (code_convert_region, code_convert_string)
8f50130c
PE
6877 (Fdefine_coding_system_internal)
6878 (coding_set_source, coding_set_destination):
d311d28c
PE
6879 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6880 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6881 (Fdefine_coding_system_internal):
6882 Don't assume fixnums fit in int.
6883 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 6884 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
6885 (Funencodable_char_position, Fcheck_coding_systems_region)
6886 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 6887 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 6888 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 6889 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 6890 Don't access memory outside of the args array.
d311d28c 6891 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
6892 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6893 result of ENCODE_CHAR.
d311d28c
PE
6894 * coding.h: Adjust decls to match defn changes elsewhere.
6895 (struct coding_system):
6896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6897 * composite.c (get_composition_id, find_composition)
6898 (run_composition_function, update_compositions)
6899 (compose_text, composition_gstring_put_cache)
6900 (composition_gstring_p, composition_gstring_width)
6901 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6902 (composition_compute_stop_pos, composition_reseat_it)
6903 (composition_update_it, struct position_record)
6904 (find_automatic_composition, composition_adjust_point)
6905 (Fcomposition_get_gstring, Ffind_composition_internal):
6906 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6907 (update_compositions):
6908 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6909 * composite.h: Adjust decls to match defn changes elsewhere.
6910 (struct composition):
6911 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6912 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6913 Do not attempt to compute the address of the object just before a
6914 buffer; this is not portable.
6915 (Faref, Faset):
6916 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6917 (Faset): Use int, not EMACS_INT, where int is wide enough.
6918 (Fstring_to_number): Don't assume fixnums fit in int.
6919 (Frem): Don't assume arg is nonnegative.
6920 * dbusbind.c (xd_append_arg): Check for integers out of range.
6921 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 6922 (extract_signed, extract_unsigned): New functions.
243e0530
PE
6923 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6924 (xd_get_connection_references): Return ptrdiff_t, not int.
6925 All uses changed.
6926 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6927 (xd_read_message_1):
6928 Use int, not unsigned, where the dbus API uses int.
6929 (Fdbus_message_internal): Don't overflow mtype.
6930 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
6931 * dired.c (directory_files_internal, file_name_completion, scmp)
6932 (file_name_completion_stat):
6933 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6934 (file_name_completion): Don't overflow matchcount.
6935 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
6936 * dispextern.h: Adjust decls to match defn changes elsewhere.
6937 (struct text_pos, struct glyph, struct bidi_saved_info)
6938 (struct bidi_string_data, struct bidi_it, struct composition_it)
6939 (struct it):
6940 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6941 (struct display_pos, struct composition_it, struct it):
6942 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6943 * dispnew.c (increment_matrix_positions)
6944 (increment_row_positions, mode_line_string)
6945 (marginal_area_string):
6946 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 6947 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
6948 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6949 (duration_to_sec_usec): New function, to check for overflow better.
6950 (Fsleep_for, sit_for): Use it.
6951 * doc.c (get_doc_string, store_function_docstring):
6952 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6953 (get_doc_string, Fsnarf_documentation):
6954 Use int, not EMACS_INT, where int is wide enough.
6955 (get_doc_string):
6956 Use SAFE_ALLOCA, not alloca.
6957 Check for overflow when converting EMACS_INT to off_t.
6958 * doprnt.c (doprnt):
6959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6960 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6961 Don't assume uid_t fits into fixnum.
6962 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6963 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6964 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6965 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6966 (general_insert_function)
6967 (Finsert_char, make_buffer_string, make_buffer_string_both)
6968 (update_buffer_properties, Fbuffer_substring)
6969 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
6970 (Fsubst_char_in_region, check_translation)
6971 (Ftranslate_region_internal, save_restriction_restore, Fformat)
6972 (transpose_markers, Ftranspose_regions):
6973 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6974 (clip_to_bounds): Move to lisp.h as an inline function).
6975 (Fconstrain_to_field): Don't assume integers are nonnegative.
6976 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
6977 (Fsubst_char_in_region, Fsave_restriction):
6978 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6979 (Femacs_pid): Don't assume pid_t fits into fixnum.
6980 (lo_time): Use int, not EMACS_INT, when int suffices.
6981 (lisp_time_argument): Check for usec out of range.
6982 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
6983 (Fuser_login_name, Fuser_full_name): Signal an error
6984 if a uid argument is out of range, rather than relying on
6985 undefined behavior.
c8d5c857
PE
6986 (Fformat_time_string): Remove now-unnecessary check.
6987 lisp_time_argument checks for out-of-range usec now.
243e0530 6988 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
6989 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
6990 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
6991 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
6992 (init_cmdargs, Fdump_emacs):
6993 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6994 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
6995 the bottom (typically) 32 bits of the fixnum.
6996 * eval.c (specpdl_size, call_debugger):
6997 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6998 (when_entered_debugger, Fbacktrace_debug):
6999 Don't assume fixnum can fit in int.
7000 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7001 the object just before a buffer; this is not portable.
7002 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7003 (grow_specpdl, unbind_to):
7004 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7005 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7006 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 7007 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
7008 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7009 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7010 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7011 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7012 (a_write, e_write):
7013 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7014 (Fcopy_file, non_regular_nbytes, read_non_regular)
7015 (Finsert_file_contents):
7016 Use int, not EMACS_INT, where int is wide enough.
7017 (READ_BUF_SIZE): Verify that it fits in int.
7018 (Finsert_file_contents): Check that counts are in proper range,
7019 rather than assuming fixnums fit into ptrdiff_t etc.
7020 Don't assume fixnums fit into int.
125b3835 7021 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
7022 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7023 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
7024 (string_char_to_byte, string_byte_to_char)
7025 (string_make_multibyte, string_to_multibyte)
7026 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7027 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7028 (substring_both, Fdelete, internal_equal, Ffillarray)
7029 (Fclear_string, mapcar1)
7030 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7031 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7032 (larger_vector, make_hash_table, maybe_resize_hash_table)
7033 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7034 (Fmaphash, secure_hash):
7035 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7036 (concat): Check for string index and length overflow.
7037 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7038 (Frequire):
7039 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7040 (larger_vector): New API (vec, incr_min, size_max) replaces old
7041 one (vec, new_size, init). This catches size overflow.
7042 INIT was removed because it was always Qnil.
7043 All callers changed.
7044 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7045 the upper bound on a hash table index size.
7046 (make_hash_table, maybe_resize_hash_table): Use it.
7047 (secure_hash): Computer start_byte and end_byte only after
7048 they're known to be in ptrdiff_t range.
7049 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7050 (Ffont_get_glyphs, Ffont_at):
7051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7052 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7053 (Flist_fonts, Fopen_font):
7054 Don't assume fixnum can fit in int.
7055 (check_gstring): Don't assume index can fit in int.
7056 (font_match_p): Check that fixnum is a character, not a nonnegative
7057 fixnum, since the later code needs to stuff it into an int.
7058 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7059 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7060 conversion overflow issues.
7061 (Fopen_font): Check for integer out of range.
7062 (Ffont_get_glyphs): Don't assume index can fit in int.
7063 * font.h: Adjust decls to match defn changes elsewhere.
7064 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7065 integer overflow.
7066 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7067 printmax_t, where ptrdiff_t is wide enough.
7068 (Finternal_char_font):
7069 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7070 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7071 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7072 (Fset_frame_position, x_set_frame_parameters)
7073 (x_set_line_spacing, x_set_border_width)
7074 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7075 Check that fixnums are in proper range for system types.
7076 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7077 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7078 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7079 Use SAFE_ALLOCA_LISP, not alloca.
7080 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7081 intptr_t is wide enough.
7082 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7083 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7084 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7085 Check for fixnum out of range.
7086 * ftfont.c (ftfont_list): Don't assume index fits in int.
7087 Check that fixnums are in proper range for system types.
7088 (ftfont_shape_by_flt):
7089 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
7090 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7091 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7092 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7093 Check that fixnums are in proper range for system types.
7094 * gnutls.h: Adjust decls to match defn changes elsewhere.
7095 * gtkutil.c (xg_dialog_run):
7096 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7097 (update_frame_tool_bar):
7098 Check that fixnums are in proper range for system types.
7099 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 7100 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
7101 * indent.c (last_known_column, last_known_column_point):
7102 (current_column_bol_cache):
7103 (skip_invisible, current_column, check_display_width):
7104 (check_display_width, scan_for_column, current_column_1)
7105 (Findent_to, Fcurrent_indentation, position_indentation)
7106 (indented_beyond_p, Fmove_to_column, compute_motion):
7107 (Fcompute_motion, Fvertical_motion):
7108 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7109 (last_known_column_modified): Use EMACS_INT, not int.
7110 (check_display_width):
7111 (Fcompute_motion):
7112 Check that fixnums and floats are in proper range for system types.
7113 (compute_motion): Don't assume index or fixnum fits in int.
7114 (compute_motion, Fcompute_motion):
7115 Use int, not EMACS_INT, when it is wide enough.
7116 (vmotion): Omit local var start_hpos that is always 0; that way
7117 we don't need to worry about overflow in expressions involving it.
7118 * indent.h: Adjust decls to match defn changes elsewhere.
7119 (struct position):
7120 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7121 Use int, not EMACS_INT, where int is wide enough.
7122 Remove unused members ovstring_chars_done and tab_offset;
7123 all uses removed.
7124 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7125 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7126 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7127 (make_gap, copy_text, insert, insert_and_inherit)
7128 (insert_before_markers, insert_before_markers_and_inherit)
7129 (insert_1, count_combining_before, count_combining_after)
7130 (insert_1_both, insert_from_string)
7131 (insert_from_string_before_markers, insert_from_string_1)
7132 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7133 (adjust_after_replace, adjust_after_insert, replace_range)
7134 (replace_range_2, del_range, del_range_1, del_range_byte)
7135 (del_range_both, del_range_2, modify_region)
7136 (prepare_to_modify_buffer, signal_before_change)
7137 (signal_after_change, Fcombine_after_change_execute):
7138 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7139 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7140 (balance_an_interval, split_interval_right, split_interval_left)
7141 (find_interval, next_interval, update_interval)
7142 (adjust_intervals_for_insertion, delete_node, delete_interval)
7143 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7144 (static_offset_intervals, offset_intervals)
7145 (merge_interval_right, merge_interval_left, make_new_interval)
7146 (graft_intervals_into_buffer, temp_set_point_both)
7147 (temp_set_point, set_point, adjust_for_invis_intang)
7148 (set_point_both, move_if_not_intangible, get_property_and_range)
7149 (get_local_map, copy_intervals, copy_intervals_to_string)
7150 (compare_string_intervals, set_intervals_multibyte_1):
7151 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7152 * intervals.h: Adjust decls to match defn changes elsewhere.
7153 (struct interval):
7154 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7155 * keyboard.c (this_command_key_count, this_single_command_key_start)
7156 (before_command_key_count, before_command_echo_length, echo_now)
7157 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7158 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7159 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7160 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7161 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7162 (last_non_minibuf_size, last_point_position, echo_truncate)
7163 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7164 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7165 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7166 (stuff_buffered_input):
7167 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7168 (last_auto_save, command_loop_1, read_char):
7169 Use EMACS_INT, not int, to avoid integer overflow.
7170 (record_char): Avoid overflow in total_keys computation.
7171 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7172 * keyboard.h: Adjust decls to match defn changes elsewhere.
7173 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7174 (Fkey_description, Fdescribe_vector, Flookup_key):
7175 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7176 (click_position): New function, to check that positions are in range.
7177 (Fcurrent_active_maps):
7178 (describe_command):
7179 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7180 (Faccessible_keymaps, Fkey_description):
7181 (preferred_sequence_p):
7182 Don't assume fixnum can fit into int.
7183 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7184 Check for integer overflow in size calculations.
7185 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7186 avoid mishandling large integers.
7187 * lisp.h: Adjust decls to match defn changes elsewhere.
7188 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7189 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7190 (struct Lisp_Marker):
7191 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7192 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
7193 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7194 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7195 All callers changed.
7196 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7197 Assume the arg has valid form, since it always does.
7198 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7199 unsigned integer system type.
7200 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7201 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7202 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7203 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7204 (duration_to_sec_usec): New decl.
7205 * lread.c (read_from_string_index, read_from_string_index_byte)
7206 (read_from_string_limit, readchar, unreadchar, openp)
7207 (read_internal_start, read1, oblookup):
7208 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7209 (Fload, readevalloop, Feval_buffer, Feval_region):
7210 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7211 (openp): Check for out-of-range argument to 'access'.
7212 (read1): Use int, not EMACS_INT, where int is wide enough.
7213 Don't assume fixnum fits into int.
6efdadfd 7214 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
7215 (read_filtered_event): Use duration_to_sec_usec
7216 to do proper overflow checking on durations.
d311d28c
PE
7217 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7218 in size calculation.
7219 (Fexecute_kbd_macro):
7220 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7221 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7222 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7223 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7224 (set_marker_both, set_marker_restricted_both, marker_position)
7225 (marker_byte_position, Fbuffer_has_markers_at):
7226 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7227 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 7228 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
7229 It now merely ensures that the menu is large enough, without
7230 necessarily growing it, as this avoids some integer overflow issues.
7231 All callers changed.
7232 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7233 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7234 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7235 Use SAFE_ALLOCA_LISP, not alloca.
7236 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7237 to EMACS_INT. Check that fixnums are in proper range for system types.
7238 * minibuf.c (minibuf_prompt_width, string_to_object)
7239 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7240 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7241 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7242 (get_minibuffer, read_minibuf_unwind):
7243 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7244 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7245 this simplifies overflow checking. All callers changed.
7246 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7247 (Ftest_completion):
7248 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7249 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7250 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7251 Check that fixnums are in proper range for system types.
7252 (Fx_create_frame, Fx_show_tip):
7253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7254 * nsfont.m (ns_findfonts, nsfont_list_family):
7255 Don't assume fixnum fits in long.
7256 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7257 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7258 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7259 wide enough.
17fdb222 7260 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
7261 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7262 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7263 (PRINTDECLARE, PRINTPREPARE):
7264 (strout, print_string):
7265 (print, print_preprocess, print_check_string_charset_prop)
7266 (print_object):
7267 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7268 (PRINTDECLARE):
7269 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7270 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7271 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 7272 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 7273 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
7274 (print_error_message): Use SAFE_ALLOCA, not alloca.
7275 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
7276 (print_depth, new_backquote_output, print_number_index):
7277 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
7278 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7279 (Fset_process_window_size, Fformat_network_address)
7280 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 7281 (sigchld_handler):
d311d28c 7282 Check that fixnums are in proper range for system types.
d44287d4 7283 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
7284 Check for process-ids out of pid_t range rather than relying on
7285 undefined behavior.
e4d81efc 7286 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
7287 (Fformat_network_address, read_process_output, send_process)
7288 (Fprocess_send_region, status_notify):
7289 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7290 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7291 (wait_reading_process_output, read_process_output, exec_sentinel):
7292 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7293 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7294 (Faccept_process_output): Use duration_to_sec_usec to do proper
7295 overflow checking on durations.
dde14581
PE
7296 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7297 Don't assume pid_t fits in int.
02481186
PE
7298 * process.h (struct Lisp_Process): Members tick and update_tick
7299 are now of type EMACS_INT, not int.
b62b53e8
PE
7300 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7301 configured --with-wide-int.
d311d28c
PE
7302 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7303 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7304 * search.c (looking_at_1, string_match_1):
7305 (fast_string_match, fast_c_string_match_ignore_case)
7306 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7307 (scan_newline, find_before_next_newline, search_command)
7308 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7309 (set_search_regs, wordify):
7310 (Freplace_match):
7311 (Fmatch_data):
7312 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7313 (string_match_1, search_buffer, set_search_regs):
7314 (Fmatch_data):
7315 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7316 (wordify): Check for overflow in size calculation.
7317 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7318 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7319 Check that fixnums are in proper range for system types.
7320 * sound.c (struct sound_device)
7321 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7322 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7323 (Fplay_sound_internal):
7324 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 7325 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
7326 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7327 (Fparse_partial_sexp):
7328 Don't assume fixnums can fit in int.
7329 (struct lisp_parse_state, find_start_pos, find_start_value)
7330 (find_start_value_byte, find_start_begv)
7331 (update_syntax_table, char_quoted, dec_bytepos)
7332 (find_defun_start, prev_char_comend_first, back_comment):
7333 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7334 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7335 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7336 (Finternal_describe_syntax_value): Check that match_lisp is a
7337 character, not an integer, since the code stuffs it into int.
7338 (scan_words, scan_sexps_forward):
7339 Check that fixnums are in proper range for system types.
7340 (Fforward_word):
7341 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7342 (scan_sexps_forward):
7343 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7344 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7345 * syntax.h: Adjust decls to match defn changes elsewhere.
7346 (struct gl_state_s):
7347 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
7348 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7349 MOST_POSITIVE_FIXNUM.
d311d28c
PE
7350 * sysdep.c (wait_for_termination_1, wait_for_termination)
7351 (interruptible_wait_for_termination, mkdir):
7352 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7353 (emacs_read, emacs_write):
7354 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
7355 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7356 and double all fit in int.
d311d28c
PE
7357 * term.c (set_tty_color_mode):
7358 Check that fixnums are in proper range for system types.
7359 * termhooks.h (struct input_event):
7360 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7361 * textprop.c (validate_interval_range, interval_of)
7362 (Fadd_text_properties, set_text_properties_1)
7363 (Fremove_text_properties, Fremove_list_of_text_properties)
7364 (Ftext_property_any, Ftext_property_not_all)
7365 (copy_text_properties, text_property_list, extend_property_ranges)
7366 (verify_interval_modification):
7367 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7368 (Fnext_single_char_property_change)
7369 (Fprevious_single_char_property_change):
7370 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
7371 (copy_text_properties):
7372 Check for integer overflow in index calculation.
d311d28c
PE
7373 * undo.c (last_boundary_position, record_point, record_insert)
7374 (record_delete, record_marker_adjustment, record_change)
7375 (record_property_change):
7376 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7377 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7378 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7379 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7380 (Fx_hide_tip, Fx_file_dialog):
7381 * w32menu.c (set_frame_menubar):
7382 Use ptrdiff_t, not int, for consistency with rest of code.
7383 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7384 (select_window, Fdelete_other_windows_internal)
7385 (window_scroll_pixel_based, window_scroll_line_based)
7386 (Frecenter, Fset_window_configuration):
7387 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7388 (Fset_window_hscroll, run_window_configuration_change_hook)
7389 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 7390 (Fscroll_other_window, Frecenter):
d311d28c
PE
7391 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7392 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7393 Don't assume fixnum fits in int.
7394 (Fset_window_scroll_bars):
7395 Check that fixnums are in proper range for system types.
7396 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7397 (string_pos, c_string_pos, number_of_chars, init_iterator)
7398 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7399 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7400 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
7401 (face_before_or_after_it_pos, handle_invisible_prop)
7402 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
7403 (display_prop_intangible_p, string_buffer_position_lim)
7404 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7405 (get_overlay_strings_1, get_overlay_strings)
7406 (iterate_out_of_display_property, forward_to_next_line_start)
7407 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7408 (get_next_display_element, set_iterator_to_next)
7409 (get_visually_first_element, compute_stop_pos_backwards)
7410 (handle_stop_backwards, next_element_from_buffer)
7411 (move_it_in_display_line_to, move_it_in_display_line)
7412 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7413 (add_to_log, message_dolog, message_log_check_duplicate)
7414 (message2, message2_nolog, message3, message3_nolog
7415 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7416 (current_message_1, truncate_echo_area, truncate_message_1)
7417 (set_message, set_message_1, store_mode_line_noprop)
7418 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7419 (text_outside_line_unchanged_p, check_point_in_composition)
7420 (reconsider_clip_changes)
7421 (redisplay_internal, set_cursor_from_row, try_scrolling)
7422 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7423 (redisplay_window, find_last_unchanged_at_beg_row)
7424 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7425 (trailing_whitespace_p, find_row_edges, display_line)
7426 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7427 (display_mode_element, store_mode_line_string)
7428 (pint2str, pint2hrstr, decode_mode_spec)
7429 (display_count_lines, display_string, draw_glyphs)
7430 (x_produce_glyphs, x_insert_glyphs)
7431 (rows_from_pos_range, mouse_face_from_buffer_pos)
7432 (fast_find_string_pos, mouse_face_from_string_pos)
7433 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7434 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7435 (safe_call, init_from_display_pos, handle_fontified_prop)
7436 (handle_single_display_spec, load_overlay_strings)
7437 (with_echo_area_buffer, setup_echo_area_for_printing)
7438 (display_echo_area, echo_area_display)
7439 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7440 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
7441 (redisplay_window, dump_glyph_row, display_mode_line)
7442 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 7443 (handle_display_spec, display_prop_string_p):
d311d28c
PE
7444 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7445 (handle_single_display_spec, build_desired_tool_bar_string)
7446 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7447 (get_specified_cursor_type):
7448 Check that fixnums are in proper range for system types.
7449 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7450 (Flookup_image_map):
7451 Don't assume fixnums fit in int.
7452 (compare_overlay_entries):
7453 Avoid mishandling comparisons due to subtraction overflow.
7454 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7455 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7456 (handle_tool_bar_click):
7457 Use int, not unsigned, since we prefer signed and the signedness
7458 doesn't matter here.
7459 (get_next_display_element, next_element_from_display_vector):
7460 Use int, not EMACS_INT, when int is wide enough.
7461 (start_hourglass): Use duration_to_sec_usec to do proper
7462 overflow checking on durations.
7463 * xfaces.c (Fbitmap_spec_p):
7464 Check that fixnums are in proper range for system types.
7465 (compare_fonts_by_sort_order):
7466 Avoid mishandling comparisons due to subtraction overflow.
7467 (Fx_family_fonts, realize_basic_faces):
7468 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7469 (Fx_family_fonts):
7470 Don't assume fixnum fits in int.
7471 Use SAFE_ALLOCA_LISP, not alloca.
7472 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7473 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7474 (face_at_buffer_position, face_for_overlay_string)
7475 (face_at_string_position):
7476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7477 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7478 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7479 (Fx_show_tip):
7480 Check that fixnums are in proper range for system types.
7481 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7482 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7483 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7484 (Fx_change_window_property): Don't assume fixnums fit in int.
7485 * xfont.c (xfont_chars_supported):
7486 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7487 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7488 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7489 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7490 * xml.c (parse_region):
7491 * xrdb.c (magic_file_p):
7492 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7493 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7494 (x_get_local_selection, x_reply_selection_request)
7495 (x_handle_selection_request, wait_for_property_change):
7496 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7497 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7498 short is wide enough.
7499 (x_send_client_event): Don't assume fixnum fits in int.
7500 * xterm.c (x_x_to_emacs_modifiers):
7501 Don't assume EMACS_INT overflows nicely into int.
7502 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7503 may come from Lisp.
7504 (handle_one_xevent): NATNUMP can eval its arg twice.
7505 (x_connection_closed):
7506 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7507 * xterm.h: Adjust decls to match defn changes elsewhere.
7508 (struct scroll_bar): Use struct vectorlike_header
7509 rather than rolling our own approximation.
7510 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7511
c6574eb5
GM
75122012-05-25 Glenn Morris <rgm@gnu.org>
7513
7514 * lisp.mk (lisp): Update for more files being compiled now.
7515
e8d32c7e
SM
75162012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7517
48def666
SM
7518 * lread.c: Remove `read_pure' which makes no difference.
7519 (read_pure): Remove var.
7520 (unreadpure): Remove function.
7521 (readevalloop): Don't call read_list with -1 flag.
7522 (read1, read_vector): Don't test read_pure any more.
7523 (read_list): Simplify.
7524
e8d32c7e
SM
7525 * fileio.c, character.h: Minor style tweaks.
7526
4b2addb7
DA
75272012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7528
7529 * window.h (clip_changed): Remove useless declaration.
7530
584461b2
JB
75312012-05-22 Juanma Barranquero <lekktu@gmail.com>
7532
7533 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7534 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7535
34374650
PE
75362012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7537
7538 Remove src/m/*.
7539 This directory predates autoconf and is no longer needed nowadays.
7540 Move its few remaining bits of functionality to where they're needed.
7541 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7542 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7543 * m/template.h: Remove.
7544 * Makefile.in (M_FILE): Remove. All uses removed.
7545 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7546 * lisp.h (USE_LSB_TAG):
7547 * mem-limits.h (EXCEEDS_LISP_PTR):
7548 Use VAL_MAX, not VALBITS, in #if.
7549 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7550 (EMACS_UINT): Define unconditionally now.
7551 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7552 (BITS_PER_EMACS_INT): New constants, replacing
7553 what used to be in config.h, but not useful in #if.
7554 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7555 define them any more.
7556 (VAL_MAX): New macro.
7557 (VALMASK): Use it.
7558 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7559 BITS_PER_EMACS_INT, in #if.
7560 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7561 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7562 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7563 * s/ms-w32.h (DATA_START):
7564 Move here from removed file m/intel386.h.
7565 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7566 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7567
261cb4bb
PE
75682012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7569
7570 Assume C89 or later.
7571 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7572 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7573 (xrealloc):
7574 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7575 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7576 * textprop.c, tparam.c (NULL): Remove.
7577 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7578 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7579 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7580 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7581 * xterm.c (input_signal_count): Assume volatile works.
7582
ff23cd9f
KB
75832012-05-21 Ken Brown <kbrown@cornell.edu>
7584
7585 * xgselect.c (xg_select): Fix first argument in call to 'select'
7586 (bug#11508).
7587
1b170bc6
KB
75882012-05-20 Ken Brown <kbrown@cornell.edu>
7589
7590 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 7591 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 7592
b2f4d39f
KB
75932012-05-19 Ken Brown <kbrown@cornell.edu>
7594
7595 * xfns.c (x_in_use): Remove `static' qualifier.
7596 * xterm.h (x_in_use): Declare.
7597 * xgselect.c: Include xterm.h.
7598 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7599 and `display_arg' (bug#9754).
7600
003fdae2
PE
76012012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7602
9232a6d9
PE
7603 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7604
003fdae2
PE
7605 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7606 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7607
784b56e2
EZ
76082012-05-18 Eli Zaretskii <eliz@gnu.org>
7609
7610 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7611
7612 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 7613 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
7614
7615 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7616 reference to image_cache->refcount.
7617 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7618
a0a79cde
JL
76192012-05-17 Juri Linkov <juri@jurta.org>
7620
7621 * search.c (Fword_search_regexp, Fword_search_backward)
7622 (Fword_search_forward, Fword_search_backward_lax)
7623 (Fword_search_forward_lax): Move functions to isearch.el
7624 (bug#10145, bug#11381).
7625
b0572523
PE
76262012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7627
7628 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7629
9660f5fc
SM
76302012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7631
7632 * lread.c (init_obarray): Declare Qt and Qnil as special.
7633
4374de83
GM
76342012-05-14 Glenn Morris <rgm@gnu.org>
7635
7636 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 7637 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 7638
dc44c39a
PE
76392012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7640
078c97cb
PE
7641 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7642
dc44c39a
PE
7643 * unexaix.c: Port to more-recent AIX compilers.
7644 (report_error, report_error_1, make_hdr, copy_sym)
7645 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7646 Make arguments const char *, not char *, to avoid violations of C
7647 standard and to fix some AIX warnings reported by Gilles Pion.
7648
e18afed7 76492012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
7650
7651 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7652 already have overlays loaded.
7653 (handle_single_display_spec): Before returning without displaying
7654 fringe bitmap, synchronize the bidi iterator with the main display
7655 iterator, by calling iterate_out_of_display_property.
7656 (iterate_out_of_display_property): Detect buffer iteration by
7657 testing that it->string is a Lisp string.
7658 (get_next_display_element): When the current object is exhausted,
7659 and there's something on it->stack, call set_iterator_to_next to
7660 proceed with what's on the stack, instead of returning zero.
7661 (set_iterator_to_next): If called at the end of a Lisp string,
7662 proceed to consider_string_end without incrementing string
7663 position. Don't increment display vector index past the end of
7664 the display vector. (Bug#11417)
c8fb9dc6
EZ
7665 (pos_visible_p): Don't report a position visible when move_it_to
7666 stopped at the last line of window, which happens to be scanned
7667 backwards by the bidi iteration. (Bug#11464)
ac268e67 7668
e18afed7 76692012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
7670
7671 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7672 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
7673 are on a TTY, and thus unable to display on the fringes.
7674 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
7675 so we need to signal to the caller that this is a "replacing"
7676 display spec. This fixes display when the spec is invalid or we
7677 are on a TTY.
7678
e18afed7 76792012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
7680
7681 * unexaix.c (make_hdr): Fix typo in prototype.
7682 This bug broke the build on AIX. Problem reported by Gilles Pion.
7683
9d0a235a
MA
76842012-05-14 Michael Albinus <michael.albinus@gmx.de>
7685
7686 * keyboard.c (kbd_buffer_get_event): Read special events also in
7687 batch mode. (Bug#11415)
7688
9e6b06ed
GM
76892012-05-12 Glenn Morris <rgm@gnu.org>
7690
7691 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7692
c1a1d7a3
EZ
76932012-05-12 Eli Zaretskii <eliz@gnu.org>
7694
7695 * lisp.mk (lisp): Add newcomment.elc.
7696
3fe7cdc8
GM
76972012-05-12 Glenn Morris <rgm@gnu.org>
7698
7699 * Makefile.in (MKDIR_P): New, set by configure.
7700 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7701
53f7d2c0
PE
77022012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7703
7704 Remove unused function hourglass_started.
7705 * dispextern.h (hourglass_started):
7706 * w32fns.c (hourglass_started):
7707 * xdisp.c (hourglass_started): Remove.
7708
75aafb17
JB
77092012-05-10 Juanma Barranquero <lekktu@gmail.com>
7710
7711 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7712 Update dependencies.
7713
12959e8e
PE
77142012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7715
97107e2e
PE
7716 * xgselect.c (xg_select): Put maxfds+1 into a var.
7717 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7718
12959e8e
PE
7719 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7720
836d29b3
DA
77212012-05-10 Dave Abrahams <dave@boostpro.com>
7722
7723 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7724 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7725
5cb67954
MA
77262012-05-09 Michael Albinus <michael.albinus@gmx.de>
7727
7728 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7729 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7730 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7731 Initialize xd_registered_buses.
7732
3478ec45
PE
77332012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7734
b263a6b0
PE
7735 Untag more efficiently if USE_LSB_TAG.
7736 This is based on a proposal by YAMAMOTO Mitsuharu in
7737 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7738 For an admittedly artificial (nth 8000 longlist) benchmark on
7739 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7740 Emacs's overall text size by 1%.
7741 * lisp.h (XUNTAG): New macro.
7742 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7743 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7744 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7745 * eval.c (Fautoload):
7746 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7747 * frame.h (XFRAME): Use XUNTAG.
7748
3478ec45
PE
7749 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7750 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7751 Remove unportable assumptions about print widths of types like
7752 dbus_uint32_t.
7753 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7754 intptr_t when converting between pointer and integer, to avoid GCC
7755 warnings about wrong width.
7756
666b903b 77572012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
7758
7759 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7760 stack for each reader_thread, instead of defaulting to 8MB
7761 determined by the linker. This avoids failures in creating
7762 subprocesses on Windows 7, see the discussion in this thread:
7763 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7764
b120cc17
JC
77652012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7766
7767 Fix up display of the *Minibuf-0* buffer in the mini window.
7768 * keyboard.c (read_char): Don't clear the echo area if there's no
7769 message to clear.
7770 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 7771 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 7772
9a4b36f8
MA
77732012-05-07 Michael Albinus <michael.albinus@gmx.de>
7774
7775 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7776 batch mode.
7777
e5f9458f
CY
77782012-05-06 Chong Yidong <cyd@gnu.org>
7779
7780 * lisp.mk (lisp): Update.
7781
eceeb5fc 77822012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
7783
7784 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7785
71873e2b
SM
77862012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7787
7788 * data.c (PUT_ERROR): New macro.
7789 (syms_of_data): Use it. Add new error type `user-error'.
7790 * undo.c (user_error): New function.
7791 (Fprimitive_undo): Use it.
7792 * print.c (print_error_message): Adjust print style for `user-error'.
7793 * keyboard.c (user_error): New function.
7794 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7795
ab0fa4e4
PE
77962012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7797
7798 Do not limit current-time-string to years 1000..9999.
7799 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7800 (Fcurrent_time_string): Support any year that is supported by the
7801 underlying localtime representation. Don't use asctime, as it
7802 has undefined behavior for years outside the range -999..9999.
7803
7ed806a7
PE
78042012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7805
7806 Fix race conditions involving setenv, gmtime, localtime, asctime.
7807 Without this fix, interrupts could mess up code that uses these
7808 nonreentrant functions, since setting TZ invalidates existing
7809 tm_zone or tzname values, and since most of these functions return
7810 pointers to static storage.
7811 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7812 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7813 Grow the critical sections to include not just invoking
7814 localtime/gmtime, but also accessing these functions' results
7815 including their tm_zone values if any, and any related TZ setting.
7816 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
7817 so that the struct tm is saved in the critical section.
7818 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
7819 motivated by the fact that memory allocation needs to be outside
7820 the critical section.
7821
0c16dfed
DA
78222012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7823
7824 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7825 with RESET_INTERVAL.
7826
7827 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7828 Remove duplicated buffer name initialization.
7829
3f83ace8
JM
78302012-05-02 Jim Meyering <jim@meyering.net>
7831
7832 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7833
c7b8541e
JM
7834 * xfns.c (x_window): Use xstrdup (Bug#11375).
7835
90207a15 78362012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
7837
7838 * xdisp.c (pos_visible_p): If already at a newline from the
7839 display string before the 'while' loop, don't walk back the glyphs
7840 from it3.glyph_row. Solves assertion violation when the display
7841 string begins with a newline (egg.el). (Bug#11367)
7842
b593d6a9
AH
78432012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7844
7845 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7846 Move to simple.el.
7847
4737362e
GM
78482012-05-01 Glenn Morris <rgm@gnu.org>
7849
99cf43f9
GM
7850 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7851 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7852 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7853 All were removed before 23.1.
7854
9311dcff
GM
7855 * dispnew.c: Remove HAVE_LIBNCURSES test;
7856 it is always true on relevant platforms.
7857
4d5c6349
GM
7858 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7859 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7860
4737362e
GM
7861 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7862
74dd3a6b
AS
78632012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7864
7865 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7866 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7867 Remove.
7868
13c379ee
PE
78692012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7870
7871 Do not avoid creating empty evaporating overlays (Bug#9642).
7872 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7873 That is, do not delete an evaporating overlay if it becomes
7874 empty after its bounds are adjusted to fit within its buffer.
7875 This fix caused other problems, and I'm reverting it until we get
7876 to the bottom of them.
7877
a8e7d6d7 78782012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
7879
7880 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7881
a8e7d6d7 78822012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
7883
7884 * xdisp.c (pos_visible_p): If the window start position is beyond
7885 ZV, start the display from buffer beginning. Prevents assertion
7886 violation in init_iterator when the minibuffer window is scrolled
7887 via the scroll bar.
7888
7889 * window.c (window_scroll_pixel_based): Likewise.
7890
a8e7d6d7 78912012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
7892
7893 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7894
a8e7d6d7 78952012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
7896
7897 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7898 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7899
a8e7d6d7 79002012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 7901
b593d6a9
AH
7902 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7903 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 7904
1c6900d9
EZ
79052012-04-26 Eli Zaretskii <eliz@gnu.org>
7906
4c3fa1d9
EZ
7907 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7908 display element, check also the underlying string or buffer
7909 character. (Bug#11341)
7910
1c6900d9
EZ
7911 * w32menu.c: Include w32heap.h.
7912 (add_menu_item): If the call to AppendMenuW (via
7913 unicode_append_menu) fails, disable Unicode menus only if we are
7914 running on Windows 9X/Me.
7915
42bf8205
AS
79162012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7917
7918 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7919 (xgetint): Add missing shift for LSB tags.
7920
b1bac16e
MR
79212012-04-24 Martin Rudalics <rudalics@gmx.at>
7922
7923 * keyboard.c (read_char): Don't wipe echo area for select window
7924 events: These might get delayed via `mouse-autoselect-window'
7925 (Bug#11304).
7926
d69621cc
JB
79272012-04-24 Juanma Barranquero <lekktu@gmail.com>
7928
7929 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
7930 manipulation of :loaded-from data.
7931
02fd101b
JB
79322012-04-23 Juanma Barranquero <lekktu@gmail.com>
7933
7934 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
7935 now a cons (bug#11311).
7936
888bec30
PE
79372012-04-23 Paul Eggert <eggert@cs.ucla.edu>
7938
89a438bd
PE
7939 Do not create empty overlays with the evaporate property (Bug#9642).
7940 * buffer.c (Fmove_overlay): Delete an evaporating overlay
7941 if it becomes empty after its bounds are adjusted to fit within
7942 its buffer. Without this fix, in a nonempty buffer (let ((o
7943 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
7944 yields an empty overlay that has the evaporate property, which is
7945 not supposed to happen.
7946
1068fe4d
PE
7947 Fix minor GTK3 problems found by static checking.
7948 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7949 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7950 (struct _EmacsFixedClass, emacs_fixed_get_type):
7951 Move decls here from emacsgtkfixed.h, since they needn't be public.
7952 (emacs_fixed_get_type): Now static.
7953 (emacs_fixed_class_init): Omit unused local.
7954 (emacs_fixed_child_type): Remove; unused.
7955 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7956 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7957 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7958 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7959 (EMACS_FIXED_GET_CLASS): Remove; unused.
7960 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7961
888bec30
PE
7962 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7963 Problem reported by Juanma Barranquero for Windows -Wunused-function.
7964
de85e130
PE
79652012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7966
d0baac98 7967 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 7968 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
7969 (__malloc_size_t, __malloc_ptrdiff_t):
7970 Remove. All uses removed, replaced by the definiens if needed,
7971 since we can assume C89 or better now.
7972 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
7973 (protect_malloc_state, align, get_contiguous_space)
7974 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
7975 (malloc_atfork_handler_child, malloc_enable_thread)
7976 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
7977 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
7978 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
7979 (special_realloc, _realloc_internal_nolock, _realloc_internal)
7980 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
7981 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
7982 Define using prototypes, not old style.
7983 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
7984 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
7985 (align): Don't assume that signed integer overflow wraps around.
7986 Omit unused local var.
7987 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
7988 (_free_internal_nolock, memalign, mallochook, reallochook):
7989 Omit no-longer-needed casts.
7990 (valloc): Use getpagesize, not __getpagesize.
7991 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
7992 (struct hdr): The 'magic' member is now size_t, not unsigned long.
7993
de85e130
PE
7994 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
7995
dcbf5805
MA
79962012-04-22 Michael Albinus <michael.albinus@gmx.de>
7997
7998 Move functions from C to Lisp. Make non-blocking method calls
7999 the default. Implement further D-Bus standard interfaces.
8000
8001 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8002 (QCdbus_request_name_allow_replacement)
8003 (QCdbus_request_name_replace_existing)
8004 (QCdbus_request_name_do_not_queue)
8005 (QCdbus_request_name_reply_primary_owner)
8006 (QCdbus_request_name_reply_in_queue)
8007 (QCdbus_request_name_reply_exists)
8008 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8009 (QCdbus_registered_serial, QCdbus_registered_method)
8010 (QCdbus_registered_signal): New Lisp objects.
8011 (XD_DEBUG_MESSAGE): Use sizeof.
8012 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8013 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8014 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8015 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8016 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8017 (xd_signature, xd_append_arg): Allow float for integer types.
8018 (xd_get_connection_references): New function.
b593d6a9
AH
8019 (xd_get_connection_address): Rename from xd_initialize.
8020 Return cached address.
dcbf5805
MA
8021 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8022 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8023 level.
8024 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 8025 Return number of refcounts.
dcbf5805
MA
8026 (Fdbus_get_unique_name): Make stronger parameter check.
8027 (Fdbus_message_internal): New defun.
8028 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8029 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8030 (Fdbus_send_signal, Fdbus_register_service)
8031 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8032 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8033 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8034 (Vdbus_compiled_version, Vdbus_runtime_version)
8035 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8036 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8037 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
8038 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8039 Adapt docstring.
dcbf5805 8040
52828e02
PE
80412012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8042
da05bc4c
PE
8043 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8044 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8045 Do not assume ptrdiff_t is the same width as 'int'.
8046
52828e02
PE
8047 * alloc.c: Handle unusual debugging option combinations.
8048 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8049 since the two debugging options are incompatible.
8050 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8051 is defined.
8052 (mem_init, mem_insert, mem_insert_fixup):
8053 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8054 (NEED_MEM_INSERT): Remove; no longer needed.
8055
f01769f9
LL
80562012-04-22 Leo Liu <sdl.web@gmail.com>
8057
8058 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8059
5790543d
PE
80602012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8061
8062 * sysdep.c [__FreeBSD__]: Minor cleanups.
8063 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8064 Use Emacs indenting style more consistently. Avoid some casts.
8065 Use 'double' consistently rather than mixing 'float' and 'double'.
8066
b91b7e4d
EW
80672012-04-21 Eduard Wiebe <usenet@pusto.de>
8068
b593d6a9
AH
8069 * sysdep.c (list_system_processes, system_process_attributes):
8070 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 8071
6114eb15
AS
80722012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8073
8074 * lisp.mk (lisp): Update.
8075
2f38dff7
PE
80762012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8077
8078 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8079 It is never used otherwise.
8080
4ae29f89
SM
80812012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8082
8083 * print.c (print_preprocess): Only check print_depth if print-circle
8084 is nil.
8085 (print_object): Check for cycles even when print-circle is nil and
8086 print-gensym is t, but only check print_depth if print-circle is nil.
8087
f30d612a
CY
80882012-04-20 Chong Yidong <cyd@gnu.org>
8089
8090 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8091 set the status to "failed" and ensure that sentinel is run.
8092
c07a4c0b 80932012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
8094
8095 * process.c (Fset_process_inherit_coding_system_flag)
8096 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 8097 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 8098
c07a4c0b 80992012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
8100
8101 * xdisp.c (string_buffer_position_lim): Limit starting position to
8102 BEGV.
8103 (set_cursor_from_row): If called for a mode-line or header-line
8104 row, return zero immediately.
8105 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
8106 farther than the first row after the header line, if any.
8107 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
8108 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8109
c07a4c0b 81102012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8111
4ae29f89
SM
8112 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8113 (bug#11238).
ad3a2b41 8114
c07a4c0b 81152012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 81162012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
8117
8118 configure: new option --enable-gcc-warnings (Bug#11207)
8119 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8120 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8121 (ALL_CFLAGS): Use new macros rather than old.
8122 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8123 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8124 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8125 -Wunused-result, -Wunused-variable. This should go away once
8126 the Emacs and Gnulib regex code is merged.
8127 (xmalloc, xrealloc): Now static.
8128
aba027e8
PE
81292012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8130
8131 * dired.c (Fsystem_groups): Remove unused local.
8132
e5a36063
GM
81332012-04-17 Glenn Morris <rgm@gnu.org>
8134
8135 * dired.c (Fsystem_users): Doc fix.
8136
316411f0
DA
81372012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8138
8139 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8140 (syms_of_dired): Add them.
8141
9426aba4
PE
81422012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8143
b62a57be
PE
8144 Fix minor alloc.c problems found by static checking.
8145 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8146 New extern decls, to avoid calling undeclared functions.
8147 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8148 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8149 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8150 (NEED_MEM_INSERT): New macro.
8151 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 8152 Remove one incorrect comment and fix another.
b62a57be 8153
3539f31f
PE
8154 Fix minor ralloc.c problems found by static checking.
8155 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8156 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8157 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8158 (r_alloc_sbrk): Now static.
8159
a041960a
PE
8160 Improve ralloc.c interface checking.
8161 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8162 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8163 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8164 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8165 [REL_ALLOC]: ... to here, to check interface.
8166 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8167 Remove decls. This fixes an "It stinks!".
8168
9426aba4
PE
8169 * alloc.c (which_symbols): Fix alignment issue / type clash.
8170
d55c12ed
AS
81712012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8172
8173 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8174 (struct Lisp_Misc_Any): Likewise.
8175 (struct Lisp_Free): Likewise.
8176 * alloc.c (union aligned_Lisp_Symbol): Define.
8177 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8178 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8179 (union aligned_Lisp_Misc): Define.
8180 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8181 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 8182 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 8183
b948ce8b
PE
81842012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8185
8186 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8187 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8188 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8189 * s/netbsd.h, s/sol2-6.h:
8190 Remove definition of GC_MARK_STACK, since the default now works.
8191 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8192 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8193 no longer the default.
8194 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8195
35dc09a1 81962012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8197
35dc09a1
GM
8198 * lread.c (lisp_file_lexically_bound_p):
8199 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 8200
35dc09a1
GM
82012012-04-14 Eli Zaretskii <eliz@gnu.org>
8202
8203 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8204 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8205
82062012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8207
8208 * nsterm.m (constrainFrameRect): Always constrain when there is only
8209 one screen (Bug#10962).
8210
bcd86815
KB
82112012-04-13 Ken Brown <kbrown@cornell.edu>
8212
8213 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8214
c25df26e
RT
82152012-04-13 Reuben Thomas <rrt@sc3d.org>
8216
8217 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8218
0fc59f1e
DC
82192012-04-11 Daniel Colascione <dancol@dancol.org>
8220
8221 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8222 against is gone. It's better to use vfork now so that when Cygwin
8223 gains a new, working vfork, we use it automatically (bug#10398).
8224
de8c03dc
SM
82252012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8226
8227 * window.c (save_window_save): Obey window-point-insertion-type.
8228
2f097256
GM
82292012-04-11 Glenn Morris <rgm@gnu.org>
8230
8231 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8232
453b951e
SM
82332012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8234
8235 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8236
75f1671a 82372012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
8238
8239 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8240 (force_quit_count): New var.
8241 (handle_interrupt): Use it.
8242
2a8ce227
JB
82432012-04-10 Juanma Barranquero <lekktu@gmail.com>
8244
8245 * w32.c (w32_delayed_load): Record the full path of the library
8246 being loaded (bug#10424).
8247
935396c0
GM
82482012-04-09 Glenn Morris <rgm@gnu.org>
8249
05920a43
GM
8250 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8251 not just in the obarray, before snarfing them. (Bug#11036)
8252
935396c0
GM
8253 * Makefile.in ($(leimdir)/leim-list.el):
8254 Pass EMACS rather than BUILT_EMACS.
8255
a18ecafa
TZ
82562012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8257
8258 * process.c (make_process):
8259 * process.h: Add integer `gnutls_handshakes_tried' member to
8260 process struct.
8261
6bbef4e5
JC
8262 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8263 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
8264
8265 * gnutls.c (gnutls_log_function2i): Convenience log function.
8266 (emacs_gnutls_read): Use new log functions,
8267 `gnutls_handshakes_tried' process member, and
8268 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8269 attempts per process (connection).
8270
b4d3bc10
CY
82712012-04-09 Chong Yidong <cyd@gnu.org>
8272
8273 * eval.c (Fuser_variable_p, user_variable_p_eh)
8274 (lisp_indirect_variable): Functions deleted.
8275 (Fdefvar): Caller changed.
8276
8277 * callint.c (Finteractive, Fcall_interactively):
8278 * minibuf.c (Fread_variable): Callers changed.
8279
70f4d973
EZ
82802012-04-09 Eli Zaretskii <eliz@gnu.org>
8281
8282 * xdisp.c (set_cursor_from_row): If the display string appears in
8283 the buffer at position that is closer to point than the position
8284 after the display string, display the cursor on the first glyph of
8285 the display string. Fixes cursor display when a 'display' text
8286 property immediately follows invisible text. (Bug#11094)
8287
cb3c2e3e
PE
82882012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8289
8290 composite.c: use 'double' consistently
8291 * composite.c (get_composition_id): Use 'double' consistently
8292 instead of converting 'float' to 'double' and vice versa; this is
8293 easier to understand and avoids a GCC warning.
8294
fd06db5d
GM
82952012-04-09 Glenn Morris <rgm@gnu.org>
8296
50fe702a
GM
8297 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8298 preparation for dumping it with emacs. (Bug#4789)
8299 (leimdir): New variable.
8300 ($(leimdir)/leim-list.el): New rule.
8301 (emacs$(EXEEXT)): Depend on leim-list.el.
8302
fd06db5d
GM
8303 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8304 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8305 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8306
55c131ee
AS
83072012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8308
8309 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8310 proper alignment.
8311
9209588f
JB
83122012-04-07 Juanma Barranquero <lekktu@gmail.com>
8313
8314 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8315 Remove unused local variable.
8316
e3fb2efb
PE
83172012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8318
8319 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8320 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8321 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8322 objects, as mark_maybe_pointer will catch them otherwise.
8323 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8324 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8325
b5385551
PE
83262012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8327
8328 Fix typo that broke non-Windows builds.
8329 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8330
9078ead6
EZ
83312012-04-07 Eli Zaretskii <eliz@gnu.org>
8332
8333 Support building on MS-Windows with libxml2.
8334
8335 * makefile.w32-in (OBJ2): Add xml.$(O).
8336 (GLOBAL_SOURCES): Add xml.c.
8337 ($(BLD)/xml.$(O)): New dependency list.
8338
8339 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8340 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8341 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8342 [!WINDOWSNT]: New macros.
8343 (init_libxml2_functions, libxml2_loaded_p): New functions.
8344 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8345 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8346 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8347 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8348 linked in).
6bbef4e5
JC
8349 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8350 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
8351 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8352
8353 * emacs.c: Don't include libxml/parser.h.
8354 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8355 xmlCleanupParser directly.
8356
8357 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8358
3811fdf3
EZ
83592012-04-07 Eli Zaretskii <eliz@gnu.org>
8360
8361 * indent.c (Fvertical_motion): If there is a display string at
8362 point, use it.vpos to compute how many lines to backtrack after
8363 move_it_to point. (Bug#11133)
8364
2f8e16b2
EZ
83652012-04-06 Eli Zaretskii <eliz@gnu.org>
8366
8367 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8368 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8369 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8370 macros related to unification of CJK characters. For the details,
8371 see the discussion following the message here:
8372 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8373
3d439cd1
CY
83742012-04-04 Chong Yidong <cyd@gnu.org>
8375
8376 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8377
8bc53d00
EZ
83782012-04-01 Eli Zaretskii <eliz@gnu.org>
8379
8380 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8381 instead of alloca. (Bug#11138)
8382
3b0512a3
AS
83832012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8384
8385 * w32menu.c (is_simple_dialog): Properly check lisp types.
8386 (Bug#11141)
8387
8427ddd2
EZ
83882012-03-31 Eli Zaretskii <eliz@gnu.org>
8389
979022ef
EZ
8390 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8391 position we get to after a call to move_it_to fails the
8392 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8393 only if we wind up in a string from display property. (Bug#11063)
8394
a6b1c7cc
EZ
8395 * window.c (Fdelete_other_windows_internal): Invalidate the row
8396 and column information about mouse highlight, so that redisplay
8397 restores it after reallocating the glyph matrices. (Bug#7464)
8398
8427ddd2
EZ
8399 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8400 string comes from a `display' text property, use the buffer
8401 position of that property as if we actually saw that position in
8402 the row's glyphs.
697ba24b
EZ
8403 (move_it_by_lines): Remove the assertion that
8404 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8405 violated when there's a before-string at the beginning of a line.
8406 (Bug#11063)
8427ddd2 8407
65a0a738
EZ
84082012-03-30 Eli Zaretskii <eliz@gnu.org>
8409
8410 * xdisp.c (append_space_for_newline): If the default face was
8411 remapped, use the remapped face for the appended newline.
8412 (extend_face_to_end_of_line): Use the remapped default face for
8413 extending the face to the end of the line.
8414 (display_line): Call extend_face_to_end_of_line when the default
8415 face was remapped. (Bug#11068)
8416
581355cc
EZ
84172012-03-29 Eli Zaretskii <eliz@gnu.org>
8418
8419 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8420
e8fc049f
SM
84212012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8422
8423 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8424
4fb9a543
GM
84252012-03-27 Glenn Morris <rgm@gnu.org>
8426
8427 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8428 Doc fixes.
8429
679910f1
KH
84302012-03-26 Kenichi Handa <handa@m17n.org>
8431
8432 * dispextern.h (struct glyph): Fix previous change. Change the
8433 bit length of glyphless.ch to 25 (Bug#11082).
8434
90d49b7f
CY
84352012-03-26 Chong Yidong <cyd@gnu.org>
8436
8437 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8438 (command_loop_1): Use it; inhibit selection update for
8439 handle-select-window too (Bug#8996).
8440
f514f6f0
FP
84412012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8442
e8fc049f 8443 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 8444
bf43fa51
KH
84452012-03-25 Kenichi Handa <handa@m17n.org>
8446
8447 * dispextern.h (struct glyph): Change the bit length of
8448 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8449
8a0c01dd
EZ
84502012-03-24 Eli Zaretskii <eliz@gnu.org>
8451
8452 * s/ms-w32.h (tzname): Include time.h before redirecting to
8453 _tzname. Fixes the MSVC build. (Bug#9960)
8454
7d1c3a76
AS
84552012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8456
8ed79523
AS
8457 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8458 characters.
8459
7d1c3a76
AS
8460 * xterm.c (XTread_socket): Only modify handling_signal if
8461 !SYNC_INPUT. (Bug#11080)
8462
e99a9b8b
EZ
84632012-03-23 Eli Zaretskii <eliz@gnu.org>
8464
8465 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8466 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8467 when fetching a multibyte character consumes more bytes than
8468 CHAR_BYTES returns, due to unification of CJK characters in
8469 string_char. (Bug#11073)
8470
5063c0e1
TN
84712012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8472
8473 * process.c (wait_reading_process_output): Handle pty disconnect
8474 by refraining from sending oneself a SIGCHLD (bug#10933).
8475
9f851fbd
CY
84762012-03-22 Chong Yidong <cyd@gnu.org>
8477
8478 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8479
5063c0e1 8480 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
8481 Mark string as coming from a prefix property.
8482 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8483 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8484
fb5b8aca
CY
84852012-03-21 Chong Yidong <cyd@gnu.org>
8486
8487 * xfaces.c (Vface_remapping_alist): Doc fix.
8488
62356a1b
EZ
84892012-03-20 Eli Zaretskii <eliz@gnu.org>
8490
8491 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
8492 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8493 Doc fixes.
62356a1b 8494
025de85b
CY
84952012-03-20 Chong Yidong <cyd@gnu.org>
8496
8497 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8498 to reflect default non-nil value of redisplay-dont-pause.
8499
4827f94e
KH
85002012-03-19 Kenichi Handa <handa@m17n.org>
8501
8502 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8503 it fit in a valid range (Bug#11003).
8504
e50a24a2
EZ
85052012-03-18 Eli Zaretskii <eliz@gnu.org>
8506
8507 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8508 that is not from display property, accept the row as a "cursor
8509 row" if one of the string's character has a non-nil `cursor'
8510 property. Fixes cursor positioning when there are newlines in
8511 overlay strings, e.g. in icomplete.el. (Bug#11035)
8512
9af5ed87
PE
85132012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8514
8515 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8516
d1f55f16
CY
85172012-03-12 Chong Yidong <cyd@gnu.org>
8518
8519 * eval.c (inhibit_lisp_code): Rename from
8520 inhibit_window_configuration_change_hook; move from window.c.
8521
8522 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8523 * window.c (run_window_configuration_change_hook)
8524 (syms_of_window): Callers changed.
8525
66c5eebd
CY
85262012-03-11 Chong Yidong <cyd@gnu.org>
8527
413df973
CY
8528 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8529
66c5eebd
CY
8530 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8531
1de11f56
CY
85322012-03-10 Chong Yidong <cyd@gnu.org>
8533
8534 * frame.c (other_visible_frames): Don't assume the selected frame
8535 is visible (Bug#10955).
8536
cae07000
SM
85372012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8538
8539 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8540
89c94350
JD
85412012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8542
8543 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8544 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8545 zero (Bug#10954).
8546
999dd333
GM
85472012-03-03 Glenn Morris <rgm@gnu.org>
8548
01a6dcc8 8549 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 8550
de0100f2
EZ
85512012-03-02 Eli Zaretskii <eliz@gnu.org>
8552
8553 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8554 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
8555 (redisplay_window, next_element_from_string): Fix typos in
8556 comments.
3e441275
EZ
8557 (redisplay_window): Pass to move_it_vertically the margin in
8558 pixels, not in screen lines.
de0100f2 8559
96a72ee9
GM
85602012-03-02 Glenn Morris <rgm@gnu.org>
8561
8562 * buffer.c (buffer-list-update-hook): Doc fix.
8563
312508d7
EZ
85642012-02-29 Eli Zaretskii <eliz@gnu.org>
8565
8566 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8567 push_it before setting up the iterator for the first overlay
8568 string, even if we have an empty string loaded.
8569 (next_overlay_string): If there's an empty string on the iterator
8570 stack, pop the stack. (Bug#10903)
8571
27f3c637
PE
85722012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8573
8574 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8575 Suggested by Stefan Monnier in
8576 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8577 * alloc.c (widen_to_Lisp_Object): New static function.
8578 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8579 and widening them to Lisp_Objects. This would work even if
8580 USE_LSB_TAG is defined and wide integers are used, which might
8581 happen in a future version of Emacs.
8582
3c9dfce6
CY
85832012-02-25 Chong Yidong <cyd@gnu.org>
8584
fa74b241
CY
8585 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8586 Doc fix.
8587
3c9dfce6
CY
8588 * xselect.c (Fx_selection_exists_p): Doc fix.
8589 (x_clipboard_manager_save_all): Print an informative message
8590 before saving to clipboard manager.
8591
9486df08
CY
85922012-02-24 Chong Yidong <cyd@gnu.org>
8593
8594 * keyboard.c (process_special_events): Handle all X selection
8595 requests in kbd_buffer, not just the next one (Bug#8869).
8596
f01d3321
CY
85972012-02-23 Chong Yidong <cyd@gnu.org>
8598
8599 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8600 call when setting menu-bar-lines and tool-bar-lines parameters.
8601 (unwind_create_frame_1): New helper function.
8602
8603 * window.c (inhibit_window_configuration_change_hook): New var.
8604 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 8605 (syms_of_window): Initialize it.
f01d3321 8606
86b847b6
CY
86072012-02-22 Chong Yidong <cyd@gnu.org>
8608
8609 * xterm.c (x_draw_image_relief): Add missing type check for
8610 Vtool_bar_button_margin (Bug#10743).
8611
a59225b1
CY
86122012-02-21 Chong Yidong <cyd@gnu.org>
8613
8614 * fileio.c (Vfile_name_handler_alist): Doc fix.
8615
8616 * buffer.c (Fget_file_buffer): Protect against invalid file
8617 handler return value.
8618
310f5bd4
PE
86192012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8620
cb3a28cc
PE
8621 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8622 when computing $valmask.
8623
310f5bd4
PE
8624 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8625 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8626 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8627 It's useless in that case, and it can cause problems on hosts
8628 that allocate halves of EMACS_INT values separately.
8629 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8630 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8631 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8632 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8633 it avoids undefined behavior on hosts where shifting right by more
8634 than the word width has undefined behavior.
8635
2375c96a
CY
86362012-02-19 Chong Yidong <cyd@gnu.org>
8637
8638 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8639 (Funhandled_file_name_directory, Ffile_name_as_directory)
8640 (Fdirectory_file_name, Fexpand_file_name)
8641 (Fsubstitute_in_file_name): Protect against invalid file handler
8642 return values (Bug#10845).
8643
3eb49e71
EZ
86442012-02-18 Eli Zaretskii <eliz@gnu.org>
8645
8646 * .gdbinit (pitx): Fix incorrect references to fields of the
8647 iterator stack.
8648
7b926f3f
CY
86492012-02-17 Chong Yidong <cyd@gnu.org>
8650
8651 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8652
11273115
PE
86532012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8654
8655 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8656 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8657
c3a70e2b
CY
86582012-02-15 Chong Yidong <cyd@gnu.org>
8659
8660 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8661 marked as special. Also, starting docstrings with * is obsolete.
8662
0ca43699
AS
86632012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8664
8665 * gnutls.c (emacs_gnutls_write): Fix last change.
8666
2e8f3c56
LI
86672012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8668
8669 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8670 send_process.
8671
af70074f
SM
86722012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8673
8674 * keymap.c (Fsingle_key_description): Handle char ranges.
8675
95986d52
CY
86762012-02-12 Chong Yidong <cyd@gnu.org>
8677
afd83bd1
CY
8678 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8679 as that creates a dangerous corner case.
8680
95986d52
CY
8681 * window.c (Fdelete_window_internal): Invalidate the mouse
8682 highlight (Bug#9904).
8683
bd7da63e
GM
86842012-02-12 Glenn Morris <rgm@gnu.org>
8685
8686 * xselect.c (Fx_own_selection_internal)
8687 (Fx_get_selection_internal, Fx_disown_selection_internal)
8688 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8689 * nsselect.m (Fx_own_selection_internal)
8690 (Fx_disown_selection_internal, Fx_selection_exists_p)
8691 (Fx_selection_owner_p, Fx_get_selection_internal):
8692 Sync docs and argument specs with the xselect.c versions.
8693
77abcbc2
LI
86942012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8695
8696 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8697
90b671e2
EZ
86982012-02-11 Eli Zaretskii <eliz@gnu.org>
8699
1c0ca0b7
EZ
8700 * w32select.c (Fx_selection_exists_p): Sync doc string and
8701 argument list with xselect.c. (Bug#10783)
8702
8703 * w16select.c (Fx_selection_exists_p): Sync doc string and
8704 argument list with xselect.c. (Bug#10783)
90b671e2 8705
49241268
GM
87062012-02-10 Glenn Morris <rgm@gnu.org>
8707
8708 * fns.c (Fsecure_hash): Doc fix.
8709
f998bbe7 87102012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
8711
8712 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8713
0992bd9c
CY
87142012-02-07 Chong Yidong <cyd@gnu.org>
8715
8716 * buffer.c (Fbuffer_local_variables)
8717 (buffer_lisp_local_variables): Handle unbound vars correctly;
8718 don't let Qunbound leak into Lisp.
8719
af008560
GM
87202012-02-07 Glenn Morris <rgm@gnu.org>
8721
dd605cc4
GM
8722 * image.c (Fimagemagick_types): Doc fix.
8723
af008560
GM
8724 * image.c (imagemagick-render-type): Change it from a lisp object
8725 to an integer. Move the doc here from the lisp manual.
8726 Treat all values not equal to 0 the same.
8727
1449fa1d
CY
87282012-02-06 Chong Yidong <cyd@gnu.org>
8729
8730 * doc.c (store_function_docstring): Avoid applying docstring of
8731 alias to base function (Bug#2603).
8732
3723ec07
AS
87332012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8734
8735 * .gdbinit (pp1, pv1): Remove redundant defines.
8736 (pr): Use pp.
8737
79c1cc1e
CY
87382012-02-04 Chong Yidong <cyd@gnu.org>
8739
8740 * nsterm.m: Declare a global (Bug#10694).
8741
d7f29f8e
EZ
87422012-02-04 Eli Zaretskii <eliz@gnu.org>
8743
cae07000
SM
8744 * w32.c (get_emacs_configuration_options):
8745 Include --enable-checking, if specified, in the return value.
d7f29f8e 8746
3b95a6f9
MR
87472012-02-04 Martin Rudalics <rudalics@gmx.at>
8748
8749 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8750 after rounding frame sizes. (Bug#9723)
8751
d6fa96a6
EZ
87522012-02-04 Eli Zaretskii <eliz@gnu.org>
8753
8754 * keyboard.c (adjust_point_for_property): Don't position point
8755 before BEGV. (Bug#10696)
8756
df0b2940
PE
87572012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8758
8759 Handle overflow when computing char display width (Bug#9496).
8760 * character.c (char_width): Return EMACS_INT, not int.
8761 (char_width, c_string_width): Check for overflow when
8762 computing the width; this is possible now that individual
8763 characters can have unbounded width. Problem introduced
8764 by merge from Emacs 23 on 2012-01-19.
8765
6bee44d6
MA
87662012-02-02 Michael Albinus <michael.albinus@gmx.de>
8767
8768 * dbusbind.c (Fdbus_register_method): Mention the return value
8769 :ignore in the docstring.
8770
44f92739
GM
87712012-02-02 Glenn Morris <rgm@gnu.org>
8772
1b9f60cc
GM
8773 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8774
44f92739
GM
8775 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8776 Unconditionally set to t. (Bug#10673)
8777 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8778 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8779 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8780
c5d3843c
KH
87812012-02-02 Kenichi Handa <handa@m17n.org>
8782
8783 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8784 0, do not call append_composite_glyph.
8785
159462d4 87862012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
8787
8788 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8789 NULL (Bug#6988).
8790 (x_produce_glyphs): If the component of a composition is a null
8791 string, set it->pixel_width to 1 to avoid zero-width glyph.
8792
78cef877
EZ
87932012-02-01 Eli Zaretskii <eliz@gnu.org>
8794
8795 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8796 first 2 arguments are identical. This makes inserting large
8797 output from a subprocess an order of magnitude faster on
8798 MS-Windows, where all sbrk'ed memory is always contiguous.
8799
97897668
GM
88002012-01-31 Glenn Morris <rgm@gnu.org>
8801
8802 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 8803 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
8804 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8805
31fd3586
GM
88062012-01-29 Glenn Morris <rgm@gnu.org>
8807
8808 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8809
0e24a8b2
CY
88102012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8811
8812 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8813
cc0adcb0
CY
88142012-01-28 Chong Yidong <cyd@gnu.org>
8815
8816 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8817
acc28cb9
CY
88182012-01-26 Chong Yidong <cyd@gnu.org>
8819
9c69cfb7
CY
8820 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8821
acc28cb9
CY
8822 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8823 repeat counts (Bug#10507).
8824
48da7392
GM
88252012-01-26 Glenn Morris <rgm@gnu.org>
8826
8827 * lread.c (syms_of_lread): Doc fix.
8828
14af5f7f
CY
88292012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8830
8831 * coding.c (encode_designation_at_bol): Change return value to
8832 EMACS_INT.
8833
0b21c100
CY
88342012-01-25 Chong Yidong <cyd@gnu.org>
8835
8836 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8837
3c2907f7
CY
88382012-01-21 Chong Yidong <cyd@gnu.org>
8839
8840 * floatfns.c (Fcopysign): Make the second argument non-optional,
8841 since nil is not allowed anyway.
8842
959ad23f
AS
88432012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8844
8845 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8846 (send_process): Likewise.
8847
34a02f46
MR
88482012-01-19 Martin Rudalics <rudalics@gmx.at>
8849
8850 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
8851 (Vwindow_persistent_parameters): Do not use Qstate.
8852 Rewrite doc-strings.
34a02f46 8853
1259009a 88542012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
8855
8856 * character.c (char_width): New function.
70d4fdf6
GM
8857 (Fchar_width, c_string_width, lisp_string_width):
8858 Use char_width (Bug#9496).
25ed9e61 8859
6a6ee00d
MR
88602012-01-16 Martin Rudalics <rudalics@gmx.at>
8861
8862 * window.c (Vwindow_persistent_parameters): New variable.
8863 (Fset_window_configuration, save_window_save): Handle persistent
8864 window parameters.
8865
c85efaf7
EZ
88662012-01-14 Eli Zaretskii <eliz@gnu.org>
8867
8868 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8869 thrashing the stack of the thread. (Bug#9087)
8870
5944709e
PE
88712012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8872
8873 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8874
e71f5d99
EZ
88752012-01-11 Eli Zaretskii <eliz@gnu.org>
8876
8877 * xdisp.c (rows_from_pos_range): Handle the case where the
8878 highlight ends on a newline. (Bug#10464)
8879 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8880 he end column for display of highlight that ends on a newline
8881 before a R2L line.
8882
ce316182
GM
88832012-01-11 Glenn Morris <rgm@gnu.org>
8884
8885 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8886 from load-path also when installation-directory is nil. (Bug#10208)
8887
5b43da69
GM
88882012-01-10 Glenn Morris <rgm@gnu.org>
8889
74cc8ff9
GM
8890 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8891
7d8d6e4e
GM
8892 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8893 Update template values to be closer to their typical values these days.
5b43da69 8894
a0db8d43
EZ
88952012-01-09 Eli Zaretskii <eliz@gnu.org>
8896
8897 * xdisp.c (rows_from_pos_range): Accept additional argument
8898 DISP_STRING, and accept any glyph in a row whose object is that
8899 string as eligible for mouse highlight. Fixes mouse highlight of
8900 display strings from overlays. (Bug#10464)
8901
9a0115ab 89022012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 8903
b9110d6a 8904 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
8905 * fileio.c (auto_saving_dir_umask): New static var.
8906 (Fmake_directory_internal): Use it.
8907 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8908 creating the directory. The old code temporarily assigns
8909 too-generous permissions to the directory.
8910 (do_auto_save_eh): Clear it.
b9110d6a 8911 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
8912 that the var is always cleared.
8913
6c1bd3f3
EZ
89142012-01-07 Eli Zaretskii <eliz@gnu.org>
8915
8916 * search.c (scan_buffer): Pass character positions to
8917 know_region_cache, not byte positions. (Bug#6540)
8918
069d2b50
L
89192012-01-07 LynX <_LynX@bk.ru> (tiny change)
8920
8921 * w32.c (sys_rename): Report EXDEV when rename of a directory
8922 fails because the target is on another logical disk. (Bug#10284)
8923
75bf0d33
DB
89242012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
8925
8926 * xterm.c (x_embed_request_focus): New function.
8927
8928 * xterm.h: Add prototype.
8929
8930 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8931
1c6e5a32
GM
89322012-01-05 Glenn Morris <rgm@gnu.org>
8933
8934 * emacs.c (emacs_copyright): Update short copyright year to 2012.
8935
651e947e
EZ
89362012-01-01 Eli Zaretskii <eliz@gnu.org>
8937
8938 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
8939 Load gnutls_transport_set_lowat only if GnuTLS version is below
8940 2.11.1.
8941 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
8942 GnuTLS versions below 2.11.1.
8943
3778cdd8
AL
89442011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
8945
8946 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
8947 to the doc string advising against its use for altering the way
8948 windows are scrolled.
8949
0e5317f7
KH
89502011-12-28 Kenichi Handa <handa@m17n.org>
8951
8952 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
8953 coding-system ASCII compatible only when it does not produce BOM
8954 on encoding (Bug#10383).
8955
93d5ca1f
JD
89562011-12-26 Jan Djärv <jan.h.d@swipnet.se>
8957
8958 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8959 can scroll.
8960 (create_and_show_popup_menu): Always use menu_position_func for
8961 Gtk3 (Bug#10361).
8962
ca22b785
AS
89632011-12-24 Andreas Schwab <schwab@linux-m68k.org>
8964
8965 * callint.c (Fcall_interactively): Don't truncate prompt string.
8966
d048e1e6
EZ
89672011-12-23 Eli Zaretskii <eliz@gnu.org>
8968
8969 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
8970 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 8971 resumed from there (after widening). (Bug#10360)
d048e1e6 8972
5ccaba1f
JD
89732011-12-22 Jan Djärv <jan.h.d@swipnet.se>
8974
8975 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
8976
204ee57f
JD
89772011-12-21 Jan Djärv <jan.h.d@swipnet.se>
8978
b81d40f0
JB
8979 * nsterm.m (x_free_frame_resources):
8980 Release f->output_data.ns->miniimage.
204ee57f
JD
8981 (ns_index_color): Fix indentation. Do not retain
8982 color_table->colors[i].
8983
8984 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
8985 before returning.
8986
8987 * nsfns.m (x_set_background_color): Assign return value from
8988 ns_index_color to face-background instead of NSColor*.
8989 (ns_implicitly_set_icon_type): Fix indentation.
8990 Change assignment in for loop to comparison.
8991
8992 * emacs.c (ns_pool): New variable.
8993 (main): Assign ns_pool.
8994 (Fkill_emacs): Call ns_release_autorelease_pool.
8995
8996 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
8997 autorelease fdesc, release fdAttrs and tdict.
8998 (ns_get_covering_families): Release charset.
8999 (ns_findfonts): Release NSFontDescriptor created with new.
9000 (ns_uni_to_glyphs): Fix indentation.
9001 (setString): Release attrStr before assigning new value.
9002
c803b2b7
JD
90032011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9004
678f4426
JD
9005 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9006 and NS_IMPL_COCOA.
9007 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9008 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9009
cd394be1 90102011-12-18 David Reitter <reitter@cmu.edu>
678f4426 9011
5fecd5fc
JD
9012 * nsterm.m (ns_term_init): Subscribe for notifications
9013 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9014 to method trackingNotification in EmacsMenu.
9015
9016 * nsmenu.m (trackingMenu): New variable.
3771cb17 9017 (trackingNotification): New method (from Aquamacs).
5fecd5fc 9018 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 9019 from Aquamacs (Bug#7030).
678f4426
JD
9020
90212011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 9022
c803b2b7
JD
9023 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9024 (symbol_to_nsstring): Fix indentation.
9025 (ns_symbol_to_pb): New function.
cae07000
SM
9026 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9027 (Fns_rotate_cut_buffers_internal): Remove.
9028 (Fns_store_selection_internal): Rename from
c803b2b7
JD
9029 Fns_store_cut_buffer_internal.
9030 (ns_get_foreign_selection, Fx_own_selection_internal)
9031 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
9032 (Fns_get_selection_internal, Fns_store_selection_internal):
9033 Use ns_symbol_to_pb and check if return value is nil.
9034 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9035 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
9036 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9037 renamed to Sns_store_selection_internal.
9038 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9039 and remove this function.
9040 (ns_handle_selection_clear): Remove, never used.
9041 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9042 here.
9043
e1b01a3a
KB
90442011-12-17 Ken Brown <kbrown@cornell.edu>
9045
9046 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9047 GID is unknown (Bug#10257).
9048
2adb6e85
PE
90492011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9050
9051 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9052 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9053 which caused a build failure on GNU/Linux IA-64. This problem was
9054 introduced by my 2011-10-07 patch.
9055
d1d7b339
JL
90562011-12-15 Juri Linkov <juri@jurta.org>
9057
9058 * image.c (imagemagick_error): New function. (Bug#10112)
9059 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9060 Use `imagemagick_error' where ImageMagick functions return
9061 `MagickFalse'.
9062 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9063 proper order.
9064
100d5755
KH
90652011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9066
9067 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9068 fill background (Bug#8992).
9069
454592a6
MR
90702011-12-13 Martin Rudalics <rudalics@gmx.at>
9071
9072 * window.c (Vwindow_combination_resize)
9073 (Vwindow_combination_limit): Use t instead of non-nil in
9074 doc-strings.
61d4b438
MR
9075 (Vrecenter_redisplay): Add first sentence of doc-string on
9076 separate line.
53524d93 9077 (Frecenter): Fix doc-string typo.
454592a6 9078
3633e3aa
KH
90792011-12-11 Kenichi Handa <handa@m17n.org>
9080
9081 * coding.c (Funencodable_char_position): Pay attention to the
9082 buffer text relocation (Bug#9389).
9083
7b9d523a 90842011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 9085
7b9d523a
JD
9086 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9087 gtk_init (Bug#10100).
9088
b73189c6
EZ
90892011-12-10 Eli Zaretskii <eliz@gnu.org>
9090
9091 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9092 IT->string is nil. (Bug#10263)
9093
f7dfe5d6
JD
90942011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9095
83faebb4
JD
9096 * nsterm.h (x_free_frame_resources): Declare.
9097
f7dfe5d6
JD
9098 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9099 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9100
9101 * nsterm.h (ns_get_defaults_value): Declare.
9102
9103 * nsterm.m (ns_default): Call ns_get_defaults_value.
9104
7cd4e72c
EZ
91052011-12-09 Eli Zaretskii <eliz@gnu.org>
9106
9107 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9108 (Bug#10170)
9109
b34d7317
YM
91102011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9111
9112 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9113 that where the value of an _OBJC_* symbol points to is in the .bss
9114 section (Bug#10240).
9115
76470ad1
KH
91162011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9117
9118 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 9119 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 9120
745fff94
KH
91212011-12-08 Kenichi Handa <handa@m17n.org>
9122
9123 * ftfont.c (get_adstyle_property): Fix previous change
9124 (Bug#10233).
9125
6e44397c
JB
91262011-12-07 Juanma Barranquero <lekktu@gmail.com>
9127
9128 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9129 dirs from the default value of EMACSLOADPATH (bug#10208).
9130
7efa6272
GM
91312011-12-07 Glenn Morris <rgm@gnu.org>
9132
9133 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9134 installation and source directories as well. (Bug#10208)
9135
f6fc4d87
CY
91362011-12-06 Chong Yidong <cyd@gnu.org>
9137
9138 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9139
2bf26180
GM
91402011-12-06 Glenn Morris <rgm@gnu.org>
9141
9142 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9143 as an error, not just -1. (Bug#10217)
9144
3a6ad4f0
CY
91452011-12-05 Chong Yidong <cyd@gnu.org>
9146
9147 * keyboard.c (process_special_events): New function.
9148 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9149
75a3b399
PE
91502011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9151
9152 * coding.c (encode_designation_at_bol): Don't use uninitialized
9153 local variable (Bug#9318).
9154
c3c9e25e
KH
91552011-12-05 Kenichi Handa <handa@m17n.org>
9156
9157 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9158 return Qnil (Bug#8046, Bug#10193).
9159
5eb05ea3
KH
91602011-12-05 Kenichi Handa <handa@m17n.org>
9161
9162 * coding.c (encode_designation_at_bol): New args charbuf_end and
9163 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
9164 (coding_set_source): Return how many bytes coding->source was
9165 relocated.
9166 (coding_set_destination): Return how many bytes
9167 coding->destination was relocated.
9168 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 9169 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
9170
91712011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9172
9173 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9174 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9175 macro (Bug#9318).
9176
91772011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9178
9179 The following changes are to fix Bug#9318.
9180
a79703f5 9181 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
9182 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9183 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 9184 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 9185
7dbda6df
JB
91862011-12-05 Juanma Barranquero <lekktu@gmail.com>
9187
9188 * lisp.h (process_quit_flag): Fix external declaration.
9189
6d5eb5b0
SM
91902011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9191
9192 Don't macro-inline non-performance-critical code.
9193 * eval.c (process_quit_flag): New function.
9194 * lisp.h (QUIT): Use it.
9195
a0c3fad0
JD
91962011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9197
9198 * nsfns.m (get_geometry_from_preferences): New function.
9199 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9200
6c07aac2
AS
92012011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9202
9203 * emacs.c (Qkill_emacs): Define.
9204 (syms_of_emacs): Initialize it.
9205 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9206 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
9207 (quit_throw_to_read_char): Add parameter `from_signal'.
9208 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
9209 * lisp.h (QUIT): Call Fkill_emacs if requested.
9210
c052ead4
JD
92112011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9212
9213 * widget.c (update_wm_hints): Return if wmshell is null.
9214 (widget_update_wm_size_hints): New function.
9215
9216 * widget.h (widget_update_wm_size_hints): Declare.
9217
9218 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9219 widget_update_wm_size_hints (Bug#10104).
9220
9e49252b
EZ
92212011-12-03 Eli Zaretskii <eliz@gnu.org>
9222
9223 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9224 before a newline, prepare the bidi iterator for consuming the
9225 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 9226 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 9227
02b16839
JL
92282011-12-02 Juri Linkov <juri@jurta.org>
9229
9230 * search.c (Fword_search_regexp): New Lisp function created from
9231 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9232 (Fword_search_backward, Fword_search_forward)
9233 (Fword_search_backward_lax, Fword_search_forward_lax):
9234 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9235 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9236
0068070e
SM
92372011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9238
9239 * fileio.c (Finsert_file_contents): Move after-change-function call
9240 to before the "handled:" label, since all "goto handled" appear in
9241 cases where the *-change-functions have already been properly called
9242 (bug#10117).
9243
3360a3fc
AS
92442011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9245
9246 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9247 waiting for input. (Bug#10169)
9248
73d6c093
EZ
92492011-11-30 Eli Zaretskii <eliz@gnu.org>
9250
9251 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9252 verifies glyph row's hash code--we have just reallocated the
9253 glyphs, so their contents can be complete garbage. (Bug#10164)
9254
febe6bea
JB
92552011-11-30 Juanma Barranquero <lekktu@gmail.com>
9256
9257 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9258
801a4313
EZ
92592011-11-30 Eli Zaretskii <eliz@gnu.org>
9260
9261 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9262 attributes are tested _before_ calling verify_row_hash, to protect
9263 against GCC re-ordering of the tests. (Bug#10164)
9264
2b56b87e
JD
92652011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9266
9267 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9268
9269 * xterm.c (handle_one_xevent): Only set async_visible and friends
9270 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 9271 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
9272 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9273
dbf31225
PE
92742011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9275
9276 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9277 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9278 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9279 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9280 All uses changed to use GCPRO1 etc.
9281 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9282 Revert to old implementation (i.e., before 2011-03-11).
9283
1305621b
YM
92842011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9285
9286 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9287 of scroll runs so as to avoid assigning disabled bogus rows and
9288 unnecessary graphics copy operations.
9289
8c9afb46
EZ
92902011-11-27 Eli Zaretskii <eliz@gnu.org>
9291
9292 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9293 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9294 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9295 (malloc, free, realloc, calloc): Redirect to e_* only when
9296 compiling Emacs.
9297
9298 * lisp.h (GCTYPEBITS): Move before first use.
9299 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9300 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9301 this macro definition.
9302
9303 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9304 _MSC_VER.
9305
54e9e3bf
JD
93062011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9307
6d5eb5b0
SM
9308 * gtkutil.c (xg_create_frame_widgets):
9309 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
9310 present with Gtk+ 2.0.
9311
83aca1cb
PE
93122011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9313
9314 * fileio.c (Finsert_file_contents): Undo previous change; see
9315 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9316
5b76caa4
PE
93172011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9318
9319 Rename locals to avoid shadowing.
9320 * fileio.c (Finsert_file_contents):
9321 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9322 * process.c (wait_reading_process_output):
9323 Rename inner 'proc' to 'p' to avoid shadowing.
9324 Indent for consistency with usual Emacs style.
9325
8c535114
EZ
93262011-11-25 Eli Zaretskii <eliz@gnu.org>
9327
9328 * xdisp.c (redisplay_window): If cursor row is not fully visible
9329 after recentering, and scroll-conservatively is set to a large
9330 number, scroll window by a few more lines to make the cursor fully
9331 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
9332 (start_display): Don't move to the next line if the display should
9333 start at a newline that is part of a display vector or an overlay
9334 string. (Bug#10119)
8c535114 9335
fa4fdb5c
JL
93362011-11-24 Juri Linkov <juri@jurta.org>
9337
9338 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9339 after the `MagickPingImage' call. (Bug#10112)
9340
90ec88df
CY
93412011-11-23 Chong Yidong <cyd@gnu.org>
9342
9343 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9344
56e2e794
MR
93452011-11-23 Martin Rudalics <rudalics@gmx.at>
9346
9347 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9348 making another buffer current. (Bug#10114)
9349
b6e64c41
GM
93502011-11-23 Glenn Morris <rgm@gnu.org>
9351
9352 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9353
6b21de18
CY
93542011-11-23 Chong Yidong <cyd@gnu.org>
9355
9356 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9357 using it (Bug#5984).
9358
b12cd789
EZ
93592011-11-22 Eli Zaretskii <eliz@gnu.org>
9360
9361 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9362 and header-lines, as they don't have one computed for them.
9363 (Bug#10098)
9364
9365 * .gdbinit (prow): Make displayed values more self-explaining.
9366 Add row's hash code.
9367
261b6fd4
LMI
93682011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9369
9370 * process.c (wait_reading_process_output): Fix asynchrounous
9371 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 9372 (wait_reading_process_output): Add comment and URL.
261b6fd4 9373
e7cfd277
JD
93742011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9375
9376 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9377
a9b9b7f5
CY
93782011-11-21 Chong Yidong <cyd@gnu.org>
9379
9380 * window.c (Fnext_window, Fprevious_window): Doc fix.
9381
b0d15b4f
SM
93822011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9383
9384 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9385
fe7a3057
JB
93862011-11-20 Juanma Barranquero <lekktu@gmail.com>
9387
9388 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9389
d2999b1a
MR
93902011-11-20 Martin Rudalics <rudalics@gmx.at>
9391
9392 * window.c (Fset_window_combination_limit): Rename argument
9393 STATUS to LIMIT.
9394 (Vwindow_combination_limit): Remove "status" from doc-string.
9395
d5ff9cd0
AS
93962011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9397
9398 * m/ibms390.h: Remove.
9399 * m/ibms390x.h: Don't include "ibms390.h".
9400
a5bb9bd3
SM
94012011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9402
9403 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9404 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9405
cd1181db
JB
94062011-11-20 Juanma Barranquero <lekktu@gmail.com>
9407
9408 * casetab.c (Fset_case_table):
9409 * charset.c (Fcharset_after): Fix typos.
9410
615a3b8d 94112011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 9412
17e845af
PE
9413 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9414 Otherwise, valgrind does not work on some platforms.
9415 Problem reported by Andreas Schwab in
6a0bf43d
PE
9416 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9417 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9418 is set, removing the need for VIRT_ADDRESS_VARIES.
9419 (PURE_P): Use a more-efficient implementation that needs just one
9420 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9421 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9422 to 4 (xorl, subq, cmpq, setbe).
9423 * alloc.c (pure): Always extern now, since that's the
9424 VIRT_ADDR_VARIES behavior.
9425 (PURE_POINTER_P): Use a single comparison, not two, for
9426 consistency with the new puresize.h.
9427 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9428 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9429 Remove VIRT_ADDR_VARIES no longer needed.
9430
f8fe6f96
EZ
94312011-11-19 Eli Zaretskii <eliz@gnu.org>
9432
9433 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9434 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9435 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9436 behave as if the cursor position were at the window margin.
9437
9438 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9439 and the cursor position is out of bounds, behave as if the cursor
9440 position were at the window margin. (Bug#10075)
9441
df05a53c
CY
94422011-11-18 Chong Yidong <cyd@gnu.org>
9443
9444 * window.c (Fwindow_combination_limit): Make first argument
9445 non-optional, since it is meaningless for live windows like the
9446 selected window.
61ccba97 9447
2071918e
DA
94482011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9449
9450 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9451
b50a28de
SM
94522011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9453
9454 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9455 (graft_intervals_into_buffer): Simplify.
9456
015137db
EZ
94572011-11-18 Eli Zaretskii <eliz@gnu.org>
9458
9459 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9460 hash values of the two rows.
9461 (copy_row_except_pointers): Preserve the used[] arrays and the
9462 hash values of the two rows. (Bug#10035)
68c95424 9463 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
9464
9465 * xdisp.c (row_hash): New function, body extracted from
9466 compute_line_metrics.
9467 (compute_line_metrics): Call row_hash, instead of computing the
9468 hash code inline.
9469
9470 * dispnew.c (verify_row_hash): Call row_hash for computing the
9471 hash code of a row, instead of duplicating code from xdisp.c.
9472
9473 * dispextern.h (row_hash): Add prototype.
9474
a2addb04
TH
94752011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9476
9477 * frame.c (delete_frame): Don't delete the terminal when the last
9478 X frame is closed if emacs is built with GTK toolkit.
9479
df85d315
JB
94802011-11-17 Juanma Barranquero <lekktu@gmail.com>
9481
9482 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9483
a0c2d0ae
MR
94842011-11-17 Martin Rudalics <rudalics@gmx.at>
9485
9486 * window.c (Vwindow_splits): Rename to
9487 Vwindow_combination_resize. Suggested by Juri Linkov.
9488 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9489 of Vwindow_splits.
9490
58179cce
JB
94912011-11-16 Juanma Barranquero <lekktu@gmail.com>
9492
7877f373
JB
9493 * nsfns.m (Fns_font_name):
9494 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 9495
b6f67890
MR
94962011-11-16 Martin Rudalics <rudalics@gmx.at>
9497
9498 * window.h (window): Rename slot "nest" to "combination_limit".
9499 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9500 (Fset_window_nest): Rename to Fset_window_combination_limit.
9501 (Vwindow_nest): Rename to Vwindow_combination_limit.
9502 (recombine_windows, make_parent_window, make_window)
9503 (Fsplit_window_internal, saved_window)
9504 (Fset_window_configuration, save_window_save): Rename all
9505 occurrences of window_nest to window_combination_limit.
9506
c7015153
JB
95072011-11-15 Juanma Barranquero <lekktu@gmail.com>
9508
9509 * image.c (imagemagick_load_image): Fix typo.
9510
322ad6ec
EZ
95112011-11-14 Eli Zaretskii <eliz@gnu.org>
9512
9513 * xdisp.c (display_line): Move the call to
9514 highlight_trailing_whitespace before the call to
9515 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
9516 faces of all the glyphs to compute ROW's hash value.
9517 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 9518
f067b8ec
JB
95192011-11-14 Juanma Barranquero <lekktu@gmail.com>
9520
9521 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9522 just return (bug#10044).
9523
1e5b2111
EZ
95242011-11-12 Eli Zaretskii <eliz@gnu.org>
9525
7ef3cbd5
EZ
9526 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9527 with user-defined heap size. Bump the default size of the temacs
9528 heap to 27MB, to avoid memory warning when running temacs.
9529 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9530
1e5b2111
EZ
9531 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9532 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
9533 (verify_row_hash) [XASSERTS]: New function.
9534 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9535 that the hash value of glyph rows is correct.
1e5b2111 9536
89d61221
MR
95372011-11-12 Martin Rudalics <rudalics@gmx.at>
9538
9539 * window.h (window): Remove splits slot.
9540 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9541 (Fdelete_other_windows_internal, make_parent_window)
9542 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9543 (Fset_window_configuration, save_window_save): Don't deal with
9544 split status of windows.
9545 (saved_window): Remove splits slot.
9546 (Vwindow_splits): Rewrite doc-string.
9547
97f18cc8
JD
95482011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9549
9550 * xfns.c (unwind_create_frame):
9551 * nsfns.m (unwind_create_frame):
9552 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9553 Vframe_list (Bug#9999).
9554
22a648b4
DA
95552011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9556
0b381c7e 9557 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 9558
659afede
KH
95592011-11-11 Kenichi Handa <handa@m17n.org>
9560
9561 * callproc.c (Fcall_process): Set the member dst_multibyte of
9562 process_coding.
9563
9ac0394b
KH
95642011-11-11 Johan Bockgård <bojohan@gnu.org>
9565
9566 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9567 avoid a crash (bug#9496).
9568
2fbdc249
CY
95692011-11-09 Chong Yidong <cyd@gnu.org>
9570
9571 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9572 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9573
ac6b1f81
PE
95742011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9575
9576 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9577
09db192c
PE
95782011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9579
9580 Avoid some portability problems by eschewing 'extern inline' functions.
9581 The trivial performance wins aren't worth the portability hassles; see
9582 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9583 et seq.
9584 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9585 (window_box_width, window_box_left, window_box_left_offset)
9586 (window_box_right, window_box_right_offset): Undo previous change,
9587 by removing the "extern"s.
9588 * intervals.c (adjust_intervals_for_insertion)
9589 (adjust_intervals_for_deletion): Undo previous change,
9590 making these static again.
9591 (offset_intervals, temp_set_point_both, temp_set_point)
9592 (copy_intervals_to_string): No longer inline.
9593 * xdisp.c (window_text_bottom_y, window_box_width)
9594 (window_box_height, window_box_left_offset)
9595 (window_box_right_offset, window_box_left, window_box_right)
9596 (window_box): No longer inline.
9597
105216ed
CY
95982011-11-08 Chong Yidong <cyd@gnu.org>
9599
9600 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
9601 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9602 Signal an error if not a live window.
105216ed
CY
9603 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9604 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9605
ae9e237f
JB
96062011-11-07 Juanma Barranquero <lekktu@gmail.com>
9607
9608 * lisp.h (syms_of_abbrev): Remove declaration.
9609 Reported by CHENG Gao <chenggao@royau.me>.
9610
c7aa8333
EZ
96112011-11-07 Eli Zaretskii <eliz@gnu.org>
9612
9613 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9614 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9615 of temacs in GUI mode.
9616
be7f5545
MR
96172011-11-07 Martin Rudalics <rudalics@gmx.at>
9618
9619 * window.h: Declare delete_all_child_windows instead of
9620 delete_all_subwindows.
9621 * window.c (Fwindow_nest, Fset_window_nest)
9622 (Fset_window_new_total, Fset_window_new_normal)
9623 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9624 (delete_all_subwindows): Rename to delete_all_child_windows.
9625 (Fdelete_other_windows_internal, Fset_window_configuration):
9626 Call delete_all_child_windows instead of delete_all_subwindows.
9627 * frame.c (delete_frame): Call delete_all_child_windows instead
9628 of delete_all_subwindows.
9629
ca78dc43
PE
96302011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9631
9632 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9633 This is also needed for porting to any host where GC_MARK_STACK is
9634 not GC_MAKE_GCPROS_NOOPS.
9635 (which_symbols): Use it.
9636
a0241d01
KH
96372011-11-07 Kenichi Handa <handa@m17n.org>
9638
9639 * coding.c (coding_set_destination): Check coding->src_pos only
9640 when coding->src_object is a buffer (bug#9910).
9641
9642 * process.c (send_process): Set the member src_multibyte of coding
9643 to 0 (bug#9911) when sending a unibyte text.
9644
9645 * callproc.c (Fcall_process): Set the member src_multibyte of
9646 process_coding to 0 (bug#9912).
9647
a64bfdfa 96482011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
9649
9650 * xmenu.c (cleanup_widget_value_tree): New function.
9651 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9652 calling free_menubar_widget_value_tree directly (Bug#9830).
9653
cb41b32a
PE
96542011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9655
9656 Fix some portability problems with 'inline'.
9657 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9658 (window_box_width, window_box_left, window_box_left_offset)
9659 (window_box_right, window_box_right_offset): Declare extern.
9660 Otherwise, these inline functions do not conform to C99 and
9661 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9662 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9663 * intervals.c (adjust_intervals_for_insertion)
9664 (adjust_intervals_for_deletion): Now extern, because otherwise the
9665 extern inline functions 'offset_intervals' couldn't refer to it.
9666 (static_offset_intervals): Remove.
9667 (offset_intervals): Rewrite using the old contents of
9668 static_offset_intervals. The old version didn't conform to C99
9669 because an extern inline function contained a reference to an
9670 identifier with static linkage.
9671
b7041366
AS
96722011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9673
9674 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9675 GC.
9676
88a37c4d
EZ
96772011-11-06 Eli Zaretskii <eliz@gnu.org>
9678
9679 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9680 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9681 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9682 return Qleft_to_right.
9683
49745b39
CY
96842011-11-06 Chong Yidong <cyd@gnu.org>
9685
9686 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9687 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9688 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9689 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9690 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9691 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9692 (Fwindow_vscroll): Doc fix.
9693 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9694 argument, since it makes no sense to pass a live window and for
9695 consistency with window-child.
9696
1f05cd82
CS
96972011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9698
9699 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9700 support MSVC.
9701
22610910
JR
97022011-11-05 Jason Rumney <jasonr@gnu.org>
9703
9704 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9705 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9706 fonts (Bug#6029).
9707 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9708 bitwise arithmetic preventing use of unicode-sip and non-truetype
9709 opentype fonts.
9710
a06776b2
EZ
97112011-11-05 Eli Zaretskii <eliz@gnu.org>
9712
3ad924ba
EZ
9713 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9714 "emacs"-only part.
9715
a06776b2
EZ
9716 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9717 initialization code to keep similarity to xfns.c after changes
9718 from 2011-11-05.
9719
c9e7db78
JD
97202011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9721
a97f8f3f
JD
9722 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9723 (unwind_create_frame): New function (Bug#9943).
9724 (Fx_create_frame): Restructure code to be more similar to the one in
9725 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9726 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9727 Move terminal->reference_count++ just before making the frame official
9728 (Bug#9943).
9729
9730 * nsterm.m (x_free_frame_resources): New function.
9731 (x_destroy_window): Move code to x_free_frame_resources.
9732
c9e7db78 9733 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
9734 (Fx_create_frame, x_create_tip_frame):
9735 Move terminal->reference_count++ just before making the frame
75f1671a 9736 official. Move initialization of image_cache_refcount and
c9e7db78
JD
9737 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9738
a6fc3b5c
EZ
97392011-11-05 Eli Zaretskii <eliz@gnu.org>
9740
9741 Support MSVC build with newer versions of Visual Studio.
9742 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9743 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9744 nt/gmake.defs.
9745
9746 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9747 which are not supported by MSVC.
9748 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9749 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9750 bitfields.
9751 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9752 types in bitfields.
9753 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9754
9755 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9756
58179cce 97572011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
9758
9759 Support MSVC build with newer versions of Visual Studio.
9760 * w32.c: Don't include w32api.h for MSVC.
9761 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9762
9763 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9764 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9765 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9766 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9767 e_* cousins.
9768 (alloca) [_MSC_VER]: Define to _alloca.
9769
9770 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9771
9772 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9773
a58c13ed
EZ
97742011-11-04 Eli Zaretskii <eliz@gnu.org>
9775
9776 * xdisp.c (note_mouse_highlight): If either of
9777 previous/next-single-property-change returns nil, treat that as
9778 the beginning or the end of the buffer. (Bug#9955)
9779
fe0b6370
JD
97802011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9781
a58c13ed 9782 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
9783 label is not null (Bug#9951).
9784 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9785 may be NULL.
9786
89bd5ee1
EZ
97872011-11-04 Eli Zaretskii <eliz@gnu.org>
9788
9789 * window.c (Fwindow_body_size): Mention in the doc string that the
9790 return value is in frame's canonical units. (Bug#9949)
9791
84c3edb9
EZ
97922011-11-03 Eli Zaretskii <eliz@gnu.org>
9793
4e2fb5c7
EZ
9794 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9795
84c3edb9 9796 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 9797 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 9798 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 9799
bc17a887
EZ
98002011-11-01 Eli Zaretskii <eliz@gnu.org>
9801
9802 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9803 Don't stop backward scan on the continuation glyph, even though
9804 its CHARPOS is positive.
6d5eb5b0
SM
9805 (mouse_face_from_buffer_pos, note_mouse_highlight):
9806 Rename cover_string to disp_string.
bc17a887 9807
4ee88440
MR
98082011-11-01 Martin Rudalics <rudalics@gmx.at>
9809
9810 * window.c (temp_output_buffer_show): Don't use
9811 Vtemp_buffer_show_specifiers.
9812 (Vtemp_buffer_show_specifiers): Remove unused variable.
9813
c2ff3c02
EZ
98142011-10-30 Eli Zaretskii <eliz@gnu.org>
9815
9816 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9817 past the beginning of the current glyph matrix.
9818
58179cce 98192011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
9820
9821 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9822 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9823 HAVE_GTK3 (Bug#9869).
b77a6a7f 9824
3b574623
JD
9825 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9826 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9827
b77a6a7f
JD
9828 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9829
9830 * xterm.c: Declare x_handle_net_wm_state to return int.
9831 (handle_one_xevent): Check if we are iconified but don't have
9832 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9833 (get_current_wm_state): Return non-zero if not hidden,
9834 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9835 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9836 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9837 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9838
196e41e4
PE
98392011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9840
9841 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9842 so that this new function doesn't get optimized away by a
9843 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9844
021f2e1a
AS
98452011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9846
9847 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9848
8b058d44
EZ
98492011-10-29 Eli Zaretskii <eliz@gnu.org>
9850
9851 Fix the `xbytecode' command.
9852 * .gdbinit (xprintbytestr): New command.
b50a28de 9853 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
9854 (xbytecode): Print the byte-code string as well.
9855
4452fb80
EZ
98562011-10-29 Kim Storm <storm@cua.dk>
9857
8b058d44
EZ
9858 * alloc.c (which_symbols): New function.
9859
21b72067
AS
98602011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9861
9862 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9863 line. (Bug#9903)
9864
83ed7b5c
GM
98652011-10-29 Glenn Morris <rgm@gnu.org>
9866
9867 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9868 Not clear what it was for, and it causes various bugs. (Bug#9839)
9869
5a7a728b
EZ
98702011-10-28 Eli Zaretskii <eliz@gnu.org>
9871
9872 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9873 possible random value that matches one of those tested as
9874 condition to clear the mouse face.
9875
d3d0842f
CY
98762011-10-28 Chong Yidong <cyd@gnu.org>
9877
9878 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9879
31b39d13
DN
98802011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9881
9882 * window.c (make_window): Initialize phys_cursor_on_p.
9883
9aba6043
SM
98842011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9885
9886 * lisp.h (struct Lisp_Symbol): Update comments.
9887
c20992f4
JB
98882011-10-28 Juanma Barranquero <lekktu@gmail.com>
9889
9890 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9891
db4f02f2
EZ
98922011-10-28 Eli Zaretskii <eliz@gnu.org>
9893
9894 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9895 <oslsachem@gmail.com> for helping to debug this.
9896
9897 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9898 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9899 (g_b_init_get_glyph_outline_w): New static variables.
9900 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9901 (GetGlyphOutlineW_Proc): New typedefs.
9902 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
9903 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9904 New functions.
9905 (w32font_open_internal, compute_metrics):
9906 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
9907 instead of calling the "wide" APIs directly.
9908
9909 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9910
9911 * w32.h (syms_of_w32font): Add prototype.
9912
87e68db4
JB
99132011-10-27 Juanma Barranquero <lekktu@gmail.com>
9914
9915 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9916 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9917 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9918 (Fmove_to_window_line): Doc fix.
9919
435c1d67
CY
99202011-10-27 Chong Yidong <cyd@gnu.org>
9921
9922 * process.c (make_process): Set gnutls_state to NULL.
9923
9924 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9925 non-NULL, regardless of GNUTLS_INITSTAGE.
9926 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
9927 an error. Set process slots as soon as we allocate them.
9928
9929 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
9930
9c6c6f49
CY
99312011-10-27 Chong Yidong <cyd@gnu.org>
9932
9aba6043
SM
9933 * gnutls.c (emacs_gnutls_deinit): New function.
9934 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
9935 (Fgnutls_deinit, Fgnutls_boot): Use it.
9936
9937 * process.c (make_process): Initialize GnuTLS credentials to NULL.
9938 (deactivate_process): Call emacs_gnutls_deinit.
9939
657d08d3
JB
99402011-10-27 Juanma Barranquero <lekktu@gmail.com>
9941
9942 * image.c (x_create_x_image_and_pixmap):
9943 * w32.c (sys_rename, w32_delayed_load):
9944 * w32font.c (fill_in_logfont):
9945 * w32reg.c (x_get_string_resource): Silence compiler warnings.
9946
5430d399
JB
99472011-10-26 Juanma Barranquero <lekktu@gmail.com>
9948
9949 * w32fns.c (w32_default_color_map): New function,
9950 extracted from Fw32_default_color_map.
a7ef684b 9951 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 9952
fe0055fa
PE
99532011-10-25 Paul Eggert <eggert@cs.ucla.edu>
9954
9955 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
9956
e6346438
SM
99572011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
9958
9959 * keyboard.c (test_undefined): New function (bug#9751).
9960 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9961
e112cc37
ET
99622011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
9963
9964 * sysdep.c (init_sys_modes): Fix the check for the controlling
9965 terminal (Bug#6649).
9966
7b5d6677
EZ
99672011-10-20 Eli Zaretskii <eliz@gnu.org>
9968
9969 * dispextern.h (struct bidi_it): New member next_en_type.
9970
9971 * bidi.c (bidi_line_init): Initialize the next_en_type member.
9972 (bidi_resolve_explicit_1): When next_en_pos is valid for the
9973 current character, check also for next_en_type being WEAK_EN.
9974 (bidi_resolve_weak): Don't enter the expensive loop if the current
9975 position is before next_en_pos. Record the bidi type of the first
9976 non-ET, non-BN character we find, in addition to its position.
9977 (bidi_level_of_next_char): Invalidate next_en_type when
9978 next_en_pos is over-stepped.
9979
7da0b018
PE
99802011-10-20 Paul Eggert <eggert@cs.ucla.edu>
9981
9982 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
9983 * editfns.c: Rewrite current-time-zone so that it invokes
9984 the equivalent of (format-time-string "%Z") to get the time zone name.
9985 This fixes a bug when the time zone name contains characters that
9986 need converting from the system time locale to Emacs internal format.
9987 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
9988 that patch fixed format-time-string to do the conversion, but
9989 I forgot to fix current-time-zone.
9990 (format_time_string): New function, containing most of
9991 what Fformat_time_string used to contain.
9992 (Fformat_time_string): Rewrite in terms of format_time_string.
9993 This doesn't change this function's behavior.
9994 (current-time-zone): Rewrite to use format_time_string.
9995 This fixes the bug reported by Michael Schierl in
9996 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
9997 Jason Rumney's 2007-06-07 change worked around this bug, but
9998 didn't fix it.
9999 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10000
8547b010
EZ
100012011-10-19 Eli Zaretskii <eliz@gnu.org>
10002
10003 * xdisp.c (start_display): If the character at POS is displayed
10004 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
10005 (try_window_reusing_current_matrix): If a line ends in a display
10006 vector or the next line starts in a display vector, continue
10007 redrawing the window even though the character position of
10008 start_row was reached.
8547b010
EZ
10009 (Bug#9771, part 2)
10010
4e948d15
CY
100112011-10-18 Chong Yidong <cyd@gnu.org>
10012
10013 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10014 with nobreak-char-display too.
10015
4787455f
EZ
100162011-10-18 Eli Zaretskii <eliz@gnu.org>
10017
10018 Fix part 3 of bug#9771.
10019 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10020 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10021 non-neutral characters if the current character is a paragraph
10022 separator (a.k.a. Newline). This avoids running the same
10023 expensive loop twice, once when we consume the preceding newline
10024 and the other time when the line actually needs to be displayed.
10025 Avoid the loop when we see neutrals on the base embedding level
10026 following a character whose directionality is the same as the
10027 paragraph's. This avoids running the expensive loop when a line
10028 ends in a long sequence of neutrals, like control characters.
10029 Add assertion against STRONG_AL type. Slightly rearrange code
10030 that determines the type of a neutral given the first non-neutral
10031 that follows it.
10032 (bidi_level_of_next_char): Set next_en_pos to zero when
10033 invalidating its info.
10034
2c91f553
EZ
100352011-10-17 Eli Zaretskii <eliz@gnu.org>
10036
10037 * xdisp.c (push_display_prop): Determine whether to record string
10038 or buffer position by IT->string, not by IT->method. Allow
10039 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
10040 (move_it_vertically_backward): Don't look for character position
10041 immediately after the newline when in a continuation line.
10042 (Bug#9771, part 1)
2c91f553 10043
c7b08b0d
MR
100442011-10-15 Martin Rudalics <rudalics@gmx.at>
10045
10046 * window.c (coordinates_in_window): Rewrite and delabelize
10047 vertical border check. (Bug#5357) (Bug#9618)
10048
6b02f655
SM
100492011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10050
10051 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10052 errors in XSetWindowBorder (bug#9310).
10053
81d40c92
DA
100542011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10055
10056 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10057 avoid crash when xmalloc overrun checking is enabled.
10058
d4172c3b
EZ
100592011-10-13 Eli Zaretskii <eliz@gnu.org>
10060
10061 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10062 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10063 cursor motion with <left> and <right> arrow keys.
10064
10065 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10066 some callers set that themselves.
10067
b00eea75
EZ
100682011-10-12 Eli Zaretskii <eliz@gnu.org>
10069
10070 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10071 display string and the previous row comes from the same string and
10072 is empty. (Bug#9739) (Bug#9738)
10073
8fe012c4
SM
100742011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10075
10076 * doc.c (get_doc_string): Encode file name (bug#9735).
10077
0074aef2
EZ
100782011-10-12 Eli Zaretskii <eliz@gnu.org>
10079
79beb178
EZ
10080 * bidi.c (bidi_level_of_next_char):
10081 * xdisp.c (get_visually_first_element): Remove old incorrect
10082 comments regarding the Unicode Line Separator character.
10083
0074aef2
EZ
10084 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10085
6e4b3fbe
DA
100862011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10087
10088 * alloc.c (Fgc_status): Do not access beyond zombies array
10089 boundary if nzombies > MAX_ZOMBIES.
10090 * alloc.c (dump_zombies): Add missing format specifier.
10091
0324f3af
PE
100922011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10093
b5525cac
PE
10094 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10095 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10096
0324f3af
PE
10097 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10098 Some packages use them to denote characters with modifiers.
10099
e9b5f888
AS
101002011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10101
10102 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10103 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10104 matching a pp-number. Rename parameter var to var1.
10105
127827c0
SM
101062011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10107
10108 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10109
c8fd3bd0
GM
101102011-10-08 Glenn Morris <rgm@gnu.org>
10111
10112 * callint.c (Fcall_interactively): Give a more explicit error for the
10113 'c' case with a non-character input. (Bug#8479)
10114
352ec8ff
EZ
101152011-10-08 Eli Zaretskii <eliz@gnu.org>
10116
03669ccb
EZ
10117 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10118 lines.
7061c986
EZ
10119 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10120 lines that are hscrolled on the left.
03669ccb 10121
352ec8ff
EZ
10122 * dispnew.c (buffer_posn_from_coords): Account for a possible
10123 presence of header-line. (Bug#4426)
10124
a66cfb1c
SM
101252011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10126
6b02f655
SM
10127 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10128 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 10129
7c5ee88e
PE
101302011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10131
10132 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10133 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10134 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10135 this makes Emacs dump core during garbage collection on rare
10136 occasions. sizeof is obviously inferior to offsetof here, so
10137 stick with offsetof.
10138 (GC_POINTER_ALIGNMENT): New macro.
10139 (mark_memory): Omit 3rd (offset) arg; caller changed.
10140 Don't assume EMACS_INT alignment is the same as pointer alignment.
10141
df1bbe5b
SM
101422011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10143
10144 * keyboard.c (read_key_sequence_remapped): New var.
10145 (read_key_sequence): Compute remapping in the right buffer.
10146 (command_loop_1): Use read_key_sequence's remapping directly.
10147
51553db6
SM
101482011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10149
32c1fffd
SM
10150 * dired.c (file_name_completion): Don't expand file name.
10151 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10152 before checking file name handler.
10153
51553db6
SM
10154 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10155 they've been requested explicitly (bug#9591).
10156
b6bd1599 101572011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
10158
10159 * keymap.c (Fsingle_key_description): Use make_specified_string
10160 instead of build_string to build string from push_key_description.
10161 (Bug#5193)
10162
f701dc2a
PE
101632011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10164
4222c55d
PE
10165 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10166 This fixes a Y2038 bug on 64-bit hosts.
10167 * buffer.c (reset_buffer):
10168 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10169 (Fclear_buffer_auto_save_failure):
10170 Use 0, not -1, to represent an unset failure time, since time_t
10171 might not be signed.
10172
f701dc2a
PE
10173 Remove dependency on glibc malloc internals.
10174 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10175 Move back here from lisp.h, but with their new implementations.
10176 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10177 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10178 * charset.c (charset_table_init): New static var.
10179 (syms_of_charset): Use it instead of xmalloc. This removes a
10180 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10181 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10182 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10183 Move back to alloc.c.
10184 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10185 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10186
9ceebf39
JD
101872011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10188
10189 * nsterm.m (windowDidResize): Call x_set_window_size only when
10190 ns_in_resize is true. Otherwise set pixelwidth/height and
10191 call change_frame_size (Bug#9628).
10192
cb993c58
PE
101932011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10194
3930c88b
PE
10195 Port --enable-checking=all to Fedora 14 x86-64.
10196 * charset.c (syms_of_charset): Also account for glibc malloc's
10197 internal overhead when calculating the initial malloc maximum.
10198
cb993c58
PE
10199 Port --enable-checking=all to Fedora 14 x86.
10200 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10201 Move to lisp.h.
10202 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10203 (overrun_check_realloc, overrun_check_free):
10204 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10205 That way, xmalloc returns a properly-aligned pointer even if
10206 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10207 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10208 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10209 into account when calculating the initial malloc maximum.
10210 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10211 Move here from alloc.c, so that charset.c can use it too.
10212 Properly align; the old code wasn't right for common 32-bit hosts
10213 when configured with --enable-checking=all.
10214 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10215 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10216
31bed486
EZ
102172011-09-29 Eli Zaretskii <eliz@gnu.org>
10218
04c70788 10219 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
10220 use EDOM.
10221
fbcaa2f3
EZ
102222011-09-28 Eli Zaretskii <eliz@gnu.org>
10223
10224 * xdisp.c (compute_display_string_end): If there's no display
10225 string at CHARPOS, return -1.
10226
10227 * bidi.c (bidi_fetch_char): When compute_display_string_end
10228 returns a negative value, treat the character as a normal
10229 character not covered by a display string. (Bug#9624)
10230
a239d4e9
JB
102312011-09-28 Juanma Barranquero <lekktu@gmail.com>
10232
10233 * lread.c (Fread_from_string): Fix typo in docstring.
10234
88652fd5
EZ
102352011-09-27 Eli Zaretskii <eliz@gnu.org>
10236
10237 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10238 newline, reseat the iterator instead of bidi-iterating there one
10239 character at a time. (Bug#9610)
32c1fffd
SM
10240 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10241 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 10242
ed497dd4
AS
102432011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10244
10245 * lread.c (readevalloop): Use correct code for NBSP.
10246 (read1): Likewise. (Bug#9608)
10247
b2bf61aa
MA
102482011-09-25 Michael Albinus <michael.albinus@gmx.de>
10249
10250 * dbusbind.c (Fdbus_register_signal): When service is not
10251 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10252
32bbb17c
GM
102532011-09-25 Glenn Morris <rgm@gnu.org>
10254
10255 * buffer.c (truncate-lines): Doc fix.
10256
94e0933e
CY
102572011-09-24 Chong Yidong <cyd@stupidchicken.com>
10258
10259 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10260 (Fset_window_next_buffers): Doc fix.
10261
cddde921
GM
102622011-09-24 Glenn Morris <rgm@gnu.org>
10263
10264 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10265
1260aef1
PE
102662011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10267
25b4bfa0
PE
10268 Fix minor problems found by static checking.
10269 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
10270 * indent.c (Fvertical_motion): Fix == vs = typo.
10271
e3cbd34b
EZ
102722011-09-24 Eli Zaretskii <eliz@gnu.org>
10273
a66cfb1c
SM
10274 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10275 Default value is now t. Doc fix.
6bf7006f 10276
e3cbd34b 10277 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 10278 logic when moving up, not only when moving down. Fix the
e3cbd34b 10279 confusing name and values of the it_overshoot_expected variable;
32c1fffd 10280 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
10281
10282 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10283 CHARPOS is covered by a display string which includes newlines.
10284 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10285 is covered by a display string with embedded newlines.
10286
a3de0cbd
MA
102872011-09-24 Michael Albinus <michael.albinus@gmx.de>
10288
10289 * dbusbind.c (Fdbus_register_signal): Add match rule to
10290 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
10291 (Fdbus_register_method, Vdbus_registered_objects_table):
10292 Fix docstring.
a3de0cbd 10293
b260039d
JM
102942011-09-24 Jim Meyering <meyering@redhat.com>
10295
32c1fffd 10296 do not ignore write error for any output size
b260039d
JM
10297 The previous change was incomplete.
10298 While it makes emacs --batch detect the vast majority of stdout
10299 write failures, errors were still ignored whenever the output size is
10300 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10301 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10302 && echo FAIL: ignored write error
10303 FAIL: ignored write error
10304 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10305 && echo FAIL: ignored write error
10306 FAIL: ignored write error
10307 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10308
8eca8a7c
AS
103092011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10310
10311 * emacs.c (Fkill_emacs): In noninteractive mode exit
10312 non-successfully if a write error occurred on stdout. (Bug#9574)
10313
3341db62
EZ
103142011-09-21 Eli Zaretskii <eliz@gnu.org>
10315
10316 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10317 the xassert test.
10318
10319 * dispextern.h (struct it): Update the comment documenting what
10320 can it->OBJECT be.
10321
8c203dbf
EZ
103222011-09-20 Eli Zaretskii <eliz@gnu.org>
10323
10324 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10325 a display string, extend search for cursor position to end of row.
10326 (find_row_edges): If the row ends in a newline from a display
10327 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10328 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
10329 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10330 non-empty line. Fixes confusing cursor motion with arrow keys at
10331 the beginning of a line that starts with whitespace.
8c203dbf 10332
a4824228
LMI
103332011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10334
10335 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10336 (bug#9493).
10337
33ed493b
CY
103382011-09-18 Chong Yidong <cyd@stupidchicken.com>
10339
10340 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10341 boolean (Bug#9154).
10342
56cd55c8
EZ
103432011-09-18 Eli Zaretskii <eliz@gnu.org>
10344
10345 * xdisp.c (display_line): Record maximum and minimum buffer
10346 positions even if no glyphs were produced (e.g., by a zero-width
10347 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10348 buffer positions that will be removed from the glyph row because
10349 they don't fit.
c02dcedf
EZ
10350 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10351 column is beyond frame width: don't subtract 1 "pixel" when
10352 computing width of the stretch.
3e62b7e0
EZ
10353 (reseat_at_next_visible_line_start): Undo the change made on
10354 2011-09-17 that saved paragraph information and restored it after
10355 the call to `reseat'. (Bug#9545)
56cd55c8 10356
5ed99d36 103572011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
10358
10359 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10360 and turn window cursor on if cleared (Bug#9415).
10361
5ed99d36 103622011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
10363
10364 * search.c (boyer_moore): Take unibyte characters from pattern
10365 literally. (Bug#9458)
10366
9bade7b2
EZ
103672011-09-18 Eli Zaretskii <eliz@gnu.org>
10368
10369 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10370
e5e9d610
PE
103712011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10372
87e4427a
PE
10373 Fix minor problem found by static checking.
10374 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10375 initialized, to pacify gcc -Wuninitialized.
10376
e5e9d610
PE
10377 * fileio.c: Report proper errno when syscall falls.
10378 (Finsert_file_contents): Save and restore errno,
10379 so that report_file_error outputs the correct diagnostic.
10380 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10381
a1674f0b
EZ
103822011-09-18 Eli Zaretskii <eliz@gnu.org>
10383
10384 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10385
fbfb6dd4
EZ
103862011-09-17 Eli Zaretskii <eliz@gnu.org>
10387
10388 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10389 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10390
bb187662
EZ
103912011-09-17 Eli Zaretskii <eliz@gnu.org>
10392
1137e8b8 10393 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 10394 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
10395
10396 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10397 (bidi_find_paragraph_start): Search back for paragraph beginning
10398 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10399 (bidi_move_to_visually_next): Only trigger paragraph-related
10400 computations when the last character is a newline or at EOB, not
10401 just any NEUTRAL_B. (Bug#9470)
10402
bb187662
EZ
10403 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10404 truncated lines if point is covered by a display string. (Bug#9524)
10405
2e621251
PE
104062011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10407
10408 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10409 (cons_to_x_long): New function.
10410 (lisp_data_to_selection_data): Use it. Correct the test for
10411 short-versus-long data; it was negated. Break out of vector
10412 loop, for efficiency, when a long datum is discovered.
10413
91a15bc6
SM
104142011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10415
10416 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10417
b41c3a35
EZ
104182011-09-16 Eli Zaretskii <eliz@gnu.org>
10419
10420 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10421 GCC PR/17406) by declaring this function with external scope.
10422
7812ba2d
PE
104232011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10424
10425 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10426 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10427
cf7edc2a
AS
104282011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10429
10430 * editfns.c (Fformat): Correctly handle text properties on "%%".
10431
bd01620e
EZ
104322011-09-15 Eli Zaretskii <eliz@gnu.org>
10433
10434 * xterm.c (x_draw_composite_glyph_string_foreground):
10435 * w32term.c (x_draw_composite_glyph_string_foreground):
10436 * term.c (encode_terminal_code):
10437 * composite.c (composition_update_it, get_composition_id):
10438 * xdisp.c (get_next_display_element)
10439 (fill_composite_glyph_string): Add comments about special meaning
10440 of TAB characters in a composition.
10441
a02719a3
PE
104422011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10443
10444 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
10445 This occurs when processing a multibyte format.
10446 Problem reported by Wolfgang Jenker.
a02719a3 10447
72589a3c
JB
104482011-09-15 Johan Bockgård <bojohan@gnu.org>
10449
10450 * xdisp.c (try_cursor_movement): Only check for exact match if
10451 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10452
1c14176c
PE
104532011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10454
10455 Remove unused external symbols.
10456 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10457 * xdisp.c (calc_pixel_width_or_height): Now static.
10458 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10459 * indent.c (check_display_width):
10460 * w32term.c: Fix comment to match code.
10461 * xterm.c, xterm.h (x_catching_errors): Remove.
10462
d2eea5b5
PE
104632011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10464
10465 * xselect.c: Use signed conversions more consistently (Bug#9498).
10466 (selection_data_to_lisp_data): Assume incoming selection data are
10467 signed integers, not unsigned. This is to be consistent with
10468 outgoing selection data, which was modified to use signed integers
10469 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10470 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10471 expects long, not unsigned long.
10472
46888499
EZ
104732011-09-14 Eli Zaretskii <eliz@gnu.org>
10474
10475 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10476 computation of loop end. Reported by Johan Bockgård
10477 <bojohan@gnu.org>.
10478
ef8ef9fb
CY
104792011-09-13 Chong Yidong <cyd@stupidchicken.com>
10480
10481 * frame.c (Fother_visible_frames_p): Function deleted.
10482
fa819fed
EZ
104832011-09-12 Eli Zaretskii <eliz@gnu.org>
10484
10485 * indent.c (compute_motion): Process display vector front to back
10486 rather than the other way around. (Bug#2496)
10487
2ba8e008
SM
104882011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10489
10490 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10491
20f53c69
CY
104922011-09-11 Chong Yidong <cyd@stupidchicken.com>
10493
10494 * minibuf.c (Fread_from_minibuffer): Doc fix.
10495
d562d7a4
EZ
104962011-09-11 Eli Zaretskii <eliz@gnu.org>
10497
10498 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10499 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10500
1c4d7f3d
LMI
105012011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10502
10503 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10504 value for non-existent files.
10505
b885bf36
EZ
105062011-09-11 Eli Zaretskii <eliz@gnu.org>
10507
10508 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10509 set its "size" to -1. This will set the modtime_size field of
10510 the corresponding buffer to -1, which is what
10511 verify-visited-file-modtime expects for files that do not exist.
10512 (Bug#9139)
10513
6612f0bf
PE
105142011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10515
10516 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10517 here ...
10518 * lisp.h: ... from here. push_key_description is no longer
10519 defined in keyboard.c, so its declaration should not be in
10520 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10521 logically belongs with push_key_description.
10522
dfb3f755
PE
105232011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10524
10525 * buffer.h: Include <sys/types.h> instead of <time.h>.
10526 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10527 Problem reported by Herbert J. Skuhra.
10528
3134906c
LMI
105292011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10530
10531 * xml.c (parse_region): Make the parsing work for
10532 non-comment-starting XML files again (bug#9144).
10533
8d903f4e
AS
105342011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10535
10536 * image.c (gif_load): Fix calculation of bottom and right corner.
10537 (Bug#9468)
10538
80ad64f4
EZ
105392011-09-10 Eli Zaretskii <eliz@gnu.org>
10540
10541 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10542 redisplay in small windows.
10543
208a048d
EZ
105442011-09-09 Eli Zaretskii <eliz@gnu.org>
10545
10546 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10547
9b1c252e
MR
105482011-09-08 Martin Rudalics <rudalics@gmx.at>
10549
10550 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10551 Operate on live windows only.
10552
2949f33b
JB
105532011-09-08 Juanma Barranquero <lekktu@gmail.com>
10554
10555 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10556
e08dcafd
EZ
105572011-09-07 Eli Zaretskii <eliz@gnu.org>
10558
10559 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10560 only under bidi iteration.
10561
115b96bd
JD
105622011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10563
10564 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10565
c8199d0f
PE
105662011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10567
10568 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10569 Without this fix, the command to link temacs failed due to an
10570 undefined symbol __builtin_isnan. This is because
10571 /usr/include/iso/math_c99.h #defines isnan(x) to
10572 __builtin_isnan(x), but the bundled gcc, which identifies itself
10573 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10574 a __builtin_isnan.
10575 * floatfns.c (isnan): #undef, and then #define to a clone of
10576 what's in data.c.
10577 (Fisnan): Always define, since it's always available now.
10578 (syms_of_floatfns): Always define isnan at the Lisp level.
10579
e39b275c 105802011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
10581
10582 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10583
b2db44d9 105842011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 10585
f4af5137 10586 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
10587 The previous code assumed that file offsets (off_t values) fit in
10588 EMACS_INT variables, which is not true on typical 32-bit hosts.
10589 The code messed up by falsely reporting buffer overflow in cases
10590 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10591 when "big" contains more than 2**29 bytes, even though this
10592 inserts just one byte and does not overflow the buffer.
10593 (Finsert_file_contents): Store file offsets as off_t
10594 values, not as EMACS_INT values. Check for overflow when
10595 converting between EMACS_INT and off_t. When checking for
10596 buffer overflow or for overlap, take the offsets into account.
10597 Don't use EMACS_INT for small values where int suffices.
10598 When checking for overlap, fix a typo: ZV was used where
10599 ZV_BYTE was intended.
10600 (Fwrite_region): Don't assume off_t fits into 'long'.
10601 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10602
ecfc0a49
MA
106032011-09-05 Michael Albinus <michael.albinus@gmx.de>
10604
10605 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10606
6511acf2 106072011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 10608
0999621a 10609 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
10610
10611 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 10612 (esprintf, exprintf, evxprintf): New functions.
62f19c19 10613 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 10614 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
10615 (modify_event_symbol): Do not assume that the length of
10616 name_alist_or_stem is safe to alloca and fits in int.
10617 (Fexecute_extended_command): Likewise for function name and binding.
10618 (Frecursion_depth): Wrap around reliably on integer overflow.
10619 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10620 since some callers pass EMACS_INT values.
10621 (Fsingle_key_description): Don't crash if symbol name contains more
10622 than MAX_ALLOCA bytes.
10623 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10624 (get_minibuffer): Arg is now EMACS_INT, not int.
10625 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 10626 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
10627 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10628
2be7d702
PE
10629 * dbusbind.c (signature_cat): New function.
10630 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
10631 Do not overrun buffer; instead, report string overflow.
10632
9d1df220
PE
10633 * dispnew.c (add_window_display_history): Don't overrun buffer.
10634 Truncate instead; this is OK since it's just a log.
10635
33ef5c64
PE
10636 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10637 even if the time zone offset is outlandishly large.
10638 Don't mishandle offset == INT_MIN.
10639
66c6fdd5
PE
10640 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10641 when creating daemon; the previous buffer-overflow check was incorrect.
10642
d749b01b
PE
10643 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10644 which has the guts of the old verror function.
10645
b5cd1905
PE
10646 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10647 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10648
6e1a67fb
PE
10649 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10650 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 10651 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 10652 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
10653 length of string rather than counting it via multiple sprintfs;
10654 that's simpler and more reliable.
c21721cc
PE
10655 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10656 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10657 sprintf, in case result does not fit in int.
10658
c57b67fc
PE
10659 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10660 (fontset_from_font): Print it.
10661
8a401434
PE
10662 * frame.c (tty_frame_count): Now printmax_t, not int.
10663 (make_terminal_frame, set_term_frame_name): Print it.
10664 (x_report_frame_params): In X, window IDs are unsigned long,
10665 not signed long, so print them as unsigned.
10666 (validate_x_resource_name): Check for implausibly long names,
10667 and don't assume name length fits in 'int'.
10668 (x_get_resource_string): Don't blindly alloca invocation name;
10669 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10670 not fit in int.
10671
6e1a67fb
PE
10672 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10673 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
10674 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10675
0df02bf3
PE
10676 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10677 Use esprintf, not sprintf, in case result does not fit in int.
10678
48e30793
PE
10679 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10680 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10681 it as a large positive number.
10682 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10683 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10684
a66ff6d8
PE
10685 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10686 in case result does not fit in int.
10687
aca216ff
PE
10688 * print.c (float_to_string): Detect width overflow more reliably.
10689 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10690 buffer overrun. Don't assume list length fits in 'int'. Treat
10691 print length of 0 as 0, not as infinity; to be consistent with other
10692 uses of print length in this function. Don't overflow print length
10693 index. Don't assume hash table size fits in 'long', or that
10694 vectorlike size fits in 'unsigned long'.
10695
31c286f7
PE
10696 * process.c (make_process): Use printmax_t, not int, to format
10697 process-name gensyms.
10698
55e5faa1
PE
10699 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10700
80f2e268
PE
10701 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10702 to avoid potential buffer overrun.
10703
670741ab
PE
10704 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10705 if X resource line is longer than 512 bytes.
10706
b7163a50
PE
10707 * xfns.c (x_window): Make sprintf buffer a bit bigger
10708 to avoid potential buffer overrun.
10709
ae58ff1f
PE
10710 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10711
c43c8a6a
PE
10712 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10713
3f8236f4
PE
107142011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10715
53e9fe90 10716 Integer overflow fixes for scrolling, etc.
6511acf2
PE
10717 Without these, Emacs silently mishandles large integers sometimes.
10718 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
10719 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10720
6511acf2
PE
10721 * xdisp.c (try_window_id): Check Emacs fixnum range before
10722 converting to 'int'.
806add1d 10723
6511acf2 10724 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
10725 Check that an Emacs fixnum is in range before assigning it to 'int'.
10726 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10727 values converted from Emacs fixnums.
10728 (Frecenter): Don't wrap around a line count if it is out of 'int'
10729 range; instead, treat it as an extreme value.
10730 (Fset_window_configuration, compare_window_configurations):
10731 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10732
6511acf2
PE
10733 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10734 that can exceed INT_MAX. Check that EMACS_INT value is in range
10735 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
10736 (match_limit): Don't assume that a fixnum can fit in 'int'.
10737
6511acf2 10738 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
10739 exceed INT_MAX.
10740
6511acf2 10741 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
10742 (Fvertical_motion): Don't wrap around LINES values that don't fit
10743 in 'int'. Instead, treat them as extreme values. This is good
10744 enough for windows, which can't have more than INT_MAX lines anyway.
10745
fcb901a7
LMI
107462011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10747
0f2f6b6d
LMI
10748 * Require libxml/parser.h to avoid compilation warning.
10749
fcb901a7
LMI
10750 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10751
10752 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10753 since this reportedly can destroy thread storage.
10754
6e20a0d4
CY
107552011-08-30 Chong Yidong <cyd@stupidchicken.com>
10756
10757 * syntax.c (find_defun_start): Update all cache variables if
10758 exiting early (Bug#9401).
10759
148ae00e
EZ
107602011-08-30 Eli Zaretskii <eliz@gnu.org>
10761
f6cfbd8f
EZ
10762 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10763
148ae00e
EZ
10764 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10765 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10766 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10767
10768 * term.c (tty_append_glyph): New function.
10769 (produce_stretch_glyph): Static function and its prototype deleted.
10770
a66cfb1c
SM
10771 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10772 Add prototypes.
148ae00e 10773
c4a07a4c
PE
107742011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10775
10776 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10777 when checking :margin (Bug#9390).
10778 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 10779 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
10780 so that the name doesn't mislead. All uses changed.
10781
6bc8cd65
JB
107822011-08-28 Johan Bockgård <bojohan@gnu.org>
10783
10784 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10785 set_tty_hooks.
10786
dca4927e
EZ
107872011-08-27 Eli Zaretskii <eliz@gnu.org>
10788
10789 * xdisp.c (move_it_to): Don't bail out early when reaching
10790 position beyond to_charpos, if we are scanning backwards.
10791 (move_it_vertically_backward): When DY == 0, make sure we get to
10792 the first character in the line after the newline.
10793
f2cad773
PE
107942011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10795
10796 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10797 (ccl_driver): Do not generate an out-of-range pointer.
10798 (Fccl_execute_on_string): Remove unnecessary check for
10799 integer overflow, noted by Stefan Monnier in
10800 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10801 Remove a FIXME that didn't need fixing.
10802 Simplify the newly-introduced buffer reallocation code.
10803
0cae2cdb
JB
108042011-08-27 Juanma Barranquero <lekktu@gmail.com>
10805
10806 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10807
5fc295a4 108082011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 10809
70c60eb2 10810 Integer and memory overflow issues (Bug#9196).
726e0ab1 10811
d31850da
PE
10812 * doc.c (get_doc_string): Rework so that
10813 get_doc_string_buffer_size is the actual buffer size, rather than
10814 being 1 less than the actual buffer size; this makes xpalloc more
10815 convenient.
10816
a69fbedb
PE
10817 * image.c (x_allocate_bitmap_record, cache_image):
10818 * xselect.c (Fx_register_dnd_atom):
10819 Simplify previous changes by using xpalloc.
10820
fe5c5d37
PE
10821 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10822 since either will do and ptrdiff_t is convenient with xpalloc.
10823
0065d054
PE
10824 * charset.c (charset_table_size)
10825 (struct charset_sort_data.priority): Now ptrdiff_t.
10826 (charset_compare): Don't overflow if priorities differ greatly.
10827 (Fsort_charsets): Don't assume list length fits in int.
10828 Check for size-calculation overflow when allocating sort data.
10829 (syms_of_charset): Allocate an initial charset table that is
10830 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10831
10832 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10833
10834 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10835 The actual value is always <= INT_MAX, and leaving it unsigned made
10836 overflow checking harder.
10837
10838 * dispextern.h (struct glyph_matrix.rows_allocated)
10839 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10840 with xpalloc. The values are still always <= INT_MAX.
10841
10842 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10843
10844 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10845 (SAFE_NALLOCA): New macro.
10846
10847 * region-cache.c (struct boundary.pos, find_cache_boundary)
10848 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10849 (set_cache_region, invalidate_region_cache)
10850 (revalidate_region_cache, know_region_cache, region_cache_forward)
10851 (region_cache_backward, pp_cache):
10852 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10853 so that ptrdiff_t * can be passed to xpalloc.
10854 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10855 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10856 (pp_cache): Don't assume cache_len fits in int.
10857 * region-cache.h: Adjust extern decls to match.
10858
10859 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10860 EMACS_INT, since either will do, for xpalloc.
10861
10862 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10863 (xnmalloc, xnrealloc, xpalloc): New functions.
10864
726e0ab1
PE
10865 * bidi.c (bidi_shelve_header_size): New constant.
10866 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10867 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10868
51f30bc5 10869 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
10870 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10871 (overlay_strings):
10872 Don't update size of array until after memory allocation succeeds,
10873 because xmalloc/xrealloc may not return.
0065d054
PE
10874 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10875 now that we have proper integer overflow checking.
10876 (record_overlay_string, overlay_strings): Catch overflows when
10877 calculating size of overlay_str_buf.
726e0ab1 10878
0065d054
PE
10879 * callproc.c (Fcall_process): Check for size overflow when
10880 calculating size of args2.
10881 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10882 Normally we prefer signed values, but sticking with ptrdiff_t would
10883 require adding more-complicated checks.
726e0ab1
PE
10884
10885 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10886 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10887 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 10888 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
10889
10890 * character.c (Fstring): Check for size-calculation overflow.
10891
10892 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10893 unnecessary integer overflow. Check for size overflow.
10894 (encode_coding_object): Don't update size until xmalloc succeeds.
10895
10896 * composite.c (get_composition_id): Check for overflow in glyph
10897 length calculations.
10898
10899 Integer and memory overflow fixes for display code.
10900 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10901 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10902 (scrolling_window): Check for overflow in size calculations.
10903 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10904 Don't assume glyph table len fits in int.
10905 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10906 (row_table_size): Now ptrdiff_t, not int.
10907 (scrolling_window): Avoid overflow in size calculations.
10908 Don't update size until allocation succeeds.
10909 * fns.c (concat): Check for overflow in size calculations.
10910 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10911 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10912 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10913
10914 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10915 (get_doc_string): Check for size calculation overflow.
10916 Don't update size until allocation succeeds.
10917 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10918 EMACS_INT, where ptrdiff_t will do.
10919 (Fsubstitute_command_keys): Check for string overflow.
10920
10921 * editfns.c (set_time_zone_rule): Don't assume environment length
10922 fits in int.
10923 (message_length): Now ptrdiff_t, not int.
10924 (Fmessage_box): Don't update size until allocation succeeds.
10925 Don't assume message length fits in int.
10926 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10927
0065d054
PE
10928 * emacs.c (main): Do not reallocate argv, since there is a null at
10929 the end that can be overwritten, and this way there's no need to
10930 worry about size-calculation overflow.
10931 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
10932
10933 * eval.c (init_eval_once, grow_specpdl): Don't update size until
10934 alloc succeeds.
10935 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
10936
10937 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
10938 (x_set_scroll_bar_width, x_figure_window_size):
10939 Check for integer overflow.
10940 (x_set_alpha): Do not assume XINT fits in int.
10941
10942 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
10943 This is for the members text_lines, text_cols, total_lines, total_cols,
10944 where the system imposes an 'int' limit.
10945
10946 * fringe.c (Fdefine_fringe_bitmap):
10947 Don't update size until alloc works.
10948
10949 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
10950 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
10951
10952 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
10953 Check for size-calculation overflow.
10954 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
10955 do, as we prefer signed integers.
10956 (id_to_widget.max_size, id_to_widget.used)
10957 (xg_store_widget_in_map, xg_remove_widget_from_map)
10958 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10959 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10960 Use and return ptrdiff_t, not int.
10961 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10962 * gtkutil.h: Change prototypes to match the above.
10963
10964 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10965 are duplicate now that they've been promoted to lisp.h.
10966 (x_allocate_bitmap_record, x_alloc_image_color)
10967 (make_image_cache, cache_image, xpm_load):
10968 Don't update size until alloc is done.
10969 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
10970 (x_detect_edges):
3256efce 10971 Check for size calculation overflow.
726e0ab1
PE
10972 (ct_colors_allocated_max): New constant.
10973 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
10974 overflow.
3256efce 10975
726e0ab1
PE
10976 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
10977 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
10978 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
10979 Use ptrdiff_t, not int, to count maps.
10980 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
10981 calculations. Don't update size until allocation succeeds.
10982 Redo calculations to avoid overflow.
726e0ab1
PE
10983 * keyboard.h: Change prototypes to match the above.
10984
10985 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
10986 to count maps.
10987 (current_minor_maps): Check for size calculation overflow.
10988 * keymap.h: Change prototypes to match the above.
10989
10990 * lread.c (read1, init_obarray): Don't update size until alloc done.
10991
10992 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
10993 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
10994
726e0ab1
PE
10995 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
10996 Now ptrdiff_t, not int.
10997 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
10998 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
10999
11000 * process.c (Fnetwork_interface_list): Check for overflow
11001 in size calculation.
11002
11003 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11004
11005 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11006 overflow. Don't bother calling xmalloc when xrealloc will do.
11007
11008 * search.c (Freplace_match): Check for size calculation overflow.
11009 (Fset_match_data): Don't assume list lengths fit in 'int'.
11010
11011 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11012 for command line length. Do not attempt to address one before the
11013 beginning of an array, as that's not portable.
11014
11015 * term.c (max_frame_lines): Remove; unused.
11016 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11017 not int.
11018 (encode_terminal_code, calculate_costs): Check for size
11019 calculation overflow.
11020 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11021 table lengths and related sizes. Don't update size until alloc
11022 done. Redo calculations to avoid overflow.
11023 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11024
11025 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11026 subtracting pointers.
11027 (gobble_line): Check for overflow more carefully. Don't update size
11028 until alloc done.
11029
11030 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11031 Don't update size until alloc done.
11032 Redo size calculations to avoid overflow.
11033 Check for size calculation overflow.
0065d054 11034 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
11035
11036 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11037 Use ptrdiff_t, not int, for sizes.
11038 (store_mode_line_noprop_char): Don't update size until alloc done.
11039
0065d054
PE
11040 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11041 Use ptrdiff_t, not int, for sizes.
11042 (Finternal_make_lisp_face, cache_face):
11043 Check for size calculation overflow.
11044 (cache_face): Treat size calculation overflows as if they were
11045 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
11046
11047 * xfns.c (x_encode_text, x_set_name_internal)
11048 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11049 sizes, since they can exceed INT_MAX in size. Check for size
11050 calculation overflow.
11051
0065d054
PE
11052 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11053 (xg_select): Check for size calculation overflow.
726e0ab1
PE
11054 Don't update size until alloc done.
11055
0065d054 11056 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 11057 as sprintf is limited to int lengths.
1d526e2f 11058
252c5ee1
PE
11059 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11060 (X_LONG_MIN): New macros.
864d7ce7
PE
11061 Use them to make the following changes clearer.
11062 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11063 This change doesn't affect the value now, but it may help remind
11064 future maintainers not to raise the value too much later.
11065 (SELECTION_QUANTUM): Remove, replacing with ...
11066 (selection_quantum): ... new function, which avoids overflow.
11067 All uses changed.
11068 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11069 assumption that selection length fits in 'int'.
11070 (x_reply_selection_request, x_handle_selection_request)
11071 (x_get_window_property, receive_incremental_selection)
11072 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11073 (lisp_data_to_selection_data, clean_local_selection_data):
11074 Use ptrdiff_t, not int, to record length of selection.
11075 (x_reply_selection_request, x_get_window_property)
11076 (receive_incremental_selection, x_property_data_to_lisp):
11077 Redo calculations to avoid overflow.
11078 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 11079 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
11080 something.
11081 (x_get_window_property, receive_incremental_selection)
11082 (lisp_data_to_selection_data, x_property_data_to_lisp):
11083 Check for size-calculation overflow.
11084 (x_get_window_property, receive_incremental_selection)
11085 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11086 Don't store size until memory allocation succeeds.
11087 (x_get_window_property): Plug memory leak on memory exhaustion.
11088 Don't double-block input; malloc is safe here. Don't assume 2**34
11089 - 4 fits in unsigned long. Add an xassert to check
11090 XGetWindowProperty overflow. Be more careful about overflow
11091 calculations, and distinguish size from memory overflow better.
11092 (receive_incremental_selection): When tracing, don't assume
11093 unsigned int is less than INT_MAX.
11094 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11095 harmful) conversions of unsigned short to int.
11096 (lisp_data_to_selection_data): Don't assume that integers
11097 in the range -65535 through -1 fit in an X unsigned short.
11098 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11099 result parameters unless successful. Rely on cons_to_unsigned
11100 to report problems with elements; the old code wasn't right anyway.
11101 (x_check_property_data): Check for int overflow; we cannot use
11102 a wider type due to X limits.
11103 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11104
726e0ab1 11105 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 11106
0065d054
PE
11107 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11108 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
11109 (x_color_cells): Don't store size until memory allocation succeeds.
11110 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 11111 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
11112 (x_term_init): Don't assume length fits in int (sprintf is limited
11113 to int size).
bc18e09d 11114
ebfa62c0
PE
11115 Use ptrdiff_t for composition IDs.
11116 * character.c (lisp_string_width):
11117 * composite.c (composition_table_size, n_compositions)
11118 (get_composition_id, composition_gstring_from_id):
11119 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11120 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11121 * window.c (Frecenter):
11122 Use ptrdiff_t, not int, for composition IDs.
11123 * composite.c (get_composition_id): Check for integer overflow.
11124 * composite.h: Adjust prototypes to match the above changes.
11125
d3411f89
PE
11126 Use ptrdiff_t for hash table indexes.
11127 * category.c (hash_get_category_set):
11128 * ccl.c (ccl_driver):
11129 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11130 * coding.c (coding_system_charset_list, detect_coding_system):
11131 * coding.h (struct coding_system.id):
11132 * composite.c (get_composition_id, gstring_lookup_cache):
11133 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11134 * image.c (xpm_get_color_table_h):
11135 * lisp.h (hash_lookup, hash_put):
11136 * minibuf.c (Ftest_completion):
11137 Use ptrdiff_t for hash table indexes, not int (which is too
11138 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11139 32-bit --with-wide-int hosts).
11140
e097a6fa
PE
11141 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11142 Add a FIXME comment about memory leaks.
11143 (syms_of_charset): Don't assume xmalloc returns.
11144
5637687f
PE
11145 Don't assume that stated character widths fit in int.
11146 * character.c (Fchar_width, c_string_width, lisp_string_width):
11147 * character.h (CHAR_WIDTH):
11148 * indent.c (MULTIBYTE_BYTES_WIDTH):
11149 Use sanitize_char_width to avoid undefined and/or bad behavior
11150 with outlandish widths.
a66cfb1c 11151 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
11152 now that we have two such functions. All uses changed.
11153 (sanitize_char_width): New inline function.
11154
a2271ba2
PE
11155 Don't assume that tab-width fits in int.
11156 * character.h (sanitize_width): New inline function.
11157 (SANE_TAB_WIDTH): New macro.
11158 (ASCII_CHAR_WIDTH): Use it.
11159 * indent.c (sane_tab_width): Remove. All uses replaced by
11160 SANE_TAB_WIDTH (current_buffer).
11161 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11162
18c52557
PE
11163 * fileio.c: Integer overflow issues with file modes.
11164 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11165
caeeedc1
PE
11166 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11167 Remove unreachable code.
11168 (read_hex, load_charset_map_from_file): Check for integer overflow.
11169
6df6ae42 11170 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
11171 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11172 (x_send_scroll_bar_event): Likewise. Check that the size does not
11173 exceed limits imposed by XClientMessageEvent, as well as the usual
11174 ptrdiff_t and size_t limits.
11175
b13995db
PE
11176 * keyboard.c: Overflow, signedness and related fixes.
11177 (make_lispy_movement): Use same integer type in forward decl
11178 that is used in the definition.
11179 (read_key_sequence, keyremap_step):
11180 Change bufsize argument back to int, undoing my 2011-03-30 change.
11181 We prefer signed types, and int is wide enough here.
11182 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11183 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11184 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11185 length, not size_t. Use ptrdiff_t for index, not int.
11186 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11187 possibility of integer overflow.
11188
13464394
PE
11189 Overflow, signedness and related fixes for images.
11190
11191 * dispextern.h (struct it.stack[0].u.image.image_id)
11192 (struct_it.image_id, struct image.id, struct image_cache.size)
11193 (struct image_cache.used, struct image_cache.ref_count):
11194 * gtkutil.c (update_frame_tool_bar):
11195 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11196 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11197 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11198 * nsmenu.m (update_frame_tool_bar):
11199 * xdisp.c (calc_pixel_width_or_height):
11200 * xfns.c (image_cache_refcount):
11201 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11202 on typical 64-bit hosts.
11203
11204 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11205 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11206 Omit unnecessary casts to int.
11207 (parse_image_spec): Check that integers fall into 'int' range
11208 when the callers expect that.
11209 (image_ascent): Redo ascent calculation to avoid int overflow.
11210 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11211 (lookup_image): Remove unnecessary tests.
11212 (xbm_image_p): Locals are now of int, not EMACS_INT,
11213 since parse_image_check makes sure they fit into int.
11214 (png_load, gif_load, svg_load_image):
11215 Prefer int to unsigned where either will do.
11216 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
11217 old tiff_error_handler and tiff_warning_handler.
11218 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
11219 stack buffer overflows. It uses only the features of vsnprintf
11220 that are common to both POSIX and native Microsoft.
11221 (tiff_error_handler, tiff_warning_handler): Use it.
11222 (tiff_load, gif_load, imagemagick_load_image):
11223 Don't assume :index value fits in 'int'.
11224 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11225 (imagemagick_load_image): Check that crop parameters fit into
11226 the integer types that MagickCropImage accepts. Don't assume
11227 Vimagemagick_render_type has a nonnegative value. Don't assume
11228 size_t fits in 'long'.
11229 (gs_load): Use printmax_t to print the widest integers possible.
11230 Check for integer overflow when computing image height and width.
11231
c11821d4
EZ
112322011-08-26 Eli Zaretskii <eliz@gnu.org>
11233
11234 * xdisp.c (redisplay_window): Don't force window start if point
11235 will be invisible in the resulting window. (Bug#9324)
11236
0c95fcf7
EZ
112372011-08-25 Eli Zaretskii <eliz@gnu.org>
11238
11239 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11240 the display spec is of the form `(space ...)'.
11241 (handle_display_spec): Return the value returned by
11242 handle_single_display_spec, not just 1 or zero.
11243 (handle_single_display_spec): If the display spec is of the form
11244 `(space ...)', and specifies display in the text area, return 2
11245 rather than 1.
fee65a97 11246 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
11247 accurately, and prefer exact match for point under bidi.
11248 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
11249
11250 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11251 into disp_prop; all users changed.
11252
11253 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11254 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11255 for the text covered by the display property.
11256
e4ed06f1
CY
112572011-08-25 Chong Yidong <cyd@stupidchicken.com>
11258
11259 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11260 Change return value to nil.
11261 (Frecord_buffer): Delete unused function.
11262
f67cdd7f
EZ
112632011-08-24 Eli Zaretskii <eliz@gnu.org>
11264
5980d4c6
EZ
11265 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11266 buffers, return left-to-right.
8610fe8b
EZ
11267 (set_cursor_from_row): Consider candidate row a win if its glyph
11268 represents a newline and point is on that newline. Fixes cursor
11269 positioning on the newline at EOL of R2L text within L2R
11270 paragraph, and vice versa.
11271 (try_cursor_movement): Check continued rows, in addition to
11272 continuation rows. Fixes unwarranted scroll when point enters a
11273 continued line of R2L text within an L2R paragraph, or vice versa.
11274 (cursor_row_p): Consider the case of point being equal to
11275 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11276 from the end of a short line to the beginning of a continued line
11277 of R2L text within L2R paragraph.
11278 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11279 composed characters.
5980d4c6 11280
f67cdd7f
EZ
11281 * bidi.c (bidi_check_type): Use xassert.
11282 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11283 members.
11284
bca633fb
EZ
112852011-08-23 Eli Zaretskii <eliz@gnu.org>
11286
11287 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11288 a character.
11289
4a5885a7
CY
112902011-08-23 Chong Yidong <cyd@stupidchicken.com>
11291
11292 * nsfont.m (ns_otf_to_script): Fix typo.
11293
0902a04e
KH
112942011-08-22 Kenichi Handa <handa@m17n.org>
11295
11296 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11297 extra slot even if the purpose is char-code-property-table.
11298
1a2e6670
EZ
112992011-08-23 Eli Zaretskii <eliz@gnu.org>
11300
8ddde651
EZ
11301 * xdisp.c (redisplay_window): When computing centering_position,
11302 account for the height of the header line. (Bug#8874)
11303
425cc014
EZ
11304 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11305 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11306 candidate is selected by the mouse, and that candidate has a
11307 composed character under the mouse.
11308
1a2e6670
EZ
11309 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11310 coordinates reported by pos-visible-in-window-p for a composed
11311 character in column zero.
11312
8b76d6f8
SM
113132011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11314
11315 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11316
dac347dd
EZ
113172011-08-22 Eli Zaretskii <eliz@gnu.org>
11318
11319 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11320 consider it a hit if to_charpos is anywhere in the range of the
11321 composed buffer positions.
11322
e013fb34
CY
113232011-08-22 Chong Yidong <cyd@stupidchicken.com>
11324
11325 * image.c (gif_load): Don't assume that each subimage has the same
11326 dimensions as the base image. Handle disposal method that is
11327 "undefined" by the gif spec (Bug#9335).
11328
bd1ba3e8
CY
113292011-08-20 Chong Yidong <cyd@stupidchicken.com>
11330
11331 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 11332 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 11333
54a1215b
EZ
113342011-08-19 Eli Zaretskii <eliz@gnu.org>
11335
823564e5
EZ
11336 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11337 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11338 from an Org mode buffer to a Speedbar frame.
11339
54a1215b
EZ
11340 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11341 a composition, take its buffer position from IT->cmp_it.charpos.
11342 Fixes cursor positioning at the beginning of a line that begins
11343 with a composed character.
11344
9778ebcc
EZ
113452011-08-18 Eli Zaretskii <eliz@gnu.org>
11346
0be6ee06
EZ
11347 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11348 character bidirectional type, use STRONG_L instead. Fixes crashes
11349 in a buffer produced by `describe-categories'.
11350
9778ebcc
EZ
11351 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11352 members before the level stack, so they would be saved and
11353 restored when copying iterator state. Fixes incorrect reordering
11354 around TABs covered by display properties.
11355
156bffbe
AS
113562011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11357
6b02f655 11358 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 11359
72ad093b
CY
113602011-08-17 Chong Yidong <cyd@stupidchicken.com>
11361
11362 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
11363 (internal_condition_case_2, internal_condition_case_n):
11364 Remove unnecessary aborts (Bug#9081).
72ad093b 11365
35774242
EZ
113662011-08-17 Eli Zaretskii <eliz@gnu.org>
11367
11368 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11369 has no `load' handler, try opening the file locally. (Bug#9311)
11370
db76dd85
KB
113712011-08-16 Ken Brown <kbrown@cornell.edu>
11372
11373 * gmalloc.c: Expand comment.
11374
b215eee5
EZ
113752011-08-16 Eli Zaretskii <eliz@gnu.org>
11376
11377 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11378 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11379
a4579d33
KB
113802011-08-16 Ken Brown <kbrown@cornell.edu>
11381
11382 Fix memory allocation problems in Cygwin build (Bug#9273).
11383
11384 * unexcw.c ( __malloc_initialized): Declare external variable.
11385 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11386
8b76d6f8
SM
11387 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11388 New variables.
a4579d33
KB
11389 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11390 dumped emacs.
11391 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11392 in the static heap.
11393 [CYGWIN] (special_realloc): New function.
11394 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11395 requests to realloc storage in the static heap.
11396
3ebec551
PE
113972011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11398
11399 * bidi.c (bidi_initialize): Remove unused local.
11400
9fd8be00
EZ
114012011-08-15 Eli Zaretskii <eliz@gnu.org>
11402
6b02f655
SM
11403 * bidimirror.h:
11404 * biditype.h: Remove file.
11405 * makefile.w32-in ($(BLD)/bidi.$(O)):
11406 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
11407
11408 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11409
11410 * chartab.c: Improve commentary for the uniprop_table API.
11411
32413314
EZ
11412 * bidi.c (bidi_paragraph_init): Support zero value of
11413 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
11414 (bidi_initialize): Use uniprop_table instead of including
11415 biditype.h and bidimirror.h.
32413314 11416
9fd8be00
EZ
11417 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11418 coordinates of the iterator when restoring from ppos_it.
11419 (Bug#9296)
11420
5cf2b69b
KH
114212011-08-14 Kenichi Handa <handa@m17n.org>
11422
11423 * process.c (create_process): Call setup_process_coding_systems
72ad093b 11424 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 11425
daf17d00
EZ
114262011-08-14 Eli Zaretskii <eliz@gnu.org>
11427
11428 * xdisp.c (move_it_in_display_line_to): Don't invoke
11429 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11430 ppos_it. Fixes vertical cursor motion when line beginning is
11431 covered by an image. (Bug#9296)
11432
08e3161a
JD
114332011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11434
11435 * nsterm.h (ns_run_ascript): Declare.
11436 (NSAPP_DATA2_RUNASSCRIPT): Define.
11437
11438 * nsfns.m (as_script, as_result, as_status): New static variables.
11439 (ns_run_ascript): New function.
5e617bc2 11440 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
11441 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11442 the event loop. Get status from as_status (Bug#7276).
11443
11444 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11445 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11446 the event loop (Bug#7276).
11447
a3720aa2
AS
114482011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11449
11450 * gnutls.c (QCgnutls_bootprop_priority)
11451 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11452 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11453 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11454 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11455 (QCgnutls_bootprop_verify_hostname_error)
11456 (QCgnutls_bootprop_callbacks_verify): Rename from
11457 Qgnutls_bootprop_..., all uses changed.
11458
11459 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11460 uses changed.
11461
0a0d27fb
PE
114622011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11463
19d5c50c
PE
11464 * xfaces.c (Qframe_set_background_mode): Now static.
11465 * dispextern.h (Qframe_set_background_mode): Remove decl.
11466
0a0d27fb
PE
11467 * process.c (Fnetwork_interface_info): Declare local only if needed.
11468
377538cb
JD
114692011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11470
11471 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11472 (Fnetwork_interface_list): Allocate in increments of bytes instead
11473 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11474 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11475 sockaddr.
11476 (struct ifflag_def): notrailers is smart on OSX.
11477 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11478 Get hardware address with getifaddrs if available.
11479
08fff70c
EZ
114802011-08-12 Eli Zaretskii <eliz@gnu.org>
11481
11482 * xdisp.c (iterate_out_of_display_property): xassert that
11483 IT->position is set to within IT->object's boundaries. Break from
11484 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
11485 when IT->position is set up wrongly due to some bug.
11486 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
11487 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11488 entry. Force push_it to save on the stack the current
11489 buffer/string position, to be restored by pop_it. Fix flags in
11490 the iterator structure wrt the object coming from a display
11491 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11492 properties. (Bug#9284)
11493
7be1c708 114942011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 11495
7be1c708
CY
11496 * fontset.c (fontset_get_font_group): Add proper type checks.
11497 (Bug#9172)
aac0c6e3 11498
7be1c708 114992011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 11500
7be1c708
CY
11501 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11502 and LC_VERSION_MIN_MACOSX.
11503 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11504 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 11505
97bb72a6
EZ
115062011-08-08 Eli Zaretskii <eliz@gnu.org>
11507
11508 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
11509 no-display-properties-and-no-overlays under bidi display.
11510 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 11511 properties and overlays.
97bb72a6 11512
d5617611
CY
115132011-08-08 Chong Yidong <cyd@stupidchicken.com>
11514
37e11a63
CY
11515 * editfns.c (Fset_time_zone_rule): Document relationship with the
11516 setenv function.
11517
d5617611
CY
11518 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11519 the font entity extracted from the cache (Bug#8109).
11520
58872834
CY
115212011-08-07 Chong Yidong <cyd@stupidchicken.com>
11522
11523 * composite.c (autocmp_chars): Don't reset point. That is done by
11524 restore_point_unwind (Bug#5984).
11525
75bfc667
JL
115262011-08-07 Juri Linkov <juri@jurta.org>
11527
11528 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11529 to show the arg `TIME' instead of `TIMEVAL'.
11530
d1410150
EZ
115312011-08-06 Eli Zaretskii <eliz@gnu.org>
11532
11533 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11534 display property strides EOL and includes a newline, as in
11535 longlines-mode. (Bug#9254)
75b771e4
EZ
11536 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11537 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
11538
11539 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11540 is non-zero, even if the data buffer is NULL. Fixes a crash in
11541 vertical-motion with longlines-mode. (Bug#9254)
11542
35928349
EZ
115432011-08-05 Eli Zaretskii <eliz@gnu.org>
11544
ec7cc85b
EZ
11545 * bidi.c <bidi_cache_total_alloc>: Now static.
11546 (bidi_initialize): Initialize bidi_cache_total_alloc.
11547
8b76d6f8 11548 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
11549 cache. (Bug#9221)
11550
11551 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11552 amount allocated this far in `bidi_cache_total_alloc'.
11553 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11554 non-zero, only free the data buffer without restoring the cache
11555 contents. All callers changed.
11556
11557 * dispextern.h (bidi_unshelve_cache): Update prototype.
11558
11559 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11560 (move_it_in_display_line, move_it_to)
11561 (move_it_vertically_backward, move_it_by_lines): Replace the call
11562 to xfree to an equivalent call to bidi_unshelve_cache.
11563 (move_it_in_display_line_to): Fix logic of returning
412b6358 11564 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 11565
e2e2423b
EZ
115662011-08-05 Eli Zaretskii <eliz@gnu.org>
11567
11568 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11569 came from a string character with a `cursor' property. (Bug#9229)
11570
ae9e757a
JD
115712011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11572
11573 * Makefile.in (LIB_PTHREAD): New variable.
11574 (LIBES): Add LIB_PTHREAD (Bug#9216).
11575
11576 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11577 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11578
213bd7f2
AS
115792011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11580
6b02f655 11581 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 11582
99aaf75f
JD
115832011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11584
11585 * xterm.c (x_find_topmost_parent): New function.
11586 (x_set_frame_alpha): Find topmost parent window with
11587 x_find_topmost_parent and set the property there also (bug#9181).
11588 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11589
c74e9d86
PE
115902011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11591
11592 * callproc.c (Fcall_process): Avoid vfork clobbering
11593 the local vars buffer, coding_systems, current_dir.
11594
640c8776
SM
115952011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11596
11597 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11598
f26d0e4c
PE
115992011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11600
8a10d76c
PE
11601 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11602 so that it is not optimized away.
11603
f26d0e4c
PE
11604 * xdisp.c (compute_display_string_pos): Remove unused local.
11605
55439c61
EZ
116062011-08-02 Eli Zaretskii <eliz@gnu.org>
11607
11608 Fix slow cursor motion and scrolling in large buffers with
11609 selective display, like Org Mode buffers. (Bug#9218)
11610
11611 * dispextern.h (struct bidi_it): New member disp_prop_p.
11612
11613 * xdisp.c: Remove one-slot cache of display string positions.
11614 (compute_display_string_pos): Accept an additional argument
5e617bc2 11615 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
11616 for a display string or property. If found, set DISP_PROP_P
11617 non-zero.
11618
11619 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
11620 DISP_PROP_P, and pass it to compute_display_string_pos.
11621 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
11622 non-zero. All callers of bidi_fetch_char changed.
11623
fb33fa43
SM
116242011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11625
11626 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11627
b099e063
DM
116282010-12-03 Don March <don@ohspite.net>
11629
11630 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11631 last character M-[char] is translated to ESC [char] (bug#7541).
11632
5cc7f7af
KH
116332011-08-02 Kenichi Handa <handa@m17n.org>
11634
d0fffa3f 11635 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
11636
11637 * chartab.c (uniprop_table): Make it non-static.
11638
525d5e6e
EZ
116392011-08-01 Eli Zaretskii <eliz@gnu.org>
11640
11641 * xdisp.c (forward_to_next_line_start): Accept additional argument
11642 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11643 on the newline.
11644 (reseat_at_next_visible_line_start): Use the bidi iterator state
11645 returned by forward_to_next_line_start to restore the state of
11646 it->bidi_it after backing up to previous newline. (Bug#9212)
11647
31011111
AS
116482011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11649
11650 * regex.c (re_comp): Protoize.
11651 (re_exec): Fix return type.
11652 (regexec): Fix type of `ret'. (Bug#9203)
11653
476371c4
PE
116542011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11655
e5d76069
PE
11656 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11657 This is needed if max-image-size is a floating-point number.
11658
9a79b20c
AS
116592011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11660
11661 * print.c (print_object): Print empty symbol as ##.
11662
11663 * lread.c (read1): Read ## as empty symbol.
11664
d8c2fa78
AA
116652011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11666
11667 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11668 setting frame foreground color (Bug#9175).
11669 (x_set_background_color): Likewise.
11670
ffe57a7a
AA
11671 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11672 contents (Bug#9176).
11673 (EmacsTooltip -init): Remove bezels and add shadows to
11674 tooltip windows.
11675
bf3492a5
AA
11676 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11677 or scroll bar (Bug#8470).
11678
d55e9c53
AA
11679 * nsfont.m (nsfont_open): Remove assignment to voffset and
11680 unnecessary vars hshink, expand, hd, full_height, min_height.
11681 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11682
11683 * nsterm.h (nsfont_info): Remove voffset field.
11684
d8c2fa78 116852011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
11686
11687 Implement strike-through and overline on NextStep (Bug#8863).
11688
11689 * nsfont.m (nsfont_open): Use underline position provided by font,
11690 instead of hard-coded value of 2.
11691 (nsfont_draw): Call ns_draw_text_decoration instead.
11692
11693 * nsterm.h: Add declaration for ns_draw_text_decoration.
11694
11695 * nsterm.m (ns_draw_text_decoration): New function for drawing
11696 underline, overline, and strike-through.
11697 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11698 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 11699 accommodate underlining, etc.
4843aac3 11700
4cc60b9b
EZ
117012011-07-28 Eli Zaretskii <eliz@gnu.org>
11702
bc7ece87
EZ
11703 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11704 default.
4cc60b9b 11705
476371c4
PE
117062011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11707
66606eea
PE
11708 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11709 Without this fix, if a signal arrives just after memory fills up,
11710 'malloc' might be invoked reentrantly.
11711
476371c4
PE
11712 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11713 In other words, assume that every image size is allowed, on non-X
11714 hosts. This assumption is probably wrong, but it lets Emacs compile.
11715
f3fcc40d
AS
117162011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11717
11718 * regex.c (re_iswctype): Convert return values to boolean.
11719
350c992f
EZ
117202011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11721
11722 * xdisp.c (compute_display_string_pos): Don't use cached display
11723 string position if the buffer had its restriction changed.
11724 (Bug#9184)
11725
5266b4bb
PE
117262011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11727
11728 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11729
2573a837 117302011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 11731
41f55ccd 11732 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 11733
39e378da
PE
11734 * bidi.c: Integer size and overflow fixes.
11735 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11736 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11737 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11738 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11739 (bidi_find_other_level_edge):
11740 Use ptrdiff_t instead of EMACS_INT where either will do.
11741 This works better on 32-bit hosts configured --with-wide-int.
11742 (bidi_cache_ensure_space): Check for size-calculation overflow.
11743 Use % rather than repeated addition, for better worst-case speed.
11744 Don't set bidi_cache_size until after xrealloc returns, because it
11745 might not return.
11746 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
11747 (bidi_cache_ensure_space): Also check that the bidi cache size
11748 does not exceed that of the largest Lisp string or buffer. See Eli
11749 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 11750
5e927815
PE
11751 * alloc.c (__malloc_size_t): Remove.
11752 All uses replaced by size_t. See Andreas Schwab's note
11753 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11754
ca4aa935
PE
11755 * image.c: Improve checking for integer overflow.
11756 (check_image_size): Assume that f is nonnull, since
11757 it is always nonnull in practice. This is one less thing to
11758 worry about when checking for integer overflow later.
11759 (x_check_image_size): New function, which checks for integer
11760 overflow issues inside X.
11761 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11762 This removes the need for a memory_full check.
11763 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11764 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11765 (xbm_read_bitmap_data): Change locals back to 'int', since
11766 their values must fit in 'int'.
11767 (xpm_load_image, png_load, tiff_load):
11768 Invoke x_create_x_image_and_pixmap earlier,
11769 to avoid much needless work if the image is too large.
11770 (tiff_load): Treat overly large images as if
11771 x_create_x_image_and_pixmap failed, not as malloc failures.
11772 (gs_load): Use x_check_image_size.
11773
5f8f9cc2
PE
11774 * gtkutil.c: Omit integer casts.
11775 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11776 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11777
5adf60bc
PE
11778 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11779
c8907a93
PE
11780 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11781 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11782 would wrongly return t on a 64-bit host.
11783
e3c25c68
PE
11784 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11785 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11786 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11787 and therefore cause GCC to emit a bogus diagnostic in some cases.
11788
3f791afe
PE
11789 * image.c: Integer signedness and overflow and related fixes.
11790 This is not an exhaustive set of fixes, but it's time to
11791 record what I've got.
11792 (lookup_pixel_color, check_image_size): Remove redundant decls.
11793 (check_image_size): Don't assume that arbitrary EMACS_INT values
11794 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11795 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11796 (tiff_load, imagemagick_load_image):
11797 Check for overflow in size calculations.
11798 (x_create_x_image_and_pixmap): Remove unnecessary test for
11799 xmalloc returning NULL; that can't happen.
11800 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11801 (xpm_color_bucket): Use better integer hashing function.
11802 (xpm_cache_color): Don't possibly over-allocate memory.
11803 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11804 (gif_memory_source):
11805 Use ptrdiff_t, not int or size_t, to record sizes.
11806 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11807 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11808 either works, as we prefer signed integers.
11809 (tiff_read_from_memory, tiff_write_from_memory):
11810 Return tsize_t, not size_t, since that's what the TIFF API wants.
11811 (tiff_read_from_memory): Don't fail simply because the read would
11812 go past EOF; instead, return a short read.
11813 (tiff_load): Omit no-longer-needed casts.
11814 (Fimagemagick_types): Don't assume size fits into 'int'.
11815
3cc5a532
PE
11816 Improve hashing quality when configured --with-wide-int.
11817 * fns.c (hash_string): New function, taken from sxhash_string.
11818 Do not discard information about ASCII character case; this
11819 discarding is no longer needed.
11820 (sxhash-string): Use it. Change sig to match it. Caller changed.
11821 * lisp.h: Declare it.
11822 * lread.c (hash_string): Remove, since we now use fns.c's version.
11823 The fns.c version returns a wider integer if --with-wide-int is
11824 specified, so this should help the quality of the hashing a bit.
11825
b312a492
PE
11826 * emacs.c: Integer overflow minor fix.
11827 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11828 Define only if GNU_LINUX.
11829 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11830
dfd153ae
PE
11831 * dispnew.c: Integer signedness and overflow fixes.
11832 Remove unnecessary forward decls, that were a maintenance hassle.
11833 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11834 All uses changed.
11835 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11836 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11837 (prepare_desired_row, line_draw_cost):
11838 Use int, not unsigned, where either works.
11839 (save_current_matrix, restore_current_matrix):
11840 Use ptrdiff_t, not size_t, where either works.
11841 (init_display): Check for overflow more accurately, and without
11842 relying on undefined behavior.
11843
a81d11a3
PE
11844 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11845 Remove, replacing with the new symbols in lisp.h. All uses changed.
11846 * fileio.c (make_temp_name):
11847 * filelock.c (lock_file_1, lock_file):
11848 * xdisp.c (message_dolog):
11849 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11850 Use pMd etc. instead.
11851 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11852 replacing the pWIDE etc. symbols removed from editfns.c.
11853
3300e6fd
PE
11854 * keyboard.h (num_input_events): Now uintmax_t.
11855 This is (very slightly) less likely to mess up due to wraparound.
11856 All uses changed.
11857
fd05c7e9
PE
11858 * buffer.c: Integer signedness fixes.
11859 (alloc_buffer_text, enlarge_buffer_text):
11860 Use ptrdiff_t rather than size_t when either will do, as we prefer
11861 signed integers.
11862
903fe15d
PE
11863 * alloc.c: Integer signedness and overflow fixes.
11864 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11865 (__malloc_size_t): Default to size_t, not to int.
11866 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11867 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11868 Prefer ptrdiff_t to size_t when either would do, as we prefer
11869 signed integers.
11870 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11871 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11872 Now const. Initialize with values that are in range even if char
11873 is signed.
11874 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11875 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11876 These functions do the right thing with sizes > 2**32.
11877 (check_depth): Now ptrdiff_t, not int.
11878 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11879 Adjust to new way of storing sizes. Check for size overflow bugs
11880 in rest of code.
11881 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11882 slightly wrong anyway, as it missed one instance of
11883 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11884 (refill_memory_reserve): Omit needless cast to size_t.
11885 (mark_object_loop_halt): Mark as externally visible.
11886
ac82cc6a
PE
11887 * xselect.c: Integer signedness and overflow fixes.
11888 (Fx_register_dnd_atom, x_handle_dnd_message):
11889 Use ptrdiff_t, not size_t, since we prefer signed.
11890 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11891 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11892 x_dnd_atoms_size and x_dnd_atoms_length.
11893
c2d1e36d
PE
11894 * doprnt.c: Prefer signed to unsigned when either works.
11895 * eval.c (verror):
11896 * doprnt.c (doprnt):
11897 * lisp.h (doprnt):
11898 * xdisp.c (vmessage):
11899 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11900 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11901 prefer signed arithmetic to avoid comparison confusion.
11902 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11903 but is a bit tricky.
11904
0e926e56
PE
11905 Assume freestanding C89 headers, string.h, stdlib.h.
11906 * data.c, doprnt.c, floatfns.c, print.c:
11907 Include float.h unconditionally.
11908 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11909 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11910 * regex.c: Likewise for stddef.h, string.h.
11911 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11912 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11913 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11914 (STDC_HEADERS): Remove obsolete defines.
11915 * sysdep.c: Include limits.h unconditionally.
11916
9cfdb3ec
PE
11917 Assume support for memcmp, memcpy, memmove, memset.
11918 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11919 * regex.c (memcmp, memcpy):
11920 Remove; we assume C89 now.
11921
11922 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11923 (__malloc_safe_bcopy): Remove; no longer needed.
11924
cf950e6b 11925 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
11926 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
11927 well either way, and we prefer signed to unsigned.
11928
dbf38e02
LMI
119292011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
11930
11931 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
11932 closes the connection while we're reading (bug#9182).
11933
d6f0886c 119342011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 11935
d6f0886c
JD
11936 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
11937 are specified (Bug#9168).
24e0f6b1 11938
2eb1f9e6
PE
119392011-07-25 Paul Eggert <eggert@cs.ucla.edu>
11940
11941 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
11942 Found by GCC static checking and --with-wide-int on a 32-bit host.
11943
22381272 119442011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
11945
11946 * xdisp.c (compute_display_string_pos): Fix logic of caching
11947 previous display string position. Initialize cached_prev_pos to
11948 -1. Fixes slow-down at the beginning of a buffer.
11949
f25e39b4
EZ
119502011-07-24 Eli Zaretskii <eliz@gnu.org>
11951
11952 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
11953 for attrs[LFACE_FONTSET_INDEX].
11954
04c4b52e
PE
119552011-07-23 Paul Eggert <eggert@cs.ucla.edu>
11956
11957 * xml.c (parse_region): Remove unused local
11958 that was recently introduced.
11959
c1734fbd
EZ
119602011-07-23 Eli Zaretskii <eliz@gnu.org>
11961
be18c5a5
EZ
11962 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11963 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
11964
c1734fbd
EZ
11965 * xdisp.c (move_it_in_display_line_to): Record the best matching
11966 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
11967 exit if none of the characters scanned was an exact match.
11968 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
11969 when exact match is impossible due to invisible text, and the
11970 lines are truncated.
11971
a258d627
JD
119722011-07-23 Jan Djärv <jan.h.d@swipnet.se>
11973
11974 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
11975 for OSX >= 10.7.
11976
b6d5a689
EZ
119772011-07-22 Eli Zaretskii <eliz@gnu.org>
11978
0f74f785
EZ
11979 Fix a significant slow-down of cursor motion with C-n, C-p,
11980 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
11981 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 11982 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
11983 (next_element_from_buffer): Call compute_stop_pos_backwards to
11984 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
11985 base_level_stop.
11986 (reseat): Don't look for prev_stop, as that could mean a very long
11987 run.
11988 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
11989 <cached_disp_overlay_modiff>: Cache for last found display string
11990 position.
551918c1 11991 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
11992 about the same buffer in the same area of character positions, and
11993 the buffer wasn't changed since the time the display string
11994 position was cached.
551918c1 11995
b2d0c91a
EZ
119962011-07-22 Eli Zaretskii <eliz@gnu.org>
11997
11998 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
11999 is an integer, which is important for empty lines. (Bug#9149)
12000
043604ee
CY
120012011-07-22 Chong Yidong <cyd@stupidchicken.com>
12002
12003 * frame.c (Fmodify_frame_parameters): In tty case, update the
12004 default face if necessary (Bug#4238).
12005
da4adb04
CY
120062011-07-21 Chong Yidong <cyd@stupidchicken.com>
12007
12008 * editfns.c (Fstring_to_char): No need to explain what a character
12009 is in the docstring (Bug#6576).
12010
9abd0532
LMI
120112011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12012
12013 * xml.c (parse_region): Make sure we always return a tree.
12014
36881d16
HK
120152011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12016
12017 * xml.c (parse_region): If a document contains only comments,
12018 return that, too.
12019
1e98674d
LMI
120202011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12021
12022 * xml.c (make_dom): Return comments, too.
12023
590bd467
PE
120242011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12025
12026 Port to OpenBSD.
12027 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12028 and the surrounding thread.
12029 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12030 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12031 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12032 timer goes off.
12033 * s/openbsd.h (BROKEN_SIGIO): Define.
12034 * unexelf.c (unexec) [__OpenBSD__]:
12035 Don't update the .mdebug section of the Alpha COFF symbol table.
12036
f41628b2
LMI
120372011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12038
12039 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12040 (bug#8460).
12041
b59b67c5
PE
120422011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12043
15e3a074
PE
12044 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12045 This fixes some race conditions on the permissions of any newly
12046 created file.
12047
41bed37d
PE
12048 * alloc.c (valid_pointer_p): Use pipe, not open.
12049 This fixes some permissions issues when debugging.
12050
b59b67c5
PE
12051 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12052 If fchown fails to set both uid and gid, try to set just gid,
12053 as that is sometimes allowed. Adjust the file's mode to eliminate
12054 setuid or setgid bits that are inappropriate if fchown fails.
12055
925a6be7
SM
120562011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12057
12058 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12059 to compare Lisp_Objects.
12060 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12061 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12062 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12063
52968808
AS
120642011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12065
0a6a104b
AS
12066 * lread.c (read_integer): Unread even EOF character.
12067 (read1): Likewise. Properly record start position of symbol.
12068
52968808
AS
12069 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12070 symbol character follows.
12071
9e381cdd
PE
120722011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12073
12074 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12075 This works around a problem with the previous change to Fcopy_file.
12076 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12077 and without this change, GCC might complain about discarding
12078 fchown's return value.
12079
b5641435
JB
120802011-07-16 Juanma Barranquero <lekktu@gmail.com>
12081
12082 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12083
a8031457
PE
120842011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12085
12086 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12087
dd889327
LMI
120882011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12089
750c33f7
LMI
12090 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12091 it's used from the C level.
12092
dd889327
LMI
12093 * process.c: Use the same condition for POLL_FOR_INPUT in both
12094 keyboard.c and process.c (bug#1858).
12095
87e86684
LM
120962011-07-09 Lawrence Mitchell <wence@gmx.li>
12097
12098 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12099 (Fgnutls_boot): Use it.
12100
64348f40
AS
121012011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12102
12103 * doc.c (Fsubstitute_command_keys): Revert last change.
12104
1d698799
LMI
121052011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12106
f863868c
LMI
12107 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12108 quotes the next character, and doesn't affect other longer
12109 sequences (bug#8935).
12110
1d698799
LMI
12111 * lread.c (syms_of_lread): Clarify that is isn't only
12112 `eval-buffer' and `eval-defun' that's affected by
12113 `lexical-binding' (bug#8460).
12114
aa4b6df6
EZ
121152011-07-15 Eli Zaretskii <eliz@gnu.org>
12116
12117 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 12118 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 12119
5d856da6
PE
121202011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12121
ad6042bb
PE
12122 Fix minor problems found by static checking.
12123 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12124 (elsz): Now a signed constant, not a size_t var. We prefer signed
12125 types to unsigned, to avoid integer comparison confusion. Without
12126 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12127 "cannot optimize loop, the loop counter may overflow", a symptom
12128 of the confusion.
f00bbb22 12129 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
12130 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12131
6468f31c
LMI
121322011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12133
49080b10
LMI
12134 * search.c (Fre_search_backward): Mention `case-fold-search' in
12135 all the re_search_* functions (bug#8138).
12136
6468f31c
LMI
12137 * keyboard.c (Fopen_dribble_file): Document when the file is
12138 closed (bug#8056).
12139
c965adc5
EZ
121402011-07-14 Eli Zaretskii <eliz@gnu.org>
12141
df9733bf
EZ
12142 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12143 bidi_cache_idx.
12144
0bb23927
EZ
12145 Support bidi reordering of display and overlay strings.
12146 * xdisp.c (compute_display_string_pos)
12147 (compute_display_string_end): Accept additional argument STRING.
12148 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12149 (reseat_to_string): Initialize bidi_it->string.s and
12150 bidi_it->string.schars.
12151 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
12152 NULL (avoids a crash in bidi_paragraph_init).
12153 Initialize itb.string.lstring.
0bb23927
EZ
12154 (init_iterator): Call bidi_init_it only of a valid
12155 buffer position was specified. Initialize paragraph_embedding to
12156 L2R.
12157 (reseat_to_string): Initialize the bidi iterator.
12158 (display_string): If we need to ignore text properties of
12159 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12160 original value of -1 will not work with bidi.)
12161 (compute_display_string_pos): First arg is now struct
12162 `text_pos *'; all callers changed. Support display properties on
12163 Lisp strings.
12164 (compute_display_string_end): Support display properties on Lisp
12165 strings.
12166 (init_iterator, reseat_1, reseat_to_string): Initialize the
12167 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12168 when iterating on a string not from display properties).
640c8776
SM
12169 (compute_display_string_pos, compute_display_string_end):
12170 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
12171 arrow keys.
12172 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
12173 base_level_stop; instead, set base_level_stop to BEGV.
12174 Fixes crashes in vertical-motion.
0bb23927
EZ
12175 (next_element_from_buffer): Improve commentary for when
12176 the iterator is before prev_stop.
12177 (init_iterator): Initialize bidi_p from the default value of
12178 bidi-display-reordering, not from buffer-local value. Use the
12179 buffer-local value only if initializing for buffer iteration.
12180 (handle_invisible_prop): Support invisible properties on strings
12181 that are being bidi-reordered.
12182 (set_iterator_to_next): Support bidi reordering of C strings and
12183 Lisp strings.
12184 (next_element_from_string): Support bidi reordering of Lisp
12185 strings.
12186 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
12187 (display_string): Support display of R2L glyph rows.
12188 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
12189 (init_iterator): Don't initialize it->bidi_p for strings
12190 here.
12191 (reseat_to_string): Initialize it->bidi_p for strings here.
12192 (next_element_from_string, next_element_from_c_string)
12193 (next_element_from_buffer): Add xassert's for correspondence
12194 between IT's object being iterated and it->bidi_it.string
12195 structure.
12196 (face_before_or_after_it_pos): Support bidi iteration.
12197 (next_element_from_c_string): Handle the case of the first string
12198 character that is not the first one in the visual order.
12199 (get_visually_first_element): New function, refactored from common
12200 parts of next_element_from_buffer, next_element_from_string, and
12201 next_element_from_c_string.
12202 (tool_bar_lines_needed, redisplay_tool_bar)
12203 (display_menu_bar): Force left-to-right direction. Add a FIXME
12204 comment for making that be controlled by a user option.
12205 (push_it, pop_it): Save and restore the state of the
12206 bidi iterator. Save and restore the bidi_p flag.
12207 (pop_it): Iterate out of display property for string iteration as
12208 well.
12209 (iterate_out_of_display_property): Support iteration over strings.
12210 (handle_single_display_spec): Set up it->bidi_it for iteration
12211 over a display string, and call bidi_init_it.
12212 (handle_single_display_spec, next_overlay_string)
12213 (get_overlay_strings_1, push_display_prop): Set up the bidi
12214 iterator for displaying display or overlay strings.
12215 (forward_to_next_line_start): Don't use the shortcut if
12216 bidi-iterating.
12217 (back_to_previous_visible_line_start): If handle_display_prop
12218 pushed the iterator stack, restore the internal state of the bidi
12219 iterator by calling bidi_pop_it same number of times.
12220 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12221 and we are bidi-iterating, don't decrement the iterator position;
12222 instead, set the first_elt flag in the bidi iterator, to produce
12223 the same effect.
12224 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12225 (push_display_prop): xassert that we are iterating a buffer.
12226 (push_it, pop_it): Save and restore paragraph_embedding member.
12227 (handle_single_display_spec, next_overlay_string)
12228 (get_overlay_strings_1, reseat_1, reseat_to_string)
12229 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12230 correctly. Don't assume unibyte strings are not bidi-reordered.
12231 (compute_display_string_pos)
12232 (compute_display_string_end): Fix handling the case of C string.
12233 (push_it, pop_it): Save and restore from_disp_prop_p.
12234 (handle_single_display_spec, push_display_prop): Set the
12235 from_disp_prop_p flag.
12236 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12237 (pop_it): Call iterate_out_of_display_property only if we are
12238 popping after iteration over a string that came from a display
12239 property. Fix a typo in popping stretch info. Add an assertion
12240 for verifying that the iterator position is in sync with the bidi
12241 iterator.
12242 (handle_single_display_spec, get_overlay_strings_1)
12243 (push_display_prop): Fix initialization of paragraph direction for
12244 string when that of the parent object is not yet determined.
12245 (reseat_1): Call bidi_init_it to resync the bidi
12246 iterator with IT's position. (Bug#7616)
12247 (find_row_edges): If ROW->start.pos gives position
12248 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12249 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12250 Reset the from_disp_prop_p flag.
12251 (SAVE_IT, RESTORE_IT): New macros.
12252 (pos_visible_p, face_before_or_after_it_pos)
12253 (back_to_previous_visible_line_start)
12254 (move_it_in_display_line_to, move_it_in_display_line)
12255 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12256 (try_scrolling, redisplay_window, display_line): Use them when
12257 saving a temporary copy of the iterator and restoring it back.
12258 (back_to_previous_visible_line_start, reseat_1)
12259 (init_iterator): Empty the bidi cache "stack".
12260 (move_it_in_display_line_to): If iterator ended up at
12261 EOL, but we never saw any buffer positions smaller than
12262 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12263 motion in bidi-reordered lines.
12264 (move_it_in_display_line_to): Record prev_method and prev_pos
12265 immediately before the call to set_iterator_to_next. Fixes cursor
12266 motion in bidi-reordered lines with stretch glyphs and strings
12267 displayed in margins. (Bug#8133) (Bug#8867)
12268 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12269 TO_CHARPOS.
640c8776
SM
12270 (pos_visible_p): Support positions in bidi-reordered lines.
12271 Save and restore bidi cache.
0bb23927
EZ
12272
12273 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12274 (bidi_paragraph_info): Delete unused struct.
12275 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12276 (bidi_cache_start): New variable.
12277 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12278 to zero.
12279 (bidi_cache_fetch_state, bidi_cache_search)
12280 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12281 (bidi_cache_find, bidi_peek_at_next_level)
12282 (bidi_level_of_next_char, bidi_find_other_level_edge)
12283 (bidi_move_to_visually_next): Compare cache index with
12284 bidi_cache_start rather than with zero.
12285 (bidi_fetch_char): Accept new argument STRING; all callers
12286 changed. Support iteration over a string. Support strings with
12287 display properties. Support unibyte strings. Fix the type of
12288 `len' according to what STRING_CHAR_AND_LENGTH expects.
12289 (bidi_paragraph_init, bidi_resolve_explicit_1)
12290 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
12291 (bidi_level_of_next_char, bidi_move_to_visually_next):
12292 Support iteration over a string.
0bb23927
EZ
12293 (bidi_set_sor_type, bidi_resolve_explicit_1)
12294 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12295 can now be zero (for strings); special values 0 and -1 were
12296 changed to -1 and -2, respectively.
12297 (bidi_char_at_pos): New function.
12298 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12299 Call it instead of FETCH_MULTIBYTE_CHAR.
12300 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12301 initialized to valid values.
12302 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12303 values.
12304 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12305 the test for valid cached positions. Fix the logic for looking up
12306 the sentinel state in the cache. GCPRO the Lisp string we are
12307 iterating.
12308 (bidi_push_it, bidi_pop_it): New functions.
12309 (bidi_initialize): Initialize the bidi cache start stack pointer.
12310 (bidi_cache_ensure_space): New function, refactored from part of
12311 bidi_cache_iterator_state. Don't assume the required size is just
12312 one BIDI_CACHE_CHUNK away.
12313 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12314 (bidi_count_bytes, bidi_char_at_pos): New functions.
12315 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12316 always valid if bidi_cache_idx is valid.
12317 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12318 is valid if it's going to be used.
12319 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12320 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
12321 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12322 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
12323 (bidi_find_other_level_edge, bidi_cache_start_stack):
12324 All variables related to cache indices are now EMACS_INT.
c965adc5 12325
0bb23927
EZ
12326 * dispextern.h (struct bidi_string_data): New structure.
12327 (struct bidi_it): New member `string'. Make flag members be 1-bit
12328 fields, and put them last in the struct.
640c8776
SM
12329 (compute_display_string_pos, compute_display_string_end):
12330 Update prototypes.
0bb23927
EZ
12331 (bidi_push_it, bidi_pop_it): Add prototypes.
12332 (struct iterator_stack_entry): New members bidi_p,
12333 paragraph_embedding, and from_disp_prop_p.
12334 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
12335 (bidi_shelve_cache, bidi_unshelve_cache):
12336 Declare prototypes.
0bb23927
EZ
12337
12338 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12339 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12340 and vector-like objects.
12341
12342 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12343 cache around display iteration.
12344
12345 * window.c (Fwindow_end, window_scroll_pixel_based)
12346 (displayed_window_lines, Frecenter): Save and restore the bidi
12347 cache around display iteration.
12348
3bbd2265
LMI
123492011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12350
12351 * editfns.c (Fdelete_region): Clarify the use of the named
12352 parameters (bug#6788).
12353
adc47434
MR
123542011-07-14 Martin Rudalics <rudalics@gmx.at>
12355
12356 * indent.c (Fvertical_motion): Set and restore w->pointm when
12357 saving and restoring the window's buffer (Bug#9006).
12358
837c31f8
LMI
123592011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12360
12361 * editfns.c (Fstring_to_char): Clarify just what is returned
12362 (bug#6576). Text by Eli Zaretskii.
12363
ac389d0c
JB
123642011-07-13 Juanma Barranquero <lekktu@gmail.com>
12365
12366 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12367
0be0ce47
EZ
123682011-07-13 Eli Zaretskii <eliz@gnu.org>
12369
12370 * buffer.c (mmap_find): Fix a typo.
12371
cd18e7e3
JB
123722011-07-13 Johan Bockgård <bojohan@gnu.org>
12373
12374 Fix execution of x selection hooks.
12375 * xselect.c (Qx_lost_selection_functions)
12376 (Qx_sent_selection_functions): New vars.
12377 (syms_of_xselect): DEFSYM them.
12378 (x_handle_selection_request): Pass Qx_sent_selection_functions
12379 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12380 (x_handle_selection_clear,x_clear_frame_selections):
12381 Pass Qx_lost_selection_functions rather than
12382 Vx_lost_selection_functions to Frun_hook_with_args.
12383
47ea7f44
PE
123842011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12385
ac389d0c 12386 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
12387 The old code sometimes used this field without initializing it.
12388
47ea7f44
PE
12389 * alloc.c (gc_sweep): Don't read past end of array.
12390 In theory, the old code could also have corrupted Emacs internals,
12391 though it'd be very unlikely.
12392
bc985c87
AS
123932011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12394
12395 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 12396 argument. (Bug#4026)
bc985c87 12397
0cf34688
LMI
123982011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12399
b3dadd76
LMI
12400 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12401 key" (bug#4257).
12402
0cf34688
LMI
12403 * window.c (Fset_window_start): Doc fix (bug#4199).
12404 (Fset_window_hscroll): Ditto.
12405
270768cd
PE
124062011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12407
077e3dda 12408 Fix minor new problems caught by GCC 4.6.1.
270768cd 12409 * term.c (init_tty): Remove unused local.
490011a6 12410 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 12411 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 12412 not used otherwise.
270768cd 12413
b1f58454
CY
124142011-07-12 Chong Yidong <cyd@stupidchicken.com>
12415
12416 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12417
22b9578d
LMI
124182011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12419
6e70ab07
LMI
12420 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12421 are the mini-buffer and the echo area (bug#3320).
12422
22b9578d
LMI
12423 * term.c (init_tty): Remove support for supdup, c10 and perq
12424 terminals, which are no longer supported (bug#1482).
12425
8974cc9f
JB
124262011-07-10 Johan Bockgård <bojohan@gnu.org>
12427
12428 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12429
a560d974
JD
124302011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12431
12432 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12433 for non-popups (Bug#3642).
12434
1dae0f0a
AS
124352011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12436
268c2c36 12437 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 12438 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
12439 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12440 * cm.c (losecursor): Likewise.
1dae0f0a
AS
12441 * data.c (fmod): Likewise.
12442 * dispnew.c (swap_glyphs_in_rows): Likewise.
12443 * emacs.c (memory_warning_signal): Likewise.
12444 * floatfns.c (float_error): Likewise.
12445 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12446 (otf_open, font_otf_capability, generate_otf_features)
12447 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12448 Likewise.
12449 * image.c (pbm_read_file): Likewise.
12450 * indent.c (string_display_width): Likewise.
12451 * intervals.c (check_for_interval, search_for_interval)
12452 (inc_interval_count, count_intervals, root_interval)
12453 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12454 * lread.c (defalias): Likewise.
268c2c36 12455 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
12456 * regex.c (set_image_of_range_1, set_image_of_range)
12457 (regex_grow_registers): Likewise.
12458 * sysdep.c (strerror): Likewise.
12459 * termcap.c (valid_filename_p, tprint, main): Likewise.
12460 * tparam.c (main): Likewise.
12461 * unexhp9k800.c (run_time_remap, save_data_space)
12462 (update_file_ptrs, read_header, write_header, calculate_checksum)
12463 (copy_file, copy_rest, display_header): Likewise.
12464 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12465 Likewise.
12466 * xdisp.c (check_it): Likewise.
12467 * xfaces.c (register_color, unregister_color, unregister_colors):
12468 Likewise.
12469 * xfns.c (print_fontset_result): Likewise.
12470 * xrdb.c (member, fatal, main): Likewise.
12471
99033785
PE
124722011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12473
12474 Fix minor problems found by static checking (Bug#9031).
12475 * chartab.c (char_table_set_range, map_sub_char_table):
12476 Remove unused locals.
12477 (uniprop_table): Now static.
12478 * composite.c (_work_char): Remove unused static var.
12479
9cb2ac56
JB
124802011-07-09 Juanma Barranquero <lekktu@gmail.com>
12481
12482 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12483
f25661f0
JD
124842011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12485
12486 * gtkutil.c (qttip_cb): Remove code without function.
12487
8278c4fe
EZ
124882011-07-09 Eli Zaretskii <eliz@gnu.org>
12489
12490 * w32.c (pthread_sigmask): New stub.
12491
1692ae2d 124922011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 12493
8a6ebd58 12494 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
12495 sigprocmask is portable only for single-threaded applications, and
12496 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
12497 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12498 (LIBES): Use it.
12499 * callproc.c (Fcall_process):
12500 * process.c (create_process):
12501 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12502 Use pthread_sigmask, not sigprocmask.
123403e4 12503
1b854618
JD
125042011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12505
12506 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12507 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12508 wrong (Bug#8591).
12509
3fe4b549
JD
125102011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12511
0ce7e563
JD
12512 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12513 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12514 (xg_hide_tooltip): Fix comment.
12515
3fe4b549
JD
12516 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12517 in registerServicesMenuSendTypes.
12518 (validRequestorForSendType): Don't check ns_return_types.
12519
12520 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12521 ns_return_type.
12522
5df75e47
JR
125232011-07-08 Jason Rumney <jasonr@gnu.org>
12524
22610910
JR
12525 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12526 SH_SHOW for hidden windows (Bug#5482).
12527
5df75e47
JR
12528 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12529 frame struct members of non-existent frames (Bug#6284).
12530
699c10bd
JD
125312011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12532
4393663b
JD
12533 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12534 variable firstTime not needed on OSX >= 10.6.
12535 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12536 >= 10.5. Use setKnobProportion, setDoubleValue.
12537
12538 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12539 (MAC_OS_X_VERSION_10_5): Define if not defined.
12540 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12541 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12542 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12543
12544 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 12545 cString and lossyCString on OSX >= 10.4.
4393663b 12546
58179cce 12547 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
12548 sizeToFit on OSX >= 10.2.
12549
12550 * nsimage.m (allocInitFromFile): Don't use deprecated method
12551 bestRepresentationForDevice on OSX >= 10.6.
12552
12553 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12554 to avoid warning.
12555
12556 * emacs.c: Declare unexec_init_emacs_zone.
12557
a63e0781
JD
12558 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12559
699c10bd
JD
12560 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12561
12562 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12563 on svcsMenu (Bug#8842).
12564
12565 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12566 ns_return_types.
12567 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12568
12569 * nsterm.m (QUTF8_STRING): Declare.
12570 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12571 (validRequestorForSendType): Return type is (id).
12572 Change indexOfObjectIdenticalTo to indexOfObject.
12573 Check if we have local selection before returning self (Bug#8842).
12574 (writeSelectionToPasteboard): Put local selection into paste board
12575 if we have a local selection (Bug#8842).
12576 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12577
12578 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12579 (ns_get_local_selection): Declare.
12580
54e10184
LMI
125812011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12582
9888ff71
LMI
12583 * keymap.c (describe_map_tree): Don't insert a double newline at
12584 the end of the buffer (bug#1169) and return whether we inserted
12585 something.
12586
54e10184
LMI
12587 * callint.c (Fcall_interactively): Change "reading args" to
12588 "providing args" to try to clarify what it does (bug#1010).
12589
15fa4783
KH
125902011-07-07 Kenichi Handa <handa@m17n.org>
12591
12592 * composite.c (composition_compute_stop_pos): Ignore a static
12593 composition starting before CHARPOS (Bug#8915).
12594
12595 * xdisp.c (handle_composition_prop): Likewise.
12596
a8815b00
EZ
125972011-07-07 Eli Zaretskii <eliz@gnu.org>
12598
12599 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12600 (Bug#9015)
12601
ef7b981d 126022011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
12603
12604 * character.h (unicode_category_t): New enum type.
12605
12606 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12607 (Qchar_code_property_table): New variable.
12608 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12609 (UNIPROP_COMPRESSED_FORM_P): New macros.
12610 (char_table_ascii): Uncompress the compressed values.
12611 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12612 Uncompress the compressed values.
ac389d0c 12613 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
12614 (char_table_ref_and_range): Uncompress the compressed values.
12615 (sub_char_table_set): New arg is_uniprop. Callers changed.
12616 Uncompress the compressed values.
12617 (sub_char_table_set_range): Args changed. Callers changed.
12618 (char_table_set_range): Adjuted for the above change.
12619 (map_sub_char_table): Delete args default_val and parent. Add arg
12620 top. Give decoded values to a Lisp function.
640c8776 12621 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
12622 values to a Lisp function. Gcpro more variables.
12623 (uniprop_table_uncompress)
12624 (uniprop_decode_value_run_length): New functions.
12625 (uniprop_decoder, uniprop_decoder_count): New variables.
12626 (uniprop_get_decoder, uniprop_encode_value_character)
12627 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12628 New functions.
12629 (uniprop_encoder, uniprop_encoder_count): New variables.
12630 (uniprop_get_encoder, uniprop_table)
12631 (Funicode_property_table_internal, Fget_unicode_property_internal)
12632 (Fput_unicode_property_internal): New functions.
12633 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12634 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 12635 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
12636 char-code-property-alist.
12637
640c8776 12638 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
12639 Vunicode_category_table.
12640
640c8776 12641 * font.c (font_range): Adjust for the change of
c805dec0
KH
12642 Vunicode_category_table.
12643
76b397fb
DN
126442011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12645
12646 * m/iris4d.h: Remove file, move contents ...
12647 * s/irix6-5.h: ... here.
12648
22b4128e
PE
126492011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12650
12651 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
12652 * alloc.c (mark_buffer):
12653 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12654 (clone_per_buffer_values): Don't assume that
22b4128e
PE
12655 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12656 This isn't true in general, and it's particularly not true
12657 if Emacs is configured with --with-wide-int.
12658 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12659 New macros, used in the buffer.c change.
12660
869795d6
JD
126612011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12662
12663 * xsettings.c: Use both GConf and GSettings if both are available.
12664 (store_config_changed_event): Add comment.
12665 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12666 (store_tool_bar_style_changed): New functions.
5e617bc2 12667 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
12668 (struct xsettings): Move font inside HAVE_XFT.
12669 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 12670 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 12671 Move inside HAVE_XFT.
640c8776 12672 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
12673 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12674 also.
12675 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 12676 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 12677 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
12678 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12679 (parse_settings): Move check for font inside HAVE_XFT.
12680 (read_settings, apply_xft_settings): Add comment.
12681 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12682 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12683 call store_font_name_changed.
12684 (xft_settings_event): Add comment.
12685 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12686 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12687 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12688 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12689 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
12690 (xsettings_get_system_font, xsettings_get_system_normal_font):
12691 Add comment.
869795d6 12692
d8ed26bd
PE
126932011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12694
12695 Random fixes. E.g., (random) never returned negative values.
12696 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12697 subseconds part to the entropy, as that's a bit more random.
12698 Prefer signed to unsigned, since the signedness doesn't matter and
12699 in general we prefer signed. When given a limit, use a
12700 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12701 latter isn't right if USE_2_TAGS_FOR_INTS.
12702 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12703 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12704
cabf1cac
SM
127052011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12706
12707 * textprop.c (text_property_stickiness):
12708 Obey Vtext_property_default_nonsticky.
12709 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12710 * w32fns.c (syms_of_w32fns):
12711 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12712
6e9b2be9
PE
127132011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12714
12715 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12716 This is more efficient than Ffile_directory_p and avoids a minor race.
12717
90186c68
LMI
127182011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12719
7c301272
LMI
12720 * buffer.c (Foverlay_put): Say what the return value is
12721 (bug#7835).
12722
c4f2d8d4
LMI
12723 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12724 is a directory before asking whether to use the file name
12725 (bug#7564).
ad637907
LMI
12726 (barf_or_query_if_file_exists): Make the "File is a directory"
12727 error be more correct.
c4f2d8d4 12728
90186c68
LMI
12729 * fns.c (Frequire): Remove the mention of the .gz files, since
12730 that's installation-specific, but keep the mention of
12731 `get-load-suffixes'.
12732
da64016e
PE
127332011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12734
12735 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12736 Report string overflow if the output is too long.
12737
7d47b580
JB
127382011-07-04 Juanma Barranquero <lekktu@gmail.com>
12739
a555cb87
JB
12740 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12741 (syms_of_gnutls): Remove duplicate DEFSYM for
12742 Qgnutls_bootprop_verify_hostname_error, an error for
12743 Qgnutls_bootprop_verify_error (which is no longer used).
12744
7d47b580
JB
12745 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12746 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12747 Also (re)move comments that are misplaced or no longer relevant.
12748
1e49bfab
LMI
127492011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12750
12751 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12752
1485f4c0
CY
127532011-07-03 Chong Yidong <cyd@stupidchicken.com>
12754
12755 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12756 and background color parameters if they have been changed.
12757
a9ab721e
LMI
127582011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12759
12760 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12761
cf7cff57
PE
127622011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12763
2e13213d
PE
12764 * xsettings.c (SYSTEM_FONT): Define only when used.
12765 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12766
cf7cff57
PE
12767 * keymap.c (access_keymap_1): Now static.
12768
7a8e04f7
CY
127692011-07-02 Chong Yidong <cyd@stupidchicken.com>
12770
12771 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12772 leave any prefix arg for the up event (Bug#1586).
12773
61352f62
LMI
127742011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12775
69bb1ef7
LMI
12776 * lread.c (syms_of_lread): Mention single symbols defined by
12777 `defvar' or `defconst' (bug#7154).
12778
61352f62 12779 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 12780 (Frequire): Mention get-load-suffixes.
61352f62 12781
28545e04
MR
127822011-07-02 Martin Rudalics <rudalics@gmx.at>
12783
12784 * window.h (window): Remove clone_number slot.
12785 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12786 Remove.
12787 (make_parent_window, make_window, saved_window)
12788 (Fset_window_configuration, save_window_save): Don't deal with
12789 clone numbers.
12790 * buffer.c (Qclone_number): Remove declaration.
12791 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12792
3349e122
SM
127932011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12794
12795 Add multiple inheritance to keymaps.
12796 * keymap.c (Fmake_composed_keymap): New function.
12797 (Fset_keymap_parent): Simplify.
12798 (fix_submap_inheritance): Remove.
12799 (access_keymap_1): New function extracted from access_keymap to handle
12800 embedded parents and handle lists of maps.
12801 (access_keymap): Use it.
12802 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12803 (Fcopy_keymap): Handle embedded parents.
12804 (Fcommand_remapping, define_as_prefix): Simplify.
12805 (Fkey_binding): Simplify.
12806 (syms_of_keymap): Move minibuffer-local-completion-map,
12807 minibuffer-local-filename-completion-map,
12808 minibuffer-local-must-match-map, and
12809 minibuffer-local-filename-must-match-map to Elisp.
12810 (syms_of_keymap): Defsubr make-composed-keymap.
12811 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12812 (parse_menu_item): Trivial simplification.
12813
3279eb87
GM
128142011-07-01 Glenn Morris <rgm@gnu.org>
12815
12816 * Makefile.in (SETTINGS_LIBS): Fix typo.
12817
39cb9e56 128182011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
12819
12820 * coding.c (Fencode_coding_string): Record the last coding system
12821 used, as the function doc string says (bug#8738).
12822
0949d2b6
JD
128232011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12824
12825 * xsettings.c (store_monospaced_changed): Take new font as arg and
12826 check for change against current_mono_font.
12827 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12828 (emacs_settings_constructor, emacs_settings_get_property)
12829 (emacs_settings_set_property, emacs_settings_class_init)
12830 (emacs_settings_init, gsettings_obj): Remove.
12831 (something_changedCB): New function for HAVE_GSETTINGS.
12832 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12833 with value as argument.
12834 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12835 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 12836 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
12837 "changed".
12838
12839 * xgselect.c: Add defined (HAVE_GSETTINGS).
12840 (xgselect_initialize): Ditto.
12841
12842 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12843 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12844 xg_select.
12845
bbc6b304
PE
128462011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12847
12848 * eval.c (struct backtrace): Simplify and port the data structure.
12849 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12850 signed bit field, as this assumption is not portable and it makes
12851 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12852 "char debug_on_exit : 1" as this is not portable either; instead,
12853 use the portable "unsigned int debug_on_exit : 1". Remove unused
12854 member evalargs. Remove obsolete comments about cc bombing out.
12855
9851bfc5
JD
128562011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12857
51bb811f 12858 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
12859 Let HAVE_GSETTINGS override HAVE_GCONF.
12860 (store_monospaced_changed): New function.
12861 (EMACS_SETTINGS): A new type derived from GObject to handle
12862 GSettings notifications.
12863 (emacs_settings_constructor, emacs_settings_get_property)
12864 (emacs_settings_set_property, emacs_settings_class_init):
12865 New functions.
12866 (gsettings_client, gsettings_obj): New variables.
12867 (GSETTINGS_SCHEMA): New define.
12868 (something_changedCB): Call store_monospaced_changed.
12869 (init_gsettings): New function.
12870 (xsettings_initialize): Call init_gsettings.
12871 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12872 to NULL.
12873
640c8776 12874 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
12875 GCONF_CFLAGS/LIBS.
12876
5386012d
MR
128772011-06-29 Martin Rudalics <rudalics@gmx.at>
12878
12879 * window.c (resize_root_window, grow_mini_window)
12880 (shrink_mini_window): Rename Qresize_root_window to
12881 Qwindow_resize_root_window and Qresize_root_window_vertically to
12882 Qwindow_resize_root_window_vertically.
12883
f13e0b08
PE
128842011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12885
12886 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12887
94515237
JB
128882011-06-27 Juanma Barranquero <lekktu@gmail.com>
12889
12890 * makefile.w32-in: Redesign dependencies so they reflect more
12891 clearly which files are directly included by each source file,
12892 and not through other includes.
12893
e43b6e43
MR
128942011-06-27 Martin Rudalics <rudalics@gmx.at>
12895
12896 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12897 (sort_overlays, overlay_strings): When an overlay's clone number
12898 matches the window's clone number process the overlay even if
12899 the overlay's window property doesn't match the current window.
12900
d68443dc
MR
12901 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12902 (Fwindow_hchild): Rename to Fwindow_left_child.
12903 (Fwindow_next): Rename to Fwindow_next_sibling.
12904 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
12905 (resize_window_check): Rename to window_resize_check.
12906 (resize_window_apply): Rename to window_resize_apply.
12907 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12908 (Fdelete_other_windows_internal, resize_frame_windows)
12909 (Fsplit_window_internal, Fdelete_window_internal)
12910 (grow_mini_window, shrink_mini_window)
12911 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 12912
c7e73be5
JD
129132011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12914
12915 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12916 (emacs_fixed_set_min_size): Remove.
12917 (emacs_fixed_new): Take frame as argument.
12918
12919 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12920 (_EmacsFixedPrivate): Remove minwidth/height.
12921 Add struct frame *f.
12922 (emacs_fixed_init): Initialize priv->f.
12923 (get_parent_class, emacs_fixed_set_min_size): Remove.
12924 (emacs_fixed_new): Set priv->f to argument.
12925 (emacs_fixed_get_preferred_width)
12926 (emacs_fixed_get_preferred_height): Use min_width/height from
12927 frames size_hint to set minimum and natural (Bug#8919).
12928 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
12929 and use min_width/height from frames size_hint to set
12930 min_width/height (Bug#8919).
12931
12932 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
12933 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
12934 Fix indentation.
c7e73be5 12935
cf99dcf8
EZ
129362011-06-26 Eli Zaretskii <eliz@gnu.org>
12937
12938 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
12939 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
12940 called at ZV.
12941
029529ac
CY
129422011-06-26 Chong Yidong <cyd@stupidchicken.com>
12943
12944 * process.c (wait_reading_process_output): Bypass select if
12945 waiting for a cell while ignoring keyboard input, and input is
12946 pending. Suggested by Jan Djärv (Bug#8869).
12947
7a7ef429
PE
129482011-06-25 Paul Eggert <eggert@cs.ucla.edu>
12949
12950 Use gnulib's dup2 module instead of rolling our own.
12951 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
12952
11fdef7d 129532011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
12954
12955 * dispnew.c (scrolling_window): Before scrolling, turn off a
12956 mouse-highlight in the window being scrolled.
12957
cd3520a4
JB
129582011-06-24 Juanma Barranquero <lekktu@gmail.com>
12959
12960 Move DEFSYM to lisp.h and use everywhere.
12961
12962 * character.h (DEFSYM): Move declaration...
12963 * lisp.h (DEFSYM): ...here.
12964
12965 * gnutls.c:
12966 * minibuf.c:
12967 * w32menu.c:
12968 * w32proc.c:
12969 * w32select.c: Don't include character.h.
12970
12971 * alloc.c (syms_of_alloc):
12972 * buffer.c (syms_of_buffer):
12973 * bytecode.c (syms_of_bytecode):
12974 * callint.c (syms_of_callint):
12975 * casefiddle.c (syms_of_casefiddle):
12976 * casetab.c (init_casetab_once):
12977 * category.c (init_category_once, syms_of_category):
12978 * ccl.c (syms_of_ccl):
12979 * cmds.c (syms_of_cmds):
12980 * composite.c (syms_of_composite):
12981 * dbusbind.c (syms_of_dbusbind):
12982 * dired.c (syms_of_dired):
12983 * dispnew.c (syms_of_display):
12984 * doc.c (syms_of_doc):
12985 * editfns.c (syms_of_editfns):
12986 * emacs.c (syms_of_emacs):
12987 * eval.c (syms_of_eval):
12988 * fileio.c (syms_of_fileio):
12989 * fns.c (syms_of_fns):
12990 * frame.c (syms_of_frame):
12991 * fringe.c (syms_of_fringe):
12992 * insdel.c (syms_of_insdel):
12993 * keymap.c (syms_of_keymap):
12994 * lread.c (init_obarray, syms_of_lread):
12995 * macros.c (syms_of_macros):
12996 * msdos.c (syms_of_msdos):
12997 * print.c (syms_of_print):
12998 * process.c (syms_of_process):
12999 * search.c (syms_of_search):
13000 * sound.c (syms_of_sound):
13001 * syntax.c (init_syntax_once, syms_of_syntax):
13002 * terminal.c (syms_of_terminal):
13003 * textprop.c (syms_of_textprop):
13004 * undo.c (syms_of_undo):
13005 * w32.c (globals_of_w32):
13006 * window.c (syms_of_window):
13007 * xdisp.c (syms_of_xdisp):
13008 * xfaces.c (syms_of_xfaces):
13009 * xfns.c (syms_of_xfns):
13010 * xmenu.c (syms_of_xmenu):
13011 * xsettings.c (syms_of_xsettings):
13012 * xterm.c (syms_of_xterm): Use DEFSYM.
13013
4228cf16
TZ
130142011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13015
cd3520a4 13016 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 13017
7fcccf1e
PE
130182011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13019
7efb4e0e
PE
13020 Integer and buffer overflow fixes (Bug#8873).
13021
ff5844ad
PE
13022 * print.c (printchar, strout): Check for string overflow.
13023 (PRINTPREPARE, printchar, strout):
13024 Don't set size unless allocation succeeds.
13025
90532f02
PE
13026 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13027 for sizes. Check for string overflow more accurately.
13028 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13029
6d84508d
PE
13030 * macros.c: Integer and buffer overflow fixes.
13031 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13032 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13033 Use ptrdiff_t, not int, for sizes.
13034 Don't increment bufsize until after realloc succeeds.
13035 Check for size-calculation overflow.
13036 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13037
437b2cb4
PE
13038 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13039
8b9ac8b4
PE
13040 * lread.c: Integer overflow fixes.
13041 (read_integer): Radix is now EMACS_INT, not int,
13042 to improve quality of diagnostics for out-of-range radices.
13043 Calculate buffer size correctly for out-of-range radices.
13044 (read1): Check for integer overflow in radices, and in
13045 read-circle numbers.
82cb60d3
PE
13046 (read_escape): Avoid int overflow.
13047 (Fload, openp, read_buffer_size, read1)
13048 (substitute_object_recurse, read_vector, read_list, map_obarray):
13049 Use ptrdiff_t, not int, for sizes.
13050 (read1): Use EMACS_INT, not int, for sizes.
20270765 13051 Check for size overflow.
8b9ac8b4 13052
7fcccf1e
PE
13053 * image.c (cache_image): Check for size arithmetic overflow.
13054
bfbbd7e7
PE
13055 * lread.c: Integer overflow issues.
13056 (saved_doc_string_size, saved_doc_string_length)
13057 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13058 Now ptrdiff_t, not int.
13059 (read1): Don't assume doc string length fits in int. Check for
13060 out-of-range doc string lengths.
13061 (read_list): Don't assume file position fits in int.
39019e54 13062 (read_escape): Check for hex character overflow.
bfbbd7e7 13063
4e323265
LL
130642011-06-22 Leo Liu <sdl.web@gmail.com>
13065
13066 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13067 Move to minibuffer.el.
13068
85fece3e
PE
130692011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13070
20b84ce9 13071 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
13072 The following patches are for when GLYPH_DEBUG && !XASSERT.
13073 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13074 * dispnew.c (flush_stdout):
13075 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13076 Mark as externally visible.
13077 * dispnew.c (check_window_matrix_pointers): Now static.
13078 * dispnew.c (window_to_frame_vpos):
13079 * xfns.c (unwind_create_frame):
13080 * xterm.c (x_check_font): Remove unused local.
13081 * scroll.c (CHECK_BOUNDS):
13082 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13083 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13084 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13085 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13086 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13087 Now static.
13088 (debug_method_add): Use va_list and vsprintf rather than relying
13089 on undefined behavior with wrong number of arguments.
13090 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13091 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13092 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13093 since we're not interested in debugging glyphs with old libraries.
13094 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13095 GCC 4.6.0's static checking.
13096
0766b489
PE
130972011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13098
31fd4b32
PE
13099 Integer overflow and signedness fixes (Bug#8873).
13100 A few related buffer overrun fixes, too.
13101
b79e8648
PE
13102 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13103
0766b489
PE
13104 * dispextern.h (struct face.stipple):
13105 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13106 (x_bitmap_mask, x_allocate_bitmap_record)
13107 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13108 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13109 (x_create_bitmap_from_xpm_data):
13110 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13111 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13112 (.bitmaps_last):
13113 * xfaces.c (load_pixmap):
13114 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13115 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13116 (.bitmaps_last, struct x_output.icon_bitmap):
13117 Use ptrdiff_t, not int, for bitmap indexes.
13118 (x_allocate_bitmap_record): Check for size overflow.
13119 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13120
b081724f
PE
13121 Use ptrdiff_t, not int, for overlay counts.
13122 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13123 * editfns.c (overlays_around, get_pos_property):
13124 * textprop.c (get_char_property_and_overlay):
13125 * xdisp.c (next_overlay_change, note_mouse_highlight):
13126 * xfaces.c (face_at_buffer_position):
21514da7
PE
13127 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13128 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13129 (Fnext_overlay_change, Fprevious_overlay_change)
13130 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 13131 Use ptrdiff_t, not int, for sizes.
21514da7 13132 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 13133
3de73e5e
PE
13134 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13135
2606c57b
PE
13136 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13137 (x_session_initialize): Do not assume string length fits in int.
13138
aaafe47a
PE
13139 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13140 This is unlikely, but can occur if DPI is outlandish.
13141
2674ddc8 13142 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
13143 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13144
28154962
PE
13145 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13146 * xrdb.c (magic_file_p, search_magic_path):
13147 Omit last arg SUFFIX; it was always 0. All callers changed.
13148 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13149
7de51af5
PE
13150 * xfont.c (xfont_match): Avoid need for strlen.
13151
25ed6cc3
PE
13152 * xfns.c: Don't assume strlen fits in int.
13153 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13154
4eab31dd
PE
13155 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13156 not unsigned long, as we prefer signed integers. All callers changed.
13157 Detect integer overflow in repeat count.
13158 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 13159 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 13160
171e2a58
PE
13161 * termcap.c: Don't assume sizes fit in int and never overflow.
13162 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13163 (gobble_line): Check for size-calculation overflow.
13164
ad39faca 13165 * minibuf.c (Fread_buffer):
6e5bb2dc 13166 * lread.c (intern, intern_c_string):
74ca2eb3
PE
13167 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13168 Don't assume string length fits in int.
13169
52c61c22 13170 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
13171 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13172
b5b8c9e5
PE
13173 * font.c: Don't assume string length fits in int.
13174 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13175 Use ptrdiff_t, not int.
ccd6111c
PE
13176 (font_intern_prop): Don't assume string length fits in int.
13177 Don't assume integer property fits in fixnum.
13178 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 13179
882f0d81 13180 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 13181 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
13182 Reformulate so as not to need the command string.
13183 Invoke gzip -cd rather than gunzip, as it's more portable.
13184 (lock_info_type, lock_file_1, lock_file):
13185 Don't assume pid_t and time_t fit in unsigned long.
13186 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13187 (current_lock_owner): Prefer signed type for sizes.
13188 Use memcpy, not strncpy, where memcpy is what is really wanted.
13189 Don't assume (via atoi) that time_t and pid_t fit in int.
13190 Check for time_t and/or pid_t out of range, e.g., via a network share.
13191 Don't alloca where an auto var works fine.
13192
93f4cf88
PE
13193 * fileio.c: Fix some integer overflow issues.
13194 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13195 Don't assume string length fits in int.
13196 (directory_file_name): Don't assume string length fits in long.
13197 (make_temp_name): Don't assume pid fits in int, or that its print
13198 length is less than 20.
13199
f3e92b69
PE
13200 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13201
1bfdaf10
PE
13202 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13203
35016e9a
PE
13204 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13205
3d1e65a1
PE
13206 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13207 We prefer signed integers, even for size calculations.
13208
0b963a93
PE
13209 * emacs.c: Don't assume string length fits in 'int'.
13210 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13211 (main): Don't invoke strlen when not needed.
13212
573f4b54
PE
13213 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13214 (XD_DEBUG_MESSAGE): Don't waste a byte.
13215
989f33ba
PE
13216 * callproc.c (getenv_internal_1, getenv_internal)
13217 (Fgetenv_internal):
965d34eb
PE
13218 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13219
e4d29b33
PE
13220 * lread.c (invalid_syntax): Omit length argument.
13221 All uses changed. This doesn't fix a bug, but it simplifies the
13222 code away from its former Hollerith-constant appearance, and it's
13223 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 13224 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 13225
eb49b136
PE
13226 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13227 This didn't break anything, but it didn't help either.
13228 It's confusing to put a bogus integer in a place where the actual
13229 value does not matter.
9f62aeb1 13230 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 13231 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 13232
15375a22
PE
13233 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13234 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13235 implementation.
b61cc01c
PE
13236 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13237 We prefer signed types, and the value cannot exceed the EMACS_INT
13238 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
13239 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13240 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13241 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 13242
53b2623d
PE
13243 * indent.c (sane_tab_width): New function.
13244 (current_column, scan_for_column, Findent_to, position_indentation)
13245 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 13246 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 13247
51cab52b 13248 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 13249
f2ed8a70
PE
13250 * lisp.h (lint_assume): New macro.
13251 * composite.c (composition_gstring_put_cache):
13252 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13253
abe80cc6
PE
13254 * editfns.c, insdel.c:
13255 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 13256
b02c740e
PE
13257 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13258
ebc96716
PE
13259 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13260
b4e50fa0 13261 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 13262 Use much-faster test for byte-length change.
311d5d7c 13263 Don't assume string byte-length fits in 'int'.
a4cf38e4 13264 Check that character arg fits in 'int'.
85461888 13265 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 13266
c0c1ee9f
PE
13267 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13268
a498d7f4
PE
13269 * fns.c (concat): Catch string overflow earlier.
13270 Do not rely on integer wraparound.
13271
51cab52b
PE
13272 * dispextern.h (struct it.overlay_strings_charpos)
13273 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
13274 * xdisp.c (forward_to_next_line_start)
13275 (back_to_previous_visible_line_start)
13276 (reseat_at_next_visible_line_start, next_element_from_buffer):
13277 Don't arbitrarily truncate the value of 'selective' to int.
13278
76031fad
PE
13279 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13280
5eb55db9
PE
13281 * composite.c: Don't truncate sizes to 'int'.
13282 (composition_gstring_p, composition_reseat_it)
13283 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
13284 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13285 not EMACS_UINT, for indexes.
5eb55db9 13286
0703a717
PE
13287 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13288
d6202519
PE
13289 * buffer.c: Include <verify.h>.
13290 (struct sortvec.priority, struct sortstr.priority):
8961a454 13291 Now EMACS_INT, not int.
c20998a7 13292 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
13293 (struct sortstr.size, record_overlay_string)
13294 (struct sortstrlist.size, struct sortlist.used):
13295 Don't truncate size to int.
13296 (record_overlay_string): Check for size-calculation overflow.
d6202519 13297 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 13298
d5a19415
JM
132992011-06-22 Jim Meyering <meyering@redhat.com>
13300
029529ac 13301 Don't leak an XBM-image-sized buffer
d5a19415
JM
13302 * image.c (xbm_load): Free the image buffer after using it.
13303
a9041e6c
PE
133042011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13305
13306 Port to Sun C.
13307 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13308 that Sun C diagnosed.
13309 * fns.c (secure_hash): Fix pointer signedness issue.
13310 * intervals.c (static_offset_intervals): New function.
13311 (offset_intervals): Use it.
13312
7f3f739f
LL
133132011-06-21 Leo Liu <sdl.web@gmail.com>
13314
13315 * deps.mk (fns.o):
13316 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13317 sha512.h.
13318
13319 * fns.c (secure_hash): Rename from crypto_hash_function and change
13320 the first arg to accept symbols.
5b66d427 13321 (Fsecure_hash): New primitive.
7f3f739f
LL
13322 (syms_of_fns): New symbols.
13323
76147d94
DD
133242011-06-20 Deniz Dogan <deniz@dogan.se>
13325
13326 * process.c (Fset_process_buffer): Clarify return value in
13327 docstring.
13328
7d7d0045
CY
133292011-06-18 Chong Yidong <cyd@stupidchicken.com>
13330
13331 * dispnew.c (add_window_display_history): Use BVAR.
13332
13333 * xdisp.c (debug_method_add): Use BVAR.
13334 (check_window_end, dump_glyph_matrix, dump_glyph)
13335 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13336
13337 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13338 Likewise.
13339
13340 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13341 check till after the cache is created in init_frame_faces.
13342
ff2bc410
SM
133432011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13344
13345 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13346
28177add
PE
133472011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13348
dd3482fe
PE
13349 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13350 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13351 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13352
393d71f3 13353 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
13354 * fileio.c (Finsert_file_contents):
13355 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13356 Remove the old (too-loose) buffer overflow checks.
13357 They weren't needed, since make_gap checks for buffer overflow.
13358 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13359 The old code merely checked for Emacs fixnum overflow, and relied
13360 on undefined (wraparound) behavior. The new code avoids undefined
13361 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13362
2e6813b0 13363 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
13364 Tune. Don't use wider integers than needed. Don't use alloca.
13365 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 13366
599a9e4f
PE
13367 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13368
99561444
PE
13369 * insdel.c, lisp.h (buffer_overflow): New function.
13370 (insert_from_buffer_1, replace_range, replace_range_2):
13371 * insdel.c (make_gap_larger):
13372 * editfns.c (Finsert_char):
13373 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13374
28177add
PE
13375 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13376
e69dafad
PE
133772011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13378
4baa020d 13379 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 13380
b1c46f02
PE
13381 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13382 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13383
e69dafad
PE
13384 * fileio.c: Don't assume EMACS_INT fits in off_t.
13385 (emacs_lseek): New static function.
13386 (Finsert_file_contents, Fwrite_region): Use it.
13387 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13388
566684ea
PE
13389 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13390
e6966cd6
PE
13391 * fns.c: Don't overflow int when computing a list length.
13392 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13393 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13394 truncation on 64-bit hosts. Check for QUIT every
13395 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13396 faster and is responsive enough.
13397 (Flength): Report an error instead of overflowing an integer.
13398 (Fsafe_length): Return a float if the value is not representable
13399 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 13400 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 13401 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 13402
dd0b0efb
PE
13403 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13404 (header_size, word_size): New constants.
13405 (allocate_vectorlike): Don't check size overflow here.
13406 (allocate_vector): Check it here instead, since this is the only
13407 caller of allocate_vectorlike that could cause overflow.
13408 Check that the new vector's length is representable as a fixnum.
13409
86fe5cfe
PE
13410 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13411 The previous code was bogus. For example, next_almost_prime (32)
13412 returned 39, which is undesirable as it is a multiple of 3; and
13413 next_almost_prime (24) returned 25, which is a multiple of 5 so
13414 why was the code bothering to check for multiples of 7?
13415
80e88859
PE
13416 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13417
4a2f0ad6
PE
13418 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13419
f66c7cf8
PE
13420 Variadic C functions now count arguments with ptrdiff_t.
13421 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13422 Back then I didn't know that the Emacs coding style prefers signed int.
13423 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
13424 were being counted with int, which may truncate counts on 64-bit
13425 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
13426 * lisp.h (struct Lisp_Subr.function.aMANY)
13427 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13428 Arg counts are now ptrdiff_t, not size_t.
13429 All variadic functions and their callers changed accordingly.
13430 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13431 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13432 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13433 * callint.c (Fcall_interactively): Check arg count for overflow,
13434 to avoid potential buffer overrun. Use signed char, not 'int',
13435 for 'varies' array, so that we needn't bother to check its size
13436 calculation for overflow.
13437 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13438 * eval.c (apply_lambda):
13439 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13440 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13441 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13442
a1759b76
PE
13443 * callint.c (Fcall_interactively): Don't use index var as event count.
13444
d96be9fc
PE
13445 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13446 * mem-limits.h (SIZE): Remove; no longer used.
13447
a690a978 13448 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 13449
578c21e6
PE
13450 Remove unnecessary casts.
13451 * xterm.c (x_term_init):
13452 * xfns.c (x_set_border_pixel):
13453 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13454 These aren't needed now that we assume ANSI C.
13455
96f53c6c
PE
13456 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13457 It's more likely to cause problems (due to unsigned overflow)
13458 than to cure them.
13459
83c77d31
PE
13460 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13461
ee2079f1
PE
13462 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13463
6da65536
PE
13464 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13465
7147c4a4
PE
13466 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13467
193e32d9
PE
13468 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13469
e5533da6
PE
13470 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13471
9910e595
PE
13472 GLYPH_CODE_FACE returns EMACS_INT, not int.
13473 * dispextern.h (merge_faces):
13474 * xfaces.c (merge_faces):
01103c44
PE
13475 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13476 Don't assume EMACS_INT fits in int.
9910e595 13477
2638320e
PE
13478 * character.h (CHAR_VALID_P): Remove unused parameter.
13479 * fontset.c, lisp.h, xdisp.c: All uses changed.
13480
045eb8d9
PE
13481 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13482
c1f134b5
PE
13483 * fns.c (concat): Minor tuning based on overflow analysis.
13484 This doesn't fix any bugs. Use int to hold character, instead
13485 of constantly refetching from Emacs object. Use XFASTINT, not
13486 XINT, for value known to be a character. Don't bother comparing
13487 a single byte to 0400, as it's always less.
13488
395fcb93 13489 * floatfns.c (Fexpt):
327eeec8
PE
13490 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13491
abbd3d23
PE
13492 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13493 for characters.
13494
684a03ef
PE
13495 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13496
0fed43f3
PE
13497 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13498 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13499 incorrectly succeed when S was a string, because 4294967386 was
13500 truncated before it was used.
13501
8fd02eb7
PE
13502 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13503 Otherwise, an out-of-range integer could cause undefined behavior
13504 on a 64-bit host.
13505
f8c86b69
PE
13506 * composite.c: Use int, not EMACS_INT, for characters.
13507 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13508 EMACS_INT, for values that are known to be in character range.
13509 This doesn't fix any bugs but is the usual style inside Emacs and
13510 may generate better code on 32-bit machines.
13511
34206dd2
PE
13512 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13513 This is for reasons similar to the recent CHAR_STRING fix.
13514 * charset.c (Fencode_char): Check that character arg is actually
13515 a character. Pass an int to ENCODE_CHAR.
13516 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13517 wider than 'int', as a compile-time check to prevent future regressions
13518 in this area.
13519
c5958d4c 13520 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
13521
13522 Make sure a 64-bit char is never passed to CHAR_STRING.
13523 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13524 by silently ignoring the top 32 bits, allowing some values
13525 that were far too large to be valid characters.
13526 * character.h: Include <verify.h>.
13527 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13528 arguments are no wider than unsigned, as a compile-time check
13529 to prevent future regressions in this area.
13530 * data.c (Faset):
01103c44 13531 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
13532 (Fsubst_char_in_region):
13533 * fns.c (concat):
13534 * xdisp.c (decode_mode_spec_coding):
13535 Adjust to CHAR_STRING's new requirement.
13536 * editfns.c (Finsert_char, Fsubst_char_in_region):
13537 * fns.c (concat): Check that character args are actually
13538 characters. Without this test, these functions did the wrong
13539 thing with wildly out-of-range values on 64-bit hosts.
13540
d37ca623
PE
13541 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13542 These casts should not be needed on 32-bit hosts, either.
13543 * keyboard.c (read_char):
13544 * lread.c (Fload): Remove casts to unsigned.
13545
ea204efb
PE
13546 * lisp.h (UNSIGNED_CMP): New macro.
13547 This fixes comparison bugs on 64-bit hosts.
13548 (ASCII_CHAR_P): Use it.
13549 * casefiddle.c (casify_object):
01103c44 13550 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
13551 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13552 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13553 * dispextern.h (FACE_FROM_ID):
13554 * keyboard.c (read_char): Use UNSIGNED_CMP.
13555
41cb286c
PE
13556 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13557 not to EMACS_INT, to avoid GCC warning.
13558
4a1b9832
PE
13559 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13560
55daad71
PE
13561 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13562 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13563 isn't needed on 32-bit machines.
8f95c75c 13564
01103c44
PE
13565 * buffer.c (Fgenerate_new_buffer_name):
13566 Use EMACS_INT for count, not int.
0ceccced 13567 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
13568
13569 * data.c (Qcompiled_function): Now static.
13570
c6f072e7
PE
13571 * window.c (window_body_lines): Now static.
13572
20ce5912
PE
13573 * image.c (gif_load): Rename local to avoid shadowing.
13574
9c4c5f81
PE
13575 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13576 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13577 * alloc.c (make_save_value): Integer argument is now of type
13578 ptrdiff_t, not int.
13579 (mark_object): Use ptrdiff_t, not int.
13580 * lisp.h (pD): New macro.
13581 * print.c (print_object): Use it.
13582
c0c5c8ae
PE
13583 * alloc.c: Use EMACS_INT, not int, to count objects.
13584 (total_conses, total_markers, total_symbols, total_vector_size)
13585 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
13586 (total_free_floats, total_floats, total_free_intervals)
13587 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
13588 Now EMACS_INT, not int. All uses changed.
13589 (Fgarbage_collect): Compute overall total using a double, so that
13590 integer overflow is less likely to be a problem. Check for overflow
13591 when converting back to an integer.
5a25e253
PE
13592 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13593 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13594 These were 'int' variables that could overflow on 64-bit hosts;
13595 they were never used, so remove them instead of repairing them.
211a0b2a 13596 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
13597 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13598 Previously, this ceilinged at INT_MAX, but that doesn't work on
13599 64-bit machines.
e46bb31a 13600 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 13601
c78baabf 13602 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 13603 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
13604 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13605 when a (possibly-narrower) signed value would do just as well.
13606 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 13607
c9d624c6
PE
13608 * alloc.c: Catch some string size overflows that we were missing.
13609 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13610 for convenience in STRING_BYTES_MAX.
13611 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13612 The definition here is exact; the one in lisp.h was approximate.
13613 (allocate_string_data): Check for string overflow. This catches
13614 some instances we weren't catching before. Also, it catches
13615 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13616 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13617 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 13618
c9d624c6
PE
13619 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13620 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 13621 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 13622
353032ce
PE
13623 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13624
2bccce07
PE
13625 * alloc.c (Fmake_string): Check for out-of-range init.
13626
0ac30604
SM
136272011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13628
13629 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13630
c195f2de
JD
136312011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13632
13633 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13634 xg_get_default_scrollbar_width.
13635
13636 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13637 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13638 (style_changed_cb): Call update_theme_scrollbar_width and call
13639 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13640 all frames (Bug#8505).
13641 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13642 Call gtk_window_set_resizable if HAVE_GTK3.
13643 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13644 and height if HAVE_GTK3 (Bug#8505).
13645 (scroll_bar_width_for_theme): New variable.
13646 (update_theme_scrollbar_width): New function.
13647 (xg_get_default_scrollbar_width): Move code to
13648 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13649 (xg_initialize): Call update_theme_scrollbar_width.
13650
13651 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13652
13653 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13654
e10ac9f1
MR
136552011-06-12 Martin Rudalics <rudalics@gmx.at>
13656
13657 * frame.c (make_frame): Call other_buffer_safely instead of
13658 other_buffer.
13659
13660 * window.c (temp_output_buffer_show): Call display_buffer with
13661 second argument Vtemp_buffer_show_specifiers and reset latter
13662 immediately after the call.
13663 (Vtemp_buffer_show_specifiers): New variable.
13664 (auto_window_vscroll_p, next_screen_context_lines)
13665 (Vscroll_preserve_screen_position): Remove leading asterisks from
13666 doc-strings.
13667
2d3c217e 136682011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 13669
7b7f97e8 13670 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
13671 * buffer.c (Qclone_number): Remove for now, as it's unused.
13672 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13673 (record_buffer): Remove unused local.
13674 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13675 (set_frame_buffer_list): Remove; unused.
13676 * frame.h (other_visible_frames): Remove decl.
13677 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13678 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13679 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13680 if HAVE_GPM.
13681 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13682 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13683 Define only if HAVE_GPM.
13684 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13685 (update_hints_inhibit): Remove; never set. All uses removed.
13686 * widgetprv.h (emacsFrameClassRec): Remove decl.
13687 * window.c (delete_deletable_window): Now returns void, since it
13688 wasn't returning anything.
13689 (compare_window_configurations): Remove unused locals.
13690 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13691 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
13692 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13693 the same widths as pointers. This follows up on the 2011-05-06 patch.
13694 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13695 * xterm.h: Likewise.
13696 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13697
1384b89e
JB
136982011-06-12 Juanma Barranquero <lekktu@gmail.com>
13699
13700 * makefile.w32-in: Update dependencies.
13701 (LISP_H): Add lib/intprops.h.
13702
1100a63c
CY
137032011-06-11 Chong Yidong <cyd@stupidchicken.com>
13704
13705 * image.c (gif_load): Add animation frame delay to the metadata.
13706 (syms_of_image): Use DEFSYM. New symbol `delay'.
13707
6198ccd0
MR
137082011-06-11 Martin Rudalics <rudalics@gmx.at>
13709
13710 * window.c (delete_deletable_window): Re-add.
13711 (Fset_window_configuration): Rewrite to handle dead buffers and
13712 consequently deletable windows.
13713 (window_tree, Fwindow_tree): Remove. Supply functionality in
13714 window.el.
13715 (compare_window_configurations): Simplify code.
13716
b6e3633c
AS
137172011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13718
1ab0dee5
AS
13719 * image.c (imagemagick_load_image): Fix type mismatch.
13720 (Fimagemagick_types): Likewise.
13721
b6e3633c
AS
13722 * window.h (replace_buffer_in_windows): Declare.
13723
9397e56f
MR
137242011-06-11 Martin Rudalics <rudalics@gmx.at>
13725
13726 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13727 Qclone_number. Remove external declaration of Qdelete_window.
13728 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13729 code.
640c8776
SM
13730 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13731 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
13732 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13733 buffer list implementation.
13734 (other_buffer_safely): New function.
13735 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13736 calls to replace_buffer_in_windows and
13737 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13738 if allowed.
13739 (record_buffer): Inhibit quitting and rewrite using quittable
13740 functions. Run Qbuffer_list_update_hook if allowed.
13741 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
13742 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13743 Move switch-to-buffer to window.el.
9397e56f
MR
13744 (bury-buffer): Move to window.el.
13745 (Vbuffer_list_update_hook): New variable.
13746
13747 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13748 section.
13749
13750 * window.h (resize_frame_windows): Move up in code.
13751 (Fwindow_frame): Remove EXFUN.
13752 (replace_buffer_in_all_windows): Remove prototype.
13753 (replace_buffer_in_windows_safely): Add prototype.
13754
13755 * window.c: Declare Qdelete_window static again. Move down
13756 declaration of select_count.
13757 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13758 (Fother_window): Move to window.el.
13759 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13760 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13761 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13762 window.el.
13763 (replace_buffer_in_windows): Implement by calling
13764 Qreplace_buffer_in_windows.
13765 (replace_buffer_in_all_windows): Remove with some functionality
13766 moved into replace_buffer_in_windows_safely.
13767 (replace_buffer_in_windows_safely): New function.
13768 (select_window_norecord, select_frame_norecord): Move in front
13769 of run_window_configuration_change_hook. Remove now obsolete
13770 declarations.
640c8776
SM
13771 (Fset_window_buffer): Rewrite doc-string.
13772 Call Qrecord_window_buffer.
9397e56f
MR
13773 (keys_of_window): Move binding for other-window to window.el.
13774
b50691aa
CY
137752011-06-11 Chong Yidong <cyd@stupidchicken.com>
13776
13777 * dispextern.h (struct image): Replace data member, whose int_val
13778 and ptr_val fields were not used by anything, with a single
13779 lisp_val object.
13780
13781 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13782 (gif_clear_image, gif_load, imagemagick_load_image)
13783 (gs_clear_image, gs_load): Callers changed.
13784
3f754b86
PE
137852011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13786
cca69397
PE
13787 * buffer.h: Include <time.h>, for time_t.
13788 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13789
109e28d0
PE
13790 Fix minor problems found by static checking.
13791
60737f02
PE
13792 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13793
4b66faf3
PE
13794 Make identifiers static if they are not used in other modules.
13795 * data.c (Qcompiled_function, Qframe, Qvector):
13796 * image.c (QimageMagick, Qsvg):
13797 * minibuf.c (Qmetadata):
13798 * window.c (resize_window_check, resize_root_window): Now static.
13799 * window.h (resize_window_check, resize_root_window): Remove decls.
13800
109e28d0
PE
13801 * window.c (window_deletion_count, delete_deletable_window):
13802 Remove; unused.
46a4ce9e
PE
13803 (window_body_lines): Now static.
13804 (Fdelete_other_windows_internal): Mark vars as initialized.
13805 Make sure 'resize_failed' is initialized.
13806 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13807 (resize_window_apply): Remove unused local.
13808 * window.h (delete_deletable_window): Remove decl.
13809
109e28d0 13810 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
13811 (imagemagick_load_image): Fix pointer signedness problem by changing
13812 last arg from unsigned char * to char *. All uses changed.
13813 Also, fix a local for similar reasons.
13814 Remove unused locals. Remove locals to avoid shadowing.
13815 (fn_rsvg_handle_free): Remove; unused.
13816 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 13817 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 13818
3f754b86
PE
13819 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13820
2547adb1
CY
138212011-06-10 Chong Yidong <cyd@stupidchicken.com>
13822
13823 * image.c (gif_load): Fix omitted cast error introduced by
13824 2011-06-06 change.
13825
2c8e37d4
MR
138262011-06-10 Martin Rudalics <rudalics@gmx.at>
13827
13828 * window.h (resize_proportionally, orig_total_lines)
13829 (orig_top_line): Remove from window structure.
13830 (set_window_height, set_window_width, change_window_heights)
13831 (Fdelete_window): Remove prototypes.
13832 (resize_frame_windows): Remove duplicate declaration.
13833
440a42e3
EZ
138342011-06-10 Eli Zaretskii <eliz@gnu.org>
13835
13836 * window.h (resize_frame_windows, resize_window_check)
13837 (delete_deletable_window, resize_root_window)
13838 (resize_frame_windows): Declare prototypes.
13839
13840 * window.c (resize_window_apply): Make definition be "static" to
13841 match the prototype.
13842
562dd5e9
MR
138432011-06-10 Martin Rudalics <rudalics@gmx.at>
13844
13845 * window.c: Remove declarations of Qwindow_size_fixed,
13846 window_min_size_1, window_min_size_2, window_min_size,
13847 size_window, window_fixed_size_p, enlarge_window, delete_window.
13848 Remove static from declaration of Qdelete_window, it's
13849 temporarily needed by Fbury_buffer.
13850 (replace_window): Don't assign orig_top_line and
13851 orig_total_lines.
13852 (Fdelete_window, delete_window): Remove. Window deletion is
13853 handled by window.el.
640c8776
SM
13854 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13855 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
13856 (Fdelete_other_windows): Remove. Deleting other windows is
13857 handled by window.el.
13858 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13859 handled in window.el.
13860 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13861 Window minimum sizes are handled in window.el.
13862 (shrink_windows, size_window, set_window_height)
13863 (set_window_width, change_window_heights, window_height)
13864 (window_width, CURBEG, CURSIZE, enlarge_window)
13865 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13866 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13867 handled in window.el.
13868 (make_dummy_parent): Rename to make_parent_window and give it a
13869 second argument horflag.
13870 (make_window): Don't set resize_proportionally any more.
13871 (Fsplit_window): Remove. Windows are split in window.el.
13872 (save_restore_action, save_restore_orig_size)
13873 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13874 Resize mini windows in window.el.
13875 (grow_mini_window, shrink_mini_window): Implement by calling
13876 Qresize_root_window_vertically, resize_window_check and
13877 resize_window_apply.
640c8776
SM
13878 (saved_window, Fset_window_configuration, save_window_save):
13879 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
13880 resize_proportionally.
13881 (window_min_height, window_min_width): Move to window.el.
13882 (keys_of_window): Move bindings for delete-other-windows,
13883 split-window, delete-window and enlarge-window to window.el.
13884
13885 * buffer.c: Temporarily extern Qdelete_window.
13886 (Fbury_buffer): Temporarily call Qdelete_window instead of
13887 Fdelete_window (Fbury_buffer will move to window.el soon).
13888
13889 * frame.c (set_menu_bar_lines_1): Remove code handling
13890 orig_top_line and orig_total_lines.
13891
13892 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13893 set_window_height but set heights directly.
13894 (change_frame_size_1): Use resize_frame_windows.
13895
13896 * xdisp.c (init_xdisp): Don't use set_window_height but set
13897 heights directly.
13898
640c8776
SM
13899 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13900 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
13901 run_window_configuration_change_hook.
13902
13903 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13904 instead of change_window_heights and run
13905 run_window_configuration_change_hook.
13906
1a13852e
MR
139072011-06-09 Martin Rudalics <rudalics@gmx.at>
13908
13909 * window.c (replace_window): Rename second argument REPLACEMENT to
13910 NEW. New third argument SETFLAG. Rewrite.
13911 (delete_window, make_dummy_parent): Call replace_window with
13912 third argument 1.
13913 (window_list_1): Move down in code.
13914 (run_window_configuration_change_hook): Move set_buffer part
13915 before select_frame_norecord part in order to unwind correctly.
13916 Rename count1 to count.
13917 (recombine_windows, delete_deletable_window, resize_root_window)
13918 (Fdelete_other_windows_internal)
13919 (Frun_window_configuration_change_hook, make_parent_window)
13920 (resize_window_check, resize_window_apply, Fresize_window_apply)
13921 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
13922 (Fdelete_window_internal, Fresize_mini_window_internal):
13923 New functions.
1a13852e
MR
13924 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13925
f3d1777e
MR
139262011-06-08 Martin Rudalics <rudalics@gmx.at>
13927
496e208e
MR
13928 * window.h (window): Add some new members to window structure -
13929 normal_lines, normal_cols, new_total, new_normal, clone_number,
13930 splits, nest, prev_buffers, next_buffers.
13931 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 13932 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 13933
f3d1777e
MR
13934 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
13935 Remove.
496e208e
MR
13936 (make_dummy_parent): Set new members of windows structure.
13937 (make_window): Move down in code. Handle new members of window
13938 structure.
13939 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
13940 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
13941 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
13942 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
13943 (Fset_window_next_buffers, Fset_window_clone_number):
13944 New functions.
496e208e
MR
13945 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
13946 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
13947 Doc-string fixes.
13948 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
13949 Argument WINDOW can be now internal window too.
13950 (Fwindow_use_time): Move up in code.
13951 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
13952 Rewrite doc-string.
13953 (Fset_window_configuration, saved_window)
13954 (Fcurrent_window_configuration, save_window_save): Handle new
13955 members of window structure.
b9e809c2
MR
13956 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
13957 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13958 (syms_of_window): New Lisp objects Qrecord_window_buffer,
13959 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13960 Qget_mru_window, Qresize_root_window,
13961 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13962 Qauto_buffer_name; staticpro them.
f3d1777e 13963
abde8f8c
MR
139642011-06-07 Martin Rudalics <rudalics@gmx.at>
13965
13966 * window.c (Fwindow_total_size, Fwindow_left_column)
13967 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
13968 (Fwindow_list_1): New functions.
13969 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
13970 (Fwindow_width, Fscroll_left, Fscroll_right):
13971 Use window_body_cols instead of window_box_text_cols.
13972 (delete_window, Fset_window_configuration):
13973 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
13974 (delete_all_subwindows): Take a window as argument and not a
13975 structure. Rewrite.
190b47e6
MR
13976 (window_loop): Remove handling of GET_LRU_WINDOW and
13977 GET_LARGEST_WINDOW.
13978 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
13979
13980 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
13981 window_box_text_cols. delete_all_subwindows now takes a
13982 Lisp_Object as argument.
abde8f8c 13983
640c8776
SM
13984 * indent.c (compute_motion, Fcompute_motion):
13985 Use window_body_cols instead of window_box_text_cols.
abde8f8c 13986
fa8a67e6
MR
13987 * frame.c (delete_frame): Call delete_all_subwindows with root
13988 window as argument.
13989
a54e3482
DC
139902011-06-07 Daniel Colascione <dan.colascione@gmail.com>
13991
13992 * fns.c (Fputhash): Document return value.
13993
60002bf5
CY
139942011-06-06 Chong Yidong <cyd@stupidchicken.com>
13995
13996 * image.c (gif_load): Implement gif89a spec "no disposal" method.
13997
0c671da6 139982011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 13999
b862a52a 14000 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 14001
be44ca6c
PE
14002 Check for overflow when converting integer to cons and back.
14003 * charset.c (Fdefine_charset_internal, Fdecode_char):
14004 Use cons_to_unsigned to catch overflow.
14005 (Fencode_char): Use INTEGER_TO_CONS.
14006 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14007 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14008 * data.c (long_to_cons, cons_to_long): Remove.
14009 (cons_to_unsigned, cons_to_signed): New functions.
14010 These signal an error for invalid or out-of-range values.
14011 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14012 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14013 * font.c (Ffont_variation_glyphs):
14014 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14015 * lisp.h: Include <intprops.h>.
14016 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14017 (cons_to_signed, cons_to_unsigned): New decls.
14018 (long_to_cons, cons_to_long): Remove decls.
14019 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14020 (Fprimitive_undo): Use CONS_TO_INTEGER.
14021 * xfns.c (Fx_window_property): Likewise.
14022 * xselect.c: Include <limits.h>.
14023 (x_own_selection, selection_data_to_lisp_data):
14024 Use INTEGER_TO_CONS.
14025 (x_handle_selection_request, x_handle_selection_clear)
14026 (x_get_foreign_selection, Fx_disown_selection_internal)
14027 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14028 (lisp_data_to_selection_data): Use cons_to_unsigned.
14029 (x_fill_property_data): Use cons_to_signed.
14030 Report values out of range.
14031
d1f3d2af
PE
14032 Check for buffer and string overflow more precisely.
14033 * buffer.h (BUF_BYTES_MAX): New macro.
14034 * lisp.h (STRING_BYTES_MAX): New macro.
14035 * alloc.c (Fmake_string):
14036 * character.c (string_escape_byte8):
14037 * coding.c (coding_alloc_by_realloc):
14038 * doprnt.c (doprnt):
14039 * editfns.c (Fformat):
14040 * eval.c (verror):
14041 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14042 since they may not be the same number.
14043 * editfns.c (Finsert_char):
14044 * fileio.c (Finsert_file_contents):
14045 Likewise for BUF_BYTES_MAX.
14046
dd52fcea
PE
14047 * image.c: Use ptrdiff_t, not int, for sizes.
14048 (slurp_file): Switch from int to ptrdiff_t.
14049 All uses changed.
14050 (slurp_file): Check that file size fits in both size_t (for
14051 malloc) and ptrdiff_t (for sanity and safety).
14052
7f9bbdbb
PE
14053 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14054 if b->modtime has its maximal value.
14055
dfe18f82
PE
14056 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14057
84acfcf0
PE
14058 Don't assume time_t can fit into int.
14059 * buffer.h (struct buffer.modtime): Now time_t, not int.
14060 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14061 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14062
ccd9a01a
PE
14063 Minor fixes for signed vs unsigned integers.
14064 * character.h (MAYBE_UNIFY_CHAR):
14065 * charset.c (maybe_unify_char):
14066 * keyboard.c (read_char, reorder_modifiers):
14067 XINT -> XFASTINT, since the integer must be nonnegative.
14068 * ftfont.c (ftfont_spec_pattern):
14069 * keymap.c (access_keymap, silly_event_symbol_error):
14070 XUINT -> XFASTINT, since the integer must be nonnegative.
14071 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14072 since it makes no difference and we prefer signed.
14073 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14074 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14075 nonnegative.
14076
d6d100dd
SM
140772011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14078
14079 * window.h (Fwindow_frame): Declare.
14080
2b6148e4
PE
140812011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14082
14083 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14084 (SPARE_MEMORY): Always define.
14085 (LARGE_REQUEST): Remove.
14086 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14087
f230ecc9
MR
140882011-06-06 Martin Rudalics <rudalics@gmx.at>
14089
727e958e
MR
14090 * lisp.h: Move EXFUNS for Fframe_root_window,
14091 Fframe_first_window and Fset_frame_selected_window to window.h.
14092
14093 * window.h: Move EXFUNS for Fframe_root_window,
14094 Fframe_first_window and Fset_frame_selected_window here from
14095 lisp.h.
14096
14097 * frame.c (Fwindow_frame, Fframe_first_window)
14098 (Fframe_root_window, Fframe_selected_window)
14099 (Fset_frame_selected_window): Move to window.c.
14100 (Factive_minibuffer_window): Move to minibuf.c.
14101 (Fother_visible_frames_p): New function.
14102
14103 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14104
f230ecc9
MR
14105 * window.c (decode_window, decode_any_window): Move up in code.
14106 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14107 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
14108 (Fwindow_buffer): Move up and rewrite doc-string.
14109 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14110 (Fwindow_prev): New functions.
727e958e
MR
14111 (Fwindow_frame): Move here from frame.c. Accept any window as
14112 argument.
14113 (Fframe_root_window, Fframe_first_window)
14114 (Fframe_selected_window): Move here from frame.c. Accept frame
14115 or arbitrary window as argument. Update doc-strings.
14116 (Fminibuffer_window): Move up in code.
14117 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
14118 (Fset_frame_selected_window): Move here from frame.c.
14119 Marginal rewrite.
727e958e
MR
14120 (Fselected_window, select_window, Fselect_window): Move up in
14121 code. Minor doc-string fixes.
f230ecc9 14122
4d09bcf6
PE
141232011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14124
14125 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14126 Do not assume that spare memory exists; that assumption is valid
14127 only if SYSTEM_MALLOC.
14128 (LARGE_REQUEST): New macro, so that the issue of large requests
14129 is separated from the issue of spare memory.
14130
810928a2
AS
141312011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14132
172418ad
AS
14133 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14134 format. (Bug#8806)
14135
43f862f7
AS
14136 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14137
810928a2
AS
14138 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14139 before statements.
14140
a059fe24
JD
141412011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14142
14143 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14144
14145 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14146
14147 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14148 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14149
989bf368
JB
141502011-06-05 Juanma Barranquero <lekktu@gmail.com>
14151
14152 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14153
4b80f674
CY
141542011-06-04 Chong Yidong <cyd@stupidchicken.com>
14155
14156 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14157 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
14158 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14159 New error handlers.
4b80f674
CY
14160 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14161 Obey Vx_select_enable_clipboard_manager. Catch errors in
14162 x_clipboard_manager_save (Bug#8779).
14163 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 14164 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 14165
99a33b77 141662011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
14167
14168 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14169
99a33b77 141702011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
14171
14172 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14173 in the current matrix if keep_current_p is non-zero.
14174
8264569d
EZ
141752011-06-04 Eli Zaretskii <eliz@gnu.org>
14176
14177 * bidi.c (bidi_level_of_next_char): Fix last change.
14178
57f97249
EZ
141792011-06-03 Eli Zaretskii <eliz@gnu.org>
14180
fec2107c 14181 Support bidi reordering of text covered by display properties.
57f97249 14182
fec2107c
EZ
14183 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14184 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14185 (bidi_cache_search, bidi_cache_iterator_state)
14186 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
14187 (bidi_level_of_next_char, bidi_move_to_visually_next):
14188 Support character positions inside a run of characters covered by a
fec2107c
EZ
14189 display string.
14190 (bidi_paragraph_init, bidi_resolve_explicit_1)
14191 (bidi_level_of_next_char): Call bidi_fetch_char and
14192 bidi_fetch_char_advance instead of FETCH_CHAR and
14193 FETCH_CHAR_ADVANCE.
14194 (bidi_init_it): Initialize new members.
14195 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14196 definitions.
14197 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14198 instead of using explicit *_CHAR codes.
d6d100dd
SM
14199 (bidi_resolve_explicit, bidi_resolve_weak):
14200 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
14201 bidirectional text is supported only in multibyte buffers.
14202 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14203 it to initialize the frame_window_p member of struct bidi_it.
14204 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14205 (bidi_resolve_explicit, bidi_resolve_weak)
14206 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14207 bidi_it->nchars is non-positive.
14208 (bidi_level_of_next_char): Don't try to lookup the cache for the
14209 next/previous character if nothing is cached there yet, or if we
14210 were just reseat()'ed to a new position.
c40e2fb2 14211
0e14fe90
EZ
14212 * xdisp.c (set_cursor_from_row): Set start and stop points
14213 according to the row's direction when priming the loop that looks
14214 for the glyph on which to display cursor.
14215 (single_display_spec_intangible_p): Function deleted.
14216 (display_prop_intangible_p): Reimplement to call
14217 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
14218 Accept 3 additional arguments needed by handle_display_spec.
14219 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
14220 values: lists, `(when COND...)' forms, etc.
14221 (single_display_spec_string_p): Support property values that are
14222 lists with the argument STRING its top-level element.
14223 (display_prop_string_p): Fix the condition for processing a
14224 property that is a list to be consistent with handle_display_spec.
fec2107c 14225 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
14226 last portion of handle_display_prop.
14227 (compute_display_string_pos): Accept additional argument
14228 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14229 value of a `display' property is a "replacing spec".
14230 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14231 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14232 the display property, but just return a value indicating whether
14233 the display property will replace the characters it covers.
14234 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14235 frame_window_p members of struct bidi_it.
d6d100dd
SM
14236 (compute_display_string_pos, compute_display_string_end):
14237 New functions.
fec2107c
EZ
14238 (push_it): Accept second argument POSITION, where pop_it should
14239 jump to continue iteration.
14240 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 14241
fec2107c
EZ
14242 * keyboard.c (adjust_point_for_property): Adjust the call to
14243 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
14244
14245 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
14246 (bidi_init_it): Update prototypes.
14247 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
14248 (compute_display_string_pos, compute_display_string_end):
14249 Declare prototypes.
fec2107c
EZ
14250 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14251 EMACS_INT.
fc6f18ce 14252
40087514 142532011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 14254
57f53182
PE
14255 Malloc failure behavior now depends on size of allocation.
14256 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14257 * lisp.h: Change signatures accordingly.
14258 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14259 All callers changed. (Bug#8762)
14260
14261 * gnutls.c: Use Emacs's memory allocators.
14262 Without this change, the gnutls library would invoke malloc etc.
14263 directly, which causes problems on non-SYNC_INPUT hosts, and which
14264 runs afoul of improving memory_full behavior. (Bug#8761)
14265 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14266 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14267 xfree instead of the default malloc, realloc, free.
14268 (Fgnutls_boot): No need to check for memory allocation failure,
14269 since xmalloc does that for us.
14270
ac32cd99 14271 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
14272 * category.c (hash_get_category_set):
14273 * ccl.c (ccl_driver):
14274 * charset.c (Fdefine_charset_internal):
14275 * charset.h (struct charset.hash_index):
14276 * composite.c (get_composition_id, gstring_lookup_cache)
14277 (composition_gstring_put_cache):
14278 * composite.h (struct composition.hash_index):
14279 * dispextern.h (struct image.hash):
14280 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14281 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14282 (hashfn_equal, hashfn_user_defined, make_hash_table)
14283 (maybe_resize_hash_table, hash_lookup, hash_put)
14284 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14285 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14286 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14287 * image.c (make_image, search_image_cache, lookup_image)
14288 (xpm_put_color_table_h):
14289 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 14290 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 14291 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 14292 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
14293 * alloc.c (allocate_vectorlike):
14294 Check for overflow in vector size calculations.
14295 * ccl.c (ccl_driver):
14296 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
14297 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14298 need to be updated by these changes.
40087514
PE
14299 * fns.c (make_hash_table, maybe_resize_hash_table):
14300 Check for integer overflow with large hash tables.
0de4bb68
PE
14301 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14302 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14303 (SXHASH_REDUCE): New macro.
14304 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14305 Use it instead of discarding useful hash info with large hash values.
14306 (sxhash_float): New function.
14307 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14308 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
14309 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14310 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
14311 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14312 Adjust signatures to match updated version of code.
14313 (consing_since_gc): Now EMACS_INT, since a single hash table can
14314 use more than INT_MAX bytes.
14315
698d32e2
DN
143162011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14317
14318 Make it possible to build with GCC-4.6+ -O2 -flto.
14319
14320 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14321
fd6fa53f
SM
143222011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14323
14324 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14325 Call minibuffer-inactive-mode.
14326
864db017
JB
143272011-05-31 Juanma Barranquero <lekktu@gmail.com>
14328
14329 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14330 Update dependencies.
14331
2ad0baf4
DN
143322011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14333
14334 * data.c (init_data): Remove code for UTS, this system is not
14335 supported anymore.
14336
4fcc2638
DN
143372011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14338
14339 Don't force ./temacs to start in terminal mode.
14340
14341 * frame.c (make_initial_frame): Initialize faces in all cases, not
14342 only when CANNOT_DUMP is defined.
14343 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14344
c56e0fd5
DN
143452011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14346
14347 * dispnew.c (add_window_display_history): Use const for the string
14348 pointer. Remove declaration, not needed.
14349
333d54da 143502011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 14351
55d4c1b2 14352 Use 'inline', not 'INLINE'.
333d54da 14353 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
14354 * alloc.c, fontset.c (INLINE): Remove.
14355 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14356 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14357 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14358 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14359 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14360
738db178
DN
143612011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14362
14363 Make it possible to run ./temacs.
14364
14365 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14366 syms_of_callproc does the same thing. Remove test for
14367 "initialized", do it in the caller.
14368 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14369
620c53a6
SM
143702011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14371
14372 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14373 (read_minibuf): Use get_minibuffer.
14374 (syms_of_minibuf): Use DEFSYM.
14375 (Qmetadata): New var.
14376 * data.c (Qbuffer): Don't make it static.
14377 (syms_of_data): Use DEFSYM.
14378
e003a292
PE
143792011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14380
14381 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14382 (CCL_CODE_MIN): New macro.
14383
ed008a6d
PE
143842011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14385
3687c2ef
PE
14386 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14387
ed008a6d
PE
14388 * eval.c (Qdebug): Now static.
14389 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14390 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14391 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14392
d66c4c7c
CY
143932011-05-29 Chong Yidong <cyd@stupidchicken.com>
14394
14395 * image.c: Various fixes to ImageMagick code comments.
14396 (Fimagemagick_types): Doc fix.
14397
5fbc2025
PE
143982011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14399
0196f88a
PE
14400 Minor fixes prompted by GCC 4.6.0 warnings.
14401
14402 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14403
5fbc2025
PE
14404 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14405 (x_clipboard_manager_save_all): Move extern decl to ...
14406 * xterm.h: ... here, so that it can be checked for consistency.
14407
1dd3c2d9
CY
144082011-05-29 Chong Yidong <cyd@stupidchicken.com>
14409
14410 * xselect.c (x_clipboard_manager_save_frame)
14411 (x_clipboard_manager_save_all): New functions.
14412 (Fx_clipboard_manager_save): Lisp function deleted.
14413
14414 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14415 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14416
14417 * xterm.h: Update prototype.
14418
5ba6571d
WX
144192011-05-28 William Xu <william.xwl@gmail.com>
14420
14421 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14422 exiting (Bug#8239).
14423
3eaff834
JM
144242011-05-28 Jim Meyering <meyering@redhat.com>
14425
e1900994 14426 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
14427 * fns.c (to_uchar): Define.
14428 (crypto_hash_function): Use it to convert some newly-signed
14429 variables to unsigned, to avoid sign-extension bugs. For example,
14430 without this change, (md5 "truc") would evaluate to
14431 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14432 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 14433 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 14434
0f6990a7
PE
144352011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14436
14437 Integer overflow fixes.
c8a9ca5a 14438
08686060
PE
14439 * dbusbind.c: Serial number integer overflow fixes.
14440 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
14441 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14442 to hold a serial number that is too large for a fixnum.
14443 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14444 Check for serial numbers out of range. Decode any serial number
59568bf0 14445 that was so large that it became a float. (Bug#8722)
08686060 14446
2d1fc3c7
PE
14447 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14448 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14449 Use XFASTINT rather than XUINT when numbers are nonnegative.
14450 (xd_append_arg, Fdbus_method_return_internal):
14451 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14452 arguments, check that Lisp number is nonnegative, rather than
59568bf0 14453 silently wrapping negative numbers around. (Bug#8722)
30217ff0 14454 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 14455 (Bug#8722)
2d1fc3c7 14456
c8a9ca5a
PE
14457 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14458
519e1d69
PE
14459 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14460
6df6ae42 14461 ccl: Add integer overflow checks.
30569699
PE
14462 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14463 (IN_INT_RANGE): New macros.
14464 (ccl_driver): Use them to check for integer overflow when
14465 decoding a CCL program. Many of the new checks are whether XINT (x)
14466 fits in int; it doesn't always, on 64-bit hosts. The new version
14467 doesn't catch all possible integer overflows, but it's an
847044ea 14468 improvement. (Bug#8719)
30569699 14469
c11285dc
PE
14470 * alloc.c (make_event_array): Use XINT, not XUINT.
14471 There's no need for unsigned here.
14472
fdccd48e
PE
14473 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14474 This follows up to the 2011-05-06 change that substituted uintptr_t
14475 for EMACS_INT. This case wasn't caught back then.
14476
37910ab2
PE
14477 Rework Fformat to avoid integer overflow issues.
14478 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14479 now (part of C89). Include <verify.h>.
14480 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14481 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14482 (Fformat): Avoid the prepass trying to compute sizes; it was only
14483 approximate and thus did not catch overflow reliably. Instead, walk
14484 through the format just once, formatting and computing sizes as we go,
14485 checking for integer overflow at every step, and allocating a larger
14486 buffer as needed. Keep track separately whether the format is
14487 multibyte. Keep only the most-recently calculated precision, rather
14488 than them all. Record whether each argument has been converted to
14489 string. Use EMACS_INT, not int, for byte and char and arg counts.
14490 Support field widths and precisions larger than INT_MAX. Avoid
14491 sprintf's undefined behavior with conversion specifications such as %#d
14492 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14493 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14494 formatting out-of-range floating point numbers with int
9173deec 14495 formats. (Bug#8668)
37910ab2 14496
2e6578fb
PE
14497 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14498
0ae6bdee
PE
14499 * data.c: Avoid integer truncation in expressions involving floats.
14500 * data.c: Include <intprops.h>.
14501 (arith_driver): When there's an integer overflow in an expression
14502 involving floating point, convert the integers to floating point
14503 so that the resulting value does not suffer from catastrophic
14504 integer truncation. For example, on a 64-bit host (* 4
14505 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14506 Do not rely on undefined behavior after integer overflow.
14507
de883a70
PE
14508 merge count_size_as_multibyte, parse_str_to_multibyte
14509 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 14510 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
14511 Check for integer overflow.
14512 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14513 since it's now a duplicate of the other. This is more of
14514 a character than a buffer op, so better that it's in character.c.
14515 * fns.c, print.c: Adjust to above changes.
14516
2ff916cb
PE
145172011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14518
14519 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14520
f1b54466
PE
145212011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14522
fb1ac845
PE
14523 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14524 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14525 (x_clipboard_manager_save): Now static.
14526 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14527
f1b54466
PE
14528 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14529 (crypto_hash_function): Now static.
14530 Fix pointer signedness problems. Avoid unnecessary initializations.
14531
a9f737ee
CY
145322011-05-27 Chong Yidong <cyd@stupidchicken.com>
14533
14534 * termhooks.h (Vselection_alist): Make it terminal-local.
14535
14536 * terminal.c (create_terminal): Initialize it.
14537
14538 * xselect.c: Support for clipboard managers.
14539 (Vselection_alist): Move to termhooks.h as terminal-local var.
14540 (LOCAL_SELECTION): New macro.
14541 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14542 (symbol_to_x_atom): Remove gratuitous arg.
14543 (x_handle_selection_request, lisp_data_to_selection_data)
14544 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
14545 (x_own_selection, x_get_local_selection, x_convert_selection):
14546 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
14547 (some_frame_on_display): Delete unused function.
14548 (Fx_own_selection_internal, Fx_get_selection_internal)
14549 (Fx_disown_selection_internal, Fx_selection_owner_p)
14550 (Fx_selection_exists_p): New optional frame arg.
14551 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14552 (x_handle_selection_clear): Don't treat other terminals with the
14553 same keyboard specially. Use the terminal-local Vselection_alist.
14554 (x_clear_frame_selections): Use Frun_hook_with_args.
14555
14556 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14557
14558 * xterm.h: Add support for those atoms.
14559
e067f0c1
CY
145602011-05-26 Chong Yidong <cyd@stupidchicken.com>
14561
14562 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14563 (converted_selections, conversion_fail_tag): New global variables.
14564 (x_selection_request_lisp_error): Free the above.
14565 (x_get_local_selection): Remove unnecessary code.
14566 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
14567 of converted selections stored in converted_selections.
14568 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
14569 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14570 (x_convert_selection): New function.
14571 (x_handle_selection_event): Simplify.
14572 (x_get_foreign_selection): Don't ignore incoming requests while
14573 waiting for an answer; this will fail when we implement
14574 SAVE_TARGETS, and seems unnecessary anyway.
14575 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14576 (Vx_sent_selection_functions): Doc fix.
14577
0f4aebc0
LL
145782011-05-26 Leo Liu <sdl.web@gmail.com>
14579
14580 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14581
e61124cd
YM
145822011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14583
14584 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14585
14586 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14587 for fringe update if it has periodic bitmap.
ac389d0c 14588 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
14589 and fringe_bitmap_periodic_p.
14590
14591 * fringe.c (get_fringe_bitmap_data): New function.
14592 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14593 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14594 row. Mark glyph row for fringe update if periodicity changed.
14595
14596 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14597 for fringe update unless it has periodic bitmap.
14598
f16d9837
KH
145992011-05-25 Kenichi Handa <handa@m17n.org>
14600
14601 * xdisp.c (get_next_display_element): Set correct it->face_id for
14602 a static composition.
14603
e1b90ef6
LL
146042011-05-24 Leo Liu <sdl.web@gmail.com>
14605
14606 * deps.mk (fns.o):
14607 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14608
14609 * fns.c (crypto_hash_function, Fsha1): New function.
14610 (Fmd5): Use crypto_hash_function.
14611 (syms_of_fns): Add Ssha1.
14612
7400048f
PE
146132011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14614
14615 * gnutls.c: Remove unused macros.
14616 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14617 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14618 Remove macros that are defined and never used.
14619 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14620
abb71cf4
CY
146212011-05-22 Chong Yidong <cyd@stupidchicken.com>
14622
14623 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14624 (Fx_get_selection_internal): Minor cleanup.
14625 (Fx_own_selection_internal): Rename arguments for consistency with
14626 select.el.
14627
6307db39
PE
146282011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14629
14630 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14631
f3d4e0a4
CY
146322011-05-22 Chong Yidong <cyd@stupidchicken.com>
14633
14634 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14635
4d8ade89
YM
146362011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14637
14638 * dispnew.c (scrolling_window): Don't exclude the case that the
14639 last enabled row in the desired matrix touches the bottom boundary.
14640
32078c8d
GM
146412011-05-21 Glenn Morris <rgm@gnu.org>
14642
14643 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
14644 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14645 and add some more files.
32078c8d 14646
7285dc67
EZ
146472011-05-20 Eli Zaretskii <eliz@gnu.org>
14648
14649 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14650 report_file_error introduced by the change from 2011-05-07.
14651
89d1bd22
PE
146522011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14653
14654 * systime.h (Time): Define only if emacs is defined.
14655 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14656 where the include path doesn't have X11/X.h by default. See
14657 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14658
cd394be1 146592011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
14660
14661 * composite.c (find_automatic_composition): Fix previous change.
14662
b9704ad9
GM
146632011-05-20 Glenn Morris <rgm@gnu.org>
14664
14665 * lisp.mk: New file, split from Makefile.in.
14666 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14667 (shortlisp): Remove.
14668 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14669
4a720484
GM
146702011-05-19 Glenn Morris <rgm@gnu.org>
14671
14672 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14673 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14674 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14675 (lisp): Set the order to that of loadup.el.
14676 (shortlisp): Make it a copy of $lisp.
14677 (SOME_MACHINE_LISP): Remove.
14678 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14679 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14680
a28d4396
KH
146812011-05-18 Kenichi Handa <handa@m17n.org>
14682
14683 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14684 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14685 (find_automatic_composition): Mostly rewrite for efficiency.
14686
a2b1fa8e
JB
146872011-05-18 Juanma Barranquero <lekktu@gmail.com>
14688
14689 * makefile.w32-in: Update dependencies.
14690
8e1f5610
CS
146912011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14692
14693 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 14694 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 14695
7025ee00 146962011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 14697
cdfa6eab
PE
14698 Fix some integer overflow issues, such as string length overflow.
14699
06d6db33
PE
14700 * insdel.c (count_size_as_multibyte): Check for string overflow.
14701
2b4560a8
PE
14702 * character.c (lisp_string_width): Check for string overflow.
14703 Use EMACS_INT, not int, for string indexes and lengths; in
14704 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14705 the resulting string length overflows an EMACS_INT; instead,
14706 report a string overflow if no precision given. When checking for
14707 precision exhaustion, use a check that cannot possibly have
14708 integer overflow. (Bug#8675)
14709 * character.h (lisp_string_width): Adjust to new signature.
14710
cb93f9be
PE
14711 * alloc.c (string_overflow): New function.
14712 (Fmake_string): Use it. This doesn't change behavior, but saves
14713 a few bytes and will simplify future changes.
14714 * character.c (string_escape_byte8): Likewise.
14715 * lisp.h (string_overflow): New decl.
14716
1a1f3366
PE
14717 Fixups, following up to the user-interface timestamp change.
14718 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14719 for UI timestamps, instead of unsigned long.
9fbd6841
PE
14720 * msdos.c (mouse_get_pos): Likewise.
14721 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
14722 * w32gui.h (Time): Define by including "systime.h" rather than by
14723 declaring it ourselves. (Bug#8664)
14724
d4e3e4d3
PE
14725 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14726 * image.c (clear_image_cache): Likewise.
14727
f6a24d19
PE
14728 * term.c (term_mouse_position): Don't assume time_t wraparound.
14729
08dc5ae6
PE
14730 Be more systematic about user-interface timestamps.
14731 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
14732 and sometimes 'EMACS_UINT', to represent these timestamps.
14733 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
14734 This makes the code easier to follow, and makes it easier to catch
14735 integer overflow bugs such as Bug#8664.
14736 * frame.c (Fmouse_position, Fmouse_pixel_position):
14737 Use Time, not unsigned long, for user-interface timestamps.
14738 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14739 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14740 * keyboard.h (last_event_timestamp): Likewise.
14741 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14742 * menu.h (xmenu_show): Likewise.
14743 * term.c (term_mouse_position): Likewise.
14744 * termhooks.h (struct input_event.timestamp): Likewise.
14745 (struct terminal.mouse_position_hook): Likewise.
14746 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14747 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14748 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14749 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14750 what it was before.
14751 * menu.h, termhooks.h: Include "systime.h", for Time.
14752
8e55734a
PE
14753 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14754 Don't assume that the difference between two unsigned long values
14755 can fit into an integer. At this point, we know button_down_time
14756 <= event->timestamp, so the difference must be nonnegative, so
14757 there's no need to cast the result if double-click-time is
14758 nonnegative, as it should be; check that it's nonnegative, just in
14759 case. This bug is triggered when events are more than 2**31 ms
86db42d2 14760 apart (about 25 days). (Bug#8664)
8e55734a 14761
841f1b75 14762 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 14763 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 14764
3e26f69c
PE
14765 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14766 that always fit in int. Use a sentinel instead of a counter, to
14767 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
14768 * frame.h (struct frame): Use int for menu_bar_items_used
14769 instead of EMACS_INT, since it always fits in int.
3e26f69c 14770
5cc152c0
PE
14771 * menu.c (grow_menu_items): Check for int overflow.
14772
d89eb65e
PE
14773 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14774
5235bd3e
PE
14775 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14776 Before, the code was not consistent. These values cannot exceed
14777 2**31 - 1 so there's no need to make them unsigned.
14778 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14779 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14780 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14781 as modifiers.
14782 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14783
bc827e23
PE
14784 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14785 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14786 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14787 presumably because the widths might not match.
14788
78eb494e
PE
14789 * window.c (size_window): Avoid needless test at loop start.
14790
04f2d78b
CB
147912011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14792
14793 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14794
d2fc7e3d 147952011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
14796
14797 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14798
d2fc7e3d 147992011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
14800
14801 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14802 `width' to `bar_area_x' and `bar_area_width', respectively.
14803 (x_scroll_run): Take account of fringe background extension.
14804
04f2d78b
CB
14805 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14806 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
14807 `bar_area_width', respectively.
14808 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14809 background extension.
14810
79b70037
GM
148112011-05-10 Jim Meyering <meyering@redhat.com>
14812
14813 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14814
2f142cc5
JB
148152011-05-10 Juanma Barranquero <lekktu@gmail.com>
14816
14817 * image.c (Finit_image_library): Return t for built-in image types,
14818 like pbm and xbm. (Bug#8640)
14819
57679c86
AS
148202011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14821
14822 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14823
888c9e86
EZ
148242011-05-07 Eli Zaretskii <eliz@gnu.org>
14825
b0512a1d
EZ
14826 * w32console.c (Fset_screen_color): Doc fix.
14827 (Fget_screen_color): New function.
14828 (syms_of_ntterm): Defsubr it.
14829
7285dc67
EZ
14830 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14831 unlink the temporary file if Fcall_process didn't create it in the
14832 first place.
14833 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14834 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
14835 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14836 cue to call_process_cleanup not to close that handle.
14837
4d3fcc8e
BK
148382011-05-07 Ben Key <bkey76@gmail.com>
14839
14840 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14841 one of two shell specific rules, either bootstrap-temacs-CMD or
14842 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14843 to the previous implementation of the bootstrap-temacs rule.
14844 The bootstrap-temacs-CMD rule is similar to the previous
14845 implementation of the bootstrap-temacs rule except that it
14846 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14847 variable.
14848
14849 These changes, along with some changes to nt/configure.bat,
14850 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14851 earlier fix to add support for --cflags and --ldflags options
14852 that include quotes so that it works whether make uses cmd or
14853 sh as the shell.
14854
b4289b64
MA
148552011-05-06 Michael Albinus <michael.albinus@gmx.de>
14856
14857 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14858 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14859 is a constant.
14860 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14861 a string. Handle both cases.
14862 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14863 (Fdbus_register_method): Use Qinvalid_function.
14864
af4c0e28
JB
148652011-05-06 Juanma Barranquero <lekktu@gmail.com>
14866
14867 * makefile.w32-in: Update dependencies.
14868 (LISP_H): Add inttypes.h and stdin.h.
14869 (PROCESS_H): Add unistd.h.
14870
c51453d9
EZ
148712011-05-06 Eli Zaretskii <eliz@gnu.org>
14872
14873 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14874 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14875
8ff0ac3c 148762011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 14877
4c4b566b
PE
14878 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14879
aab2b9b5
PE
14880 * term.c (vfatal): Remove stray call to va_end.
14881 It's not needed and the C Standard doesn't allow it here anyway.
14882
c378da0b
PE
14883 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14884 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14885
288b08c7
PE
14886 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14887 bytes.
14888
e3601888
PE
14889 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14890
db6c0e74
PE
14891 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14892
dd5963ea
PE
14893 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14894
88c9450f
PE
14895 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14896
2f9442b8
PE
14897 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14898
c032b5f8
PE
14899 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14900 * charset.c (Fdefine_charset_internal): Don't initialize
14901 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 14902 32-bit int (Bug#8600).
a108c10b
PE
14903
14904 * lread.c (read_integer): Be more consistent with string-to-number.
14905 Use string_to_number to do the actual conversion; this avoids
14906 rounding errors and fixes some other screwups. Without this fix,
14907 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14908 (digit_to_number): Move earlier, for benefit of read_integer.
14909 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 14910 not a digit in any supported base. (Bug#8602)
a108c10b 14911
ad5f9eea
PE
14912 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14913
aec1708a
PE
14914 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14915 to match comment at start of function. This also removes a
14916 GCC warning about overflow in a 32+64-bit port.
14917
47be4ab5
PE
14918 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14919
371cac43
PE
14920 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14921 Reported by Stefan Monnier in
14922 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
14923 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14924 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 14925
d01a7826
PE
14926 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
14927 (EMACS_UINTPTR): Likewise, with uintptr_t.
14928
7fd47d5c
PE
14929 * lisp.h: Prefer 64-bit EMACS_INT if available.
14930 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
14931 on 32-bit hosts that have 64-bit int, so that they can access
14932 large files.
122b0c86
PE
14933 However, temporarily disable this change unless the temporary
14934 symbol WIDE_EMACS_INT is defined.
7fd47d5c 14935
8727937b
PE
14936 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
14937
8ac068ac
PE
14938 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
14939 This removes an assumption that EMACS_INT and long are the same
14940 width as pointers. The assumption is true for Emacs porting targets
14941 now, but we want to make other targets possible.
14942 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
14943 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
14944 In the rest of the code, change types of integers that hold casted
14945 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
14946 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
14947 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
14948 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
14949 No need to cast type when ORing.
14950 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
14951 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
14952 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
14953 assume EMACS_INT is the same width as char *.
14954 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
14955 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
14956 Remove no-longer-needed casts.
14957 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14958 (xg_tool_bar_help_callback, xg_make_tool_item):
14959 Use EMACS_INTPTR to hold an integer
14960 that will be cast to void *; this can avoid a GCC warning
14961 if EMACS_INT is not the same width as void *.
14962 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14963 * xdisp.c (display_echo_area_1, resize_mini_window_1):
14964 (current_message_1, set_message_1):
14965 Use a local to convert to proper width without a cast.
14966 * xmenu.c (dialog_selection_callback): Likewise.
14967
ede49d71
PE
14968 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
14969 Also, don't assume VALBITS / RAND_BITS is less than 5,
14970 and don't rely on undefined behavior when shifting a 1 left into
14971 the sign bit.
14972 * lisp.h (get_random): Change signature to match.
14973
2f30ecd0
PE
14974 * lread.c (hash_string): Use size_t, not int, for hash computation.
14975 Normally we prefer signed values; but hashing is special, because
14976 it's better to use unsigned division on hash table sizes so that
14977 the remainder is nonnegative. Also, size_t is the natural width
14978 for hashing into memory. The previous code used 'int', which doesn't
14979 retain enough info to hash well into very large tables.
14980 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
14981
2a866e7b
PE
14982 * dbusbind.c: Don't possibly lose pointer info when converting.
14983 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14984 Use XPNTR rather than XHASH, so that the high-order bits of
14985 the pointer aren't lost when converting through void *.
14986
51639eac
PE
14987 * eval.c (Fautoload): Don't double-shift a pointer.
14988
92394119
PE
14989 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
14990
dbdb9a7c
JB
149912011-05-06 Juanma Barranquero <lekktu@gmail.com>
14992
14993 * gnutls.c (DEF_GNUTLS_FN):
14994 * image.c (DEF_IMGLIB_FN): Make function pointers static.
14995
db7a0b4f
AS
149962011-05-05 Andreas Schwab <schwab@linux-m68k.org>
14997
14998 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
14999 marker. (Bug#8610)
15000
cd394be1 150012011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
15002
15003 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15004 New version that can reserve upto 2GB of heap space.
15005
f7ff1b0f 150062011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
15007
15008 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15009
639c109b
TZ
150102011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15011
15012 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15013 `gnutls_certificate_set_x509_key_file'.
15014
d2127135
JB
150152011-05-05 Juanma Barranquero <lekktu@gmail.com>
15016
15017 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15018 Update dependencies.
15019
e968f4f3
JB
150202011-05-04 Juanma Barranquero <lekktu@gmail.com>
15021
15022 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15023 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15024 Remove unused parameter `fildes'.
15025 * process.c (read_process_output, send_process): Don't pass it.
15026
84d358f0
JB
150272011-05-04 Juanma Barranquero <lekktu@gmail.com>
15028
15029 Fix previous change: the library cache is defined in w32.c.
15030 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15031 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15032
0898ca10
JB
150332011-05-04 Juanma Barranquero <lekktu@gmail.com>
15034
15035 Implement dynamic loading of GnuTLS on Windows.
15036
15037 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15038 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15039 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15040 Declare.
15041
15042 * gnutls.c (Qgnutls_dll): Define.
15043 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15044 (gnutls_*): Declare function pointers.
15045 (init_gnutls_functions): New function to initialize function pointers.
15046 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15047 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15048 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15049 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15050 (emacs_gnutls_write, emacs_gnutls_read)
15051 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15052 (Fgnutls_available_p): New function.
15053 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15054 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15055 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15056
15057 * image.c: Include w32.h.
15058 (Vimage_type_cache): Delete.
15059 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15060 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15061 (w32_delayed_load): Move to w32.c.
15062
15063 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15064
15065 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15066 (w32_delayed_load): Move from image.c. When loading a library, record
15067 its filename in the :loaded-from property of the library id.
15068 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15069 Initialize and staticpro them.
15070 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15071
15072 * process.c: Include lisp.h before w32.h, not after.
15073 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15074 instead of gnutls_record_check_pending.
15075
15076 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15077
ff4de4aa
TZ
150782011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15079
15080 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15081 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15082 as passed in.
15083
abe95abb
JD
150842011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15085
15086 * xterm.c (x_set_frame_alpha): Do not set property on anything
15087 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15088
e16e55d4
JB
150892011-05-02 Juanma Barranquero <lekktu@gmail.com>
15090
15091 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15092
bafcf6a5
JB
150932011-05-02 Juanma Barranquero <lekktu@gmail.com>
15094
15095 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15096 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15097 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15098 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15099 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15100 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15101 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15102 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15103 (Qgnutls_bootprop_callbacks_verify): Make static.
15104
e7a6747f
AS
151052011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15106
19ed11ba
AS
15107 * callproc.c: Indentation fixup.
15108
e7a6747f 15109 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
15110 (wait_for_termination, interruptible_wait_for_termination):
15111 Move after wait_for_termination_1.
e7a6747f 15112
1ef14cb4
LMI
151132011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15114
15115 * sysdep.c (interruptible_wait_for_termination): New function
15116 which is like wait_for_termination, but allows keyboard
15117 interruptions.
15118
15119 * callproc.c (Fcall_process): Add (:file "file") as an option for
15120 the STDOUT buffer.
15121 (Fcall_process_region): Ditto.
15122
330d880c
EZ
151232011-04-30 Eli Zaretskii <eliz@gnu.org>
15124
8db90b73
EZ
15125 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15126 rather than `XVECTOR (FOO)->size'.
15127
330d880c
EZ
15128 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15129 inttypes.h, as a gnulib replacement is used if it not available in
15130 system headers.
15131
15cbd324
EZ
151322011-04-21 Eli Zaretskii <eliz@gnu.org>
15133
15134 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15135 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15136 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15137
15138 * coding.c (coding_alloc_by_realloc): Error out if destination
15139 will grow beyond MOST_POSITIVE_FIXNUM.
15140 (decode_coding_emacs_mule): Abort if there isn't enough place in
15141 charbuf for the composition carryover bytes. Reserve an extra
15142 space for up to 2 characters produced in a loop.
15143 (decode_coding_iso_2022): Abort if there isn't enough place in
15144 charbuf for the composition carryover bytes.
15145
151462011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 15147
ae940cca
EZ
15148 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15149 aborting when %lld or %lll format is passed.
15150 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15151 %llo or %llx format is passed. (Bug#8545)
15152
03ab8921
EZ
15153 * window.c (window_scroll_line_based): Use a marker instead of
15154 simple variables to record original value of point. (Bug#7952)
15155
afda1437
EZ
15156 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15157 produced by %s or %c overflows available buffer space. (Bug#8545)
15158
f76dee0c
PE
151592011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15160
15161 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 15162 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 15163
fdc5744d
JB
151642011-04-28 Juanma Barranquero <lekktu@gmail.com>
15165
15166 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15167
638f053a
JB
151682011-04-28 Juanma Barranquero <lekktu@gmail.com>
15169
15170 * keyboard.c (Qdelayed_warnings_hook): Define.
15171 (command_loop_1): Run `delayed-warnings-hook'
15172 if Vdelayed_warnings_list is non-nil.
15173 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15174 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15175
d178f871
EZ
151762011-04-28 Eli Zaretskii <eliz@gnu.org>
15177
15178 * doprnt.c (doprnt): Don't return value smaller than the buffer
15179 size if the message was truncated. (Bug#8545).
15180
b124fd93
JB
151812011-04-28 Juanma Barranquero <lekktu@gmail.com>
15182
15183 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15184 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15185
e810457d
PE
151862011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15187
15188 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15189
ea51cceb
JB
151902011-04-27 Juanma Barranquero <lekktu@gmail.com>
15191
15192 * makefile.w32-in: Update dependencies.
15193
94dcfacf
EZ
151942011-04-27 Eli Zaretskii <eliz@gnu.org>
15195
15196 Improve `doprnt' and its usage. (Bug#8545)
15197 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15198 `format_end'. Remove support for %l as a conversion specifier.
15199 Don't use xrealloc. Improve diagnostics when the %l size modifier
15200 is used. Update the commentary.
15201
15202 * eval.c (verror): Simplify calculation of size_t.
15203
15204 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15205 messages.
15206
f61f41d7
PE
152072011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15208
15209 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15210 change.
15211
96fb4434
PE
152122011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15213
15214 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15215 This makes this file independent of the recent pseudovector change.
15216
671875da 152172011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 15218
69e9b5a3
PE
15219 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15220
b5f869a7 15221 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 15222 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 15223 Remove unused local.
c8926152 15224 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 15225
841a1577 15226 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
15227 GCC 4.6.0 optimizes based on type-based alias analysis.
15228 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
15229 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15230 != &v->size, and therefore "v->size = 1; b->size = 2; return
15231 v->size;" must therefore return 1. This assumption is incorrect
15232 for Emacs, since it type-puns struct Lisp_Vector * with many other
15233 types. To fix this problem, this patch adds a new type struct
f904488f 15234 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
15235 and pseudovectors, and helps optimizing compilers not get fooled
15236 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15237 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
15238 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15239 the size member.
eab3844f
PE
15240 (XSETPVECTYPE): Rewrite in terms of new macro.
15241 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15242 This is a bit clearer, and further avoids the possibility of
15243 undesirable aliasing.
15244 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 15245 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
15246 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15247 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
15248 (ASIZE): Now uses header.size rather than size.
15249 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
15250 to avoid the hassle of writing XVECTOR (foo)->header.size.
15251 (struct vectorlike_header): New type.
eab3844f
PE
15252 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15253 object, to help avoid aliasing.
15254 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15255 (SUBRP): Likewise, since Lisp_Subr is a special case.
15256 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15257 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15258 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 15259 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
15260 changed to be "header.size" and "header.next".
15261 * buffer.h (struct buffer): Likewise.
15262 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15263 * frame.h (struct frame): Likewise.
15264 * process.h (struct Lisp_Process): Likewise.
15265 * termhooks.h (struct terminal): Likewise.
15266 * window.c (struct save_window_data, struct saved_window): Likewise.
15267 * window.h (struct window): Likewise.
15268 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15269 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15270 * buffer.c (init_buffer_once): Likewise.
15271 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15272 special case.
15273 * process.c (Fformat_network_address): Use local var for size,
15274 for brevity.
15275
0df1eac5
PE
15276 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15277
847ab9d1 15278 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
15279 * data.c (atof): Remove decl; no longer used or needed.
15280 (digit_to_number): Move to lread.c.
15281 (Fstring_to_number): Use new string_to_number function, to be
15282 consistent with how the Lisp reader treats infinities and NaNs.
15283 Do not assume that floating-point numbers represent EMACS_INT
15284 without losing information; this is not true on most 64-bit hosts.
15285 Avoid double-rounding errors, by insisting on integers when
15286 parsing non-base-10 numbers, as the documentation specifies.
15287 * lisp.h (string_to_number): New decl, replacing ...
15288 (isfloat_string): Remove.
bc0a5c13 15289 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 15290 (read1): Do not accept +. and -. as integers; this
452f4150
PE
15291 appears to have been a coding error. Similarly, do not accept
15292 strings like +-1e0 as floating point numbers. Do not report
15293 overflow for integer overflows unless the base is not 10 which
15294 means we have no simple and reliable way to continue.
15295 Break out the floating-point parsing into a new
15296 function string_to_number, so that Fstring_to_number parses
15297 floating point numbers consistently with the Lisp reader.
04f2d78b 15298 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
15299 (E_CHAR, EXP_INT): Remove, replacing with ...
15300 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15301 (string_to_number): New function, replacing isfloat_string.
15302 This function checks for valid syntax and produces the resulting
15303 Lisp float number too. Rework it so that string-to-number
bc0a5c13 15304 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
15305 so that overflow for non-base-10 numbers is reported only when
15306 there's no portable and simple way to convert to floating point.
452f4150 15307
67769ffc
PE
15308 * textprop.c (set_text_properties_1): Rewrite for clarity,
15309 and to avoid GCC warning about integer overflow.
15310
c20db43f
PE
15311 * intervals.h (struct interval): Use EMACS_INT for members
15312 where EMACS_UINT might cause problems. See
15313 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15314 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15315 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15316 All uses changed.
37aa2f85
PE
15317 (offset_intervals): Tell GCC not to worry about length overflow
15318 when negating a negative length.
c20db43f 15319
2538aa2f
PE
15320 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15321 (overrun_check_free): Likewise.
15322
f2d3008d
PE
15323 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15324 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15325 word size.
15326
ec8df744
PE
15327 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15328 (gnutls_make_error): Rename local to avoid shadowing.
15329 (gnutls_emacs_global_deinit): ifdef out; not used.
15330 (Fgnutls_boot): Use const for pointer to readonly storage.
15331 Comment out unused local. Fix pointer signedness problems.
15332
640ee02d
PE
15333 * lread.c (openp): Don't stuff size_t into an 'int'.
15334 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15335 about possible signed overflow.
15336
6048fb2a
PE
15337 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15338 (GDK_KEY_g): Don't define if already defined.
15339 (xg_prepare_tooltip): Avoid pointer signedness problem.
15340 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15341
fa3c87e1
PE
15342 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15343 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15344
2172544b
PE
15345 * xfns.c (Fx_window_property): Simplify a bit,
15346 to make a bit faster and to avoid GCC 4.6.0 warning.
15347 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15348
9b821a21
PE
15349 * fns.c (internal_equal): Don't assume size_t fits in int.
15350
3c616cfa
PE
15351 * alloc.c (compact_small_strings): Tighten assertion a little.
15352
c2982e87
PE
15353 Replace pEd with more-general pI, and fix some printf arg casts.
15354 * lisp.h (pI): New macro, generalizing old pEd macro to other
15355 conversion specifiers. For example, use "...%"pI"d..." rather
15356 than "...%"pEd"...".
15357 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 15358 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
15359 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15360 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15361 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15362 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15363 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15364 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15365 64-bit hosts.
15366 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15367 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15368 * print.c (safe_debug_print, print_object): Likewise.
15369 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15370 to int.
6f04d126
PE
15371 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15372 avoiding the 0 flag, which is not portable.
c2982e87
PE
15373 * process.c (Fmake_network_process): Use pI to avoid cast.
15374 * region-cache.c (pp_cache): Likewise.
15375 * xdisp.c (decode_mode_spec): Likewise.
15376 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15377 behavior on 64-bit hosts with printf arg.
6f04d126 15378 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
15379 (x_stop_queuing_selection_requests): Likewise.
15380 (x_get_window_property): Don't truncate byte count to an 'int'
15381 when tracing.
0b432f21 15382
5e073ec7
PE
15383 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15384 here, since it parses constructs like leading '-' and spaces,
15385 which are not wanted; and it overflows with large numbers.
15386 Instead, simply match F[0-9]+, which is what is wanted anyway.
15387
36372bf9
PE
15388 * alloc.c: Remove unportable assumptions about struct layout.
15389 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15390 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15391 (allocate_vectorlike, make_pure_vector): Use the new macros,
15392 plus offsetof, to remove unportable assumptions about struct layout.
15393 These assumptions hold on all porting targets that I know of, but
15394 they are not guaranteed, they're easy to remove, and removing them
15395 makes further changes easier.
15396
0b432f21
PE
15397 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15398 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
15399 (string_overrun_cookie): Now const. Use initializers that
15400 don't formally overflow signed char, to avoid warnings.
000098c1
PE
15401 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15402 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
15403 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15404 multiple of sizeof (EMACS_INT); it need not be, if
15405 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 15406 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 15407
895009e1
JB
154082011-04-26 Juanma Barranquero <lekktu@gmail.com>
15409
15410 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15411
6a7a1b0b
TZ
154122011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15413
15414 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 15415 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
15416 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15417
841a1577 154182011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
15419
15420 * lisp.h (Qdebug): List symbol.
895009e1 15421 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
15422 * keyboard.c (debug-on-event): New variable.
15423 (handle_user_signal): Break into debugger when debug-on-event
15424 matches the current signal symbol.
15425
f2d3ba6f
DN
154262011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15427
15428 * alloc.c (check_sblock, check_string_bytes)
15429 (check_string_free_list): Convert to standard C.
15430
42ce4c63
TZ
154312011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15432
15433 * w32.c (emacs_gnutls_push): Fix typo.
15434
825cd63c
EZ
154352011-04-25 Eli Zaretskii <eliz@gnu.org>
15436
fb11d64d
EZ
15437 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15438 "cast to pointer from integer of different size".
15439
825cd63c
EZ
15440 Improve doprnt and its use in verror. (Bug#8545)
15441 * doprnt.c (doprnt): Document the set of format control sequences
15442 supported by the function. Use SAFE_ALLOCA instead of always
15443 using `alloca'.
15444
15445 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15446 is one byte too soon. Don't use xrealloc; instead xfree and
15447 xmalloc anew.
15448
e061a11b
TZ
154492011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15450
15451 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15452 callbacks stage.
15453
15454 * gnutls.c: Renamed global_initialized to
15455 gnutls_global_initialized. Added internals for the
15456 :verify-hostname-error, :verify-error, and :verify-flags
15457 parameters of `gnutls-boot' and documented those parameters in the
15458 docstring. Start callback support.
9173deec
JB
15459 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15460 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15461 on error. Return error code.
e061a11b
TZ
15462 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15463 (emacs_gnutls_read): Likewise.
15464 (Fgnutls_boot): Return handshake error code.
15465 (emacs_gnutls_handle_error): New function.
15466 (wsaerror_to_errno): Likewise.
15467
15468 * w32.h (emacs_gnutls_pull): Add prototype.
15469 (emacs_gnutls_push): Likewise.
15470
15471 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15472 (emacs_gnutls_push): Likewise.
15473
154742011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15475
15476 * process.c (wait_reading_process_output): Check if GnuTLS
15477 buffered some data internally if no FDs are set for TLS
15478 connections.
15479
15480 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15481 (LIBS): Link to USER_LIBS.
15482 ($(BLD)/gnutls.$(0)): New target.
15483
fa6996bc
EZ
154842011-04-24 Eli Zaretskii <eliz@gnu.org>
15485
eb35682e
EZ
15486 * xdisp.c (handle_single_display_spec): Rename the
15487 display_replaced_before_p argument into display_replaced_p, to
15488 make it consistent with the commentary. Fix typos in the
15489 commentary.
15490
e2ad650c
EZ
15491 * textprop.c (syms_of_textprop): Remove dead code.
15492 (copy_text_properties): Delete obsolete commentary about an
15493 interface that was deleted long ago. Fix typos in the description
15494 of arguments.
15495
1b2de274
EZ
15496 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15497 to changes in oldXMenu/XMenu.h from 2011-04-16.
15498 <menu_help_message, prev_menu_help_message>: Constify.
15499 (IT_menu_make_room): menu->help_text is now `const char **';
15500 adjust.
15501
15502 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15503 to changes in oldXMenu/XMenu.h from 2011-04-16.
15504 (struct XMenu): Declare `help_text' `const char **'.
15505
15506 * xfaces.c <Qunspecified>: Make extern again.
15507
15508 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 15509 required by POSIX.
1b2de274 15510
762b15be
EZ
15511 * doc.c (get_doc_string): Improve the format passed to `error'.
15512
15513 * doprnt.c (doprnt): Improve commentary.
15514
15515 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15516
15517 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15518 them with etags.
15519
f1052e5d
EZ
15520 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15521 changes in globals.h immediately force recompilation.
762b15be
EZ
15522 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15523 $(CURDIR)/s/ms-w32.h.
15524 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 15525
fa6996bc
EZ
15526 * character.c (Fchar_direction): Function deleted.
15527 (syms_of_character): Don't defsubr it.
15528 <char-direction-table>: Deleted.
15529
e6c3da20
EZ
155302011-04-23 Eli Zaretskii <eliz@gnu.org>
15531
15532 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15533 * doprnt.c: Include limits.h.
15534 (SIZE_MAX): New macro.
04f2d78b
CB
15535 (doprnt): Return a size_t value. 2nd arg is now size_t.
15536 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
15537 Improve overflow protection. Support `l' modifier for integer
15538 conversions. Support %l conversion. Don't assume an EMACS_INT
15539 argument for integer conversions and for %c.
15540
15541 * lisp.h (doprnt): Restore prototype.
15542
15543 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15544 $(SRC)/character.h.
15545
15546 * Makefile.in (base_obj): Add back doprnt.o.
15547
15548 * deps.mk (doprnt.o): Add back prerequisites.
15549 (callint.o): Depend on character.h.
15550
15551 * eval.c (internal_lisp_condition_case): Include the handler
15552 representation in the error message.
15553 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15554 when breaking from the loop.
15555
15556 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15557
15558 * callint.c (Fcall_interactively): When displaying error message
15559 about invalid control letter, pass the character's codepoint, not
15560 a pointer to its multibyte form. Improve display of the character
15561 in octal and display also its hex code.
15562
15563 * character.c (char_string): Use %x to display the (unsigned)
15564 codepoint of an invalid character, to avoid displaying a bogus
15565 negative value.
15566
15567 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15568 `error', not SYMBOL_NAME itself.
15569
15570 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15571 character arguments to `error'.
15572
15573 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15574 to `error' in error message about FINAL_CHAR argument. Make sure
15575 FINAL_CHAR is a character, and use %c when it is passed as
15576 argument to `error'.
15577
4ffd0d6b 155782011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
15579
15580 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15581
15582 * w32.c: Include <time.h>.
15583 (sys_localtime): New function.
15584
4ffd0d6b 155852011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
15586
15587 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15588
4ffd0d6b 15589 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 15590
4ffd0d6b 155912011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 15592
4ffd0d6b
GM
15593 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15594 zombies (Bug#8467).
aac0c6e3 15595
04c56954
EZ
155962011-04-19 Eli Zaretskii <eliz@gnu.org>
15597
15598 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15599 gl_state.e_property when gl_state.object is Qt.
15600
15601 * insdel.c (make_gap_larger): Remove limitation of buffer size
15602 to <= INT_MAX.
15603
16a43933
CY
156042011-04-18 Chong Yidong <cyd@stupidchicken.com>
15605
15606 * xdisp.c (lookup_glyphless_char_display)
15607 (produce_glyphless_glyph): Handle cons cell entry in
15608 glyphless-char-display.
15609 (Vglyphless_char_display): Document it.
15610
15611 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15612 glyphless-char-display.
15613
4581706e
CY
156142011-04-17 Chong Yidong <cyd@stupidchicken.com>
15615
15616 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15617
15618 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15619
15620 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15621 definition for no-X builds.
15622
4887c6e2 156232011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 15624
fd35b6f9
PE
15625 Static checks with GCC 4.6.0 and non-default toolkits.
15626
5c1ccb01
PE
15627 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15628
006c5daa
PE
15629 * process.c (keyboard_bit_set): Define only if SIGIO.
15630 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15631 (send_process): Repair possible setjmp clobbering.
15632
efc736d3
PE
15633 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15634
4e2fe2e6
PE
15635 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15636
f97334a2
PE
15637 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15638
4e75f29d
PE
15639 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15640 Define only if needed.
15641
90efadd1
PE
15642 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15643 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 15644 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 15645
3c647824
PE
15646 * dispextern.h (struct redisplay_interface): Rename param
15647 to avoid shadowing.
e264f262 15648 * termhooks.h (struct terminal): Likewise.
761383f4 15649 * xterm.c (xembed_send_message): Likewise.
3c647824 15650
b58c5c4a
PE
15651 * insdel.c (make_gap_smaller): Define only if
15652 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15653
cad59032
PE
15654 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15655 it.
15656
c339dc2e
PE
15657 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15658 so that we aren't warned about unused symbols.
15659
91a3e27b
PE
15660 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15661
399c71d3 15662 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 15663
8ffc96f5
PE
15664 * xfns.c (x_real_positions): Mark locals as initialized.
15665
eef9bc79
PE
15666 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15667
098db9dd
PE
15668 * xterm.c: Fix problems found by static analysis with other toolkits.
15669 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
15670 (x_dispatch_event): Declare static if USE_GTK, and
15671 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 15672 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 15673 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
15674 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15675 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 15676
eb18f6cc
PE
15677 * xmenu.c (menu_help_callback): Pointer type fixes.
15678 Use const pointers when pointing at readonly data. Avoid pointer
15679 signedness clashes.
15680 (FALSE): Remove unused macro.
15681 (update_frame_menubar): Remove unused decl.
15682
1fe72bf8
PE
15683 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15684
60d9e1db
PE
15685 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15686 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15687 (single_menu_item): Rename local to avoid shadowing.
15688
39261c26
PE
15689 * keyboard.c (make_lispy_event): Remove unused local var.
15690
018c5e19
PE
15691 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15692 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15693
63d2b86e
PE
15694 * bitmaps: Change bitmaps from unsigned char back to the X11
15695 compatible char. Avoid the old compiler warnings about
15696 out-of-range initializers by using, for example, '\xab' rather
15697 than 0xab.
15698
aefd87e1
PE
15699 * xgselect.c (xgselect_initialize): Check vs interface
15700 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15701
bf501fb9
PE
15702 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15703
e9829fdf
PE
15704 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15705 to read-only memory.
15706
1086c095
PE
15707 * fns.c (vector): Remove; this old hack is no longer needed.
15708
2baccd04 15709 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 15710 Remove unused var.
dde42981 15711 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 15712
72391843 15713 * xrdb.c (x_load_resources): Omit unused local.
3565b346 15714
436c16df 15715 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 15716 (x_window): Rename locals to avoid shadowing.
dc5ddd85 15717 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 15718
92bb796d 15719 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 15720 (x_term_init): Remove local to avoid shadowing.
92bb796d 15721
764430a3 15722 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
15723
15724 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15725 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15726
d1dfb56c
EZ
157272011-04-16 Eli Zaretskii <eliz@gnu.org>
15728
c4354cb4
EZ
15729 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15730
d1dfb56c
EZ
15731 Fix regex.c, syntax.c and friends for buffers > 2GB.
15732 * syntax.h (struct gl_state_s): Declare character position members
15733 EMACS_INT.
15734
15735 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15736
04f2d78b
CB
15737 * textprop.c (verify_interval_modification, interval_of):
15738 Declare arguments EMACS_INT.
d1dfb56c
EZ
15739
15740 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15741 EMACS_INT.
15742
15743 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15744
15745 * indent.c (Fvertical_motion): Local variable it_start is now
15746 EMACS_INT.
15747
15748 * regex.c (re_match, re_match_2, re_match_2_internal)
15749 (bcmp_translate, regcomp, regexec, print_double_string)
15750 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15751 (re_compile_pattern, re_exec): Declare arguments and local
15752 variables `size_t' and `ssize_t' and return values `regoff_t', as
15753 appropriate.
15754 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15755 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15756 <compile_stack_type>: `size' and `avail' are now `size_t'.
15757
15758 * regex.h <regoff_t>: Use ssize_t, not int.
15759 (re_search, re_search_2, re_match, re_match_2): Arguments that
15760 specify buffer/string position and length are now ssize_t and
15761 size_t. Return type is regoff_t.
15762
613052cd
BK
157632011-04-16 Ben Key <bkey76@gmail.com>
15764
15765 * nsfont.m: Fixed bugs in ns_get_family and
15766 ns_descriptor_to_entity that were caused by using free to
15767 deallocate memory blocks that were allocated by xmalloc (via
15768 xstrdup). This caused Emacs to crash when compiled with
15769 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15770 --enable-checking=xmallocoverrun). xfree is now used to
15771 deallocate these memory blocks.
15772
4170f62f 157732011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 15774
71b41406
PE
15775 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15776
9587a89d
PE
15777 emacs_write: Accept and return EMACS_INT for sizes.
15778 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15779 et seq.
15780 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15781 Accept and return EMACS_INT.
15782 (emacs_gnutls_write): Return the number of bytes written on
15783 partial writes.
15784 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
15785 (emacs_read, emacs_write): Remove check for negative size, as the
15786 Emacs source code has been audited now.
9587a89d
PE
15787 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15788 (emacs_read, emacs_write): Use it.
273a5f82
PE
15789 * process.c (send_process): Adjust to the new signatures of
15790 emacs_write and emacs_gnutls_write. Do not attempt to store
15791 a byte offset into an 'int'; it might overflow.
9587a89d 15792 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 15793
3e047f51
PE
15794 * sound.c: Don't assume sizes fit in 'int'.
15795 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 15796 Return EMACS_INT, not int.
3e047f51 15797 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
15798 Accept EMACS_INT, not int.
15799 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
15800 record read return values.
15801
cc39a9db
BK
158022011-04-15 Ben Key <bkey76@gmail.com>
15803
c9d0ec6d
JB
15804 * keyboard.c (Qundefined): Don't declare static since it is used
15805 in nsfns.m.
15806 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15807 static since they are used in nsfont.m.
cc39a9db 15808
6c60eb9f
SM
158092011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15810
15811 * process.c (Qprocessp): Don't declare static.
15812 * lisp.h (Qprocessp): Declare again.
15813
7990b61a
JB
158142011-04-15 Juanma Barranquero <lekktu@gmail.com>
15815
15816 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15817
5d4cb038
PE
158182011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15819
8bd7b830 15820 Improve C-level modularity by making more things 'static'.
cd64ea1d 15821
e3b27b31
PE
15822 Don't publish debugger-only interfaces to other modules.
15823 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15824 (verify_bytepos, count_markers): Move decls to the only modules
15825 that need them.
15826 * region-cache.h (pp_cache): Likewise.
15827 * window.h (check_all_windows): Likewise.
15828 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15829
5d4cb038
PE
15830 * sysdep.c (croak): Now static, if
15831 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15832 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
15833
15834 * alloc.c (refill_memory_reserve): Now static if
15835 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15836 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 15837
e87b6180
PE
15838 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15839 Define only if USE_LUCID.
15840
ac64929e
PE
15841 * xrdb.c (x_customization_string, x_rm_string): Now static.
15842
6f37259d
PE
15843 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15844 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15845
1683e3ab
PE
15846 * xdisp.c (draw_row_with_mouse_face): Now static.
15847 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15848
de9c2632
PE
15849 * window.h (check_all_windows): Mark externally visible.
15850
2b96acb7
PE
15851 * window.c (window_deletion_count): Now static.
15852
15853 * undo.c: Make symbols static if they're not exported.
15854 (last_undo_buffer, last_boundary_position, pending_boundary):
15855 Now static.
15856
50436f33
PE
15857 * textprop.c (interval_insert_behind_hooks): Now static.
15858 (interval_insert_in_front_hooks): Likewise.
15859
64520e5c
PE
15860 * term.c: Make symbols static if they're not exported.
15861 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15862 (max_frame_lines, tty_set_terminal_modes):
15863 (tty_reset_terminal_modes, tty_turn_off_highlight):
15864 (get_tty_terminal): Now static.
15865 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15866 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 15867 HAVE_WINDOW_SYSTEM.
64520e5c
PE
15868 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15869 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15870
1fa53021
PE
15871 * sysdep.c: Make symbols static if they're not exported.
15872 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15873 Now static.
15874 (sigprocmask_set, full_mask): Remove; unused.
15875 (wait_debugging): Mark as visible.
15876 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15877 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15878
d4b43b22
PE
15879 * syntax.c (syntax_temp): Define only if !__GNUC__.
15880
b7c513d0
PE
15881 * sound.c (current_sound_device, current_sound): Now static.
15882
989b29ad
PE
15883 * search.c (searchbufs, searchbuf_head): Now static.
15884
13a55a78
PE
15885 * scroll.c (scroll_cost): Remove; unused.
15886 * dispextern.h (scroll_cost): Remove decl.
15887
de68a1fc
PE
15888 * region-cache.h (pp_cache): Mark as externally visible.
15889
40ccffa6
PE
15890 * process.c: Make symbols static if they're not exported.
15891 (process_tick, update_tick, create_process, chan_process):
15892 (Vprocess_alist, proc_buffered_char, datagram_access):
15893 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15894 (deactivate_process): Mark defn as static, as well as decl.
15895 * lisp.h (create_process): Remove decl.
15896 * process.h (chan_process, Vprocess_alist): Remove decls.
15897
ad64fc97
PE
15898 * print.c: Make symbols static if they're not exported.
15899 (print_depth, new_backquote_output, being_printed, print_buffer):
15900 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15901 (print_interval, print_number_index, initial_stderr_stream):
15902 Now static.
15903 * lisp.h (Fprinc): Remove decl.
15904 (debug_output_compilation_hack): Mark as externally visible.
15905
adddb265
PE
15906 * sysdep.c (croak): Move decl from here to syssignal.h.
15907 * syssignal.h (croak): Put it here, so the API can be checked when
15908 'croak' is called from dissociate_if_controlling_tty.
15909
1717ede2
PE
15910 * minibuf.c: Make symbols static if they're not exported.
15911 (minibuf_save_list, choose_minibuf_frame): Now static.
15912 * lisp.h (choose_minibuf_frame): Remove decl.
15913
fa5fb2bc
PE
15914 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15915
1e3890d1
PE
15916 * lread.c: Make symbols static if they're not exported.
15917 (read_objects, initial_obarray, oblookup_last_bucket_number):
15918 Now static.
15919 (make_symbol): Remove; unused.
15920 * lisp.h (initial_obarray, make_symbol): Remove decls.
15921
8a1414fa
PE
15922 * keyboard.c: Make symbols static if they're not exported.
15923 (single_kboard, recent_keys_index, total_keys, recent_keys):
15924 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15925 (this_single_command_key_start, echoing, last_auto_save):
15926 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15927 (command_loop, echo_now, keyboard_init_hook, help_char_p):
15928 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
15929 (Vlispy_mouse_stem, double_click_count):
15930 Now static.
15931 (force_auto_save_soon): Define only if SIGDANGER.
15932 (ignore_mouse_drag_p): Now static if
15933 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15934 (print_help): Remove; unused.
15935 (stop_character, last_timer_event): Mark as externally visible.
15936 * keyboard.h (ignore_mouse_drag_p): Declare only if
15937 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
15938 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
15939 * lisp.h (echoing): Remove decl.
15940 (force_auto_save_soon): Declare only if SIGDANGER.
15941 * xdisp.c (redisplay_window): Simplify code, to make it more
15942 obvious that ignore_mouse_drag_p is not accessed if !defined
15943 USE_GTK && !defined HAVE_NS.
15944
93ea6e8f
PE
15945 * intervals.c: Make symbols static if they're not exported.
15946 (merge_properties_sticky, merge_interval_right, delete_interval):
15947 Now static.
15948 * intervals.h (merge_interval_right, delete_interval): Remove decls.
15949
77382fcc
PE
15950 * insdel.c: Make symbols static if they're not exported.
15951 However, leave prepare_to_modify_buffer alone. It's never
15952 called from outside this function, but that appears to be a bug.
15953 (combine_after_change_list, combine_after_change_buffer):
4889fc82 15954 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
15955 (adjust_after_replace_noundo): Remove; unused.
15956 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 15957 (signal_before_change): Remove decls.
77382fcc 15958
9306c32e
PE
15959 * indent.c (val_compute_motion, val_vmotion): Now static.
15960
cd44d2eb
PE
15961 * image.c: Make symbols static if they're not exported.
15962 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15963 if USE_GTK.
15964 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15965 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15966
ad9a7a06
PE
15967 * fringe.c (standard_bitmaps): Now static.
15968 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
15969
81626931
PE
15970 * frame.c: Make symbols static if they're not exported.
15971 (x_report_frame_params, make_terminal_frame): Now static.
15972 (get_frame_param): Now static, unless HAVE_NS.
15973 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
15974 (x_get_resource_string): Remove; not used.
15975 * frame.h (make_terminal_frame, x_report_frame_params):
15976 (x_get_resource_string); Remove decls.
15977 (x_fullscreen_adjust): Declare only if WINDOWSNT.
15978 * lisp.h (get_frame_param): Declare only if HAVE_NS.
15979
239f9db9
PE
15980 * font.c, fontset.c: Make symbols static if they're not exported.
15981 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
15982 (FACE_SUITABLE_FOR_CHAR_P): Use it.
15983 * font.c (font_close_object): Now static.
15984 * font.h (font_close_object): Remove.
15985 * fontset.c (FONTSET_OBJLIST): Remove.
15986 (free_realized_fontset) #if-0 the body, which does nothing.
15987 (face_suitable_for_char_p): #if-0, as it's never called.
15988 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
15989 * xfaces.c (face_at_string_position):
15990 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
15991 since 0 is always ASCII.
15992
dfcf3579
PE
15993 * fns.c (weak_hash_tables): Now static.
15994
5045092b
PE
15995 * fileio.c: Make symbols static if they're not exported.
15996 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
15997 (Vwrite_region_annotation_buffers): Now static.
15998
57a96f5c
PE
15999 * eval.c: Make symbols static if they're not exported.
16000 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16001 * lisp.h (backtrace_list): Remove decl.
16002
35f08c38
PE
16003 * emacs.c: Make symbols static if they're not exported.
16004 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16005 (fatal_error_code, fatal_error_signal_hook, standard_args):
16006 Now static.
16007 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16008 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16009 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16010 * lisp.h (fatal_error_signal_hook): Remove decl.
16011 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16012
f44bd759
PE
16013 * editfns.c: Move a (normally-unused) function to its only use.
16014 * editfns.c, lisp.h (get_operating_system_release): Remove.
16015 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16016 worth the hassle of breaking this out.
16017
b532497d
PE
16018 * xterm.c: Make symbols static if they're not exported.
16019 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16020 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16021 (x_destroy_window, x_delete_display):
16022 Now static.
16023 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16024 (x_mouse_leave): Remove; unused.
16025 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16026 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16027 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16028 Remove decls.
16029 (x_mouse_leave): Declare only if WINDOWSNT.
16030 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16031 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16032 USE_X_TOOLKIT.
16033
1675728f
PE
16034 * ftxfont.c: Make symbols static if they're not exported.
16035 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16036 HAVE_FREETYPE.
16037 * font.h (ftxfont_driver): Likewise.
16038
e4cebfca
PE
16039 * xfns.c: Make symbols static if they're not exported.
16040 (x_last_font_name, x_display_info_for_name):
16041 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16042 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16043 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16044 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16045 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16046 (last_show_tip_args): Now static.
16047 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16048 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16049 (x_screen_planes): Remove; unused.
16050 * dispextern.h (x_screen_planes): Remove decl.
16051
5bf46f05
PE
16052 * dispnew.c: Make symbols static if they're not exported.
16053 * dispextern.h (redraw_garbaged_frames, scrolling):
16054 (increment_row_positions): Remove.
16055 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16056 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16057 Now static.
16058 (redraw_garbaged_frames): Remove; unused.
16059
435f4c28
PE
16060 * xfaces.c: Make symbols static if they're not exported.
16061 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16062 Remove decls.
16063 * xterm.h (defined_color): Remove decls.
16064 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16065 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16066 (menu_face_changed_default, defined_color, free_realized_face):
16067 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16068 (ascii_face_of_lisp_face): Remove; unused.
16069
8524aef3
PE
16070 * xdisp.c: Make symbols static if they're not exported.
16071 * dispextern.h (scratch_glyph_row, window_box_edges):
16072 (glyph_to_pixel_coords, set_cursor_from_row):
16073 (get_next_display_element, set_iterator_to_next):
16074 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16075 (show_mouse_face): Remove decls
16076 * frame.h (message_buf_print): Likewise.
16077 * lisp.h (pop_message, set_message, check_point_in_composition):
16078 Likewise.
16079 * xterm.h (set_vertical_scroll_bar): Likewise.
16080 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16081 (message_buf_print, scratch_glyph_row, displayed_buffer):
16082 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16083 (get_next_display_element, show_mouse_face, window_box_edges):
16084 (frame_to_window_pixel_xy, check_point_in_composition):
16085 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16086 (glyph_to_pixel_coords): Remove; unused.
16087
16390cd2
PE
16088 * dired.c (file_name_completion): Now static.
16089
16090 * dbusbind.c (xd_in_read_queued_messages): Now static.
16091
a25f4dfa
PE
16092 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16093 * data.c (circular_list_error): Remove.
16094
14a9c8df
PE
16095 * commands.h (last_point_position, last_point_position_buffer):
16096 (last_point_position_window): Remove decls.
16097 * keyboard.c: Make these variables static.
16098
04f2d78b
CB
16099 * coding.h (coding, code_convert_region, encode_coding_gap):
16100 Remove decls.
74ab6df5
PE
16101 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16102 (iso_code_class, detect_coding, code_convert_region): Now static.
16103 (encode_coding_gap): Remove; unused.
16104
38dfbee1
PE
16105 * chartab.c (chartab_chars, chartab_bits): Now static.
16106
a2cb4e63
PE
16107 * charset.h (charset_iso_8859_1): Remove decl.
16108 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16109 Now static.
16110
127198fd
PE
16111 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16112 * ccl.c (Vccl_program_table): Now static.
16113 (check_ccl_update): Remove; unused.
16114
d85b608f
PE
16115 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16116 * category.h: ... from here.
16117 * category.c (check_category_table, set_category_set): Now static.
16118
31cd66f3
PE
16119 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16120 * lisp.h: Remove these decls.
16121
c358e587
PE
16122 * buffer.c (buffer_count): Remove unused var.
16123
e78aecca
PE
16124 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16125 so that it's not optimized away.
16126 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16127 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16128 exported only to the debugger.
16129
e192d7d3 16130 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 16131 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 16132
92470028
PE
16133 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16134 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16135 was inaccessible from Lisp.
16136 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16137 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16138
244ed907
PE
16139 alloc.c: Import and export fewer symbols, and remove unused items.
16140 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16141 is defined.
16142 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16143 it's not optimized away by whole-program optimization.
16144 (message_enable_multibyte, free_misc): Remove.
16145 (catchlist, handlerlist, mark_backtrace):
16146 Declare only if BYTE_MARK_STACK.
16147 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16148 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16149 (message_enable_multibyte): Remove decl.
16150 (free_misc, interval_free_list, float_block, float_block_index):
16151 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16152 (cons_free_list, last_marked_index):
16153 Now static.
16154 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16155 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16156 (mark_backtrace): Define only if BYTE_MARK_STACK.
16157 * xdisp.c (message_enable_multibyte): Now static.
16158
61c2b50e 16159 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
16160 This makes it easier for human readers (and static analyzers)
16161 to see whether these variables are used from other modules.
16162 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16163 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16164 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16165 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16166 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16167 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16168 * xmenu.c, xselect.c:
16169 Declare Q* vars static if they are not used in other modules.
16170 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16171 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16172 Remove decls of unexported vars.
16173 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16174
95c82688
PE
16175 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16176
16a97296
PE
16177 Make Emacs functions such as Fatom 'static' by default.
16178 This makes it easier for human readers (and static analyzers)
16179 to see whether these functions can be called from other modules.
16180 DEFUN now defines a static function. To make the function external
16181 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
16182 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16183 (Finit_image_library):
16a97296
PE
16184 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16185 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16186 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16187 Remove decls, since these functions are now static.
16188 (Funintern, Fget_internal_run_time): New decls, since these functions
16189 were already external.
95c82688 16190
16a97296
PE
16191 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16192 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16193 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16194 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16195 * keyboard.c, keymap.c, lread.c:
16196 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16197 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16198 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16199 Mark functions with DEFUE instead of DEFUN,
16200 if they are used in other modules.
16201 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16202 decls for now-static functions.
16203 * buffer.h (Fdelete_overlay): Remove decl.
16204 * callproc.c (Fgetenv_internal): Mark as internal.
16205 * composite.c (Fremove_list_of_text_properties): Remove decl.
16206 (Fcomposition_get_gstring): New forward static decl.
16207 * composite.h (Fcomposite_get_gstring): Remove decl.
16208 * dired.c (Ffile_attributes): New forward static decl.
16209 * doc.c (Fdocumntation_property): New forward static decl.
16210 * eval.c (Ffetch_bytecode): New forward static decl.
16211 (Funintern): Remove extern decl; now in .h file where it belongs.
16212 * fileio.c (Fmake_symbolic_link): New forward static decl.
16213 * image.c (Finit_image_library): New forward static decl.
16214 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16215 * intervals.h (Fprevious_property_change):
16216 (Fremove_list_of_text_properties): Remove decls.
16217 * keyboard.c (Fthis_command_keys): Remove decl.
16218 (Fcommand_execute): New forward static decl.
16219 * keymap.c (Flookup_key): New forward static decl.
16220 (Fcopy_keymap): Now static.
16221 * keymap.h (Flookup_key): Remove decl.
16222 * process.c (Fget_process): New forward static decl.
16223 (Fprocess_datagram_address): Mark as internal.
16224 * syntax.c (Fsyntax_table_p): New forward static decl.
16225 (skip_chars): Remove duplicate decl.
16226 * textprop.c (Fprevious_property_change): New forward static decl.
16227 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16228 Now internal.
16229 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16230 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16231
785bbd42
PE
16232 * editfns.c (Fformat): Remove unreachable code.
16233
8b913b57
AS
162342011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16235
16236 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16237 change. (Bug#8496)
16238
a6744a35
EZ
162392011-04-13 Eli Zaretskii <eliz@gnu.org>
16240
16241 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16242 when at ZV. (Bug#8487)
16243
e7974947
AS
162442011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16245
baad03f0
AS
16246 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16247 (Bug#8437)
16248 * keyboard.c (parse_tool_bar_item): Likewise.
16249 * sound.c (sound_cleanup, alsa_close): Likewise.
16250 * termcap.c (tgetent): Likewise.
16251 * xfns.c (x_default_font_parameter): Likewise.
16252 * xsettings.c (read_and_apply_settings): Likewise.
16253
e7974947
AS
16254 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16255 (overrun_check_free): Protoize.
16256
28272684
PE
162572011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16258
16259 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16260 since callers should never pass a negative size.
16261 Change the signature to match that of plain 'read' and 'write'; see
16262 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16263 * lisp.h: Update prototypes of emacs_write and emacs_read.
16264
11997c76
EZ
162652011-04-11 Eli Zaretskii <eliz@gnu.org>
16266
16267 * xdisp.c (redisplay_window): Don't try to determine the character
16268 position of the scroll margin if the window start point w->startp
e896f03c 16269 is outside the buffer's accessible region. (Bug#8468)
11997c76 16270
8a2cbd72
EZ
162712011-04-10 Eli Zaretskii <eliz@gnu.org>
16272
16273 Fix write-region and its subroutines for buffers > 2GB.
16274 * fileio.c (a_write, e_write): Modify declaration of arguments and
16275 local variables to support buffers larger than 2GB.
16276 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16277
16278 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16279 argument, local variables, and return value.
16280
16281 * lisp.h: Update prototypes of emacs_write and emacs_read.
16282
16283 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16284
4073e537 162852011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 16286
1ebfdcb6
PE
16287 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16288
b2ded58d
PE
16289 Fix more problems found by GCC 4.6.0's static checks.
16290
7d66342c
PE
16291 * xdisp.c (vmessage): Use a better test for character truncation.
16292
bbf47d44
PE
16293 * charset.c (load_charset_map): <, not <=, for optimization,
16294 and to avoid potential problems with integer overflow.
9248994d 16295 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 16296 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 16297 * editfns.c (Fformat): Likewise.
1e69125e 16298 * syntax.c (skip_chars): Likewise.
3befa583 16299
e3019616
PE
16300 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16301 This also lets GCC 4.6.0 generate slightly better loop code.
16302
becfa255
PE
16303 * callint.c (Fcall_interactively): <, not <=, for optimization.
16304 (Fcall_interactively): Count the number of arguments produced,
16305 not the number of arguments given. This is simpler and lets GCC
16306 4.6.0 generate slightly better code.
16307
dae0cd48
PE
16308 * ftfont.c: Distingish more carefully between FcChar8 and char.
16309 The previous code passed unsigned char * to a functions like
16310 strlen and xstrcasecmp that expect char *, which does not
16311 conform to the C standard.
16312 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16313 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16314 char * when the C standard requires it.
16315
76032d70
PE
16316 * keyboard.c (read_char): Remove unused var.
16317
eb3f1cc8
PE
16318 * eval.c: Port to Windows vsnprintf (Bug#8435).
16319 Include <limits.h>.
16320 (SIZE_MAX): Define if the headers do not.
16321 (verror): Do not give up if vsnprintf returns a negative count.
16322 Instead, grow the buffer. This ports to Windows vsnprintf, which
16323 does not conform to C99. Problem reported by Eli Zaretskii.
16324 Also, simplify the allocation scheme, by avoiding the need for
16325 calling realloc, and removing the ALLOCATED variable.
16326
70476b54
PE
16327 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16328
12020a9e
PE
16329 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16330 But keep the doprint source code for now, as we might revamp it
16331 and use it again (Bug#8435).
ea6c7ae6
PE
16332 * lisp.h (doprnt): Remove.
16333 * Makefile.in (base_obj): Remove doprnt.o.
16334 * deps.mk (doprnt.o): Remove.
16335
5fdb398c
PE
16336 error: Print 32- and 64-bit integers portably (Bug#8435).
16337 Without this change, on typical 64-bit hosts error ("...%d...", N)
16338 was used to print both 32- and 64-bit integers N, which relied on
16339 undefined behavior.
61bdb816 16340 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
16341 * lisp.h (error, verror): Mark as printf-like functions.
16342 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16343 Report overflow in size calculations when allocating printf buffer.
16344 Do not truncate output string at its first null byte.
16345 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16346 Truncate the output at a character boundary, since vsnprintf does not
16347 do that.
16348 * charset.c (check_iso_charset_parameter): Convert internal
16349 character to string before calling 'error', since %c now has the
16350 printf meaning.
16351 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16352 overflow when computing char to be passed to 'error'. Do not
16353 pass Lisp_Object to 'error'; pass the integer instead.
16354 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16355 formatted with plain %d.
16356
b189fa66
PE
16357 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16358
bff87ef0
PE
16359 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16360
7e2cac20
PE
16361 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16362
ce4d90b5
PE
16363 * xterm.c (x_catch_errors): Remove duplicate declaration.
16364
266c9547
PE
16365 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16366
79c49ad2
PE
16367 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16368
368f4090
JM
163692011-04-10 Jim Meyering <meyering@redhat.com>
16370
16371 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16372 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16373 return ssize_t not "int", and use size_t as the buffer length.
16374 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16375 * gnutls.h: Update declarations.
16376 * process.c (read_process_output): Use ssize_t, to match.
16377 (send_process): Likewise.
16378
a32d4040
CY
163792011-04-09 Chong Yidong <cyd@stupidchicken.com>
16380
16381 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16382
8546720e 163832011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 16384
04f2d78b
CB
16385 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16386 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 16387
8546720e
GM
16388 * xterm.c (handle_one_xevent):
16389 * xmenu.c (create_and_show_popup_menu):
16390 * xselect.c (x_decline_selection_request)
16391 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 16392
0a2f5c1a 163932011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
16394
16395 Fix some uses of `int' instead of EMACS_INT.
16396 * search.c (string_match_1, fast_string_match)
16397 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16398 (scan_buffer, find_next_newline_no_quit)
16399 (find_before_next_newline, search_command, Freplace_match)
16400 (Fmatch_data): Make some `int' variables be EMACS_INT.
16401
16402 * xdisp.c (display_count_lines): 3rd argument and return value now
16403 EMACS_INT. All callers changed.
16404 (pint2hrstr): Last argument is now EMACS_INT.
16405
16406 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16407 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16408 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16409 (decode_coding_utf_16, decode_coding_emacs_mule)
16410 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16411 (decode_coding_ccl, decode_coding_charset)
16412 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16413 (decode_coding_iso_2022, decode_coding_emacs_mule)
16414 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16415 <char_offset, last_offset>: Declare EMACS_INT.
16416 (encode_coding_utf_8, encode_coding_utf_16)
16417 (encode_coding_emacs_mule, encode_invocation_designation)
16418 (encode_designation_at_bol, encode_coding_iso_2022)
16419 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16420 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16421 Declare EMACS_INT.
16422 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16423 (encode_invocation_designation): Last argument P_NCHARS is now
16424 EMACS_INT.
16425 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16426 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16427
16428 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16429 All users changed.
16430
16431 * ccl.c (Fccl_execute_on_string): Declare some variables
16432 EMACS_INT.
16433
8546720e 164342011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
16435
16436 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16437
4e19a977
CS
164382011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16439
16440 * process.c (Fformat_network_address): Doc fix.
16441
87302331
R
164422011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16443
ee7683eb 16444 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 16445
cbb59342
CY
164462011-04-08 Chong Yidong <cyd@stupidchicken.com>
16447
16448 * keyboard.c (read_char): Call Lisp function help-form-show,
16449 instead of using internal_with_output_to_temp_buffer.
16450 (Qhelp_form_show): New var.
e0d38eeb 16451 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
16452
16453 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16454
16455 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16456
e67a13ab
CY
164572011-04-06 Chong Yidong <cyd@stupidchicken.com>
16458
04f2d78b
CB
16459 * process.c (Flist_processes): Remove to Lisp.
16460 (list_processes_1): Delete.
e67a13ab 16461
973f782d
EZ
164622011-04-06 Eli Zaretskii <eliz@gnu.org>
16463
7c106b1e
EZ
16464 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16465
973f782d
EZ
16466 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16467
41cf7d1a 164682011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 16469
ca23cc88
PE
16470 Fix more problems found by GCC 4.6.0's static checks.
16471
f390e2d5
PE
16472 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16473
42eea0d0
PE
16474 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16475
b69769da 16476 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 16477
f9541e84
PE
16478 * xdisp.c (vmessage): Mark as a printf-like function.
16479
13841b55
PE
16480 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16481
c136c10f
PE
16482 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16483
5e2d4a30
PE
16484 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16485 printf-like functions.
16486 (tiff_load): Add casts to remove these marks before passing them
16487 to system-supplied API.
16488
583f48b9
PE
16489 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16490
b25d760e
PE
16491 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16492 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
16493 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16494 directly, rather than having caller test rule sign. This avoids
16495 some unnecessary tests.
16496 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16497 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16498 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 16499
bc7b6697 16500 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 16501 (xfont_open): Avoid unnecessary tests.
bc7b6697 16502
27ccc379
PE
16503 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16504
dcd5c89a
PE
16505 * composite.h, composite.c (composition_gstring_put_cache):
16506 Use EMACS_INT, not int, for length.
16507
b13a45c6
PE
16508 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16509 breaking out part of COMPOSITION_DECODE_RULE.
16510 (COMPOSITION_DECODE_RULE): Use it.
16511 * composite.c (get_composition_id): Remove unused local vars,
16512 by using the new macro.
16513
1e792e4d
PE
16514 * textprop.c (set_text_properties_1): Change while to do-while,
16515 since the condition is always true at first.
16516
dc6c6455 16517 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
16518 (interval_deletion_adjustment): Return unsigned value.
16519 All uses changed.
dc6c6455 16520
aba7731a
PE
16521 * process.c (list_processes_1, create_pty, read_process_output):
16522 (exec_sentinel): Remove vars that were set but not used.
afd4052b 16523 (create_pty): Remove unnecessary "volatile"s.
bc57d757 16524 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 16525 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 16526 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 16527
fdfc4bf3
PE
16528 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16529
fca8fe46 16530 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 16531 (update_syntax_table): Use unsigned instead of int.
fca8fe46 16532
06a0259a 16533 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 16534 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 16535 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 16536
e7b9e80f
PE
16537 * print.c (print_error_message): Avoid int overflow.
16538
56201685
PE
16539 * font.c (font_list_entities): Redo for clarity,
16540 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16541
78834453 16542 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 16543 (font_score): Avoid potential overflow in diff calculation.
78834453 16544
0bc0b309 16545 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 16546 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 16547
e610eaca
PE
16548 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16549
b895abce
PE
16550 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16551 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16552 can always succeed if overflow has undefined behavior.
16553
1f1d9321 16554 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 16555 (wordify): Omit three unnecessary tests.
1f1d9321 16556
c59478bc
PE
16557 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16558 All callers changed. This avoids the need for an unused var.
16559
79b73827
PE
16560 * casefiddle.c (casify_region): Remove var that is set but not used.
16561
a4db5dfe
PE
16562 * dired.c (file_name_completion): Remove var that is set but not used.
16563
43aae36e
PE
16564 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16565
2a47c44d 16566 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 16567 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 16568
a37c69bf
PE
16569 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16570 Check for integer overflow on size calculations.
16571
328ab8e7
PE
16572 * buffer.c (Fprevious_overlay_change): Remove var that is set
16573 but not used.
16574
e5a2a5cb
PE
16575 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16576 Remove vars that are set but not used.
8d84a6eb 16577 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 16578 (timer_check_2): Mark vars as initialized.
e5a2a5cb 16579
a60e5f68
PE
16580 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16581
f661cb61 16582 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 16583 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 16584
f0397f5a
PE
16585 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16586 that are set but not used.
16587
8664db06 16588 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 16589 if XCreateBitmapFromData fails (Bug#8410).
8664db06 16590
6abdaa4a
PE
16591 * xselect.c (x_get_local_selection, x_handle_property_notify):
16592 Remove vars that are set but not used.
16593
0ce7538d 16594 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 16595 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 16596
9ae848fc
PE
16597 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16598 Remove var that is set but not used.
0b918413
PE
16599 (scroll_bar_windows_size): Now size_t, not int.
16600 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16601 Check for overflow.
9ae848fc 16602
a5a62657
PE
16603 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16604 (map_tty_color) [!defined MSDOS]: Likewise.
16605
5c5cdd39
PE
16606 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16607
66ebf983
PE
16608 * coding.c: Remove vars that are set but not used.
16609 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16610 All callers changed.
16611 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16612 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16613 (decode_coding_charset): Remove vars that are set but not used.
16614
1be4d761
PE
16615 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16616 that is set but not used.
16617
47553fa8
PE
16618 * print.c (print_object): Remove var that is set but not used.
16619
1f7196bf 16620 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
16621 The gnulib version avoids calling malloc in the usual case,
16622 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16623 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16624 * filelock.c (current_lock_owner): Likewise.
16625 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16626 * sysdep.c: Include allocator.h, careadlinkat.h.
16627 (emacs_no_realloc_allocator): New static constant.
16628 (emacs_readlink): New function.
fdb61804
PE
16629 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16630 ../lib/careadlinkat.h.
d1fdcab7 16631
f84c17c7
SM
166322011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16633
16634 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16635 first non-nil return value).
16636
ef3862ad
JD
166372011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16638
16639 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16640 if not defined (Bug#8403).
16641
376a7006
JB
166422011-04-02 Juanma Barranquero <lekktu@gmail.com>
16643
16644 * xdisp.c (display_count_lines): Remove parameter `start',
16645 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16646 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16647 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16648 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16649 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16650 and thereabouts. All callers changed.
16651 (get_per_char_metric): Remove parameter `f', unused since
16652 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16653
6ca3801d
JM
166542011-04-02 Jim Meyering <meyering@redhat.com>
16655
16656 do not dereference NULL upon failed strdup
16657 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16658 (ns_get_family): Likewise.
16659
d8e2b5ba
JB
166602011-04-02 Juanma Barranquero <lekktu@gmail.com>
16661
16662 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16663
8c74fcbd
JD
166642011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16665
16666 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16667 later (Bug#8403).
16668
7200d79c
SM
166692011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16670
03408648 16671 Add lexical binding.
7200d79c 16672
03408648
SM
16673 * window.c (Ftemp_output_buffer_show): New fun.
16674 (Fsave_window_excursion):
16675 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16676
16677 * lread.c (lisp_file_lexically_bound_p): New function.
16678 (Fload): Bind Qlexical_binding.
16679 (readevalloop): Remove `evalfun' arg.
16680 Bind Qinternal_interpreter_environment.
16681 (Feval_buffer): Bind Qlexical_binding.
16682 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16683 Mark as dynamic.
16684 (syms_of_lread): Declare `lexical-binding'.
16685
16686 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16687
16688 * keyboard.c (eval_dyn): New fun.
16689 (menu_item_eval_property): Use it.
ca105506
SM
16690
16691 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 16692
03408648
SM
16693 * fns.c (concat, mapcar1): Accept byte-code-functions.
16694
16695 * eval.c (Fsetq): Handle lexical vars.
16696 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16697 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16698 (FletX, Flet): Obey lexical binding.
16699 (Fcommandp): Handle closures.
16700 (Feval): New `lexical' arg.
16701 (eval_sub): New function extracted from Feval. Use it almost
16702 everywhere where Feval was used. Look up vars in lexical env.
16703 Handle closures.
16704 (Ffunctionp): Move from subr.el.
16705 (Ffuncall): Handle closures.
16706 (apply_lambda): Remove `eval_flags'.
16707 (funcall_lambda): Handle closures and new byte-code-functions.
16708 (Fspecial_variable_p): New function.
16709 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16710 but without exporting it to Lisp.
23aba0ea 16711
23aba0ea 16712 * doc.c (Fdocumentation, store_function_docstring):
03408648 16713 * data.c (Finteractive_form): Handle closures.
23aba0ea 16714
03408648
SM
16715 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16716 interactive spec.
ba83908c 16717
04f2d78b
CB
16718 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16719 New byte-codes.
03408648
SM
16720 (exec_byte_code): New function extracted from Fbyte_code to handle new
16721 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 16722
03408648 16723 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 16724
03408648 16725 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 16726
e2abce01
JB
167272011-03-31 Juanma Barranquero <lekktu@gmail.com>
16728
16729 * xdisp.c (redisplay_internal): Fix prototype.
16730
63696a73 167312011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 16732
63696a73 16733 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
16734 (try_scrolling): Use it when setting scroll_limit.
16735 Limit scrolling to 100 screen lines.
63696a73
EZ
16736 (redisplay_window): Even when falling back on "recentering",
16737 position point in the window according to scroll-conservatively,
16738 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16739
16740 (try_scrolling): When point is above the window, allow searching
16741 as far as scroll_max, or one screenful, to compute vertical
16742 distance from PT to the scroll margin position. This prevents
16743 try_scrolling from unnecessarily failing when
16744 scroll-conservatively is set to a value slightly larger than the
16745 window height. Clean up the case of PT below the margin at bottom
16746 of window: scroll_max can no longer be INT_MAX. When aggressive
16747 scrolling is in use, don't let point enter the opposite scroll
16748 margin as result of the scroll.
16749 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
16750 threshold of 100 lines for never-recentering scrolling.
16751
e4cc2dfc
JB
167522011-03-31 Juanma Barranquero <lekktu@gmail.com>
16753
16754 * dispextern.h (move_it_by_lines):
16755 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16756 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16757 (message_log_check_duplicate): Remove parameters `prev_bol' and
16758 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16759 (redisplay_internal): Remove parameter `preserve_echo_area',
16760 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16761
16762 * indent.c (Fvertical_motion):
16763 * window.c (window_scroll_pixel_based, Frecenter):
16764 Don't pass `need_y_p' to `move_it_by_lines'.
16765
1c470562
SM
167662011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16767
44f230aa
SM
16768 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16769 steal a few bits to be more compact.
16770 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16771 Remove unneeded casts.
16772
1c470562
SM
16773 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16774
888adce9
ZK
167752011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16776
16777 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16778 binding" message (bug#7967).
16779
f838ed7b
PE
167802011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16781
77861b95
PE
16782 Fix more problems found by GCC 4.6.0's static checks.
16783
de6dbc14
PE
16784 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16785 Remove unused local var.
16786
f838ed7b
PE
16787 * editfns.c (Fmessage_box): Remove unused local var.
16788
792c7b2b
PE
16789 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16790 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16791 Omit unused local vars.
c499e557 16792 * window.c (shrink_windows): Omit unused local var.
b01a1c29 16793 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
16794 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16795 Omit unused local var.
16796
ba0165e1
PE
16797 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16798 Don't assume string length fits in int.
32ad8845 16799 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 16800 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 16801
3c59b4c9
PE
16802 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16803 instead of alloca (Bug#8344).
16804
a3eed478 16805 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 16806 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 16807
eb4d412d
PE
16808 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16809
1658b401
PE
16810 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16811 concerns.
16812
16813 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16814
16815 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 16816
9a2c6e05
PE
16817 * keyboard.c (syms_of_keyboard): Use the same style as later
16818 in this function when indexing through an array. This also
16819 works around GCC bug 48267.
16820
03d0a109
PE
16821 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16822
44f730c8
PE
16823 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16824
fe75f926
PE
16825 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16826 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16827
ffa8c828
PE
16828 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16829 This avoids undefined behavior on integer overflow, and is a bit
16830 more convenient anyway since it is compared to a size_t variable.
16831
c5101a77
PE
16832 Variadic C functions now count arguments with size_t, not int.
16833 This avoids an unnecessary limitation on 64-bit machines, which
16834 caused (substring ...) to crash on large vectors (Bug#8344).
16835 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16836 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 16837 All variadic functions and their callers changed accordingly.
c5101a77
PE
16838 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16839 * data.c (arith_driver, float_arith_driver): Likewise.
16840 * editfns.c (general_insert_function): Likewise.
16841 * eval.c (struct backtrace.nargs, interactive_p)
16842 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16843 (funcall_lambda, mark_backtrace): Likewise.
16844 * fns.c (concat): Likewise.
16845 * frame.c (x_set_frame_parameters): Likewise.
16846 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16847 0 if not found, not -1. All callers changed.
16848
dd3f25f7
PE
16849 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16850 (stack_copy_size): Now size_t, not int.
16851 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16852
461c2ab9
JB
168532011-03-28 Juanma Barranquero <lekktu@gmail.com>
16854
16855 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16856 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16857 All callers changed.
16858
16859 * lisp.h (multibyte_char_to_unibyte):
16860 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16861 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16862 * character.h (CHAR_TO_BYTE8):
16863 * cmds.c (internal_self_insert):
16864 * editfns.c (general_insert_function):
16865 * keymap.c (push_key_description):
16866 * search.c (Freplace_match):
16867 * xdisp.c (message_dolog, set_message_1): All callers changed.
16868
f6d62986
SM
168692011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16870
16871 * keyboard.c (safe_run_hook_funcall): New function.
16872 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16873 don't set the hook to nil, but remove the offending function instead.
16874 (Qcommand_hook_internal): Remove, unused.
16875 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16876 Vcommand_hook_internal.
16877
16878 * eval.c (enum run_hooks_condition): Remove.
16879 (funcall_nil, funcall_not): New functions.
16880 (run_hook_with_args): Call each function through a `funcall' argument.
16881 Remove `cond' argument, now redundant.
16882 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16883 (Frun_hook_with_args_until_failure): Adjust accordingly.
16884 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16885
1db5b1ad
JB
168862011-03-28 Juanma Barranquero <lekktu@gmail.com>
16887
16888 * dispextern.h (string_buffer_position): Remove declaration.
16889
16890 * print.c (strout): Remove parameter `multibyte', unused since
16891 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16892
16893 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16894 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16895 All callers changed.
16896
16897 * w32.c (_wsa_errlist): Use braces for struct initializers.
16898
16899 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16900 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16901 All callers changed.
16902 (string_buffer_position): Likewise. Also, make static (it's never
16903 used outside xdisp.c).
16904 (cursor_row_p): Remove parameter `w', unused since
16905 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16906 (decode_mode_spec): Remove parameter `precision', introduced during
16907 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16908 All callers changed.
16909
5ffb62aa
JD
169102011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16911
16912 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16913
461c2ab9 169142011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
16915
16916 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16917 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16918 (ns_update_auto_hide_menu_bar): New functions.
16919 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16920 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16921 ns_constrain_all_frames.
16922 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16923 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16924
5c380ffb
JD
169252011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16926
16927 * nsmenu.m (runDialogAt): Remove argument to timer_check.
16928
9af30bdf
GM
169292011-03-27 Glenn Morris <rgm@gnu.org>
16930
16931 * syssignal.h: Replace RETSIGTYPE with void.
16932 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
16933 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
16934 Replace SIGTYPE with void everywhere.
16935 * s/usg5-4-common.h (SIGTYPE): Remove definition.
16936 * s/template.h (SIGTYPE): Remove commented out definition.
16937
e2abce01
JB
169382011-03-26 Eli Zaretskii <eliz@gnu.org>
16939
16940 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
16941 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
16942
f868cd8a
JB
169432011-03-26 Juanma Barranquero <lekktu@gmail.com>
16944
59eb0929
JB
16945 * w32.c (read_unc_volume): Use parameter `henum', instead of
16946 global variable `wget_enum_handle'.
16947
16948 * keymap.c (describe_vector): Remove parameters `indices' and
16949 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
16950 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
16951
f868cd8a
JB
16952 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
16953
16954 * keyboard.c (timer_check): Remove parameter `do_it_now',
16955 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
16956 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
16957 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
16958
16959 * keyboard.c (read_char):
16960 * w32menu.c (w32_menu_display_help):
16961 * xmenu.c (show_help_event, menu_help_callback):
16962 Adjust calls to `show_help_echo'.
16963
16964 * gtkutil.c (xg_maybe_add_timer):
16965 * keyboard.c (readable_events):
16966 * process.c (wait_reading_process_output):
16967 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
16968
16969 * insdel.c (adjust_markers_gap_motion):
16970 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
16971 (gap_left, gap_right): Don't call it.
16972
2ecf6fdb
CY
169732011-03-25 Chong Yidong <cyd@stupidchicken.com>
16974
16975 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
16976 incurred during fontification.
16977
6b1f9ba4
JB
169782011-03-25 Juanma Barranquero <lekktu@gmail.com>
16979
16980 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
16981 (DEFVAR_PER_BUFFER): Don't pass it.
16982
16983 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
16984 (scrolling_window): Don't pass it.
16985
0f4a96b5
JB
169862011-03-25 Juanma Barranquero <lekktu@gmail.com>
16987
16988 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
16989
16990 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
16991 and `suffix'.
16992 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
16993 of variables specific to SELinux and computation of `encoded_absname'.
16994
16995 * image.c (XPutPixel): Remove unused variable `height'.
16996
16997 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
16998
16999 * unexw32.c (get_section_info): Remove unused variable `section'.
17000
17001 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17002 (system_process_attributes): Remove unused variable `sess'.
17003 (sys_read): Remove unused variable `err'.
17004
17005 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17006 (w32_wnd_proc): Remove unused variable `isdead'.
17007 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17008 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17009 (x_create_tip_frame): Remove unused variable `tem'.
17010
17011 * w32inevt.c (w32_console_read_socket):
17012 Remove unused variable `no_events'.
17013
17014 * w32term.c (x_draw_composite_glyph_string_foreground):
17015 Remove unused variable `width'.
17016
1149507c
JB
170172011-03-24 Juanma Barranquero <lekktu@gmail.com>
17018
17019 * w32term.c (x_set_glyph_string_clipping):
17020 Don't pass uninitialized region to CombineRgn.
17021
9c88f339
JB
170222011-03-23 Juanma Barranquero <lekktu@gmail.com>
17023
17024 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17025 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17026 (Fx_close_connection): Remove unused variable `i'.
17027
17028 * w32font.c (w32font_draw): Return number of glyphs.
17029 (w32font_open_internal): Remove unused variable `i'.
17030 (w32font_driver): Add missing initializer.
17031
17032 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17033 (fill_in_menu): Remove unused variable `items_added'.
17034
17035 * w32term.c (last_mouse_press_frame): Remove static global variable.
17036 (w32_clip_to_row): Remove unused variable `f'.
17037 (x_delete_terminal): Remove unused variable `i'.
17038
17039 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17040 (NOTHING): Remove unused static global variable.
17041 (uniscribe_check_otf): Remove unused variable `table'.
17042 (uniscribe_font_driver): Add missing initializers.
17043
dee091a3
JD
170442011-03-23 Julien Danjou <julien@danjou.info>
17045
17046 * term.c (Fsuspend_tty, Fresume_tty):
17047 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17048 * window.c (temp_output_buffer_show):
17049 * insdel.c (signal_before_change):
17050 * frame.c (Fhandle_switch_frame):
17051 * fileio.c (Fdo_auto_save):
17052 * emacs.c (Fkill_emacs):
17053 * editfns.c (save_excursion_restore):
17054 * cmds.c (internal_self_insert):
17055 * callint.c (Fcall_interactively):
17056 * buffer.c (Fkill_all_local_variables):
17057 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17058 Use Frun_hooks.
0f4a96b5 17059 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 17060 unconditionally since it does the check itself.
dee091a3 17061
2c520ab5 170622011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 17063
c9c49752
PE
17064 Fix more problems found by GCC 4.5.2's static checks.
17065
8abc3f12
PE
17066 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17067 the first time through the loop, since we know p0 < p1 then.
17068 This also avoids a gcc -Wstrict-overflow warning.
17069
a2d26660
PE
17070 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17071 leading to a memory leak, possible in functions like
17072 load_charset_map_from_file that can allocate an unbounded number
b12ef411 17073 of objects (Bug#8318).
a2d26660 17074
916c72e9
PE
17075 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17076 that could (at least in theory) be that large.
17077
19ab8a18
PE
17078 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17079 This is less likely to overflow, and avoids undefined behavior if
17080 overflow does occur. All callers changed. Use strtoul to scan
17081 for the unsigned long integer.
b7cbbd6f
PE
17082 (pint2hrstr): Simplify and tune code slightly.
17083 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 17084
f0641eff
PE
17085 * scroll.c (do_scrolling): Work around GCC bug 48228.
17086 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17087
7f650bb9
PE
17088 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17089 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
17090 (validate_x_resource_name): Simplify count usage.
17091 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 17092
37dd57d1
PE
17093 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17094 fail (Bug#8306).
81e56e61 17095
699979fc 17096 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 17097
401bf9b4
PE
17098 * process.c (Fmake_network_process): Use socklen_t, not int,
17099 where POSIX says socklen_t is required in portable programs.
17100 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 17101 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
17102 (Fmake_network_process, server_accept_connection):
17103 (wait_reading_process_output, read_process_output):
17104 Likewise.
17105
b93aacde
PE
17106 * process.c: Rename or move locals to avoid shadowing.
17107 (list_processes_1, Fmake_network_process):
17108 (read_process_output_error_handler, exec_sentinel_error_handler):
17109 Rename or move locals.
4dc343ee 17110 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 17111 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 17112 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 17113 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 17114 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 17115
af8a867c 17116 Make tparam.h and terminfo.c consistent.
44f230aa
SM
17117 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17118 Include tparam.h instead, since it declares them.
af8a867c
PE
17119 * cm.h (PC): Remove extern decl; tparam.h now does this.
17120 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17121 * terminfo.c: Include tparam.h, to check interfaces.
17122 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17123 (tparam): Adjust signature to match interface in tparam.h;
17124 this removes some undefined behavior. Check that outstring and len
17125 are zero, which they always are with Emacs.
17126 * tparam.h (PC, BC, UP): New extern decls.
17127
0248044d 17128 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 17129 (xftfont_open): Rename locals to avoid shadowing.
0248044d 17130
8ff096c1 17131 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
17132 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17133 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 17134 (ftfont_list): Remove unused local.
49eaafba
PE
17135 (get_adstyle_property, ftfont_pattern_entity):
17136 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17137 Rename locals to avoid shadowing.
8ff096c1 17138
e2be39f6
PE
17139 * xfont.c (xfont_list_family): Mark var as initialized.
17140
c9735e30
PE
17141 * xml.c (make_dom): Now static.
17142
8f5201ae
PE
17143 * composite.c (composition_compute_stop_pos): Rename local to
17144 avoid shadowing.
b246f932
PE
17145 (composition_reseat_it): Remove unused locals.
17146 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 17147 (composition_update_it): Mark var as initialized.
11b61122
PE
17148 (find_automatic_composition): Mark vars as initialized,
17149 with a FIXME (Bug#8290).
8f5201ae 17150
760fbc2c
PE
17151 character.h: Rename locals to avoid shadowing.
17152 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17153 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17154 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17155 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17156 to avoid shadowing.
17157
ff08eb85
PE
17158 * textprop.c (property_change_between_p): Remove; unused.
17159
fc7bf025
PE
17160 * intervals.c (interval_start_pos): Now static.
17161
235d7abc
PE
17162 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17163
44f230aa
SM
17164 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17165 Rename locals to avoid shadowing.
3e7d6594 17166
50060332
PE
17167 * sound.c (wav_play, au_play, Fplay_sound_internal):
17168 Fix pointer signedness.
d01f234b 17169 (alsa_choose_format): Remove unused local var.
c83b8872
PE
17170 (wav_play): Initialize a variable to 0, to prevent undefined
17171 behavior (Bug#8278).
50060332 17172
c4fc4e30
PE
17173 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17174
918436ed
PE
17175 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17176
c939f91b
PE
17177 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17178 clobbering (Bug#8298).
b9c7f648
PE
17179 * sysdep.c (sys_subshell): Likewise.
17180 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 17181
6bd8c144
PE
17182 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17183 This should get cleaned up, so that child_setup has the
17184 same signature on all platforms.
17185
7710357c 17186 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 17187 (relocate_fd): Rename locals to avoid shadowing.
7710357c 17188
c59da222
CY
171892011-03-22 Chong Yidong <cyd@stupidchicken.com>
17190
17191 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17192 not to be necessary, and produces flickering.
17193
66b87493
GM
171942011-03-20 Glenn Morris <rgm@gnu.org>
17195
17196 * config.in: Remove file.
17197
45b6f6d5
JB
171982011-03-20 Juanma Barranquero <lekktu@gmail.com>
17199
17200 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17201 are now in src/globals.h.
17202 (syms_of_minibuf): Remove spurious & from previous change.
17203
cd394be1 172042011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
17205
17206 * minibuf.c (completing-read-function): New variable.
17207 (completing-read-default): Rename from completing-read.
17208 (completing-read): Call completing-read-function.
17209
b14e3e21
CY
172102011-03-19 Juanma Barranquero <lekktu@gmail.com>
17211
17212 * xfaces.c (Fx_load_color_file):
17213 Read color file from absolute filename (bug#8250).
17214
f2b726e6
JB
172152011-03-19 Juanma Barranquero <lekktu@gmail.com>
17216
17217 * makefile.w32-in: Update dependencies.
17218
09f6ff02
EZ
172192011-03-17 Eli Zaretskii <eliz@gnu.org>
17220
17221 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17222
29a6015a
PE
172232011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17224
a3a6c54e
PE
17225 Fix more problems found by GCC 4.5.2's static checks.
17226
b766f867
PE
17227 * process.c (make_serial_process_unwind, send_process_trap):
17228 (sigchld_handler): Now static.
17229
be02381c
PE
17230 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17231 That way, the code declares only the vars that it needs.
17232 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17233 * s/cygwin.h (PTY_ITERATION): Likewise.
17234 * s/darwin.h (PTY_ITERATION): Likewise.
17235 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17236
57048744
PE
17237 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17238 * process.c (allocate_pty): Don't declare stb unless it's needed.
17239
7914961c 17240 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
17241 (CONSTANTLIM): Remove; unused.
17242 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17243 Define only if needed.
7914961c 17244
b3967b18
PE
17245 * unexelf.c (unexec): Name an expression,
17246 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
17247 Use a different way to cause a compilation error if anyone uses
17248 n rather than nn, a way that does not involve shadowing.
73366a00 17249 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 17250
29a6015a
PE
17251 * deps.mk (unexalpha.o): Remove; unused.
17252
43cfc33e 17253 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 17254 * unexec.h: New file.
ce701a33
PE
17255 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17256 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17257 Depend on unexec.h.
17258 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17259 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17260 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 17261 Change as necessary to match prototype in unexec.h.
ce701a33 17262
01f44d5a
PE
17263 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17264 shadowing.
4f63c6bb 17265 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 17266
a6670b0b
PE
17267 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17268 Rename locals to avoid shadowing.
17269
cef2010d 17270 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 17271 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 17272
d4d7173a
PE
17273 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17274
f08b802a
PE
17275 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17276 warning when compiling print.c.
17277
3ddb0639
PE
17278 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17279 instead of using an uninitialized var.
5ad03b97 17280 (font_sort_entities): Mark var as initialized.
3ddb0639 17281
170a2692
PE
17282 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17283
e663c700
PE
17284 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17285 pointers to constants.
89bc529a 17286 (font_parse_fcname): Remove unused vars.
7b81e2d0 17287 (font_delete_unmatched): Now static.
ea838e10 17288 (font_get_spec): Remove; unused.
13a547c6
PE
17289 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17290 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17291 Rename or move locals to avoid shadowing.
e663c700 17292
2a80c887 17293 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 17294 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 17295
1384fa33 17296 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 17297 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 17298
8b2c52e9
PE
17299 * alloc.c (mark_backtrace): Move decl from here ...
17300 * lisp.h: ... to here, so that it can be checked.
17301
475545b5 17302 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 17303 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
17304 (lisp_indirect_variable): Name an expression,
17305 to avoid gcc -Wbad-function-cast warning.
1faed8ae 17306 (Fdefvar): Rename locals to avoid shadowing.
475545b5 17307
b1349114 17308 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 17309 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 17310 Use const pointer when appropriate.
b1349114 17311
a2928364
PE
17312 * lisp.h (get_system_name, get_operating_system_release):
17313 Move decls here, to check interfaces.
17314 * process.c (get_operating_system_release): Move decl to lisp.h.
17315 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
17316 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17317 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17318 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
17319 (Fformat_time_string, Fencode_time, Finsert_char):
17320 (Ftranslate_region_internal, Fformat):
17321 Rename or remove local vars to avoid shadowing.
9710023e 17322 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 17323
a415e694
PE
17324 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17325 avoid shadowing.
17326
8ef4622d
PE
17327 * lisp.h (eassert): Check that the argument compiles, even if
17328 ENABLE_CHECKING is not defined.
17329
946f9a5b
PE
17330 * data.c (Findirect_variable): Name an expression, to avoid
17331 gcc -Wbad-function-cast warning.
112396d6 17332 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 17333 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
17334 (Fmake_variable_buffer_local, Fmake_local_variable):
17335 Mark variables as initialized.
52746918 17336 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 17337
e5aab7e7 17338 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
17339 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17340 Rename locals to avoid shadowing.
dff45157
PE
17341 (mark_stack): Move local variables into the #ifdef region where
17342 they're used.
7bc26fdb
PE
17343 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17344 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17345 needed otherwise.
17346 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17347 (GC_STRING_CHARS): Remove; not used.
d40d4be1 17348 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 17349
e5aab7e7
PE
17350 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17351 avoids undefined behavior in theory.
17352
4da60324
PE
17353 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17354
88043301
PE
17355 Use functions, not macros, for up- and down-casing (Bug#8254).
17356 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17357 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17358 to use the following functions instead of these macros.
17359 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17360 EMACS_INT, since callers assume the returned value fits in int.
17361 (upcase1): Likewise, for UPCASE_TABLE.
17362 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 17363 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 17364 the race-condition problem in the old DOWNCASE.
88043301 17365
19ed5445
PE
17366 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17367 Rename locals to avoid shadowing.
17368 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
17369 (regex_compile, re_search_2, re_match_2_internal):
17370 Remove unused local vars.
952db0d7
PE
17371 (FREE_VAR): Rewrite so as not to use empty "else",
17372 which gcc can warn about.
da053e48 17373 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
17374 (RETALLOC_IF): Define only if needed.
17375 (WORDCHAR_P): Likewise. This one is never needed, but is used
17376 only in a comment talking about a compiler bug, so put inside
17377 the #if 0 of that comment.
17378 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17379 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17380 Remove; unused.
19ed5445 17381
1f3561e4 17382 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
17383 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17384 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 17385
ded6f8f7
PE
17386 * search.c (simple_search): Remove unused var.
17387
dbd37a95
PE
17388 * dired.c (compile_pattern): Move decl from here ...
17389 * lisp.h: ... to here, so that it can be checked.
17390 (struct re_registers): New forward decl.
17391
7e47afad
PE
17392 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17393
85f24f61
PE
17394 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17395 All uses changed.
17396 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17397 Rename locals to avoid shadowing.
5671df8f 17398 (Fvertical_motion): Mark locals as initialized.
85f24f61 17399
181aa2be 17400 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 17401 (casify_region): Mark local as initialized.
181aa2be 17402
930d429c
PE
17403 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17404
7082eac6
PE
17405 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17406 New macros, so that the caller can use some names other than
17407 gcpro1, gcpro2, etc.
17408 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17409 of the new macros.
17410 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17411 argument, for consistency with GCPRO2_VAR, etc: it is now the
17412 prefix of the variable, not the variable itself. All uses
17413 changed.
38b2c076
PE
17414 * dired.c (directory_files_internal, file_name_completion):
17415 Rename locals to avoid shadowing.
17416
15206ed9
PE
17417 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17418 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17419 dired.c's scmp function, had undefined behavior.
17420 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17421 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17422 * buffer.h: ... to here, because these macros use current_buffer,
17423 and the new implementation with inline functions needs to have
17424 current_buffer in scope now, rather than later when the macros
17425 are used.
17426 (downcase, upcase1): New static inline functions.
17427 (DOWNCASE, UPCASE1): Reimplement using these functions.
17428 This avoids undefined behavior in expressions like
17429 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17430 from race conditions in accessing the global variables
17431 case_temp1 and case_temp2.
17432 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17433 * lisp.h (case_temp1, case_temp2): Remove their decls.
17434 * character.h (ASCII_CHAR_P): Move from here ...
17435 * lisp.h: ... to here, so that the inline functions mentioned
17436 above can use them.
17437
4a6bea26
PE
17438 * dired.c (directory_files_internal_unwind): Now static.
17439
f14b7e14
PE
17440 * fileio.c (file_name_as_directory, directory_file_name):
17441 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17442 Now static.
2893f146
PE
17443 (file_name_as_directory): Use const pointers when appropriate.
17444 (Fexpand_file_name): Likewise. In particular, newdir might
17445 point at constant storage, so make it a const pointer.
fd4ead52 17446 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
17447 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17448 signedness issues.
f839df0c
PE
17449 (Fset_file_times, Finsert_file_contents, auto_save_error):
17450 Rename locals to avoid shadowing.
f14b7e14 17451
5716756e 17452 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
17453 (Ftry_completion, Fall_completions): Rename or remove locals
17454 to avoid shadowing.
5716756e 17455
b4c3046a
PE
17456 * marker.c (bytepos_to_charpos): Remove; unused.
17457
b45db522
PE
17458 * lisp.h (verify_bytepos, count_markers): New decls,
17459 so that gcc does not warn that these functions aren't declared.
17460
85876d07
PE
17461 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17462 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 17463 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 17464 (copy_text): Remove unused local var.
85876d07 17465
03d78a21 17466 * filelock.c (within_one_second): Now static.
b3dd38ab 17467 (lock_file_1): Rename local to avoid shadowing.
03d78a21 17468
5df8f01b
PE
17469 * buffer.c (fix_overlays_before): Mark locals as initialized.
17470 (fix_start_end_in_overlays): Likewise. This function should be
17471 simplified by using pointers-to-pointers, but that's a different
17472 matter.
b1d876f1 17473 (switch_to_buffer_1): Now static.
8f54f30a
PE
17474 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17475 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 17476
a70072c9 17477 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 17478 Fix pointer signedness issue.
edced198
PE
17479 (sys_subshell): Mark local as volatile if checking for lint,
17480 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 17481 (MAXPATHLEN): Define only if needed.
a70072c9 17482
a0977c44
PE
17483 * process.c (serial_open, serial_configure): Move decls from here ...
17484 * systty.h: ... to here, so that they can be checked.
17485
a884fdcc
PE
17486 * fns.c (get_random, seed_random): Move extern decls from here ...
17487 * lisp.h: ... to here, so that they can be checked.
17488
604efe86 17489 * sysdep.c (reset_io): Now static.
b8950c94 17490 (wait_for_termination_signal): Remove; unused.
604efe86 17491
38fc62d9
PE
17492 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17493 (copy_keymap_item, append_key, push_text_char_description):
17494 Now static.
1004a21a 17495 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 17496 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
17497 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17498 (describe_map_tree):
17499 Rename locals to avoid shadowing.
38fc62d9 17500
2f2650da
PE
17501 * keyboard.c: Declare functions static if they are not used elsewhere.
17502 (echo_char, echo_dash, cmd_error, top_level_2):
17503 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
17504 (read_char, kbd_buffer_get_event, make_lispy_position):
17505 (make_lispy_event, make_lispy_movement, apply_modifiers):
17506 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17507 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17508 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 17509 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 17510 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 17511
a053e86c 17512 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
17513 (mark_kboards): Move decl here ...
17514 * alloc.c (mark_kboards): ... from here.
a053e86c 17515
4752793e
PE
17516 * lisp.h (force_auto_save_soon): New decl.
17517
74f10ca7 17518 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
17519 (DEFINE_DUMMY_FUNCTION): New macro.
17520 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17521 Use it.
c03cd23f
PE
17522 (main): Add casts to avoid warnings
17523 if GCC considers string literals to be constants.
74f10ca7 17524
022e70d4
PE
17525 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17526
59d6fe83
PE
17527 * dbusbind.c: Pointer signedness fixes.
17528 (xd_signature, xd_append_arg, xd_initialize):
17529 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17530 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17531 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17532 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17533
78320123
PE
17534 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17535 if GCC considers string literals to be constants.
49cebcca 17536 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 17537
35ac2a97
SM
175382011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17539
fb103ca9
SM
17540 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17541 (print_preprocess, print_object): New macro to fix last change.
17542
35ac2a97
SM
17543 * print.c (print_preprocess): Don't forget font objects.
17544
62973b41
JB
175452011-03-16 Juanma Barranquero <lekktu@gmail.com>
17546
17547 * emacs.c (USAGE3): Doc fixes.
17548
0e48bb22
AS
175492011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17550
17551 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17552 structure.
17553
7684e57b
JB
175542011-03-14 Juanma Barranquero <lekktu@gmail.com>
17555
17556 * lisp.h (VWindow_system, Qfile_name_history):
17557 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17558 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17559 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17560
17561 * w32select.c: Don't #include "keyboard.h".
c96bbc66 17562 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
17563
17564 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17565 * w32console.c (detect_input_pending, read_input_pending)
17566 (encode_terminal_code):
17567 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17568 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17569 (w32_system_caret_y, Qfile_name_history):
17570 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17571 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17572 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17573 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17574 * w32proc.c (Qlocal, report_file_error):
17575 * w32term.c (Vwindow_system, updating_frame):
17576 * w32uniscribe.c (initialized, uniscribe_font_driver):
17577 Remove unneeded extern declarations.
17578
2aa46d6c
CY
175792011-03-14 Chong Yidong <cyd@stupidchicken.com>
17580
c96bbc66 17581 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 17582
cffc6f3b
CY
175832011-03-13 Chong Yidong <cyd@stupidchicken.com>
17584
17585 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17586 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17587 These macros can no longer be used for assignment.
17588
44f230aa
SM
17589 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17590 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
17591 (record_buffer_markers, fetch_buffer_markers): New functions for
17592 recording and fetching special buffer markers.
17593 (set_buffer_internal_1, set_buffer_temp): Use them.
17594
17595 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17596
17597 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17598
17599 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17600 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17601
17602 * xdisp.c (hscroll_window_tree):
17603 (reconsider_clip_changes): Use PT instead of BUF_PT.
17604
d251f04b
EZ
176052011-03-13 Eli Zaretskii <eliz@gnu.org>
17606
17607 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17608 $(EMACS_ROOT)/lib/intprops.h.
17609
f0c77cd1
PE
176102011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17611
3eca4629
PE
17612 Fix more problems found by GCC 4.5.2's static checks.
17613
7c86ee98
PE
17614 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17615 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
17616 (xg_free_frame_widgets): Make it clear that a local variable is
17617 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
17618 (gdk_window_get_screen): Make it clear that this macro is needed
17619 only if USE_GTK_TOOLTIP.
1e5524e7
PE
17620 (int_gtk_range_get_value): New function, which avoids a diagnostic
17621 from gcc -Wbad-function-cast.
17622 (xg_set_toolkit_scroll_bar_thumb): Use it.
17623 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17624 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
17625 (get_utf8_string, xg_get_file_with_chooser):
17626 Rename locals to avoid shadowing.
17627 (create_dialog): Move locals to avoid shadowing.
7c86ee98 17628
41729b81
PE
17629 * xgselect.c (xg_select): Remove unused var.
17630
f0c77cd1
PE
17631 * image.c (four_corners_best): Mark locals as initialized.
17632 (gif_load): Initialize transparent_p to zero (Bug#8238).
17633 Mark another local as initialized.
ec6cf4c6 17634 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 17635
ce0ad53d 17636 * image.c (clear_image_cache): Now static.
d5d5a617 17637 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 17638 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
17639 (x_edge_detection): Remove unnecessary cast that
17640 gcc -Wbad-function-cast diagnoses.
2037898d 17641 (gif_load): Fix pointer signedness.
6ae141d6
PE
17642 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17643 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 17644
33383987 176452011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 17646
d32df629
PE
17647 Improve quality of tests for time stamp overflow.
17648 For example, without this patch (encode-time 0 0 0 1 1
17649 1152921504606846976) returns the obviously-bogus value (-948597
17650 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17651 reports time overflow. See
17652 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
17653 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17654 * editfns.c: Include limits.h and intprops.h.
17655 (TIME_T_MIN, TIME_T_MAX): New macros.
17656 (time_overflow): Move earlier, to before first use.
17657 (hi_time, lo_time): New functions, for an accurate test for
17658 out-of-range times.
17659 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17660 (Fget_internal_run_time): Don't assume time_t fits in int.
17661 (make_time): Use list2 instead of Fcons twice.
17662 (Fdecode_time): More accurate test for out-of-range times.
17663 (check_tm_member): New function.
17664 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
17665 (lisp_time_argument): Don't rely on undefined left-shift and
17666 right-shift behavior when checking for time stamp overflow.
8be6f318 17667
fe31d94c
PE
17668 * editfns.c (time_overflow): New function, refactoring common code.
17669 (Fformat_time_string, Fdecode_time, Fencode_time):
17670 (Fcurrent_time_string): Use it.
17671
8be6f318
PE
17672 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17673 * dired.c (make_time): Move to ...
17674 * editfns.c (make_time): ... here.
17675 * systime.h: Note the move.
17676
09d9db2c 176772011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 17678
126bc0dc
YM
17679 * fringe.c (update_window_fringes): Remove unused variables.
17680
c47cbdfd
YM
17681 * unexmacosx.c (copy_data_segment): Also copy __got section.
17682 (Bug#8223)
17683
7ac80be9
EZ
176842011-03-12 Eli Zaretskii <eliz@gnu.org>
17685
c96bbc66 17686 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
17687 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17688 Constify `char *' arguments and their references according to
17689 prototypes in tparam.h.
17690
ecb0f94d 17691 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 17692
7ac80be9
EZ
17693 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17694 Adapt all references accordingly.
17695
17696 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17697
ef1fd07e
TT
176982011-03-11 Tom Tromey <tromey@redhat.com>
17699
17700 * buffer.c (syms_of_buffer): Remove obsolete comment.
17701
7ef4b50c
EZ
177022011-03-11 Eli Zaretskii <eliz@gnu.org>
17703
17704 * termhooks.h (encode_terminal_code): Declare prototype.
17705
17706 * msdos.c (encode_terminal_code): Don't declare prototype.
17707
17708 * term.c (encode_terminal_code): Now external again, used by
17709 w32console.c and msdos.c.
17710
44f230aa
SM
17711 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17712 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 17713
4b1ec863 177142011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 17715
1714f52b 17716 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 17717
4b1ec863
PE
17718 * fringe.c (update_window_fringes): Mark locals as initialized
17719 (Bug#8227).
17720 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 17721
524c7aa6
PE
17722 * alloc.c (mark_fringe_data): Move decl from here ...
17723 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17724 to check its interface.
17725 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17726
a5c0af81 17727 * fontset.c (free_realized_fontset): Now static.
7519b8cd 17728 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 17729 (fontset_font): Mark local as initialized.
a9a06e0b 17730 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 17731
b4716021
PE
17732 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17733
811e9bac 17734 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 17735 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
17736 (x_own_selection, Fx_disown_selection_internal): Rename locals
17737 to avoid shadowing.
17738 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 17739
7e3ab302
PE
17740 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17741 so that the caller can use some name other than gcpro1.
17742 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
17743 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17744 (Fx_backspace_delete_keys_p):
17745 Use them to avoid shadowing, and rename vars to avoid shadowing.
17746 (x_decode_color, x_set_name, x_window): Now static.
6b437900 17747 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 17748 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
17749 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17750 Remove unused locals.
7e3ab302
PE
17751 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17752 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17753 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17754 macros.
f78faa98 17755
e2b13473
PE
17756 * xterm.h (x_mouse_leave): New decl.
17757
77f23912
PE
17758 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17759 Remove unused functions.
cdf4ba58
PE
17760 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17761 (x_calc_absolute_position): Now static.
7411c686 17762 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 17763 Don't declare local "event" unless it's used.
ed7bf3a5
PE
17764 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17765 unless they are used.
38d0b34a
PE
17766 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17767 (x_fatal_error_signal): Remove; not used.
a6067996
PE
17768 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17769 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17770 (x_error_catcher, x_connection_closed, x_error_handler):
17771 (x_error_quitter, xembed_send_message, x_iconify_frame):
17772 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 17773 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 17774 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 17775
44f230aa
SM
17776 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17777 Rename or move locals to avoid shadowing.
6b463e58 17778 (tty_defined_color, merge_face_heights): Now static.
5967d051 17779 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
17780 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17781 does not deduce is never used uninitialized.
73719eba
PE
17782 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17783 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 17784
426994c3 17785 * terminal.c (store_terminal_param): Now static.
5489860b 17786
032f1620 17787 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 17788 (set_frame_menubar): Remove unused local.
d4323972 17789 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
17790 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17791 since they might point to immutable storage.
281585b0
PE
17792 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17793 since it's unused otherwise.
032f1620 17794
367c19e5 17795 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 17796 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
17797 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17798 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 17799 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
17800 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17801 does not deduce are never used uninitialized.
70739cbe 17802
07b48fa9
PE
17803 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17804
8868a238 17805 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
17806 * window.c (window_loop, size_window):
17807 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 17808
7e5cf297 17809 * window.c (display_buffer): Now static.
d6550a9f
PE
17810 (size_window): Mark variables that gcc -Wuninitialized
17811 does not deduce are never used uninitialized.
a586633d
PE
17812 * window.h (check_all_windows): New decl, to forestall
17813 gcc -Wmissing-prototypes diagnostic.
5b555da1 17814 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 17815
f6095868
PE
17816 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17817 shadowing.
17818 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
17819 Include <limits.h>.
17820 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17821 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
17822 (load_charset_map): Mark variables that gcc -Wuninitialized
17823 does not deduce are never used uninitialized.
53df7c11 17824 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 17825
f38b440c
PE
17826 * coding.c (coding_set_source, coding_set_destination):
17827 Use "else { /* comment */ }" rather than "else /* comment */;"
17828 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
17829 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17830 a block, when the outer 'i' will do.
17831 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17832 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17833 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17834 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17835 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17836 Rename locals to avoid shadowing.
17837 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
17838 * coding.c (emacs_mule_char, encode_invocation_designation):
17839 Now static, since they're not used elsewhere.
413bb2db 17840 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 17841 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
17842 (decode_coding_emacs_mule): Mark variables that gcc
17843 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
17844 (detect_coding_iso_2022): Initialize a local variable that might
17845 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 17846 this initialization is needed. (Bug#8211)
5f58e762
PE
17847 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17848 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17849 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17850 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17851 Remove unused macros.
f38b440c 17852
232b38b9 17853 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 17854 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 17855 * character.c (string_count_byte8): Likewise.
232b38b9 17856
fb90da1b
PE
17857 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17858 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17859
fb93dbc2
PE
17860 * chartab.c (copy_sub_char_table): Now static, since it's not used
17861 elsewhere.
5c156ace
PE
17862 (sub_char_table_ref_and_range, char_table_ref_and_range):
17863 Rename locals to avoid shadowing.
bbcd0949 17864 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 17865
7d3b3862 17866 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 17867 (BIDI_BOB): Remove unused macro.
7d3b3862 17868
6be7d3da
PE
17869 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17870 deduce are never used uninitialized.
c2ed9c8b 17871 * term.c (encode_terminal_code): Likewise.
6be7d3da 17872
75f8807f 17873 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 17874
50938595
PE
17875 * tparam.h: New file.
17876 * term.c, tparam.h: Include it.
17877 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17878 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17879 Move these decls to tparam.h, and make them agree with what
17880 is actually in tparam.c. The previous trick of using incompatible
17881 decls in different modules does not conform to the C standard.
17882 All callers of tparam changed to use tparam's actual API.
17883 * tparam.c (tparam1, tparam, tgoto):
17884 Use const pointers where appropriate.
17885
fbceeba2
PE
17886 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17887 * cm.h (struct cm): Likewise.
17888 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17889 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17890 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17891 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17892 (turn_on_face, init_tty): Likewise.
17893 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 17894
7f3f1250
PE
17895 * term.c (term_mouse_position): Rename local to avoid shadowing.
17896
e6ca6543
PE
17897 * alloc.c (mark_ttys): Move decl from here ...
17898 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17899
c40f8d15
AS
179002011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17901
17902 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17903
cfe0661d
JB
179042011-03-09 Juanma Barranquero <lekktu@gmail.com>
17905
17906 * search.c (compile_pattern_1): Remove argument regp, unused since
17907 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17908 (compile_pattern): Don't pass it.
17909
0afb4571
J
179102011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17911
17912 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17913 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17914 for ! HAVE_GTK3.
17915 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17916
17917 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17918
17919 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17920 gdk_window_get_screen, gdk_window_get_geometry,
17921 gdk_x11_window_lookup_for_display and GDK_KEY_g.
17922 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17923 (xg_get_pixbuf_from_pixmap): New function.
17924 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17925 to Pixmap, take frame as parameter, remove GdkColormap parameter.
17926 Call xg_get_pixbuf_from_pixmap instead of
17927 gdk_pixbuf_get_from_drawable.
17928 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
17929 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
17930 (xg_check_special_colors): Use GtkStyleContext and its functions
17931 for HAVE_GTK3.
17932 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
17933 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
17934 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
17935 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
17936 Call gtk_widget_get_preferred_size.
0afb4571
J
17937 (xg_frame_resized): gdk_window_get_geometry only takes 5
17938 parameters.
44f230aa
SM
17939 (xg_win_to_widget, xg_event_is_for_menubar):
17940 Call gdk_x11_window_lookup_for_display.
0afb4571
J
17941 (xg_set_widget_bg): New function.
17942 (delete_cb): New function.
895009e1 17943 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 17944 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
17945 (xg_set_background_color): Call xg_set_widget_bg.
17946 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
17947 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
17948 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
17949 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
17950 if ! HAVE_GTK3.
17951 (update_frame_tool_bar): Call gtk_widget_hide.
17952 (xg_initialize): Use GDK_KEY_g.
17953
17954 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
17955 if ! HAVE_GTK3
17956 (x_session_initialize): Call gdk_x11_set_sm_client_id.
17957
17958 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17959 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17960 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17961
1c2cc4ef
JB
179622011-03-08 Juanma Barranquero <lekktu@gmail.com>
17963
17964 * w32xfns.c (select_palette): Check success of RealizePalette against
17965 GDI_ERROR, not zero.
17966
33383987 17967See ChangeLog.11 for earlier changes.
aac0c6e3
MR
17968
17969;; Local Variables:
17970;; coding: utf-8
aac0c6e3
MR
17971;; End:
17972
2f097256 17973 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
17974
17975 This file is part of GNU Emacs.
17976
17977 GNU Emacs is free software: you can redistribute it and/or modify
17978 it under the terms of the GNU General Public License as published by
17979 the Free Software Foundation, either version 3 of the License, or
17980 (at your option) any later version.
17981
17982 GNU Emacs is distributed in the hope that it will be useful,
17983 but WITHOUT ANY WARRANTY; without even the implied warranty of
17984 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17985 GNU General Public License for more details.
17986
17987 You should have received a copy of the GNU General Public License
17988 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.