Shell output catching a la gud-gdb.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
62aba0d4
FP
12012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
2
3 Support x64 build on MS-Windows.
4 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
5 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
6 compatibility with x64.
5e4daaf3 7 (x_get_focus_frame): Add prototype.
62aba0d4
FP
8
9 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
10 defining an XRectangle structure.
11
12 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
13 arithmetics for compatibility with x64.
14
15 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
16 compatibility with x64.
17
18 * w32heap.h: Adjust prototypes and declarations.
19
20 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
21 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
22 DWORD, long, and unsigned long, for compatibility with x64.
23 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
24 (sbrk): Argument is now of type ptrdiff_t.
25
26 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
27 less than 0x0500.
28 (w32_msg_pump): Use WPARAM type for 'result'.
29
30 * w32.c (init_environment, get_emacs_configuration): Support AMD64
31 architecture.
32 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
33 compatibility with x64.
34
35 * vm-limit.c (lim_data): Now size_t.
36 (check_memory_limits): Adjust prototypes of real_morecore and
37 __morecore to receive argument of type ptrdiff_t. Use size_t for
38 five_percent and data_size.
39
40 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
41 variables, for compatibility with x64.
42 (rva_to_section, offset_to_section, relocate_offset)
43 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
44 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
45 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
46 for compatibility with x64.
47
48 * sysdep.c (STDERR_FILENO): Define if not already defined.
49
50 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
51 (__morecore): Argument type is now ptrdiff_t.
52 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
53 (relinquish): Use ptrdiff_t type for 'excess'.
54 (r_alloc_sbrk): Argument type is now ptrdiff_t.
55
56 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
57 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
58 instead of a literal number.
59
60 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
61 (min): Define only if not already defined.
62
63 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
64 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
65 hosts.
66
67 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
68 'bitmaps' is a pointer.
69
70 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
71
72 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
73
e7a2937b
PE
742012-09-30 Paul Eggert <eggert@cs.ucla.edu>
75
76 file-attributes has a new optional arg FOLLOW-SYMLINKS.
77 * dired.c (directory_files_internal, Ffile_attributes):
78 New arg follow_symlinks. All uses changed.
79
b43d62ae
SM
802012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
81
82 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
83
c06c382a
EZ
842012-09-30 Eli Zaretskii <eliz@gnu.org>
85
86 Support atimers and CPU profiler via profile.c on MS-Windows.
87 * w32proc.c (sig_mask, crit_sig): New static variables.
88 (sys_signal): Support SIGALRM and SIGPROF.
89 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 90 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
91 sigfillset, and sigprocmask are no longer no-ops.
92 (sigismember): New function.
93 (struct itimer_data): New definition.
94 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
95 (crit_prof): New static variables.
96 (MAX_SINGLE_SLEEP): New definition.
97 (timer_loop, stop_timer_thread, term_timers, init_timers)
98 (start_timer_thread, getitimer, setitimer): New functions.
99 (alarm): No longer a no-op, calls setitimer.
100
101 * w32.c (term_ntproc): Call term_timers.
102 (init_ntproc): Make sure all signals are unblocked at startup, to
103 erase any traces of dumping. Call init_timers.
104
105 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
106 Windows-specific code to display the hourglass mouse pointer is no
107 longer used.
108 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
109 to hourglass timer expiration.
110 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
111 Remove, no longer used.
b43d62ae
SM
112 (w32_note_current_window, show_hourglass, hide_hourglass):
113 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
114 window systems.
115 (syms_of_w32fns): Don't initialize hourglass_timer.
116
117 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
118 WINDOWSNT as well.
119 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
120
121 * w32.h (init_timers, term_timers): Add prototypes.
122
95402d5f
KH
1232012-09-30 Kenichi Handa <handa@gnu.org>
124
125 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
126 to the buffer relocation which may be caused by ccl_driver.
127
dd946752
JD
1282012-09-30 Jan Djärv <jan.h.d@swipnet.se>
129
d7e642cc
JD
130 * xfns.c (Fx_file_dialog): Update comment.
131
132 * w32fns.c (Fx_file_dialog): Update comment.
133
134 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
135 Initialize panel name field if OSX >= 10.6.
136
137 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
138
dd946752
JD
139 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
140
141 * nsterm.m (NEW_STYLE_FS): New define.
142 (ns_fullscreen_hook, windowWillEnterFullScreen)
143 (windowDidEnterFullScreen, windowWillExitFullScreen)
144 (windowDidExitFullScreen, toggleFullScreen, handleFS)
145 (setFSValue): New functions.
146 (EmacsFSWindow): New implementation.
147 (canBecomeKeyWindow): New function for EmacsFSWindow.
148 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
149 (dealloc): Release nonfs_window if in fullscreen.
150 (updateFrameSize:): Call windowDidMove to update top/left.
151 (windowWillResize:toSize:): Check if frame is still maximized.
152 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
153 next_maximized, maximized_width, maximized_height and nonfs_window.
154 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
155 tbar_height.
156 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
157 fullscreen. Set maximized_width/height. Act on next_maximized.
158
159 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
160 (EmacsView): Add variables for fullscreen.
161 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
162 (EmacsFSWindow): New interface for fullscreen.
163
427730eb
JB
1642012-09-30 Juanma Barranquero <lekktu@gmail.com>
165
166 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
167
48de8b12
CY
1682012-09-30 Chong Yidong <cyd@gnu.org>
169
170 * fns.c (Frandom): Doc fix.
171
5938d519
MR
1722012-09-30 Martin Rudalics <rudalics@gmx.at>
173
174 * window.c (Vwindow_combination_limit): New default value.
175 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
176
cb5b0266
PE
1772012-09-30 Paul Eggert <eggert@cs.ucla.edu>
178
179 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
180 Suggested by Eli Zaretskii in
181 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
182
84f72efd
EZ
1832012-09-30 Eli Zaretskii <eliz@gnu.org>
184
185 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
186 HAVE_TIMER_SETTIME is defined.
187
9d4dcdc9
PE
1882012-09-30 Paul Eggert <eggert@cs.ucla.edu>
189
d89460ed
PE
190 Profiler improvements: more-accurate timers, overflow checks.
191 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
192 signal.h, setjmp.h. Include systime.h instead.
193 (saturated_add): New function.
194 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
195 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
196 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
197 New static vars.
84f72efd 198 (enum profiler_cpu_running): New enum.
d89460ed
PE
199 (profiler_cpu_running): Now of that enum type, not bool.
200 All uses changed to store the new value.
201 (handle_profiler_signal): Rename from sigprof_handler_1,
202 for consistency with other handlers. Do not check whether
203 cpu_log is a hash-table if garbage collecting, since it
204 doesn't matter in that case.
205 (deliver_profiler_signal): Rename from sigprof_handler,
206 for consistency with other handlers.
207 (setup_cpu_timer): New function, with much of what used to be in
208 Fprofiler_cpu_start. Check for out-of-range argument.
209 Prefer timer_settime if available, and prefer
210 thread cputime clocks, then process cputime clocks, then
211 monotonic clocks, to the old realtime clock. Use make_timeval
212 to round more-correctly when falling back to setitimer.
213 (Fprofiler_cpu_start): Use it.
214 (Fprofiler_cpu_stop): Prefer timer_settime if available.
215 Don't assume that passing NULL as the 2nd argument of setitimer
216 is the same as passing a pointer to all-zero storage.
217 Ignore SIGPROF afterwards.
218 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
219 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
220 non-fatal signal handlers. Ignore SIGPROF on startup.
221 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
222 in profiler.c, since sysdep.c now uses it.
223
9d4dcdc9
PE
224 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
225 Suggested by Eli Zaretskii in
226 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
227
8e5691a0
JB
2282012-09-29 Juanma Barranquero <lekktu@gmail.com>
229
230 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
231
e7c1b6ef
SM
2322012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
233
234 * lisp.h (struct backtrace): Remove indirection for `function' field.
235 * xdisp.c (redisplay_internal):
236 * profiler.c (record_backtrace, sigprof_handler_1):
237 * alloc.c (Fgarbage_collect):
238 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
239 (Fbacktrace_frame): Adjust accordingly.
240
e61d39cd 2412012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
242
243 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
244 (Frun_hook_with_args_until_failure): Doc fixes.
245
404043ea
EZ
2462012-09-28 Eli Zaretskii <eliz@gnu.org>
247
248 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
249 Qautomatic_redisplay and change the symbol name. All users changed.
250
704d3f45
TM
2512012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
252
253 * profiler.c (sigprof_handler): Fix race condition.
254
757140ff
GM
2552012-09-28 Glenn Morris <rgm@gnu.org>
256
257 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
258
a615a3ae
PE
2592012-09-27 Paul Eggert <eggert@cs.ucla.edu>
260
261 Check more robustly for timer_settime.
89d17fd0
PE
262 * Makefile.in (LIB_TIMER_TIME): New macro.
263 (LIBES): Add it.
a615a3ae
PE
264 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
265 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
266 call timer_settime.
267
3670daf7
TM
2682012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
269
270 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
271
6a586b7f
JB
2722012-09-26 Juanma Barranquero <lekktu@gmail.com>
273
274 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
275
41c8bfcf
PE
2762012-09-26 Paul Eggert <eggert@cs.ucla.edu>
277
278 * character.h (MAYBE_UNIFY_CHAR): Remove.
279 * charset.c, charset.h (maybe_unify_char): Now static.
280 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
281 Since this stuff is now private to charset.c, there's no need for
282 a public macro and no need to inline by hand.
283
3a880af4
SM
2842012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
285 Stefan Monnier <monnier@iro.umontreal.ca>
286 Juanma Barranquero <lekktu@gmail.com>
611b7507 287
3a880af4
SM
288 * profiler.c: New file.
289 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
290 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
291 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
292 * emacs.c (main): Call syms_of_profiler.
293 * alloc.c (Qautomatic_gc): New constant.
294 (MALLOC_PROBE): New macro.
295 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
296 (total_bytes_of_live_objects): New function.
297 (Fgarbage_collect): Use it. Record itself in backtrace_list.
298 Call malloc_probe for the memory profiler.
299 (syms_of_alloc): Define Qautomatic_gc.
300 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
301 race condition.
302 (struct backtrace): Move definition...
303 * lisp.h (struct backtrace): ..here.
304 (Qautomatic_gc, profiler_memory_running): Declare vars.
305 (malloc_probe, syms_of_profiler): Declare functions.
306 * xdisp.c (Qautomatic_redisplay): New constant.
307 (redisplay_internal): Record itself in backtrace_list.
308 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 309
5938d519 3102012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
3112012-09-25 Juanma Barranquero <lekktu@gmail.com>
312
313 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
314
e26fd2e4
PE
3152012-09-25 Paul Eggert <eggert@cs.ucla.edu>
316
317 Prefer POSIX timers if available.
318 They avoid a race if the timer is too close to the current time.
319 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
320 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 321 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 322
eedec3ee
EZ
3232012-09-25 Eli Zaretskii <eliz@gnu.org>
324
325 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
326 CHAR_STRING_ADVANCE.
327 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
328 STRING_CHAR_ADVANCE.
329
aa15c6bb
JB
3302012-09-25 Juanma Barranquero <lekktu@gmail.com>
331
332 Move Vlibrary_cache to emacs.c and reset before dumping.
333
334 * lisp.h (reset_image_types): Declare.
335 [WINDOWSNT] (Vlibrary_cache): Declare.
336
337 * image.c (reset_image_types): New function.
338
339 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
340 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
341 (Fdump_emacs): Reset Vlibrary_cache and image_types.
342
343 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
344 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
345
346 * w32.h (Vlibrary_cache): Do not declare.
347
54d629be
EZ
3482012-09-25 Eli Zaretskii <eliz@gnu.org>
349
16b22fef
EZ
350 * w32proc.c (sys_signal): Handle all signals defined by the
351 MS-Windows runtime, not just SIGCHLD. Actually install the signal
352 handlers for signals supported by Windows. Don't override
353 term_ntproc as the handler for SIGABRT.
354 (sigaction): Rewrite to call sys_signal instead of duplicating its
355 code.
356 (sys_kill): Improve commentary.
357
358 * w32.c (term_ntproc): Accept (and ignore) one argument, for
359 consistency with a signature of a signal handler. All callers
360 changed.
361 (init_ntproc): Accept an argument DUMPING. If dumping, don't
362 install term_ntproc as a signal handler for SIGABRT, as that
363 should be done by the dumped Emacs.
364
365 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
366
367 * w32select.c (term_w32select): Protect against repeated
368 invocation by setting clipboard_owner to NULL after calling
369 DestroyWindow.
370
371 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
372 and term_ntproc to their modified signatures.
373
54d629be
EZ
374 * character.c (char_string, string_char): Remove calls to
375 MAYBE_UNIFY_CHAR. See the discussion starting at
376 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
377 for the details.
378
59f7af81
CY
3792012-09-25 Chong Yidong <cyd@gnu.org>
380
381 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
382
22e8cf4a
SM
3832012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
384
385 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
386 when encountering an unknown bytecode.
387
578098f3
PE
3882012-09-24 Paul Eggert <eggert@cs.ucla.edu>
389
390 image.c, indent.c: Use bool for booleans.
391 * dispextern.h (struct image_type): Members valid_p, load, init
392 now return bool, not int. All uses changed.
393 * image.c: Omit unnecessary static decls.
394 (x_create_bitmap_mask, x_build_heuristic_mask):
395 Return void, not int, since callers don't care about the return value.
396 (x_create_bitmap_mask, define_image_type, valid_image_p)
397 (struct image_keyword, parse_image_spec, image_spec_value)
398 (check_image_size, image_background)
399 (image_background_transparent, x_clear_image_1)
400 (postprocess_image, lookup_image, x_check_image_size)
401 (x_create_x_image_and_pixmap, xbm_image_p)
402 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
403 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
404 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
405 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
406 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
407 (png_image_p, init_png_functions, png_load_body, png_load)
408 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
409 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
410 (init_gif_functions, gif_load, imagemagick_image_p)
411 (imagemagick_load_image, imagemagick_load, svg_image_p)
412 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
413 (gs_load):
414 * nsimage.m (ns_load_image):
415 * nsterm.m (ns_defined_color):
416 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
417 * xfns.c (x_defined_color):
418 * xterm.c (x_alloc_lighter_color_for_widget)
419 (x_alloc_nearest_color_1, x_alloc_nearest_color)
420 (x_alloc_lighter_color):
421 * indent.c (disptab_matches_widthtab, current_column)
422 (scan_for_column, string_display_width, indented_beyond_p)
423 (compute_motion, vmotion, Fvertical_motion):
424 Use bool for booleans.
425
a5f2b6ec
CY
4262012-09-24 Chong Yidong <cyd@gnu.org>
427
428 * chartab.c (Fset_char_table_default): Obsolete function removed.
429
18e27ea8
PE
4302012-09-23 Paul Eggert <eggert@cs.ucla.edu>
431
afea8a8a
PE
432 Move pid_t related decls out of lisp.h.
433 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
434 (interruptible_wait_for_termination):
435 Move these decls from lisp.h to syswait.h, since they use pid_t.
436 Needed on FreeBSD; see Herbert J. Skuhra in
437 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
438 * callproc.c: Include syswait.h.
439
18e27ea8
PE
440 gnutls.c, gtkutil.c: Use bool for boolean.
441 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
442 (emacs_gnutls_handle_error):
443 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
444 (xg_hide_tooltip, xg_create_frame_widgets)
445 (create_dialog, xg_uses_old_file_dialog)
446 (xg_get_file_with_chooser, xg_get_file_with_selection)
447 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
448 (xg_item_label_same_p, xg_update_menubar)
449 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
450 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
451 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
452 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
453 (update_frame_tool_bar, free_frame_tool_bar):
454 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
455 * nsmenu.m (ns_update_menubar):
456 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
457 * xfns.c (Fx_show_tip) [USE_GTK]:
458 Use bool for boolean.
459 * gtkutil.c (xg_update_frame_menubar):
460 * xmenu.c (update_frame_menubar):
461 Return void, not int, since caller ignores return value.
462 * gtkutil.c (xg_change_toolbar_position):
463 Return void, not 1.
464
af0e9f75
JB
4652012-09-23 Juanma Barranquero <lekktu@gmail.com>
466
467 * makefile.w32-in (BLOCKINPUT_H): Remove.
468 (SYSSIGNAL_H): New macro.
469 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
470 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
471 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
472 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
473 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
474 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
475 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
476 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
477 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
478 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
479 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
480 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
481 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
482 ($(BLD)/w32xfns.$(O)): Update dependencies.
483
5101529e
EZ
4842012-09-23 Eli Zaretskii <eliz@gnu.org>
485
486 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
487 fatal_error_backtrace.
488
489 * w32proc.c (sys_kill): Undo last change: don't do anything when
490 invoked to deliver SIGABRT to our own process. This is now
491 handled by emacs_raise.
492
2c3ee0ad
JB
4932012-09-23 Juanma Barranquero <lekktu@gmail.com>
494
495 * w32term.c (w32_read_socket): Remove leftover reference to
496 interrupt_input_pending.
497
62a1d661
PE
4982012-09-23 Paul Eggert <eggert@cs.ucla.edu>
499
500 Do not use SA_NODEFER.
501 Problem reported by Dani Moncayo in
502 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
503 * alloc.c (die):
504 * sysdep.c (emacs_abort): Do not reset signal handler.
505 * emacs.c (terminate_due_to_signal): Reset signal handler here.
506 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
507 wanted even on POSIXish hosts, and it doesn't work on Windows.
508
a0942b9a
JD
5092012-09-23 Jan Djärv <jan.h.d@swipnet.se>
510
511 * xterm.c (x_term_init): Call fixup_locale before and after calling
512 gtk_init (Bug#12392).
513
d07ff9db
CY
5142012-09-23 Chong Yidong <cyd@gnu.org>
515
516 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
517 Vdynamic_library_alist.
518
519 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
520 (Fgnutls_available_p): Caller changed.
521
522 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
523 (Flibxml_parse_xml_region): Likewise.
524
525 * dispextern.h (struct image_type): Remove arg from init function.
526
527 * image.c (Finit_image_library, lookup_image_type)
528 (define_image_type): Remove now-unneeded second arg.
529 (init_xpm_functions, init_png_functions, init_jpeg_functions)
530 (init_tiff_functions, init_gif_functions, init_svg_functions):
531 Arglist and w32_delayed_load calling convention changed.
532 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 533 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 534
4d7e6e51
PE
5352012-09-23 Paul Eggert <eggert@cs.ucla.edu>
536
537 Simplify and avoid signal-handling races (Bug#12471).
538 * alloc.c (die):
539 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
540 Avoid recursive loop if there's a fatal error in the function itself.
541 * atimer.c (pending_atimers):
542 * blockinput.h: Don't include "atimer.h"; no longer needed.
543 (interrupt_input_pending): Remove. All uses removed.
544 pending_signals now counts both atimers and ordinary interrupts.
545 This is less racy than having three separate pending-signal flags.
546 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
547 (input_blocked_p):
548 Rename from their upper-case counterparts BLOCK_INPUT,
549 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
550 INPUT_BLOCKED_P, and turn into functions. All uses changed.
551 This makes it easier to access volatile variables more accurately.
552 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
553 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
554 that's more reliable if the code is buggy and sets
555 interrupt_input_blocked to a negative value. All uses changed.
556 * atimer.c (deliver_alarm_signal):
557 Remove. No need to deliver this to the parent; any thread can
558 handle this signal now. All uses replaced by underlying handler.
559 * atimer.c (turn_on_atimers):
560 * dispnew.c (handle_window_change_signal):
561 * emacs.c (handle_danger_signal):
562 * keyboard.c (kbd_buffer_get_event):
563 Don't reestablish signal handler; not needed with sigaction.
564 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
565 (UNBLOCK_INPUT_TO):
566 Rework to avoid unnecessary accesses to volatile variables.
567 (UNBLOCK_INPUT_TO): Now a function.
568 (totally_unblock_input, unblock_input): New decls.
569 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
570 (init_data): Remove. Necessary stuff now done in init_signal.
571 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
572 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
573 (fatal_error_code): Remove; no longer needed.
574 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
575 it doesn't always backtrace. All uses changed. No need to reset
576 signal to default, since sigaction and/or die does that for us now.
577 Use emacs_raise (FOO), not kill (getpid (), FOO).
578 (main): Check more-accurately whether we're dumping.
579 Move fatal-error setup to sysdep.c
580 * floatfns.c: Do not include "syssignal.h"; no longer needed.
581 * gtkutil.c (xg_get_file_name, xg_get_font):
582 Remove no-longer-needed signal-mask manipulation.
583 * keyboard.c, process.c (POLL_FOR_INPUT):
584 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
585 * keyboard.c (read_avail_input): Remove.
586 All uses replaced by gobble_input.
587 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
588 (kbd_buffer_store_event_hold, gobble_input):
589 (record_asynch_buffer_change) [USABLE_SIGIO]:
590 (store_user_signal_events):
591 No need to mess with signal mask.
592 (gobble_input): If blocking input and there are terminals, simply
593 set pending_signals to 1 and return. All hooks changed to not
594 worry about whether input is blocked.
595 (process_pending_signals): Clear pending_signals before processing
596 them, in case a signal comes in while we're processing.
597 By convention callers now test pending_signals before calling us.
598 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
599 New functions, to support changes to blockinput.h.
600 (handle_input_available_signal): Now extern.
601 (reinvoke_input_signal): Remove. All uses replaced by
602 handle_async_input.
603 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
604 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
605 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
606 Clear sigmask reliably, even if Fsignal returns, which it can.
607 Omit unnecessary accesses to volatile var.
608 (quit_throw_to_read_char): No need to restore sigmask.
609 * keyboard.c (gobble_input, handle_user_signal):
610 * process.c (wait_reading_process_output):
611 Call signal-handling code rather than killing ourselves.
612 * lisp.h: Include <float.h>, for...
613 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
614 (pending_signals): Now volatile.
615 (syms_of_data): Now const if IEEE floating point.
616 (handle_input_available_signal) [USABLE_SIGIO]:
617 (terminate_due_to_signal, record_child_status_change): New decls.
618 * process.c (create_process): Avoid disaster if memory is exhausted
619 while we're processing a vfork, by tightening the critical section
620 around the vfork.
621 (send_process_frame, process_sent_to, handle_pipe_signal)
622 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
623 ignores SIGPIPE.
624 (send_process): No need for setjmp/longjmp any more, since the
625 SIGPIPE stuff is now gone. Instead, report an error if errno
626 is EPIPE.
627 (record_child_status_change): Now extern. PID and W are now args.
628 Return void, not bool. All callers changed.
629 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
630 Remove. All uses removed. This bug should be fixed now in a
631 different way.
632 (wait_for_termination_1): Use waitpid rather than sigsuspend,
633 and record the child status change directly. This avoids the
634 need to futz with the signal mask.
635 (process_fatal_action): Move here from emacs.c.
636 (emacs_sigaction_flags): New function, containing
637 much of what used to be in emacs_sigaction_init.
638 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
639 caught by emacs, to make races less likely.
640 (deliver_process_signal): Rename from handle_on_main_thread.
641 All uses changed.
642 (BACKTRACE_LIMIT_MAX): Now at top level.
643 (thread_backtrace_buffer, threadback_backtrace_pointers):
644 New static vars.
645 (deliver_thread_signal, deliver_fatal_thread_signal):
646 New functions, for more-accurate delivery of thread-specific signals.
647 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
648 (deliver_arith_signal): Handle in this thread, not
649 in the main thread, since it's triggered by this thread.
650 (maybe_fatal_sig): New function.
651 (init_signals): New arg DUMPING so that we can be more accurate
652 about whether we're dumping. Caller changed.
653 Treat thread-specific signals differently from process-general signals.
654 Block all signals while handling fatal error; that's safer.
655 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
656 on IEEE hosts.
657 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
658 Ignore SIGPIPE unless batch.
659 (emacs_backtrace): Output backtrace for the appropriate thread,
660 which is not necessarily the main thread.
661 * syssignal.h: Include <stdbool.h>.
662 (emacs_raise): New macro.
663 * xterm.c (x_connection_signal): Remove; no longer needed
664 now that we use sigaction.
665 (x_connection_closed): No need to mess with sigmask now.
666 (x_initialize): No need to reset SIGPIPE handler here, since
667 init_signals does this for us now.
668
8f4635e9
JD
6692012-09-23 Jan Djärv <jan.h.d@swipnet.se>
670
671 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 672 background rect may be larger (Bug#12245).
8f4635e9 673
3296976d
CY
6742012-09-23 Chong Yidong <cyd@gnu.org>
675
676 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
677
d41e491e
PE
6782012-09-22 Paul Eggert <eggert@cs.ucla.edu>
679
680 * .gdbinit: Just stop at fatal_error_backtrace.
681 See Stefan Monnier's request in
682 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
683 Remove no-longer-used query of system type.
684
c88b867f
CY
6852012-09-22 Chong Yidong <cyd@gnu.org>
686
687 * search.c (Freplace_match): Doc fix (Bug#12325).
688
689 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
690
691 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
692 (Fline_end_position): Doc fix.
693
694 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
695
bb4d86b4
CY
6962012-09-22 Chong Yidong <cyd@gnu.org>
697
698 * dispextern.h (struct image_type): Add new slot, storing a type
699 initialization function.
700
701 * image.c (define_image_type): Call the image initializer function
702 if it is defined. Arguments and return value changed.
703 (valid_image_p, make_image): Callers changed.
704 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
705 (gif_type, imagemagick_type, svg_type, gs_type):
706 Add initialization functions.
bb4d86b4
CY
707 (Finit_image_library): Call lookup_image_type.
708 (CHECK_LIB_AVAILABLE): Macro deleted.
709 (lookup_image_type): Call define_image_type here, rather than via
710 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
711 (syms_of_image): Move define_image_type calls for xbm_type and
712 pbm_type to lookup_image_type.
713
df9685f3
EZ
7142012-09-22 Eli Zaretskii <eliz@gnu.org>
715
716 * keyboard.c (timer_check_2): Move calculation of 'timers' and
717 'idle_timers' from here ...
718 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
719 lists, to avoid infloops when the timer does something stupid,
720 like reinvoke itself with the same or smaller time-out.
721 (Bug#12447)
722
8e17c9ba
MR
7232012-09-22 Martin Rudalics <rudalics@gmx.at>
724
725 * window.c (Fsplit_window_internal): Handle only Qt value of
726 Vwindow_combination_limit separately.
727 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
728 (Vwindow_combination_limit): New default value.
729 Rewrite doc-string.
8e17c9ba 730
589bd69b
EZ
7312012-09-22 Eli Zaretskii <eliz@gnu.org>
732
733 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
734 the new overlay string. (Bug#10159)
735
01108e3f
PE
7362012-09-22 Paul Eggert <eggert@cs.ucla.edu>
737
738 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
739 or that fprintf is async-signal-safe. POSIX doesn't require
740 either assumption.
741
82f8cd94
CY
7422012-09-22 Chong Yidong <cyd@gnu.org>
743
744 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
745 (Bug#8207).
746
3cccbd87
KH
7472012-09-22 Kenichi Handa <handa@gnu.org>
748
749 * composite.c (composition_reseat_it): Handle the case that a
750 grapheme cluster is not covered by a single font (Bug#12352).
751
09c01941
CY
7522012-09-21 Chong Yidong <cyd@gnu.org>
753
754 * image.c (define_image_type): Avoid adding duplicate types to
755 image_types (Bug#12463). Suggested by Jörg Walter.
756
acfa068f 7572012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
758
759 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
760 (print_load_command_name): Add case LC_DATA_IN_CODE.
761 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
762
acfa068f 7632012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
764
765 * eval.c (Frun_hook_with_args_until_success)
766 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
767
acfa068f 7682012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
769
770 * fileio.c (Ffile_selinux_context): Only call freecon when
771 lgetfilecon succeeded.
772 (Fset_file_selinux_context): Likewise. (Bug#12444)
773
acfa068f 7742012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
775
776 * xdisp.c (try_window_reusing_current_matrix): Under bidi
777 reordering, locate the cursor by calling set_cursor_from_row; if
778 that fails, clear the desired glyph matrix before returning a
779 failure indication to the caller. Fixes leaving garbled display
780 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
781 (compute_stop_pos_backwards): Fix a typo that caused crashes while
782 scrolling through multibyte text.
aa36e4d2 783
e99f70c8
SM
7842012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
785
786 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
787 calling mark_vectorlike since that's the one that marks the window.
788 (mark_discard_killed_buffers): Mark the final cdr.
789 * window.h (struct window): Move prev/next_buffers to the
790 non-standard fields.
791 * window.c (make_window): Initialize prev/next_buffers manually.
792
f75beb47
PE
7932012-09-20 Paul Eggert <eggert@cs.ucla.edu>
794
795 Omit unused arg EXPECTED from socket hooks.
796 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
797 * nsterm.m (ns_term_init):
798 * termhooks.h (struct terminal.read_socket_hook):
799 * w32inevt.c (w32_console_read_socket):
800 * w32term.c (w32_read_socket):
801 * xterm.c (XTread_socket):
802 Omit unused arg EXPECTED. All callers changed.
803 (store_user_signal_events): Return void, not int, since callers no
804 longer care about the return value. All uses changed.
805
b019b76a
JB
8062012-09-20 Juanma Barranquero <lekktu@gmail.com>
807
808 * w32gui.h (XParseGeometry): Do not declare.
809
05642592
PE
8102012-09-19 Paul Eggert <eggert@cs.ucla.edu>
811
e4bce92a
PE
812 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
813 Ignore 'expected'. See Eli Zaretskii in
814 <http://bugs.gnu.org/12471#8> (last line).
815
05642592
PE
816 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
817 (XParseGeometry): Now static. Substitute extremal values for
818 values that are out of range.
819
e543ae91
JD
8202012-09-19 Jan Djärv <jan.h.d@swipnet.se>
821
822 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
823
824 * nsfns.m (XParseGeometry): Remove.
825 (Fx_create_frame): Call x_set_offset to correctly interpret
826 top_pos in geometry.
827
3a880af4 828 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
829 (Fx_parse_geometry): If there is a space in string, call
830 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
831
45ba16c7
EZ
8322012-09-17 Eli Zaretskii <eliz@gnu.org>
833
c8b9f1bc
EZ
834 * search.c (scan_buffer): Use character positions in calls to
835 region_cache_forward and region_cache_backward, not byte
836 positions. (Bug#12196)
837
b4c932a2
EZ
838 * w32term.c (w32_read_socket): Set pending_signals to 1, like
839 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
840
45ba16c7
EZ
841 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
842 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
843 emacs_blocked_malloc, now deleted.
844
eeceac93
PE
8452012-09-17 Paul Eggert <eggert@cs.ucla.edu>
846
847 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
848 The workaround was for improving performance on Solaris 2.4, but
849 is getting in the way now. Emacs will still work if someone is
850 still running Solaris 2.4 in a museum somewhere; Sun dropped
851 support for Solaris 2.4 in 2003.
852 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
853 * process.c (create_process) [HAVE_WORKING_VFORK]:
854 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
855 since Emacs no longer uses vfork on that platform.
856
78f83752
GM
8572012-09-17 Glenn Morris <rgm@gnu.org>
858
859 * emacs.c: Use COPYRIGHT.
860
634b8cac
PE
8612012-09-16 Paul Eggert <eggert@cs.ucla.edu>
862
0caaedb1
PE
863 Remove configure's --without-sync-input option (Bug#12450).
864 When auditing signal-handling in preparation for cleaning it up,
865 I found that SYNC_INPUT has race conditions and would be a real
866 pain to fix. Since it's an undocumented and deprecated
867 configure-time option, now seems like a good time to remove it.
868 Also see <http://bugs.gnu.org/11080#16>.
869 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
870 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
871 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
872 (malloc_hysteresis):
873 (check_depth) [XMALLOC_OVERRUN_CHECK]:
874 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
875 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
876 (dont_register_blocks, bytes_used_when_reconsidered)
877 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
878 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
879 [!SYSTEM_MALLOC && !SYNC_INPUT]:
880 Remove. All uses removed.
881 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
882 implementation, one that depends on whether the new macro
883 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
884 is defined.
885 * atimer.c (run_timers, handle_alarm_signal):
886 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
887 (handle_async_input, process_pending_signals)
888 (handle_input_available_signal, init_keyboard):
889 * nsterm.m (ns_read_socket):
890 * process.c (wait_reading_process_output):
891 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
892 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
893 (emacs_write):
894 * xterm.c (XTread_socket):
895 Assume SYNC_INPUT.
896 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
897 * eval.c (handling_signal): Remove. All uses removed.
898 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
899 All uses replaced with the SYNC_INPUT version.
900 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
901 Remove decls.
902 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
903 Now static.
904
634b8cac
PE
905 * font.c (Ffont_shape_gstring): Remove unused local.
906
83da1b55
GM
9072012-09-16 Glenn Morris <rgm@gnu.org>
908
518650a5
GM
909 * Makefile.in (clean): No longer run nextstep's clean.
910
83da1b55
GM
911 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
912 (ns_frag): Remove.
913 (ns-app): Move here from ns.mk, and simplify.
914 (clean): Simplify nextstep entry.
915 * ns.mk: Remove file.
916
85a43e2e
KH
9172012-09-17 Kenichi Handa <handa@gnu.org>
918
919 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
920 not covert the last few charactes.
921
ba13e616 9222012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
923
924 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
925 here, but just check the validity of glyphs in the glyph-string.
926
a8c729af
MR
9272012-09-16 Martin Rudalics <rudalics@gmx.at>
928
3a880af4
SM
929 * window.c (Fwindow_parameter, Fset_window_parameter):
930 Accept any window as argument (Bug#12452).
a8c729af 931
c077c059
JD
9322012-09-16 Jan Djärv <jan.h.d@swipnet.se>
933
934 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
935 to ns_term_init to avoid memory leak.
936
937 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
938 explicit retain/release.
939 (ns_term_init): Only allow one display. Initialize outerpool and
940 ns_*_types.
941
39a57ad0
PE
9422012-09-15 Paul Eggert <eggert@cs.ucla.edu>
943
944 Port _setjmp fix to POSIXish hosts as well as Microsoft.
945 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
946 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
947 the Microsoft problem in a different way, by altering ../nt/config.nt.
948
7105c8cb
EZ
9492012-09-15 Eli Zaretskii <eliz@gnu.org>
950
951 * w32xfns.c:
952 * w32uniscribe.c:
953 * w32term.c:
954 * w32select.c:
955 * w32reg.c:
956 * w32proc.c:
957 * w32menu.c:
958 * w32inevt.c:
959 * w32heap.c:
960 * w32font.c:
961 * w32fns.c:
962 * w32console.c:
963 * w32.c:
964 * w16select.c: Remove inclusion of setjmp.h, as it is now included
965 by lisp.h. This completes removal of setjmp.h inclusion
966 erroneously announced in the previous commit. (Bug#12446)
967
968 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
969 more accurate.
970
971 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
972 not defined as a macro. The latter happens on MS-Windows.
973 (Bug#12446)
974
0328b6de
PE
9752012-09-15 Paul Eggert <eggert@cs.ucla.edu>
976
977 Port better to POSIX hosts lacking _setjmp (Bug#12446).
978 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 979 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
980 only reason for the instance was because "lisp.h" was included.
981 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
982 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
983 and _longjmp with the new symbols. Emacs already uses _setjmp if
984 available, so this change affects only POSIXish hosts that have
985 sigsetjmp but not _setjmp, such as some versions of Solaris and
986 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
987 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
988 (png_load_body) [HAVE_PNG]:
989 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
990 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
991 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
992 since PNG requires jmp_buf. This is the only exception to the
993 general rule that we now use sys_setjmp and sys_longjmp.
994 This exception is OK since this code does not change the signal
995 mask or longjmp out of a signal handler.
996
2af03429
PE
9972012-09-14 Paul Eggert <eggert@cs.ucla.edu>
998
999 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1000 Include "syssignal.h", for 'main_thread'.
1001
2f294edf
DA
10022012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1003
1004 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
1005 * insdel.c (replace_range, replace_range_2):
1006 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
1007 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1008 Remove redundant check before calling offset_intervals.
1009
6b533e9c
MR
10102012-09-14 Martin Rudalics <rudalics@gmx.at>
1011
1012 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1013 current buffer (Bug#12387).
1014
2a7931e3
JB
10152012-09-14 Juanma Barranquero <lekktu@gmail.com>
1016
1017 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1018
c18e885b
PE
10192012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1020
1021 Use a more backwards-compatible timer format (Bug#12430).
1022 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1023 vector element, not from the 4th, since PSECS is now at the end.
1024 (Fcurrent_idle_time): Doc fix.
1025
d59a1afb
DA
10262012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1027
1028 Function to mark objects and remove killed buffers at once.
1029 * alloc.c (discard_killed_buffers): Rename to ...
1030 (mark_discard_killed buffers) ... new name. Add marking
1031 of remaining objects. Fix comment. Adjust users.
1032 (mark_object): Do not touch frame buffer lists here.
1033 * frame.c (delete_frame): Reset frame buffer lists here.
1034
5f0cb45a
PE
10352012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1036
8ea47e3a
PE
1037 Better workaround for GNOME bug when --enable-gcc-warnings.
1038 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1039 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1040 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1041
4a4bbad2
PE
1042 Simplify SIGIO usage (Bug#12408).
1043 The code that dealt with SIGIO was crufty and confusing, e.g., it
1044 played tricks like "#undef SIGIO" but these tricks were not used
1045 consistently. Simplify mostly by not #undeffing standard symbols,
1046 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1047 or not as we please) rather than "defined SIGIO" (standard symbol
1048 that we probably shouldn't #undef).
1049 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1050 Modules that need it can include it.
1051 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1052 * dispextern.h (ignore_sigio): New decl.
1053 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1054 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1055 * emacs.c (shut_down_emacs):
1056 * keyboard.c (kbd_buffer_store_event_hold):
1057 Use ignore_sigio rather than invoking 'signal' directly.
1058 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1059 for FIONREAD.
1060 (FIONREAD, SIGIO): Do not #undef.
1061 (tty_read_avail_input): Use #error rather than a syntax error.
1062 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1063 for I_PIPE, used by SETUP_SLAVE_PTY.
1064 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1065 * sysdep.c (croak): Remove; no longer needed. This bit of
1066 temporary code, with Fred N. Fish's comment that it's temporary,
1067 has been in Emacs since at least 1992!
1068 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1069 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1070 * syssignal.h (croak): Remove decl.
1071 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1072 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1073 now that we're termios-only.
1074 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1075 * term.c (dissociate_if_controlling_tty): Use #error rather than
1076 a run-time error.
1077
5f0cb45a
PE
1078 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1079 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1080 to work around GNOME bug 683906.
1081 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1082 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1083 This works around GCC bug 54561.
1084
40bce90b
PE
10852012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1086
1087 More fixes for 'volatile' and setjmp/longjmp.
1088 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1089 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1090 (png_load_body) [HAVE_PNG]:
1091 (jpeg_load_body) [HAVE_JPEG]:
1092 New function, with most of the old parent function's body.
1093 (png_load) [HAVE_PNG]:
1094 (jpeg_load) [HAVE_JPEG]:
1095 Invoke the new function, to avoid longjmp munging our locals.
1096 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1097 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1098 longjmp is passed 2, as the C standard doesn't guarantee this.
1099 Instead, store the failure code into mgr->failure_code.
1100
bfeae2cf
SM
11012012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1102
1103 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1104 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1105 (syms_of_keyboard): Remove support for unread-command-char.
1106
8099e36b
EZ
11072012-09-12 Eli Zaretskii <eliz@gnu.org>
1108
1109 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1110 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1111 violation. (Bug#12426)
1112
92547ff9
PE
11132012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1114
1115 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1116
45b82ad0
SM
11172012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1118
1119 * eval.c: Add `inhibit-debugger'.
1120 (Qinhibit_debugger): New symbol.
1121 (call_debugger): Bind it instead of Qdebug_on_error.
1122 (maybe_call_debugger): Test Vinhibit_debugger.
1123 (syms_of_eval): Define inhibit-debugger.
1124 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1125 (syms_of_xdisp): Remove inhibit-debug-on-message.
1126
5779a1dc
PE
11272012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1128
50f2e553
PE
1129 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1130 If a nonvolatile local variable is written before a _longjmp to
1131 the frame containing the variable, and is read after the _longjmp,
1132 the value read is indeterminate. Some local variables of type
1133 'struct handler' and 'struct catchtag' are used in this way, so
1134 mark each of their slots as volatile if the slot can be set before
1135 _longjmp and read afterwards.
1136 * lisp.h (struct handler): var and chosen_clause are now volatile.
1137 (struct catchtag): val, next, and pdlcount are now volatile.
1138
ae1d87e2
PE
1139 * bidi.c (bidi_push_it, bidi_pop_it):
1140 * fns.c (copy_hash_table):
1141 * image.c (define_image_type):
1142 * keyboard.c (kbd_buffer_store_event_hold):
1143 * process.c (Fprocess_send_eof):
1144 * xfaces.c (x_create_gc) [HAVE_NS]:
1145 * xgselect.c (xg_select):
1146 Prefer assignment to memcpy when either will do.
1147
5779a1dc
PE
1148 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1149 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1150 time an item is removed. No need to mark this function 'inline';
1151 the compiler knows better than we do.
1152
c4c9756b
JD
11532012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1154
1155 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1156 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1157 to change_frame_size (Bug#12388).
1158 (windowDidResize:): Pass YES to updateFrameSize.
1159
1160 * nsterm.h: Add delay parameter to updateFrameSize.
1161
d73e321c
DA
11622012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1163
1164 Discard killed buffers from deleted window and frame objects.
1165 This reduces an amount of references to killed buffers and
1166 helps GC to reclaim them faster.
1167 * alloc.c (discard_killed_buffers): New function.
1168 (mark_object): Use it for deleted windows and frames.
1169 (mark_object): If symbol's value is set up for a killed buffer
1170 or deleted frame, restore it's global binding.
1171 * data.c (swap_in_global_binding): Add GC notice.
1172 (swap_in_symval_forwarding): Use convenient set_blv_where.
1173 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1174 * window.h: ... to here.
1175
e578f381
DA
11762012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1177
1178 Convenient macro to check whether the buffer is live.
1179 * buffer.h (BUFFER_LIVE_P): New macro.
1180 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1181 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1182
3057e615
YM
11832012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1184
1185 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1186 composition cases (Bug#12364).
1187
1188 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1189 overhang of succeeding glyphs overlapping box cursor.
1190
1191 * w32term.c (x_draw_glyph_string): Likewise.
1192
6fda35f2
PE
11932012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1194
c990426a
PE
1195 Simplify, document, and port floating-point (Bug#12381).
1196 The porting part of this patch fixes bugs on non-IEEE platforms
1197 with frexp, ldexp, logb.
1198 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1199 Now static.
1200 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1201 support, by removing commented-out code and briefly listing the
1202 C89 functions excluded. The commented-out stuff was confusing
1203 maintenance, e.g., we thought we needed cbrt but it was commented out.
1204 (logb): Remove decl; no longer needed.
1205 (isfinite): New macro, if not already supplied.
1206 (isnan): Don't replace any existing macro.
1207 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1208 are present on all C89 platforms.
1209 (Ffrexp): Do not special-case zero, as frexp does the right thing
1210 for that case.
1211 (Flogb): Do not use logb, as it doesn't have the desired meaning
1212 on hosts that use non-base-2 floating point. Instead, stick with
1213 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1214 frexp, to avoid getting an unspecified result.
1215
6fda35f2
PE
1216 * xdisp.c (Qinhibit_debug_on_message): Now static.
1217
16130a58
JD
12182012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1219
1220 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1221 NSBezierPath (Bug#12131).
1222
d105a573
CY
12232012-09-10 Chong Yidong <cyd@gnu.org>
1224
1225 * fns.c (Fdelq, Fdelete): Doc fix.
1226
ff55dfe8
PE
12272012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1228
1229 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1230 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1231
e7032e7c
SM
12322012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1233
1234 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1235 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1236 Use it.
1237
e9957956
EZ
12382012-09-09 Eli Zaretskii <eliz@gnu.org>
1239
aba05ce9
EZ
1240 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1241 left fringe if the window has a left margin. This avoids leaving
1242 traces of the cursor because its leftmost pixel is not drawn over.
1243
e9957956
EZ
1244 * dispnew.c (update_window_line): When the left margin area of a
1245 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1246 that screen line. (Bug#12277)
1247
f6196b87
PE
12482012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1249
1250 Assume C89 or later for math functions (Bug#12381).
1251 This simplifies the code, and makes it a bit smaller and faster,
1252 and (most important) makes it easier to clean up signal handling
1253 since we can stop worring about floating-point exceptions in
1254 library code. That was a problem before C89, but the problem
1255 went away many years ago on all practical Emacs targets.
1256 * data.c, image.c, lread.c, print.c:
1257 Don't include <math.h>; no longer needed.
1258 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1259 might be autoconfigured, as that never happens.
1260 * data.c (fmod):
1261 * doprnt.c (DBL_MAX_10_EXP):
1262 * print.c (DBL_DIG):
1263 Remove. C89 or later always defines these.
1264 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1265 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1266 (arith_error, domain_error, domain_error2):
1267 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1268 no longer needed -- we simply return what C returns. All uses removed.
1269 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1270 the wrapped code.
1271 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1272 Remove. All uses expanded, as these macros are no longer used
1273 more than once and are now more trouble than they're worth.
1274 (Ftan): Use tan, not sin / cos.
1275 (Flogb): Assume C89 frexp.
1276 (fmod_float): Assume C89 fmod.
1277 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1278 (init_floatfns): Remove. All uses removed.
1279
9d7f1863
JD
12802012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1281
1282 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1283 compositeToPoint for OSX < 10.6 (Bug#12390).
1284
eabf0404
PE
12852012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1286
1287 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1288 This produces more-accurate results.
1289
0b3b1d23
JD
12902012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1291
1292 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1293 changes (Bug#12088).
1294
6dcef6ec
CY
12952012-09-08 Chong Yidong <cyd@gnu.org>
1296
1297 * syntax.c (Fstring_to_syntax): Doc fix.
1298
aa7d57c5
JD
12992012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1300
1301 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1302 in the internal border.
1303 (x_set_window_size): Remove static variables and their usage.
1304 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
1305 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1306 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
1307 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1308 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1309 (ns_fix_rect_ibw): Remove.
1310 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1311 (ns_dumpglyphs_box_or_relief): Ditto.
1312 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1313 adjustment.
1314 (ns_dumpglyphs_image): Ditto.
fc0c31f8 1315 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
1316 border adjustment.
1317 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1318 their usage. Add fringe_extended_p and its use as in other terms.
1319 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1320 scroll bar was removed.
1321 (updateFrameSize): New function.
1322 (windowDidResize): Move code to updateFrameSize and call it.
1323
1324 * nsterm.h (EmacsView): Add updateFrameSize.
1325
1a5432bc
CY
13262012-09-07 Chong Yidong <cyd@gnu.org>
1327
b4f5313e
CY
1328 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1329
1a5432bc
CY
1330 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1331
1a4f1e9b
PE
13322012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1333
1334 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
1335 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1336 Problem introduced when merging patches. Noted by Eli Zaretskii in
1337 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
1338 * floatfns.c: Comment fix.
1339 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1340 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1341 and anyway the declaration is harmless even if SIGDANGER is not defined.
1342 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1343 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1344 source files not surprisingly expected syssignal.h to define, or
1345 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1346 Include <sys/ioctl.h>, for FIONREAD.
1347 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1348 This eliminates a problem whereby other files mysteriously had
1349 to include "syssignal.h" before including "systty.h" if they
1350 wanted to use "#ifdef SIGIO".
1351
bc8000ff
EZ
13522012-09-07 Eli Zaretskii <eliz@gnu.org>
1353
3e6d6928
EZ
1354 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1355
1356 * w32.c (sigemptyset): Empty the set.
1357 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1358
bc8000ff
EZ
1359 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1360
b4fa72f2
DA
13612012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1362
1363 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1364 (mark_object): Likewise for frame objects.
1365
30730c93
PE
13662012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1367
1368 * syssignal.h (handle_on_main_thread): Always declare,
1369 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1370 This ports to platforms without HAVE_PTHREAD.
1371
2fe28299
PE
13722012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1373
1374 Signal-handler cleanup (Bug#12327).
1375 Emacs's signal handlers were written in the old 4.2BSD style with
1376 sigblock and sigmask and so forth, and this led to some
1377 inefficiencies and confusion. Rewrite these to use
1378 pthread_sigmask etc. without copying signal sets around. Also,
1379 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1380 'signal', and instead use functions that do not attempt to take
1381 over the system name space. This patch causes Emacs's text
1382 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1383 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1384 Do not include <signal.h> or "syssignal.h", as these
1385 modules do not use signals.
1386 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1387 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1388 Do not include <signal.h>, as "syssignal.h" does that for us now.
1389 * atimer.c (sigmask_atimers): New function.
1390 (block_atimers, unblock_atimers): New functions,
1391 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1392 All uses replaced.
1393 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1394 no longer needed here.
1395 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 1396 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
1397 * sysdep.c (struct save_signal): New member 'action', replacing
1398 old member 'handler'.
1399 (save_signal_handlers, restore_signal_handlers):
1400 Use sigaction instead of 'signal' to save and restore.
1401 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1402 New function. All users of 'signal' modified to use set_sighandler
1403 if they're writeonly, and to use sys_signal if they're read+write.
1404 (emacs_sigaction_init, forwarded_signal): New functions.
1405 (sys_signal): Remove. All uses replaced by calls to sigaction
1406 and emacs_sigaction_init, or by direct calls to 'signal'.
1407 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1408 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1409 all uses replaced by pthread_sigmask etc. calls.
1410 * syssignal.h: Include <signal.h>.
1411 (emacs_sigaction_init, forwarded_signal): New decls.
1412 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1413 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1414 (sigmask, sys_sigmask): Remove; no longer needed.
1415 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1416 (sigblock, sigunblock, sigfree):
1417 (sigsetmask) [!defined sigsetmask]:
1418 Remove. All uses replaced by pthread_sigmask.
1419 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1420 no longer need to be replaced, and its typical old uses
1421 are now done via emacs_sigaction_init and sigaction.
1422 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1423 (sys_sigdel): Remove; unused.
1424 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1425
0216c128
EZ
14262012-09-06 Eli Zaretskii <eliz@gnu.org>
1427
1428 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1429 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1430
c752cfa9
DA
14312012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1432
1433 Explicitly mark buffer_defaults and buffer_local_symbols.
1434 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1435 mark_local_symbols here.
1436 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1437 since special buffers aren't marked here any more.
1438 (allocate_buffer): Chain new buffer with all_buffers here...
1439 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1440 not here.
1441 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1442 (syms_of_buffer): Remove staticpro of the above.
1443 (init_buffer_once): Set names for buffer_defaults and
1444 buffer_local_symbols.
1445
a864ef14
PE
14462012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1447
1448 Use bool for booleans in font-related modules.
1449 * font.c (font_intern_prop, font_style_to_value)
1450 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1451 (generate_otf_features, font_check_otf_features, font_check_otf)
1452 (font_match_p, font_list_entities, font_at):
1453 * fontset.c (fontset_id_valid_p, reorder_font_vector
1454 (fontset_find_font, Fset_fontset_font)
1455 (face_suitable_for_char_p) [0]:
1456 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1457 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1458 (m17n_flt_initialized, ftfont_shape_by_flt):
1459 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1460 * nsfont.m (nsfont_draw):
1461 * w32font.c (w32font_draw):
1462 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1463 Use bool for booleans.
1464 * font.h: Adjust to above API changes.
1465 (struct font, struct font_driver, struct font_driver_list):
1466 Use bool for booleans.
1467 (struct font): Remove useless member encoding_type.
1468 All users removed.
1469 * fontset.c, xftfont.c: Omit unnecessary static decls.
1470
0699fc18
DA
14712012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1472
1473 * alloc.c (mark_object): Revert window marking code
1474 since it's unsafe for the Fset_window_configuration.
1475
20ef56db
PE
14762012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1477
2fe28299 1478 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
1479 Be more systematic about preserving errno whenever a signal
1480 handler returns, even if it's not in the main thread. Do this by
1481 renaming signal handlers to distinguish between signal delivery
1482 and signal handling. All uses changed.
1483 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1484 * data.c (deliver_arith_signal): Rename from arith_error.
1485 * dispnew.c (deliver_window_change_signal): Rename from
1486 window_change_signal.
1487 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1488 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1489 * keyboard.c (deliver_input_available_signal): Rename from
1490 input_available_signal.
1491 (deliver_user_signal): Rename from handle_user_signal.
1492 (deliver_interrupt_signal): Rename from interrupt_signal.
1493 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1494 (deliver_child_signal): Rename from sigchld_handler.
1495 * atimer.c (handle_alarm_signal):
1496 * data.c (handle_arith_signal):
1497 * dispnew.c (handle_window_change_signal):
1498 * emacs.c (handle_fatal_signal, handle_danger_signal):
1499 * keyboard.c (handle_input_available_signal):
1500 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1501 * process.c (handle_pipe_signal, handle_child_signal):
1502 New functions, with the actual signal-handling code taken from the
1503 original respective signal handlers, sans the sporadic attempts to
1504 preserve errno, since that's now done by handle_on_main_thread.
1505 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1506 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1507 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1508 Move to sysdep.c.
1509 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1510 Move initialization of main_thread to sysdep.c's init_signals.
1511 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1512 our usage, and simplifies the mainline code.
1513 (record_child_status_change): New static function, as a helper
1514 for handle_child_signal, and with most of the old child handler's
1515 contents.
1516 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1517 (handle_child_signal): Use the above.
1518 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1519 Moved here from emacs.c.
1520 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1521 code moved here from emacs.c's main function.
1522 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
1523 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1524 This lets callers save and restore errno properly.
20ef56db 1525
e3ccf108
DA
15262012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1527
1528 Remove redundant or unused things here and there.
1529 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1530 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1531 * editfns.c (Fcompare_buffer_substrings): Likewise.
1532 * frame.h (struct terminal, struct font_driver_list):
1533 Remove redundant declarations.
1534 * window.h (Qleft, Qright): Likewise.
1535
697e1e39
DA
15362012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1537
1538 Do not mark objects from deleted buffers, windows and frames.
1539 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1540 (mark_object): Likewise for windows and frames.
1541
c1ca42ca
DA
15422012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1543
1544 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1545 buffer_defaults and buffer_local_symbols as valid objects.
1546 Return special value to denote them.
1547
014d93be
PE
15482012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1549
f75d7a91
PE
1550 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1551 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1552 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1553 (file_name_absolute_p, Fsubstitute_in_file_name):
1554 (check_executable, check_writable, Ffile_accessible_directory_p)
1555 (Fset_file_selinux_context, Fdefault_file_modes)
1556 (Finsert_file_contents, choose_write_coding_system)
1557 (Fwrite_region, build_annotations, a_write, e_write)
1558 (Fdo_auto_save):
1559 * filelock.c (boot_time_initialized, get_boot_time)
1560 (get_boot_time_1, lock_file_1, within_one_second):
1561 * floatfns.c (in_float):
1562 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1563 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1564 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1565 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1566 * window.c (compare_window_configurations):
1567 Use bool for booleans.
1568 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1569 (Fdefault_file_modes): Now mode_t, not int, for modes.
1570 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1571 (internal_delete_file): Now returns void, not a (boolean) int,
1572 since nobody was looking at the return value.
1573 * lisp.h, window.h: Adjust to above API changes.
1574
014d93be
PE
1575 * xdisp.c (set_message): Simplify and reindent last change.
1576
776f29e1
JB
15772012-09-05 Juanma Barranquero <lekktu@gmail.com>
1578
1579 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1580
7f7e0167
LI
15812012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1582
1583 * eval.c (call_debugger): Make the function non-static so that we
1584 can call it from set_message.
1585
1586 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1587 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1588
cf29dd84
PE
15892012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1590
1591 Give more-useful info on a fatal error (Bug#12328).
1592 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1593 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1594 of doing the work ourselves.
1595 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1596 do most of the work.
1597 (fatal_error_backtrace): New function, taken from the guts
1598 of the old fatal_error_signal, but with a new option to output
1599 a backtrace.
1600 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1601 info about the signal than just its number.
1602 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1603 * sysdep.c: Include <execinfo.h>
1604 (emacs_backtrace): New function, taken partly from the previous
1605 code of the 'die' function.
1606 (emacs_abort): Call fatal_error_backtrace rather than abort.
1607
972debf2
SM
16082012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1609
1610 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1611 eager (load-time) macro-expansion.
1612 * lisp.mk (lisp): Add macroexp.
1613
1088b922
PE
16142012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1615
1616 Simplify redefinition of 'abort' (Bug#12316).
1617 Do not try to redefine the 'abort' function. Instead, redo
1618 the code so that it calls 'emacs_abort' rather than 'abort'.
1619 This removes the need for the NO_ABORT configure-time macro
1620 and makes it easier to change the abort code to do a backtrace.
1621 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1622 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1623 Remove; sysdep.c's emacs_abort now takes its place.
1624 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1625 'abort' changed to use 'emacs_abort'.
1626 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1627 (abort) [!defined abort]: Rename to ...
1628 (emacs_abort): ... new name.
1629 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1630 the place of the old 'abort' in emacs.c.
1631 * w32.c, w32fns.c (abort): Do not #undef.
1632 * w32.c (emacs_abort): Rename from w32_abort.
1633
30934d33
EZ
16342012-09-04 Eli Zaretskii <eliz@gnu.org>
1635
1636 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1637 offsets[j].dv, since the y axis of the screen coordinates points
1638 down, while the y axis of the font definition coordinates points
1639 up. This fixes display of Arabic diacritics such as KASRA and
1640 KASRATAN. (Bug#11860)
1641
af26b72c
PE
16422012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1643
1644 Be more systematic about _setjmp vs setjmp.
1645 * alloc.c (test_setjmp, mark_stack):
1646 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1647 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1648 (png_load, my_error_exit, jpeg_load):
1649 * process.c (send_process_trap, send_process):
1650 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1651 The underscored versions are up to 30x faster on some hosts.
1652 Formerly, the code used setjmp+longjmp sometimes and
1653 _setjmp+_longjmp at other times, with no particular reason to
1654 prefer setjmp+longjmp.
1655
26d4541d
PE
16562012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1657
d42f4f0f 1658 Fix minor problem found by static checking.
26d4541d 1659 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 1660
c5e28e39
MR
16612012-09-03 Martin Rudalics <rudalics@gmx.at>
1662
1663 * buffer.c (Fdelete_all_overlays): New function.
1664
3eab3ca9
CY
16652012-09-03 Chong Yidong <cyd@gnu.org>
1666
1667 * gtkutil.c: Add extern decl for Qxft.
1668
c04889f8
PE
16692012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1670
1882aa38
PE
1671 * emacs.c, eval.c: Use bool for boolean.
1672 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1673 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1674 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1675 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1676 (main, decode_env_path, Fdaemon_initialized):
1677 * eval.c (call_debugger, Finteractive_p, interactive_p):
1678 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1679 (maybe_call_debugger, Fbacktrace):
1680 * process.c (read_process_output, exec_sentinel):
1681 Use bool for booleans.
1682 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1683 All callers changed.
1684 * eval.c (interactive_p): Omit always-true boolean argument
1685 EXCLUDE_SUBRS_P. All callers changed.
1686 * dispextern.h, lisp.h: Reflect above API changes.
1687 * firstfile.c (dummy): Use the address of 'main', whose signature
1688 won't change, instead of the address of 'initialize', whose
1689 signature just changed from int to bool.
1690 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1691 * msdos.c (fatal_error_in_progress): ... from here.
1692 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1693 of incrementing it.
1694 (redisplay_internal, unwind_redisplay): Simply clear
1695 REDISPLAYING_P when unwinding, instead of saving its previous,
1696 always-false value and then restoring it.
1697
a411ac43
PE
1698 Clean up some extern decls.
1699 Mostly, this hoists extern decls out of .c files and into .h files.
1700 That way, we're more likely to catch errors if the interfaces change.
1701 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1702 declare xg_mark_data.
1703 * dispextern.h (x_frame_parm_handlers):
1704 * font.h (Qxft):
1705 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1706 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1707 (Qultra_bold, Qoblique, Qitalic):
1708 Move extern decl here from .c file.
1709 * alloc.c (xg_mark_data) [USE_GTK]:
1710 * doc.c (Qclosure):
1711 * eval.c (Qlexical_binding):
1712 * fns.c (time) [!HAVE_UNISTD_H]:
1713 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1714 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1715 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1716 * lread.c (Qinternal_interpreter_environment):
1717 * minibuf.c (Qbuffer):
1718 * process.c (QCfamily, QCfilter):
1719 * widget.c (free_frame_faces):
1720 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1721 * xfont.c (x_clear_errors):
1722 * xterm.c (x_frame_parm_handlers):
1723 Remove now-redundant extern decls.
1724 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1725 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1726 Now static.
1727 * xfaces.c: Remove unnecessary static decls.
1728 * xterm.c (updating_frame): Remove decl of nonexistent object.
1729
c04889f8
PE
1730 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1731 when building globals.h, as the objects that are not built on
1732 this host are not needed to compile C files on this host.
1733
8b339673
JD
17342012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1735
1736 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1737
1738 * frame.h: Add missing prototype for x_wm_set_size_hint.
1739
a08d4ba7
PE
17402012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1741
1742 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1743 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1744 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1745 (Fsubstitute_command_keys):
1746 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1747 (save_excursion_save, save_excursion_restore)
1748 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1749 (format_time_string, general_insert_function)
1750 (make_buffer_string, make_buffer_string_both)
1751 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1752 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1753 (copy_text, insert_1, insert_1_both, insert_from_string)
1754 (insert_from_string_before_markers, insert_from_string_1)
1755 (insert_from_buffer, insert_from_buffer_1, replace_range)
1756 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1757 (del_range_2, modify_region):
1758 * intervals.c (intervals_equal, balance_possible_root_interval)
1759 (adjust_intervals_for_insertion, merge_properties_sticky)
1760 (graft_intervals_into_buffer, lookup_char_property)
1761 (adjust_for_invis_intang, set_point_both)
1762 (get_property_and_range, compare_string_intervals)
1763 (set_intervals_multibyte_1, set_intervals_multibyte):
1764 * keyboard.c (decode_timer):
1765 Use bool for boolean.
1766 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1767 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1768
48c948de
CY
17692012-09-02 Chong Yidong <cyd@gnu.org>
1770
1771 * keymap.c (push_key_description): Print M-TAB as C-M-i
1772 (Bug#11758).
1773
6c49a40b
JB
17742012-09-02 Juanma Barranquero <lekktu@gmail.com>
1775
1776 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1777 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1778 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1779 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1780 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1781 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1782 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1783
4dfbd238
EZ
17842012-09-01 Eli Zaretskii <eliz@gnu.org>
1785
7e510e28
EZ
1786 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1787 more than one grapheme cluster passed to the shaper: compute the
1788 offset adjustment values separately for each cluster. (Bug#11860)
1789
4dfbd238
EZ
1790 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1791 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1792 about implicit conversions from integer to pointer.
1793
86571ae0
DC
17942012-09-01 Daniel Colascione <dancol@dancol.org>
1795
1796 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1797 system used too early.
1798
0e23ef9d
PE
17992012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1800
1801 Better seed support for (random).
1802 * emacs.c (main): Call init_random.
1803 * fns.c (Frandom): Set the seed from a string argument, if given.
1804 Remove long-obsolete Gentzel cruft.
1805 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1806 (init_random): New function.
1807
17a2cbbd
DC
18082012-09-01 Daniel Colascione <dancol@dancol.org>
1809
1810 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1811 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1812 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1813 x_wm_set_size_hint, x_query_colors, x_real_positions,
1814 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1815 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1816 all of which have been moved to common code.
1817
1818 * xfaces.c: Include TERM_HEADER instead of listing all possible
1819 window-system headers.
1820
1821 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1822 to match header.
1823
1824 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1825 directly accessing frame internals.
1826
f18cbb28 1827 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
1828 globals_of_w32font.
1829
1830 * process.c: Include TERM_HEADER instead of listing all possible
1831 window-system headers.
1832
3a880af4
SM
1833 * nsterm.h: Remove declarations now in frame.h.
1834 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
1835
1836 * menu.c: Include TERM_HEADER instead of listing all possible
1837 window-system headers.
1838
1839 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1840 window system.
1841
1842 * keyboard.c: Include TERM_HEADER instead of listing all possible
1843 window-system headers.
1844
1845 * image.c: Include TERM_HEADER instead of listing all possible
1846 window-system headers. Declare Vlibrary_cache when compiling for
1847 Windows.
1848
1849 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1850 window system declarations.
1851
1852 * frame.h: Move common functions here: set_frame_menubar,
1853 x_set_window_size, x_sync, x_get_focus_frame,
1854 x_set_mouse_position, x_set_mouse_pixel_position,
1855 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1856 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1857 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1858 x_activate_menubar, x_real_positions, x_bitmap_icon,
1859 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1860 and x_query_colors.
1861
1862 * frame.c: Include TERM_HEADER instead of listing all possible
1863 window-system headers.
1864
1865 * font.c: Include TERM_HEADER instead of listing all possible
1866 window-system headers.
1867
1868 * emacs.c: Include TERM_HEADER.
1869
f18cbb28
EZ
1870 * dispnew.c: Include TERM_HEADER instead of listing all possible
1871 window-system headers.
17a2cbbd 1872
f18cbb28 1873 * ccl.h: Include character.h.
17a2cbbd
DC
1874
1875 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1876 the current window system; include in list of objects to link into
1877 Emacs.
1878
c650a5de
DA
18792012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1880
1881 Remove mark_ttys function and fix tty_display_info initialization.
1882 * lisp.h (mark_ttys): Remove prototype.
1883 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1884 to mark_ttys because all possible values of 'top_frame' slot are
1885 the frames which are reachable from Vframe_list.
1886 * term.c (mark_ttys): Remove.
1887 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1888
4e0f6479
DA
18892012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1890
1891 Change struct frame bitfields from unsigned char to unsigned.
1892 * frame.h (struct frame): Change type of 'display_preempted',
1893 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1894 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1895 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1896 bitfields from unsigned char to unsigned.
1897
8b96a52c
DA
18982012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1899
1900 Remove unused member of struct x_output and struct w32_output.
1901 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1902 * w32term.h (struct w32_output): Likewise.
1903
b4444c8a
JD
19042012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1905
1906 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1907 does not become zero (Bug#12234).
1908
b98521db
PE
19092012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1910
1911 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1912 for GCC 4.7.1 x86-64.
1913
31d02438
GM
19142012-08-30 Glenn Morris <rgm@gnu.org>
1915
1916 * lread.c (init_lread): For out-of-tree builds, only add the
1917 source directory's site-lisp dir to the load-path if it exists,
1918 consistent with in-tree builds. (Bug#12302)
1919
7f8941d8
JD
19202012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1921
1922 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 1923 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
1924 (windowShouldClose:): Set window_closed.
1925 (dealloc): New member, free button_values.
fc0c31f8
JB
1926 (process_dialog:): Make member function. Remove window argument,
1927 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
1928 in button_values.
1929 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 1930 with tag. Remove return self, declare return value as void.
7f8941d8
JD
1931 (addString:row:): Remove return self, declare return value as void.
1932 (addSplit): Remove return self, declare return value as void.
1933 (clicked:): Remove return self, declare return value as void.
fc0c31f8 1934 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
1935 (initFromContents:isQuestion:): Adjust call to process_dialog.
1936 Code formatting change.
1937 (timeout_handler:): Set timer_fired to YES.
1938 (runDialogAt:): Set timer_fired to NO.
1939 Handle click on close button as quit.
1940
1941 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1942 Add window_closed and button_values. Add void as return value for
1943 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1944 Add process_dialog as new member.
1945
eada0861 19462012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 1947
eada0861
GM
1948 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1949 is not one of the heaps we manage. (Bug#12242)
1950
19512012-08-28 Glenn Morris <rgm@gnu.org>
1952
1953 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1954
457294dd
MR
19552012-08-28 Martin Rudalics <rudalics@gmx.at>
1956
1957 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
1958 auto-buffer-name window parameter. Install revision of reverted
1959 fix.
457294dd 1960
4f2daf31
DA
19612012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1962
1963 Do not allow to set major mode for a dead buffer.
1964 * buffer.c (Fset_buffer_major_mode): Signal an error
1965 if the buffer is dead.
1966 (Fother_buffer, other_buffer_safely): Remove redundant
1967 nested declaration.
1968
66322887
DA
19692012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1970
1971 Always use set_buffer_if_live to restore original buffer at unwind.
1972 * buffer.h (record_unwind_current_buffer): New function.
1973 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1974 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1975 * undo.c, window.c: Adjust users.
1976 * buffer.c (set_buffer_if_live): Fix comment.
1977
a3d794a1
DA
19782012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1979
1980 Fix usage of set_buffer_internal.
1981 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1982 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1983 * coding.c (decode_coding): Omit redundant test.
1984 * fileio.c (decide_coding_unwind): Likewise.
1985 * fns.c (secure_hash): Likewise.
1986 * insdel.c (modify_region): Likewise.
1987 * keyboard.c (command_loop_1): Likewise.
1988 * print.c (PRINTFINISH): Likewise.
1989 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1990
59ea14cd
PE
19912012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1992
1993 * dispnew.c: Use bool for boolean.
1994 (frame_garbaged, display_completed, delayed_size_change)
1995 (fonts_changed_p, add_window_display_history)
1996 (add_frame_display_history, verify_row_hash)
1997 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1998 (row_equal_p, realloc_glyph_pool)
1999 (allocate_matrices_for_frame_redisplay)
2000 (showing_window_margins_p)
2001 (adjust_frame_glyphs_for_frame_redisplay)
2002 (build_frame_matrix_from_leaf_window, make_current)
2003 (mirrored_line_dance, mirror_line_dance, update_frame)
2004 (update_window_tree, update_single_window)
2005 (check_current_matrix_flags, update_window, update_text_area)
2006 (update_window_line, set_window_update_flags, scrolling_window)
2007 (update_frame_1, scrolling, buffer_posn_from_coords)
2008 (do_pending_window_change, change_frame_size)
2009 (change_frame_size_1, sit_for):
2010 Use bool for boolean.
2011 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2012 and remove last int (actually boolean) argument, which was always 0.
2013 All callers changed.
2014 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2015 * dispextern.h (struct composition_it): Use bool for boolean.
2016 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2017 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2018 * dired.c (file_name_completion):
2019 Use bool for boolean. (This was missed in an earlier change.)
2020
95072a94
MR
20212012-08-27 Martin Rudalics <rudalics@gmx.at>
2022
2023 * window.c (Fset_window_configuration): Revert first part of
2024 last change.
2025
0f19feff
JD
20262012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2027
2028 * nsterm.h (NSPanel): New class variable dialog_return.
2029
3a880af4
SM
2030 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2031 Initialize dialog_return.
0f19feff
JD
2032 (windowShouldClose:): Use stop instead of stopModalWithCode.
2033 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2034 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2035 event.
2036 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2037 modal loop returns.
2038
f10fe38f
PE
20392012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2040
de1339b0
PE
2041 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2042 * composite.c (find_composition, composition_gstring_p)
2043 (composition_reseat_it, find_automatic_composition):
2044 * data.c (let_shadows_buffer_binding_p)
2045 (let_shadows_global_binding_p, set_internal, make_blv)
2046 (Fmake_variable_buffer_local, Fmake_local_variable)
2047 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2048 (cons_to_signed, arith_driver):
2049 * dbusbind.c (xd_in_read_queued_messages):
2050 * dired.c (directory_files_internal, file_name_completion):
2051 Use bool for booleans.
2052 * dired.c (file_name_completion):
2053 * process.h (fd_callback):
2054 Omit int (actually boolean) argument. It wasn't being used.
2055 All uses changed.
2056 * composite.h, lisp.h: Reflect above API changes.
2057
f10fe38f
PE
2058 * cmds.c, coding.c: Use bool for booleans.
2059 * cmds.c (move_point, Fself_insert_command):
2060 * coding.h (struct composition status, struct coding_system):
2061 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2062 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2063 (emacs_mule_char, decode_coding_emacs_mule)
2064 (encode_coding_emacs_mule, detect_coding_iso_2022)
2065 (decode_coding_iso_2022, encode_invocation_designation)
2066 (encode_designation_at_bol, encode_coding_iso_2022)
2067 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2068 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2069 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2070 (encode_coding_raw_text, detect_coding_charset)
2071 (decode_coding_charset, encode_coding_charset, detect_eol)
2072 (detect_coding, get_translation_table, produce_chars)
2073 (consume_chars, reused_workbuf_in_use)
2074 (make_conversion_work_buffer, code_conversion_save)
2075 (decode_coding_object, encode_coding_object)
2076 (detect_coding_system, char_encodable_p)
2077 (Funencodable_char_position, code_convert_region)
2078 (code_convert_string, code_convert_string_norecord)
2079 (Fset_coding_system_priority):
2080 * fileio.c (Finsert_file_contents):
2081 Use bool for booleans.
2082 * coding.h, lisp.h: Reflect above API changes.
2083 * coding.c: Remove unnecessary static function decls.
2084 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2085 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2086 not a boolean 'int', since callers never look at the return value.
2087 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2088 * coding.h (decoding_buffer_size, encoding_buffer_size)
2089 (emacs_mule_string_char): Remove unused extern decls.
2090 (struct iso_2022_spec, struct coding_system):
2091 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2092 (struct emacs_mule_spec): Remove unused field 'full_support'.
2093 All initializations removed.
2094 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2095
5474c384
DA
20962012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2097
f10fe38f 2098 Fix spare memory change (Bug#12286).
5474c384
DA
2099 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2100 (valid_lisp_object_p): Likewise.
2101
c4b6914d
MR
21022012-08-27 Martin Rudalics <rudalics@gmx.at>
2103
2104 * window.c (Fset_window_configuration): Record any window's old
2105 buffer if it's replaced (see Bug#8789). If the new current
2106 buffer doesn't appear in the selected window, go to its old
2107 point (Bug#12208).
2108
35aaa1ea
DA
21092012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2110
2111 Special MEM_TYPE_SPARE to denote reserved memory.
2112 * alloc.c (enum mem_type): New memory type.
2113 (refill_memory_reserve): Use new type for spare memory.
2114 This prevents live_cons_p and live_string_p from incorrect
2115 detection of uninitialized objects from spare memory as live.
2116
6af64513
PE
21172012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2118
8b2e00a3
PE
2119 Spelling fixes.
2120 * Makefile.in (.PHONY): versioclean -> versionclean.
2121
b52d6985
PE
2122 Remove unused external symbols.
2123 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2124 * window.c (Qwindow_valid_p, decode_valid_window):
2125 Now static, not extern.
2126 * data.c (Qinterval): Remove; unused.
2127 (syms_of_data): Do not define 'interval'.
2128 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2129 * window.h (decode_valid_window):
2130 Remove decls.
2131
d5172d4f
PE
2132 * character.c, charset.c, chartab.c: Use bool for booleans.
2133 * character.c (lisp_string_width, string_count_byte8)
2134 (string_escape_byte8):
2135 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2136 (load_charset_map_from_file, map_charset_chars)
2137 (Fdefine_charset_internal, define_charset_internal)
2138 (Fdeclare_equiv_charset, find_charsets_in_text)
2139 (Ffind_charset_region, char_charset, Fiso_charset):
2140 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2141 (sub_char_table_set, sub_char_table_set_range)
2142 (char_table_set_range, optimize_sub_char_table)
2143 (map_sub_char_table):
2144 Use bool for boolean.
2145 * character.c (str_to_unibyte): Omit last boolean argument; it was
2146 always 0. All callers changed.
2147 * character.h, charset.h: Adjust to match previous changes.
2148 * character.h (char_printable_p): Remove decl of nonexistent function.
2149 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2150 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2151 are all boolean, so make them single-bit bitfields.
2152
6af64513
PE
2153 * lisp.h (ASET): Remove attempt to detect side effects.
2154 It was meant to be temporary and it often doesn't work,
2155 because when IDX has side effects the behavior of IDX==IDX
2156 is undefined. See Stefan Monnier in
2157 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2158
e1f29348
BR
21592012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2160
2161 * lisp.h (functionp): New function (extracted from Ffunctionp).
2162 (FUNCTIONP): Use it.
2163 * eval.c (Ffunctionp): Use it.
2164
17c05d74
PE
21652012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2166
0f46bc75
PE
2167 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2168 as that's faster and simpler than static storage. Don't bother
2169 with the g_main_context_query overhead if g_main_context_pending
2170 says no events are pending.
2171 (gfds, gfds_size): Remove these static vars.
2172 (xgselect_initialize): Remove; no longer needed.
2173 All uses and decls removed.
2174
ee4c0f69
PE
2175 * emacs.c (fatal_error_signal_hook): Remove.
2176 All uses removed. This leftover from old code was always 0.
2177
17c05d74
PE
2178 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2179 * casefiddle.c (casify_object, casify_region):
2180 * casetab.c (set_case_table):
2181 * category.c, category.h (word_boundary_p):
2182 * category.h (CHAR_HAS_CATEGORY):
2183 Use bool for booleans, instead of int.
2184
391ceac5
EZ
21852012-08-25 Eli Zaretskii <eliz@gnu.org>
2186
2187 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2188
2f221583
PE
21892012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2190
f4a681b0
PE
2191 On assertion failure, print backtrace if available.
2192 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2193 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2194 * Makefile.in (LIB_EXECINFO): New macro.
2195 (LIBES): Use it.
2196
2f221583
PE
2197 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2198 * bytecode.c (exec_byte_code):
2199 * callint.c (check_mark, Fcall_interactively):
2200 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2201 (getenv_internal, sync_process_alive, call_process_exited):
2202 * lisp.h (USE_SAFE_ALLOCA):
2203 Use bool for booleans, instead of int.
2204 * lisp.h, process.h: Adjust prototypes to match above changes.
2205 * callint.c (Fcall_interactively): Don't assume the mark's
2206 offset fits in 'int'.
2207
37ef52bb
PE
22082012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2209
2210 * buffer.c, buffer.h: Use bool for boolean.
2211 * buffer.c (reset_buffer_local_variables)
2212 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2213 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2214 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2215 (overlay_touches_p, overlay_strings, Foverlay_put)
2216 (report_overlay_modification, call_overlay_mod_hooks):
2217 (mmap_enlarge, mmap_set_vars):
2218 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2219 Use bool for booleans, instead of int.
2220 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2221 since the 1-or-0 return value is always ignored anyway.
2222 (mmap_initialized_p):
2223 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2224 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2225
2cc21167
PE
22262012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2227
2228 * bidi.c: Use bool for boolean.
2229 This is a bit more readable, and makes the text segment of bidi.o
2230 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2231 Presumably it's faster too.
2232 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2233 Now bool.
2234 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2235 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2236 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2237 (bidi_explicit_dir_char, bidi_level_of_next_char)
2238 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2239 Use bool for booleans, instead of int.
2240 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2241 (bidi_unshelve_cache): Adjust decls to match code.
2242
7db4ddf4
MR
22432012-08-23 Martin Rudalics <rudalics@gmx.at>
2244
2245 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2246 argument.
2247
b1bb8011
PE
22482012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2249
2250 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2251 * atimer.h: Include <stdbool.h>.
2252
ff687885
DN
22532012-08-22 Dan Nicolaescu <dann@gnu.org>
2254
2255 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2256 compile time tests instead of run time tests on systems that do
2257 not use them.
2258 (FRAME_MAC_P): Remove leftover from deleted code.
2259 * frame.c (syms_of_frame): Remove leftover from deleted code.
2260
4ce7a138
JD
22612012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2262
2263 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2264
d733ec6d
PE
22652012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2266
2267 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2268 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 2269 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
2270 (fontset_add): Return void, for FONTSET_ADD.
2271
d0d2d26f
PE
22722012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2273
fce31d69
PE
2274 * alloc.c: Use bool for booleans.
2275 (gc_in_progress, abort_on_gc)
2276 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2277 (dont_register_blocks) [GC_MALLOC_CHECK]:
2278 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2279 (check_string_bytes, make_specified_string, memory_full)
2280 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2281 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2282 (mark_stack, valid_pointer_p, make_pure_string)
2283 (Fgarbage_collect, survives_gc_p, gc_sweep):
2284 Use bool for booleans, instead of int.
2285 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2286 Remove unused local.
2287 * alloc.c (PURE_POINTER_P):
2288 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2289 * editfns.c (Fformat):
2290 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2291 (Fdo_auto_save):
2292 * fns.c (sweep_weak_table):
2293 * lisp.h (suppress_checking, push_message, survives_gc_p)
2294 (make_pure_string, gc_in_progress, abort_on_gc):
2295 * lread.c (readchar, read1):
2296 * print.c (Fprin1_to_string):
2297 * xdisp.c (push_message):
2298 Use bool for booleans affected directly or indirectly by
2299 alloc.c's changes.
2300
d0d2d26f
PE
2301 Make recently-introduced setters macros.
2302 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2303 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2304 (set_fontset_default, set_fontset_fallback): Rename from their
2305 upper-case counterparts, and make them functions rather than macros.
2306 This is more consistent with the other recently-introduced setters.
2307 These don't need to be inline, since they're local.
2308
d18e2bb6
JD
23092012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2310
2311 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2312 the loop (Bug#12247).
2313
1b9d9d16
PE
23142012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2315
2316 * lisp.h (vcopy): Use memcpy rather than our own loop.
2317 This fixes a performance regression introduced by the recent
2318 addition of vcopy. This means 'vcopy' will need to be modified
2319 for a copying collector, but that's OK. Also, tighten the
2320 checking in the assertion.
2321
b2f09701
EZ
23222012-08-21 Eli Zaretskii <eliz@gnu.org>
2323
2324 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2325 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2326 non-base glyph for the width of the base character, according to
e1f29348
BR
2327 what x_draw_composite_glyph_string_foreground expects.
2328 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
2329 expectations, to produce correct width of the composed character.
2330 Reverse the sign of the DU offset produced by ScriptPlace.
2331
9b994fed
PE
23322012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2333
2334 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2335
086ca913
DA
23362012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2337
2338 Avoid direct writes to contents member of struct Lisp_Vector.
2339 * lisp.h (vcopy): New function to copy data into vector.
2340 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2341 * fns.c (Ffillarray): Use ASET.
2342 * keyboard.c (timer_check_2): Use AREF and ASET.
2343 (append_tool_bar_item, Frecent_keys): Use vcopy.
2344 * lread.c (read_vector): Use ASET.
2345 * msdos.c (Frecent_doskeys): Use vcopy.
2346 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2347 (Finternal_merge_in_global_face): Use ASET and vcopy.
2348 * xfont.c (xfont_list_pattern): Likewise.
2349
5481664a
MR
23502012-08-21 Martin Rudalics <rudalics@gmx.at>
2351
2352 * window.c (Fwindow_point): For the selected window always return
2353 the position of its buffer's point.
2354 (Fset_window_point): For the selected window always go in its
2355 buffer to the specified position.
2356
6d470bdd
DA
23572012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2358
2359 Setter macros for fontsets.
2360 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2361 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2362 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2363 Adjust users.
2364
24564fe1
GM
23652012-08-20 Glenn Morris <rgm@gnu.org>
2366
2367 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2368 Don't assume that `ln -f' works.
2369
0a05a035
EZ
23702012-08-20 Eli Zaretskii <eliz@gnu.org>
2371
2372 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2373 and later about non-assignments with no effect. See discussion at
2374 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2375 details.
2376
e46f2325
DA
23772012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2378
2379 Inline setter functions for Lisp_Objects slots of struct specbinding.
2380 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2381 Adjust users.
2382
734fbd86
MR
23832012-08-20 Martin Rudalics <rudalics@gmx.at>
2384
2385 * window.c (select_window): Always make selected window's buffer
2386 current.
2387
f1a95992
DA
23882012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2389
2390 Use AREF and ASET for docstrings of category tables.
2391 * category.h (CATEGORY_DOCSTRING): Use AREF.
2392 (SET_CATEGORY_DOCSTRING): Use ASET.
2393 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2394
e83064be
DA
23952012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2396
2397 Inline setter functions for hash table members.
2398 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2399 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2400 (set_hash_key_and_value, set_hash_index, set_hash_next)
2401 (set_hash_hash): New functions.
2402 * charset.c, fns.c: Adjust users.
2403
4ce60d2e
DA
24042012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2405
2406 Inline getter and setter functions for per-buffer values.
2407 * buffer.h (per_buffer_default, set_per_buffer_default)
2408 (per_buffer_value, set_per_buffer_value): New functions.
2409 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2410 * buffer.c, data.c: Adjust users.
2411
c06c9690
JB
24122012-08-20 Juanma Barranquero <lekktu@gmail.com>
2413
2414 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2415
32bd4250
PE
24162012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2417
bad03192 2418 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
2419 as gnulib does this if the system doesn't.
2420 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
2421 Remove declaration. MS-Windows declares it on stdlib.h which is
2422 included by conf_post.h.
b69a6d22
PE
2423 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2424 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2425 * vm-limit.c: Include <unistd.h>, for 'environ'.
2426
22d7feb2
PE
2427 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2428 (start_of_data): Remove decl; mem-limits.h provides it.
2429
32bd4250
PE
2430 * xdisp.c (handle_invisible_prop): Make it a bit faster
2431 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2432
450809af
CY
24332012-08-19 Chong Yidong <cyd@gnu.org>
2434
2435 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2436 ends (Bug#3874).
2437
9e677988
AS
24382012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2439
6b1319ce
AS
2440 * .gdbinit: Use call instead of set when calling a function in the
2441 inferior.
2442
9e677988
AS
2443 * data.c (set_internal): Don't use set_blv_found.
2444 (Fkill_local_variable): Likewise.
2445
d7191076
AA
24462012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2447
2448 * nsfont.m (ns_ascii_average_width): Ensure the string
2449 ascii_printable is initialized with a null-terminated character
2450 array. Otherwise, it can contain undesired extra characters.
2451
e757f1c6
PE
24522012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2453
2454 port new setting code to Sun C 5.8 2005/10/13
2455 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2456 Return void, not Lisp_Object. Otherwise, the compiler
2457 complains about (A?B:C) where B is void and C is Lisp_Object
2458 when compiling CHAR_TABLE_SET, due to the recent change to
2459 the API of sub_char_table_set_contents.
2460
a999ce26
CY
24612012-08-18 Chong Yidong <cyd@gnu.org>
2462
2463 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2464 for the string case (Bug#3874).
2465
3f22b86f
PE
24662012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2467
39eb03f1
PE
2468 * buffer.h (BSET): Remove (Bug#12215).
2469 Replace all uses with calls to new setter functions.
2470 (bset_bidi_paragraph_direction, bset_case_canon_table)
2471 (bset_case_eqv_table, bset_directory, bset_display_count)
2472 (bset_display_time, bset_downcase_table)
2473 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2474 (bset_last_selected_window, bset_local_var_alist)
2475 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2476 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2477 (bset_width_table):
2478 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2479 (bset_auto_fill_function, bset_auto_save_file_format)
2480 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2481 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2482 (bset_cache_long_line_scans, bset_case_fold_search)
2483 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2484 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2485 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2486 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2487 (bset_header_line_format, bset_indicate_buffer_boundaries)
2488 (bset_indicate_empty_lines, bset_invisibility_spec)
2489 (bset_left_fringe_width, bset_major_mode, bset_mark)
2490 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2491 (bset_name, bset_overwrite_mode, bset_pt_marker)
2492 (bset_right_fringe_width, bset_save_length)
2493 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2494 (bset_scroll_up_aggressively, bset_selective_display)
2495 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2496 (bset_word_wrap, bset_zv_marker):
2497 * category.c (bset_category_table):
2498 * syntax.c (bset_syntax_table):
2499 New setter functions.
2500
6a09a33b
PE
2501 * process.h (PSET): Remove (Bug#12215).
2502 Replace all uses with calls to new setter functions.
2503 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2504 (PROCESS_INLINE): New macro.
2505 (pset_childp): New setter function.
2506 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2507 * process.c (PROCESS_INLINE):
2508 Define to EXTERN_INLINE, so that the corresponding functions
2509 are compiled into code.
2510 (pset_buffer, pset_command, pset_decode_coding_system)
2511 (pset_decoding_buf, pset_encode_coding_system)
2512 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2513 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2514 (pset_type, pset_write_queue): New setter functions.
2515
e8c17b81
PE
2516 * window.h (WSET): Remove (Bug#12215).
2517 Replace all uses with calls to new setter functions.
2518 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2519 (WINDOW_INLINE): New macro.
2520 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2521 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2522 (wset_total_lines, wset_vertical_scroll_bar)
2523 (wset_window_end_pos, wset_window_end_valid)
2524 (wset_window_end_vpos): New setter functions.
2525 * window.c (WINDOW_INLINE):
2526 Define to EXTERN_INLINE, so that the corresponding functions
2527 are compiled into code.
2528 (wset_combination_limit, wset_dedicated, wset_display_table)
2529 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2530 (wset_new_normal, wset_new_total, wset_next_buffers)
2531 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2532 (wset_prev_buffers, wset_right_fringe_width)
2533 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2534 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2535 (wset_window_parameters):
2536 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2537 (wset_column_number_displayed, wset_region_showing):
2538 New setter functions.
2539
3f22b86f
PE
2540 * termhooks.h (TSET): Remove (Bug#12215).
2541 Replace all uses with calls to new setter functions.
2542 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2543 (TERMHOOKS_INLINE): New macro.
2544 (tset_charset_list, tset_selection_alist): New setter functions.
2545 * terminal.c (TERMHOOKS_INLINE):
2546 Define to EXTERN_INLINE, so that the corresponding functions
2547 are compiled into code.
2548 (tset_param_alist): New setter function.
2549
742af32f
PE
25502012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2551
15dbb4d6
PE
2552 * keyboard.h (KSET): Remove (Bug#12215).
2553 Replace all uses with calls to new setter functions.
2554 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2555 (KEYBOARD_INLINE): New macro.
2556 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2557 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2558 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2559 New setter functions.
2560 * keyboard.c (KEYBOARD_INLINE):
2561 Define to EXTERN_INLINE, so that the corresponding functions
2562 are compiled into code.
2563 (kset_echo_string, kset_kbd_queue)
2564 (kset_keyboard_translate_table, kset_last_prefix_arg)
2565 (kset_last_repeatable_command, kset_local_function_key_map)
2566 (kset_overriding_terminal_local_map, kset_real_last_command)
2567 (kset_system_key_syms): New setter functions.
2568
f00af5b1
PE
2569 * frame.h (FSET): Remove (Bug#12215).
2570 Replace all uses with calls to new setter functions.
2571 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2572 (FRAME_INLINE): New macro.
2573 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2574 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2575 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2576 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2577 (fset_param_alist, fset_root_window, fset_scroll_bars)
2578 (fset_selected_window, fset_title, fset_tool_bar_items)
2579 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2580 * frame.c (FRAME_INLINE):
2581 Define to EXTERN_INLINE, so that the corresponding functions
2582 are compiled into code.
2583 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2584
0c94c8d6
PE
2585 A few more naming-convention fixes for getters and setters.
2586 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2587 and rename from buffer_overlays_set_before.
2588 (set_buffer_overlays_after): Move here from buffer.h, and rename
2589 from buffer_overlays_set_after.
2590 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2591 All uses changed.
2592 (set_buffer_intervals): Rename from buffer_set_intervals.
2593 * intervals.c (set_interval_object): Move here from intervals.h,
2594 and rename from interval_set_object.
2595 (set_interval_left): Move here from intervals.h, and rename from
2596 interval_set_left.
2597 (set_interval_right): Move here from intervals.h, and rename from
2598 interval_set_right.
2599 (copy_interval_parent): Move here from intervals.h, and rename from
2600 interval_copy_parent.
2601 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2602 (set_interval_plist): Rename from interval_set_plist.
2603 Return void, not Lisp_Object, since no caller uses the result.
2604 * lisp.h (string_intervals): Rename from string_get_intervals.
2605 (set_string_intervals): Rename from string_set_intervals.
2606
34dabdb7
PE
2607 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2608 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 2609 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
2610 All uses changed. See the end of
2611 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2612
742af32f
PE
2613 * lisp.h (CSET): Remove (Bug#12215).
2614 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2615 (set_char_table_purpose): New functions,
2616 replacing CSET. All uses changed. For example, replace
2617 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 2618 "set_char_table_parent (char_table, parent);".
742af32f
PE
2619 The old version was confusing because it used the same name
2620 'parent' for two different things.
2621
a04e2c62
DA
26222012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2623
2624 Functions to get and set Lisp_Object fields of buffer-local variables.
2625 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2626 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2627 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2628 * data.c, eval.c, frame.c: Adjust users.
2629
383dcbf9
CY
26302012-08-17 Chong Yidong <cyd@gnu.org>
2631
2632 * xfaces.c (merge_face_vectors): If the target font specfies a
2633 font spec, make the font's attributes take precedence over
2634 directly-specified attributes.
2635 (merge_face_ref): Recognize :font.
2636
44386687
DA
26372012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2638
2639 Do not use memcpy for copying intervals.
2640 * intervals.c (reproduce_interval): New function.
2641 (reproduce_tree, reproduce_tree_obj): Use it.
2642 (reproduce_tree_obj): Remove prototype.
2643
927c7216
PE
26442012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2645
2646 * lisp.h (duration_to_sec_usec): Remove unused decl.
2647
93044f7b
AA
26482012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2649
2650 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2651 to an allocated instance of NSString, not to the class itself.
2652
9851e4a5
JB
26532012-08-17 Juanma Barranquero <lekktu@gmail.com>
2654
2655 * makefile.w32-in (C_CTYPE_H): New macro.
2656 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2657 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2658 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2659
620f13b0
PE
26602012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2661
2662 Use ASCII tests for character types.
2663 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2664 * xfns.c, xterm.c:
2665 Don't include <ctype.h>; was not needed.
2666 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2667 * sysdep.c, xfaces.c:
2668 Include <c-ctype.h> instead of <ctype.h>.
2669 * nsterm.m: Include <c-ctype.h>.
2670 * charset.c (read_hex):
2671 * doc.c (Fsnarf_documentation):
2672 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2673 (DRIVE_LETTER) [DOS_NT]:
2674 (Ffile_name_directory, Fexpand_file_name)
2675 (Fsubstitute_in_file_name):
2676 * font.c (font_parse_xlfd, font_parse_fcname):
2677 * frame.c (x_set_font_backend):
2678 * gtkutil.c (xg_get_font):
2679 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2680 * nsimage.m (hexchar):
2681 * nsterm.m (ns_xlfd_to_fontname):
2682 * sysdep.c (system_process_attributes):
2683 * xfaces.c (hash_string_case_insensitive):
2684 Use C-locale tests instead of locale-specific tests for character
2685 types, since we want the ASCII interpretation here, not the
2686 interpretation suitable for whatever happens to be the current locale.
2687
52162052
MR
26882012-08-16 Martin Rudalics <rudalics@gmx.at>
2689
2690 Consistently check windows for validity/liveness
2691 (Bug#11984, Bug#12025, Bug#12026).
2692 * lisp.h (CHECK_VALID_WINDOW): New macro.
2693 * window.c (decode_window): Rename to decode_live_window.
2694 (decode_valid_window, Fwindow_valid_p): New functions.
2695 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2696 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2697 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2698 (Fwindow_prev_sibling, Fwindow_combination_limit)
2699 (Fset_window_combination_limit, Fwindow_use_time)
2700 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2701 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2702 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2703 (Fwindow_hscroll, Fset_window_hscroll)
2704 (Fwindow_redisplay_end_trigger)
2705 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2706 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2707 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2708 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2709 (Fwindow_end, Fset_window_point, Fset_window_start)
2710 (Fpos_visible_in_window_p, Fwindow_line_height)
2711 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2712 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2713 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2714 (Fset_window_parameter, Fwindow_display_table)
2715 (Fset_window_display_table, Fdelete_other_windows_internal)
2716 (Fset_window_buffer, Fset_window_new_total)
2717 (Fset_window_new_normal, Fdelete_window_internal)
2718 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2719 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2720 (Fwindow_scroll_bars): Check whether argument window is a valid or
2721 live window. Update doc-strings.
2722 (syms_of_window): New symbol Qwindow_valid_p.
2723 * keyboard.c (Fposn_at_x_y): Check whether argument
2724 frame_or_window denotes a valid window.
2725
2751c80f
DA
27262012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2727
2728 Fix previous char table change.
2729 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2730 * chartab.c (optimize_sub_char_table): Likewise.
2731
032a42c8
CY
27322012-08-16 Chong Yidong <cyd@gnu.org>
2733
a2d19368
CY
2734 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2735
032a42c8
CY
2736 * xfont.c (xfont_open):
2737 * xftfont.c (xftfont_open): Set the font's max_width field.
2738
2739 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2740 min_width to space_width and average_width to the average over
2741 printable ASCII characters.
2742 (ns_char_width): Code cleanup.
2743 (ns_ascii_average_width): New utility function.
2744
2745 * font.h (struct font): Update comments.
2746
a098c930
DA
27472012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2748
032a42c8 2749 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
2750 * lisp.h (CSET): New macro.
2751 (char_table_set_extras, char_table_set_contents)
2752 (sub_char_table_set_contents): New function.
2753 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2754 * syntax.c: Adjust users.
2755
8be3a09c
SM
27562012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2757
2758 * eval.c (eval_sub): Bind lexical-binding.
2759 * lread.c (Qlexical_binding): Make non-static.
2760
ac4845a6
JD
27612012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2762
ddee6515
JD
2763 * nsmenu.m (popupSession): Remove.
2764 (pop_down_menu): Remove endModalSession.
2765 (timeout_handler:): New method.
2766 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2767 Call runModalForWindow. Check timer_fired when it returns.
2768 If not set, cancel timer and break out of loop.
2769 Otherwise loop again, with a new timeout.
2770
2771 * nsterm.m: Include fcntl.h if present.
2772 (fd_entry, t_readfds, inNsSelect): Remove.
2773 (select_writefds, select_valid, select_timeout, selfds)
2774 (select_mutex, apploopnr): Add.
2775 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2776 Otherwise call kbd_buffer_store_event.
2777 (ns_send_appdefined): Remove release of fd_entry.
2778 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2779 Increment and decrement apploopnr.
2780 (ns_select): If no file descriptors, just do a NSTimer.
2781 Otherwise copy read/write masks and start select thread (fd_handler).
2782 Start main loop and wait for application defined event.
2783 Inform select thread to stop selecting after main loop is exited.
2784 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 2785 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
2786 (fd_handler:): Loop forever, wait for info from the main thread
2787 to either start or stop selecting. When select returns, send
2788 and appdefined event.
2789 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2790 If not call kbd_buffer_store_event.
2791
2792 * nsterm.h (EmacsApp): fd_handler takes id argument.
2793 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2794
ac4845a6
JD
2795 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2796
eb424fe3
EZ
27972012-08-15 Eli Zaretskii <eliz@gnu.org>
2798
2799 * region-cache.c (move_cache_gap): Update gap_len using the actual
2800 growth of the boundaries array. Do not change cache_len.
2801 (Bug#12196)
2802
4e6a86c6
DA
28032012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2804
2805 Generalize and cleanup font subsystem checks.
2806 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
2807 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2808 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 2809
5bf192ca
DA
28102012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2811
2812 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2813
f2045622
CY
28142012-08-15 Chong Yidong <cyd@gnu.org>
2815
8be3a09c
SM
2816 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2817 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2818 extract the font descriptor instead of just the font name.
2819 In that case, return a font spec instead of a string.
f2045622
CY
2820 (x_last_font_name): Move to this file from xfns.c.
2821
2822 * xfns.c (Fx_select_font): The return value can also be a font
2823 spec. Move x_last_font_name management to gtkutil.c.
2824
2825 * xfaces.c: Make font weight and style symbols non-static.
2826
7f6feb56
SM
28272012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2828
2829 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2830 (bug#12117).
2831
fecbd8ff
SM
28322012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2833
2834 * alloc.c (Fgarbage_collect): Use plural form consistently.
2835
9b8d5165
EZ
28362012-08-14 Eli Zaretskii <eliz@gnu.org>
2837
2838 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2839 iteration through the command loop. Fixes a problem whereby mouse
2840 movements are ignored until the first mouse click.
2841
f5d9e83a
PE
28422012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2843
2844 Use bool, not int, for Lisp booleans.
2845 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2846 makes Emacs a bit smaller and presumably a bit faster.
2847 * lisp.h: Include <stdbool.h>.
2848 (struct Lisp_Boolfwd, defvar_bool):
2849 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2850 * regex.c [!emacs]: Include <stdbool.h>.
2851 (false, true): Remove; <stdbool.h> does this for us now.
2852
55802e4a
CY
28532012-08-14 Chong Yidong <cyd@gnu.org>
2854
4abcdac8
CY
2855 * character.c (Fcharacterp): Doc fix (Bug#12076).
2856
2857 * data.c (Findirect_variable): Doc fix (Bug#11040).
2858
55802e4a
CY
2859 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2860
2861 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 2862 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 2863
8e99d072
BR
28642012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2865
2866 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2867 (bug#12022).
2868
08908aca
MR
28692012-08-14 Martin Rudalics <rudalics@gmx.at>
2870
2871 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2872 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2873 * minibuf.c (choose_minibuf_frame, read_minibuf):
2874 * w32fns.c (x_create_tip_frame):
2875 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2876 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2877
56120d6f
PE
28782012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2879
2880 * intervals.c (offset_intervals): Remove obsolete comment.
2881
67b77c0b
AS
28822012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2883
2884 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2885
f48b82fd
GR
28862012-08-14 Gergely Risko <gergely@risko.hu>
2887
2888 * coding.c (decode_coding): Record buffer modification before
2889 disabling undo_list (Bug#11773).
2890
fd318b54
DA
28912012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2892
2893 Revert and cleanup some recent overlay changes.
2894 * buffer.h (enum overlay_type): Remove.
2895 (buffer_get_overlays, buffer_set_overlays): Likewise.
2896 (buffer_set_overlays_before, buffer_set_overlays_after):
2897 New function. Adjust users.
2898 (unchain_both): Add eassert.
2899
41a62dd9
DA
29002012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2901
2902 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2903
5884c324
PE
29042012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2905
2906 * gtkutil.c (xg_mark_data): Don't assume C99.
2907
ca06f160
JD
29082012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2909
2910 * gtkutil.c (xg_frame_tb_info): New struct.
2911 (TB_INFO_KEY): New define.
2912 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2913 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2914 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2915 if not present.
2916 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 2917 is up to date. Otherwise store new data.
ca06f160
JD
2918 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2919
7864a3f7
DA
29202012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2921
2922 Use KSET for write access to Lisp_Object members of struct kboard.
2923 * keyboard.h (KSET): New macro.
2924 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2925 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2926 * xterm.c: Adjust users.
2927
4c31be61
DA
29282012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2929
2930 Use BSET for write access to Lisp_Object members of struct buffer.
2931 * buffer.h (BSET): New macro.
2932 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2933 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2934 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2935 * window.c, xdisp.c, xfns.c: Adjust users.
2936
14ae4239
BT
29372012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2938
2939 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2940
32bcadb4
JD
29412012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2942
3d29b2ce 2943 * nsterm.m (not_in_argv): New function.
fc0c31f8 2944 (application:openFile, application:openTempFile:):
3d29b2ce
JD
2945 (application:openFileWithoutUI:, application:openFiles:): Open file
2946 if not_in_argv returns non-zero (bug#12171).
2947
32bcadb4 2948 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
2949 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2950 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
2951 (xg_get_font_name): Use those functions/macros here.
2952 Reported by Frans Oilinki <moilinki@gmail.com>.
2953
9ff9402d 29542012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
2955
2956 * unexmacosx.c (copy_data_segment): Copy initialized data in
2957 statically linked libraries from input file rather than memory.
2958
db74a5fc
YM
2959 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2960 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2961 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2962
25e65510
GM
29632012-08-10 Glenn Morris <rgm@gnu.org>
2964
2965 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2966 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2967
7961135c
DA
29682012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2969
2970 Fix last change to allow compilation with low optimization levels.
2971 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2972 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2973
42b3a444
DA
29742012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2975
2976 Use common inline syntax in intervals.h.
2977 * intervals.h (INTERVALS_INLINE): New macro.
2978 Change all users from LISP_INLINE.
2979
9fb0c957
DA
29802012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2981
2982 Define Qnone once for all platforms.
2983 * frame.c (Qnone): Define here.
2984 (syms_of_frame): DEFSYM it.
2985 * lisp.h (Qnone): New declaration.
2986 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2987 * xfns.c: Remove duplication. Adjust users.
2988
65e8ee52
DA
29892012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2990
2991 Remove unused macros from intervals.h.
2992 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2993 * intervals.c: Adjust comment.
2994
9b855fd6
EZ
29952012-08-10 Eli Zaretskii <eliz@gnu.org>
2996
2997 * w32fns.c <w32_unicode_gui>: New static variable.
2998 (globals_of_w32fns): Initialize it according to os_subtype.
2999 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3000 testing os_subtype.
3001
39cb9e56 30022012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
3003 Eli Zaretskii <eliz@gnu.org>
3004
3005 Fix bug #10299 with Unicode characters sent by customized
3006 keyboards created by MSKLC.
3007 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3008 (w32_init_class): Use it to initialize the Emacs class with either
3009 ANSI or Unicode API calls.
3010 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3011 later.
3012 (w32_wnd_proc): If the character code sent by WM_CHAR or
3013 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3014 original message. Call DefWindowProcW on NT and later.
3015
9374581a
GM
30162012-08-10 Glenn Morris <rgm@gnu.org>
3017
4b94e8cf
GM
3018 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3019
9374581a
GM
3020 * lisp.h (DIRECTORY_SEP): Let configure set it.
3021
a2752828
DA
30222012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3023
3024 Use TSET for write access to Lisp_Object slots of struct terminal.
3025 * termhooks.h (TSET): New macro.
3026 * coding.c, terminal.c, xselect.c: Adjust users.
3027
cc92c454
SM
30282012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3029
3030 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3031 the failing expression, include them in the error message.
3032 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3033 * lisp.h (internal_condition_case_n): Update declaration.
3034
4cb3e6b3
DA
30352012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3036
3037 Inline functions to examine and change buffer overlays.
3038 * buffer.c (unchain_both): New function.
3039 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3040 (buffer_has_overlays): New function.
3041 (enum overlay_type): New enum.
3042 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3043 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3044
8707c1e5
DA
30452012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3046
3047 Inline functions to examine and change buffer intervals.
3048 * alloc.c (mark_interval_tree): Remove.
3049 (MARK_INTERVAL_TREE): Simplify.
3050 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3051 * intervals.c (buffer_balance_intervals): New function.
3052 (graft_intervals_into_buffer): Adjust indentation.
3053 (set_intervals_multibyte): Simplify.
3054 * buffer.h (BUF_INTERVALS): Remove.
3055 (buffer_get_intervals, buffer_set_intervals): New function.
3056 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3057 * intervals.c, textprop.c: Adjust users.
3058
ad8c997f
DA
30592012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3060
3061 Inline functions to examine and change string intervals.
3062 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3063 (string_get_intervals, string_set_intervals): New function.
3064 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3065 * lread.c, print.c, textprop.c: Adjust users.
3066
32ac3a6b
GM
30672012-08-08 Glenn Morris <rgm@gnu.org>
3068
3069 * lisp.mk (lisp): Remove language/persian.elc.
3070
77c7bcb1
DA
30712012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3072
3073 Cleanup intervals.
3074 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3075 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
3076 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3077 Adjust comment. Move under #if 0.
77c7bcb1
DA
3078 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3079 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3080
9c08a8d4
DA
30812012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3082
3083 Check total length of intervals with eassert.
3084 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3085 * intervals.c: Change all users to eassert.
3086
26d16b35
EZ
30872012-08-07 Eli Zaretskii <eliz@gnu.org>
3088
14ae4239
BT
3089 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3090 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
3091 INTERNAL_FIELD in Lisp_Cons.
3092
c644523b
DA
30932012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3094
3095 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3096 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3097 name since all xname users are fixed long time ago. Do not
3098 use INTERNAL_FIELD.
3099 (set_symbol_name, set_symbol_function, set_symbol_plist):
3100 (set_symbol_next, set_overlay_plist): New function.
3101 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3102 (struct Lisp_Overlay): Likewise.
3103 (CVAR, MVAR, SVAR): Remove.
3104 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3105 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3106 * xterm.c: Adjust users.
3107 * .gdbinit: Change to use name field of struct Lisp_Symbol
3108 where appropriate.
3109
6a3d20cc
DA
31102012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3111
3112 Basic functions to set Lisp_Object and pointer slots of intervals.
3113 * intervals.h (interval_set_parent, interval_set_object):
3114 (interval_set_left, interval_set_right, interval_set_plist):
3115 (interval_copy_parent): New function.
3116 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
3117 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3118 Adjust indentation.
6a3d20cc
DA
3119 (INTERVAL_SIZE): Remove. Adjust users.
3120 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3121
4d2b044c
DA
31222012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3123
3124 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3125 * process.h (PGET): Remove.
3126 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3127 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3128
d3d50620
DA
31292012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3130
3131 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3132 * window.h (WGET): Remove.
3133 (struct window): Do not use INTERNAL_FIELD.
3134 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3135 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3136 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3137 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3138 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3139 Adjust users.
3140
d10a51dc
CY
31412012-08-07 Chong Yidong <cyd@gnu.org>
3142
3143 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3144 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3145 (Fdelete_window_internal): Signal an error if the window is not on
3146 a live frame (Bug#12025).
3147
e69b0960
DA
31482012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3149
3150 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3151 * frame.h (FGET): Remove.
3152 (struct frame): Do not use INTERNAL_FIELD.
3153 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3154 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3155 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3156 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3157
25a20a3a
JB
31582012-08-06 Juanma Barranquero <lekktu@gmail.com>
3159
3160 * w32.c: Silence compiler warnings.
3161 (map_w32_filename): Remove unused variable `is_fat'.
3162 (chase_symlinks): Add parentheses around expression.
3163
1c6f11f4
GM
31642012-08-06 Glenn Morris <rgm@gnu.org>
3165
1db4583a
GM
3166 * sysdep.c: Respect BROKEN_GETWD.
3167
1c6f11f4
GM
3168 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3169 Let configure handle it.
3170 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3171
2b90362b
DA
31722012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3173
3174 Use GCALIGNMENT where appropriate.
3175 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3176 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3177 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3178
5f50daf2
EZ
31792012-08-06 Eli Zaretskii <eliz@gnu.org>
3180
14ae4239
BT
3181 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3182 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 3183
cbcc7007
SM
31842012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3185
3186 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3187 that should be sufficient for everyone.
3188
4d365fa4
JD
31892012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3190
3191 * keyboard.c (timer_check_2): Add break so timer_check returns next
3192 timeout.
3193
dd86bd82
DA
31942012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3195
3196 Fix Windows build errors introduced after converting to WGET and WSET.
3197 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3198 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3199
054e1668
JD
32002012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3201
3202 * nsterm.m (ns_frame_rehighlight): Use FSET.
3203
3204 * nsmenu.m (ns_update_menubar): Use FSET.
3205
21238f11
DA
32062012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3207
3208 Separate read and write access to Lisp_Object slots of Lisp_Process.
3209 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3210 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3211
077288cf
DA
32122012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3213
3214 Separate read and write access to Lisp_Object slots of struct window.
3215 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3216 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3217 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3218 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3219 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3220 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3221 Adjust users.
3222
71688bd7
DA
32232012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3224
3225 Fix Windows build errors introduced after converting to FGET and FSET.
3226 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3227 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3228 (w32_judge_scroll_bars): Change to use FSET.
3229 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3230
f99bac93
DA
32312012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3232
3233 Fix replacement typo.
3234 * window.c (replace_window): Set root_window instead of
3235 selected_window. This fixes a total window subsystem
3236 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3237
8c2a0f2d
GM
32382012-08-06 Glenn Morris <rgm@gnu.org>
3239
3240 * lisp.mk (lisp): Add language/persian.elc.
3241
edd74c35
DA
32422012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3243
3244 Separate read and write access to Lisp_Object slots of struct frame.
3245 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3246 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3247 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3248 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3249 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3250
8671676c
AS
32512012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3252
3253 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3254
663e2b3f
DA
32552012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3256
3257 Generalize common compile-time constants.
3258 * lisp.h (header_size, bool_header_size, word_size): Now here.
3259 (struct Lisp_Vector): Add comment.
3260 (struct Lisp_Bool_Vector): Move up to define handy constants.
3261 (VECSIZE, PSEUDOVECSIZE): Simplify.
3262 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3263 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3264 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3265 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3266 * xfont.c, xmenu.c: Use word_size where appropriate.
3267
d32e47af
LM
32682012-08-05 Lawrence Mitchell <wence@gmx.li>
3269
3270 * search.c (Freplace_match): Treat \? in the replacement text
3271 literally (Bug#8161).
3272
e5d9c0d1
CY
32732012-08-05 Chong Yidong <cyd@gnu.org>
3274
3275 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3276 * frame.c (Vdelete_frame_functions):
3277 * emacs.c (Vkill_emacs_hook): Doc fix.
3278
8da0576b
EZ
32792012-08-04 Eli Zaretskii <eliz@gnu.org>
3280
3281 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3282 --with-x-toolkit=no builds.
3283 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3284
02676e5d
CY
32852012-08-04 Chong Yidong <cyd@gnu.org>
3286
3287 * syntax.c (Fmodify_syntax_entry): Doc fix.
3288
97147da9
EZ
32892012-08-04 Eli Zaretskii <eliz@gnu.org>
3290
76151e2c
EZ
3291 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3292 * w32.c (init_environment): Change the default values of many
3293 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
3294 them into environment when they were not already defined.
3295 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 3296 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
3297 (check_windows_init_file): Now external, not static.
3298 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
3299 called when Vload_path is already set up.
3300
3301 * w32.h (check_windows_init_file): Add prototype.
3302
3303 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3304 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3305 compatibility with Posix platforms.
3306 (main): Move the call to check_windows_init_file to here from
3307 w32.c.
3308 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3309 any, in the DEFALT argument into the root of the Emacs build or
3310 installation tree, as appropriate.
3311
3312 * callproc.c (init_callproc_1): Call decode_env_path instead of
3313 doing its equivalent by hand.
3314 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3315 the code that sets Vexec_path run on MS-Windows.
3316
3317 * lread.c (init_lread): Add comments to #ifdef's.
3318
97147da9
EZ
3319 * msdos.c (dos_set_window_size, IT_update_begin)
3320 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3321 instead of direct references.
3322
185ee146
PE
33232012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3324
3325 Export DEFAULT_REHASH_* to GDB.
3326 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3327 Now constants, not macros.
3328
8834c57a
PE
33292012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3330
98c6f1e3
PE
3331 Remove unnecessary casts involving pointers.
3332 These casts are no longer needed now that we assume C89 or later,
3333 since they involve casting to or from void *.
3334 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3335 (make_pure_float, make_pure_vector):
3336 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3337 * macros.c (Fstart_kbd_macro):
3338 * menu.c (find_and_return_menu_selection):
3339 * minibuf.c (read_minibuf_noninteractive):
3340 * sysdep.c (closedir):
3341 * xdisp.c (x_produce_glyphs):
3342 * xfaces.c (compare_fonts_by_sort_order):
3343 * xfns.c (x_real_positions, select_visual):
3344 * xselect.c (x_stop_queuing_selection_requests)
3345 (x_get_window_property, x_get_window_property_as_lisp_data):
3346 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3347 Remove unnecessary pointer casts.
3348 * alloc.c (record_xmalloc): New function.
3349 * lisp.h (record_xmalloc): New decl.
3350 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3351 more like a function. This is because the pointer cast is not
3352 needed. All uses changed.
3353 * print.c (print_string, print_error_message): Avoid length recalc.
3354
8834c57a
PE
3355 Improve fix for macroexp crash with debugging (Bug#12118).
3356 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3357 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3358 not supposed to be invoked from the garbage collector.
3359 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3360 (gc_aset): New function, which is like ASET but can be
3361 used in the garbage collector.
3362 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3363 (set_hash_index): Use it instead of ASET.
3364
6dad7178
EZ
33652012-08-03 Eli Zaretskii <eliz@gnu.org>
3366
3367 Support symlinks on latest versions of MS-Windows.
3368 * w32.c: Include winioctl.h and aclapi.h.
3369 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3370 (revert_to_self): Forward declarations of static functions.
3371 <static BOOL g_b_init_get_security_info>:
3372 <g_b_init_create_symbolic_link>: New static flags.
3373 (globals_of_w32): Initialize them to zero.
3374 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3375 (map_w32_filename): Improve commentary. Simplify switch.
3376 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3377 headers (most versions of MinGW w32api don't).
3378 (get_security_info, create_symbolic_link)
3379 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3380 New functions.
3381 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3382 in the argument file name.
3383 (sys_access): Call unc_volume_file_attributes only if
3384 GetFileAttributes fails with network-related error codes.
3385 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3386 have the required privileges.
14ae4239 3387 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
3388 get_file_security_desc.
3389 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
3390 with addition of handling of symlinks and support for 'lstat'.
3391 If possible, get file's attributes and security information by
6dad7178
EZ
3392 handle, not by name. Produce S_IFLNK bit for symlinks, when
3393 called from 'lstat'.
3394 (stat, lstat): New functions, call 'stat_worker'.
3395 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3396 symlinks when the underlying filesystem supports them.
3397
f162bcc3
PE
33982012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3399
79ea6c20
PE
3400 Fix macroexp crash on Windows with debugging (Bug#12118).
3401 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3402 checking subscripts; problem introduced with the recent
3403 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3404 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3405 since it's used in non-static inline functions now.
3406
c0ce93fd
PE
3407 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3408 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 3409
f162bcc3
PE
3410 Use C99-style 'extern inline' if available.
3411 * buffer.h (BUFFER_INLINE):
3412 * category.h (CATEGORY_INLINE):
3413 * character.h (CHARACTER_INLINE):
3414 * charset.h (CHARSET_INLINE):
3415 * composite.h (COMPOSITE_INLINE):
3416 * dispextern.h (DISPEXTERN_INLINE):
3417 * lisp.h (LISP_INLINE):
3418 * systime.h (SYSTIME_INLINE):
3419 New macro, replacing 'static inline' in this header.
3420 * buffer.h, category.h, character.h, charset.h, composite.h:
3421 * dispextern.h, lisp.h, systime.h:
3422 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3423 * alloc.c (LISP_INLINE):
3424 * buffer.c (BUFFER_INLINE):
3425 * category.c (CATEGORY_INLINE):
3426 * character.c (CHARACTER_INLINE):
3427 * charset.c (CHARSET_INLINE):
3428 * composite.c (COMPOSITE_INLINE):
3429 * dispnew.c (DISPEXTERN_INLINE):
3430 * sysdep.c (SYSTIME_INLINE):
3431 Define to EXTERN_INLINE, so that the corresponding functions
3432 are compiled into code.
3433 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3434 (INLINE_HEADER_END): New macros.
3435 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3436 since it's used in non-static inline functions now.
a8333d03 3437 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 3438
837b365b
GM
34392012-08-02 Glenn Morris <rgm@gnu.org>
3440
d66b744d
GM
3441 * s/: Remove empty directory.
3442
837b365b
GM
3443 * s/ms-w32.h: Move to ../nt/inc.
3444 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3445 Update for new ms-w32.h location.
3446
13294f95
PE
34472012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3448
3449 Port to Solaris 8.
3450 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3451
90df0db3
GM
34522012-08-02 Glenn Morris <rgm@gnu.org>
3453
3454 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3455 hard-coding the path separator.
3456
4939150c
PE
34572012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3458
3459 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3460 This how ASET and AREF are supposed to work, and makes
3461 it easier to think about future improvements. See
3462 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3463 * charset.h (set_charset_attr): New function.
3464 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3465 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3466 (aref_addr): New function. All uses of &AREF(...) changed.
3467 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3468 (set_hash_index): New functions. All lvalue-style uses of
3469 HASH_KEY etc. changed.
3470 * keyboard.c (set_prop): New function. All lvalue-style uses
3471 of PROP changed.
3472
947b2afd
AA
34732012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3474
3475 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3476 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3477 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3478 * nsfns.m (ns_set_name_as_filename): Likewise.
3479 * nsmenu.m (ns_update_menubar): Likewise.
3480 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3481
4f5d0325
EZ
34822012-08-01 Eli Zaretskii <eliz@gnu.org>
3483
2008beae
EZ
3484 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3485 Adapt to latest changes in field names of the corresponding Lisp
288479f6 3486 objects.
2008beae 3487
4f5d0325
EZ
3488 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3489
fe3cc771
GM
34902012-08-01 Glenn Morris <rgm@gnu.org>
3491
3492 * s/msdos.h: Remove file.
3493 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3494 * Makefile.in (S_FILE): Remove.
3495 (config_h): Remove S_FILE.
3496
c90acc54
JB
34972012-08-01 Juanma Barranquero <lekktu@gmail.com>
3498
3499 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3500 Remove; moved to nt/config.nt.
3501
d8a05828
DA
35022012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3503
3504 Use INTERNAL_FIELD for conses and overlays.
3505 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3506 Remove obsolete comment.
3507 (MVAR): New macro.
3508 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3509 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3510
8271d590
DA
35112012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3512
3513 Use INTERNAL_FIELD for symbols.
3514 * lisp.h (SVAR): New macro. Adjust users.
3515 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3516 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3517
3193acd2
DA
35182012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3519
3520 Use INTERNAL_FIELD for processes.
3521 * process.h (PVAR): New macro. Adjust style.
3522 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3523 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3524
3a45383a
DA
35252012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3526
3527 Use INTERNAL_FIELD for windows.
3528 * window.h (WVAR): New macro.
3529 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3530 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3531 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3532 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3533 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3534 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3535
c1dbc63c
PE
35362012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3537
3538 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3539
5c0c0e8a
GM
35402012-08-01 Glenn Morris <rgm@gnu.org>
3541
3542 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3543 Move to configure.ac.
3544
552a99b4
JB
35452012-08-01 Juanma Barranquero <lekktu@gmail.com>
3546
3547 * makefile.w32-in (CONFIG_H): Update dependencies.
3548 (CONF_POST_H): New macro.
3549
3550 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3551
8d8e2dfe
GM
35522012-07-31 Glenn Morris <rgm@gnu.org>
3553
bc96620a
GM
3554 * Makefile.in (S_FILE): No longer set by configure.
3555
476b1b2d
GM
3556 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3557 is available.
3558 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3559
b2c7a106
GM
3560 * process.h (NULL_DEVICE):
3561 * emacs.c (SEPCHAR):
3562 * editfns.c (USER_FULL_NAME): Let configure set them.
3563
d53d062a
GM
3564 * s/README, s/template.h: Remove files.
3565
4515017f
GM
3566 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3567
8d8e2dfe
GM
3568 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3569 Move to configure.ac.
3570
5b20b3cc
EZ
35712012-07-31 Eli Zaretskii <eliz@gnu.org>
3572
1e0afd9a
EZ
3573 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3574 resulting renaming of 'struct frame' members.
3575
5b20b3cc
EZ
3576 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3577
3578 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3579 after introduction of FVAR.
3580
f1310128
JD
35812012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3582
79e721e0
JD
3583 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3584
3585 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3586 instead of compositeToPoint.
3587 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3588
8d7c7eed 3589 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 3590
e34f7f79
DA
35912012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3592
3593 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3594 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 3595 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
3596 (BVAR): Change to use INTERNAL_FIELD.
3597 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3598 (KVAR): Change to use INTERNAL_FIELD.
3599 * frame.h (FVAR): New macro.
3600 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
3601 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3602 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3603 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
3604 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3605
c09bfb2f
DA
36062012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3607
3608 Miscellaneous fixes for non-default X toolkits.
3609 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3610 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3611 Move under #ifdef USE_LUCID.
3612 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3613 definition and usage to avoid warnings.
3614
14c114ae
JD
36152012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3616
3617 * nsterm.m (openFiles): Fix previous checkin.
3618
3bd21e82
PE
36192012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3620
3621 * indent.c (compute_motion): Remove unused local.
3622
c1529ded
GM
36232012-07-31 Glenn Morris <rgm@gnu.org>
3624
400d5621
GM
3625 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3626
268e2432
GM
3627 * conf_post.h [USG5_4]:
3628 Move remaining contents of s/usg5-4-common.h here.
3629 * s/usg5-4-common.h: Remove file.
3630
7552f3ee
GM
3631 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3632 * s/irix6-5.h: Remove file.
3633
6a381852
GM
3634 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3635 * s/darwin.h: Remove file.
3636
c1529ded
GM
3637 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3638 * s/hpux10-20.h: Remove file, which is now empty.
3639
b429a4ee
GM
36402012-07-30 Glenn Morris <rgm@gnu.org>
3641
3642 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3643 * Makefile.in (config_h): Add conf_post.h.
3644 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3645
adff3182
JD
36462012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3647
3648 * nsterm.m (ns_do_open_file): New variable.
b9031d69 3649 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
3650 (openFile, openTempFile, openFileWithoutUI, openFiles):
3651 Open files only if ns_do_open_file.
adff3182 3652
c32af1e4
PE
36532012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3654
7393bcbb
PE
3655 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3656 This no-op macro hasn't been needed for many years.
3657 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3658
c32af1e4
PE
3659 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3660 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3661 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3662 gdb_make_enums_visible.
3663 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3664 (DIRECTORY_SEP): Now a constant, not a macro.
3665
302fc036
EZ
36662012-07-30 Eli Zaretskii <eliz@gnu.org>
3667
3668 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3669 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3670
3671 * w32term.c <w32_keyboard_codepage>: Renamed from
3672 keyboard_codepage and now external. All users changed.
3673
3674 * w32term.h: Add declaration of w32_keyboard_codepage.
3675
3676 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3677 the codepage to translate keys to Unicode. If this argument is
3678 -1, use the value returned by GetConsoleCP. All callers changed.
3679
88fb40b4
PE
36802012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3681
0aee6912
PE
3682 Update .PHONY listings in makefiles.
3683 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3684 bootstrap-clean, distclean, maintainer-clean, versioclean,
3685 extraclean, frc.
3686
88fb40b4
PE
3687 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3688 This is a bit clearer. Fix some commentary typos.
3689
0a763bd1
GM
36902012-07-30 Glenn Morris <rgm@gnu.org>
3691
32bac6d6
GM
3692 * s/netbsd.h: Let configure include signal.h if needed.
3693 Remove file, which is now empty.
3694
b65e7c46
GM
3695 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3696 Let configure set them.
3697 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3698 No more need to undefine.
0a763bd1 3699
169304bd
AS
37002012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3701
3702 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3703 non-single-byte char when adding meta modifier. (Bug#12090)
3704
6cd7a139
DA
37052012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3706
3707 Convert safe_call to use variable number of arguments.
3708 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3709 (safe_call2): Fix comment.
3710 * lisp.h (safe_call): Adjust prototype.
3711 * coding.c (encode_coding_object): Change to use safe_call2.
3712 * xfaces.c (merge_face_heights): Change to use safe_call1.
3713
d34d6ffc
GM
37142012-07-30 Glenn Morris <rgm@gnu.org>
3715
7b8a48e4 3716 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 3717 does that unconditionally. Remove file, which is now empty.
7b8a48e4 3718
d34d6ffc
GM
3719 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3720 Remove empty files.
3721
03a660a6
PE
37222012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3723
3724 Export to GDB most of lisp.h's remaining object-like macros.
3725 * lisp.h (min, max): Move earlier, because they're used earlier now.
3726 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3727 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3728 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3729 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3730 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3731 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3732 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3733 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3734 Now constants, for GDB. They need not be macros.
3735 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3736 Now constants, for GDB, as well as macros, for static initializers.
3737 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3738 Move to after the definition of struct Lisp_Char_Table,
3739 since the former now needs that type defined.
3740 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3741 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3742 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3743 New enums, for gdb_make_enums_visible.
3744 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 3745 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
3746 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3747 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3748 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3749 enum maxargs, enum MAX_ALLOCA.
3750 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3751 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3752 no longer needed, now that they are done in lisp.h.
3753
e499d0ee
DA
37542012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3755
3756 Cleanup string bytes checking.
3757 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3758 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3759 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3760 (check_sblock, compact_small_strings): Simplify.
3761
d5040d2d
PE
37622012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3763
3764 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3765 These macros are confusing and no longer need to be defined, as
3766 the enum values now suffice. All uses replaced with definiens.
3767 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3768
7f259ae6
JB
37692012-07-29 Juanma Barranquero <lekktu@gmail.com>
3770
3771 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3772 ($(BLD)/w32console.$(O)): Update dependencies.
3773
7e63e0c3
DA
37742012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3775
3776 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3777 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3778 time. Adjust users.
3779 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3780
ffd817eb
JD
37812012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3782
3783 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3784 setting sitelisp (Bug#12010).
3785
417a7a0e
EZ
37862012-07-29 Eli Zaretskii <eliz@gnu.org>
3787
14ae4239 3788 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
3789
3790 * w32heap.c (cache_system_info):
3791 * w32.c (sys_rename):
3792 * w32proc.c (find_child_console, sys_kill): All users changed.
3793
387d4d92
PE
37942012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3795
3796 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3797
55a6cca6
EZ
37982012-07-29 Eli Zaretskii <eliz@gnu.org>
3799
3800 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3801
dbcf001c
DA
38022012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3803
3804 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
3805 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3806 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 3807
e2688e4a
DA
38082012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3809
3810 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3811 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3812 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3813 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3814 (replace_range, replace_range_2, del_range_2): Change to eassert.
3815 * marker.c (byte_char_debug_check): Adjust style.
3816
b46a6a83
PE
38172012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3818
3819 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3820 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3821 long-ago-commented-out code that talks about "WIN32".
3822 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3823 All uses changed.
3824
e32a5799
PE
38252012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3826
3827 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3828 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3829 Simplify by using alignof.
3830 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3831 * lisp.h: Include <stdalign.h>.
3832 (GCALIGNMENT): New macro and constant.
3833 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3834 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3835 (stdalign): New macro, if not already defined.
3836
df81cd29
EZ
38372012-07-28 Eli Zaretskii <eliz@gnu.org>
3838
01bd1b0d
EZ
3839 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3840 * w32inevt.c: Include w32inevt.h.
3841 (w32_read_console_input): New inline function, calls either
3842 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3843 w32_console_unicode_input.
3844 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3845 (w32_kbd_patch_key, key_event): Use the codepage returned by
3846 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3847 (key_event): use uChar.UnicodeChar only if
3848 w32_console_unicode_input is non-zero.
3849
3850 * w32console.c: Include w32heap.h.
3851 <w32_console_unicode_input>: New global variable.
3852 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3853 family of Windows, zero otherwise.
3854
3855 * w32inevt.h: Declare w32_console_unicode_input.
3856
df81cd29
EZ
3857 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3858 --without-x. (Bug#11742)
3859
c20fdd9e
PE
38602012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3861
3862 Adjust GDB to reflect pvec_type changes (Bug#12036).
3863 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
3864 2012-07-04 changes to pseudovector representation.
3865 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 3866
32770973 38672012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
3868
3869 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3870 bus address.
3871 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3872
3438fe21
EZ
38732012-07-27 Eli Zaretskii <eliz@gnu.org>
3874
bcfbc9de
EZ
3875 * alloc.c (listn): Fix the order the arguments are consed onto the
3876 list.
3877
3438fe21
EZ
3878 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3879 enumeration constants, as PURE and HEAP are too general, and clash
3880 with other headers and sources, such as gmalloc.c and the
3881 MS-Windows system headers. All users changed.
3882
eeaea515
DA
38832012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3884
3885 Revert last save_excursion_save and save_excursion_restore changes.
3886 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3887 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3888
073c88c2
DA
38892012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3890
3891 Fix recently-introduced typos in Windows port.
3892 Reported by Martin Rudalics <rudalics@gmx.at>.
3893 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 3894 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 3895
4706125e
PE
38962012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3897
3898 Improve GDB symbol export (Bug#12036).
3899 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3900 arms of an 'if', not using conditional expressions; otherwise GDB
3901 complains about the types in the unevaluated arm when the argument
3902 is an integer literal.
3903 (xgetint): Simplify expression.
3904 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3905 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3906 Zaretskii in <http://bugs.gnu.org/12036#13>.
3907 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3908 needed now that we have gdb_make_enums_visible.
3909 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3910 (enum enum_USE_LSB_TAG):
3911 New enum types, packaging up enums that need to be exported to GDB.
3912
694b6c97
DA
39132012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3914
3915 Utility function to make a list from specified amount of objects.
3916 * lisp.h (enum constype): New datatype.
3917 (listn): New prototype.
3918 * alloc.c (listn): New function.
3919 (Fmemory_use_count, syms_of_alloc): Use it.
3920 * buffer.c (syms_of_buffer): Likewise.
3921 * callint.c (syms_of_callint): Likewise.
3922 * charset.c (define_charset_internal): Likewise.
3923 * coding.c (syms_of_coding): Likewise.
3924 * keymap.c (syms_of_keymap): Likewise.
3925 * search.c (syms_of_search): Likewise.
3926 * syntax.c (syms_of_syntax): Likewise.
3927 * w32.c (init_environment): Likewise.
3928 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3929 * xdisp.c (syms_of_xdisp): Likewise.
3930 * xfns.c (syms_of_xfns): Likewise.
3931
6195f384
DA
39322012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3933
3934 Fast save_excursion_save and save_excursion_restore.
3935 * lisp.h (struct Lisp_Excursion): New data type.
3936 (PVEC_EXCURSION): New pseudovector type.
3937 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3938 to deal with it. Adjust comments.
3939 (init_marker, attach_marker): New prototype.
3940 (unchain_marker): Adjust prototype.
3941 * marker.c (attach_marker): Change to global.
3942 (init_marker): New function.
3943 * alloc.c (Fmake_marker, build_marker): Use it.
3944 (build_marker): More easserts.
3945 (mark_object): Handle struct Lisp_Excursion.
3946 * editfns.c (save_excursion_save, save_excursion_restore):
3947 Reimplement to use struct Lisp_Excursion. Add comments.
3948
5eceb8fb
PE
39492012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3950
3951 Fix export of symbols to GDB (Bug#12036).
3952 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3953 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3954 emacs.c, as this is a more-suitable home. Had this been done earlier
3955 the fix for 12036 would have avoided some of the problems noted in
3956 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3957 would have been more obvious.
562157c8
PE
3958 * emacs.c: Do not include <verify.h>; no longer needed.
3959 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
3960 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3961 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3962 Remove; now done in lisp.h.
3963 * lisp.h (PUBLISH_TO_GDB): New macro.
3964 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3965 (DATA_SEG_BITS): Use it.
3966 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3967 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3968 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3969 not be usable in #if. This simplifies things.
3970
d6749401
JB
39712012-07-26 Juanma Barranquero <lekktu@gmail.com>
3972
3973 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3974
1781b9e9
PE
39752012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3976
d89518db 3977 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
3978 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3979 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3980 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3981 Adjust to changes in lisp.h and emacs.c, by using
3982 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3983 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3984 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3985 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3986 instead of gdb_valbits.
3987 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3988 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3989 instead of gdb_array_mark_flag.
3990 (xboolvector): Get size from $->size, not $->header.size.
3991 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3992 (xreload, hook-run, hookpost-run): Remove.
3993 * emacs.c: Include <verify.h>.
3994 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3995 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3996 Remove.
3997 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3998 (gdb_USE_LSB_TAG): New enum constants.
3999 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4000 Also define these as enum constants, so they're visible to GDB.
4001 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4002 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4003 as constants, so they're visible to GDB.
4004 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4005 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4006 Now enum constants, not macros, so they're visible to GDB.
4007 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4008 more convenient now. All uses changed.
4009 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4010 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4011
3628596a
DA
40122012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4013
4014 Explicitly free restriction data that are not needed anymore.
4015 * editfns.c (save_restriction_restore): Free restriction data.
4016
7abaf5cc
SM
40172012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4018
4019 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4020 add argument, tune behavior, and adjust all callers.
4021
71f88e00
PE
40222012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4023
4024 Use typedef for EMACS_INT, EMACS_UINT.
4025 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4026 than macros. This simplifies debugging in the usual case, since
4027 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4028 and it allows expressions involving EMACS_INT casts.
4029 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4030
57ec3034
JD
40312012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4032
4033 * nsterm.m (ns_read_socket): Return early if there is a modal
4034 window (Bug#12043).
4035
8137e7b3
MR
40362012-07-25 Martin Rudalics <rudalics@gmx.at>
4037
4038 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4039 that FOCUS-FRAME can be omitted.
4040
04e9897c
DA
40412012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4042
4043 Adjust buffer text indirection counters at the end of Fkill_buffer.
4044 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4045 buffer is definitely dead. This should really fix an issue reported
4046 by Christoph Scholtes again. (Bug#12007).
4047 (init_buffer_once): Initialize indirection counters of
4048 buffer_defaults and buffer_local_symbols (for sanity and safety).
4049
8a0484e1
EZ
40502012-07-24 Eli Zaretskii <eliz@gnu.org>
4051
4052 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4053 and continuation glyphs on tooltip frames, leave them at zero.
4054 Avoids continued lines in tooltips. (Bug#11832)
4055
fa691a83
DA
40562012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4057
4058 Simplify copy_overlay.
04e9897c 4059 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
4060 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4061
436bc8e0
EZ
40622012-07-23 Eli Zaretskii <eliz@gnu.org>
4063
4064 * print.c (print_object): Don't crash when a frame's name is nil
4065 or invalid. (Bug#12025)
4066
4067 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4068 it signals an error when a tooltip frame is being created.
4069
d7a7fda3
DA
40702012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4071
4072 Cleanup miscellaneous objects allocation and initialization.
4073 * alloc.c (allocate_misc): Change to static. Add argument to
4074 specify the subtype. Adjust comment and users.
4075 (build_overlay): New function.
4076 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4077 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4078 (allocate_misc): Remove prototype.
4079 (build_overlay): Add prototype.
4080
40812012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
4082
4083 Swap buffer text indirection counters in Fbuffer_swap_text.
4084 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4085 This avoids crash reported by Christoph Scholtes at
4086 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4087
9d7fa573
JD
40882012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4089
4090 * nsmenu.m (Popdown_data): New struct.
4091 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4092 free Popdown_data.
4093 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4094 (initWithContentRect): Make imgView and contentView non-static
4095 and autorelease them. Also autorelease img and matrix (Bug#12005).
4096 (dealloc): Remove (Bug#12005).
4097
0dd6d66d
DA
40982012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4099
4100 Adjust consing_since_gc when objects are explicitly freed.
4101 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4102 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4103 (free_cons, free_misc): Subtract object size from consing_since_gc.
4104
d36d71df
DA
41052012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4106
4107 Simplify and cleanup markers positioning code.
4108 * marker.c (attach_marker): More useful eassert.
4109 (live_buffer, set_marker_internal): New function.
4110 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4111 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4112
fb9ea40f
PE
41132012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4114
4115 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4116 as it's limited by the amount of memory, not by INT_MAX.
4117
2d5c5f7d
EZ
41182012-07-21 Eli Zaretskii <eliz@gnu.org>
4119
07fb592e
EZ
4120 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4121 in special-event-map. See the discussion at
4122 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4123 for the reasons.
4124
37a9eac8 4125 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
4126 info.dwItemData. Fixes crashes on 64-bit Windows.
4127 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 4128
c4328746
JD
41292012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4130
fc0c31f8 4131 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 4132 (conversationIdentifier): Return value is NSInteger.
784051c4 4133 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 4134
6e5d1c12
CY
41352012-07-21 Chong Yidong <cyd@gnu.org>
4136
4137 * window.c (decode_any_window): Signal an error if the window is
4138 on a dead frame (Bug#11984).
4139
9928463d
DA
41402012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4141
4142 Add indirection counting to speed up Fkill_buffer.
4143 * buffer.h (struct buffer): New member.
4144 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4145 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4146 base buffer indirection counter.
4147 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4148 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4149 through buffer list if indirection counter is 0.
4150
f8643a6b
DA
41512012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4152
4153 Extend the value returned by Fgarbage_collect with heap statistics.
4154 * alloc.c (Qheap): New symbol.
4155 (syms_of_alloc): DEFSYM it.
4156 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4157 (Fmemory_free): Remove.
4158 (syms_of_alloc): Don't defsubr it.
4159 * buffer.c (Fcompact_buffer): Remove.
4160 (syms_of_buffer): Don't defsubr it.
4161
dac616ff
DA
41622012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4163
4164 Make maybe_gc inline.
4165 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4166 * lisp.h (consing_since_gc, gc_relative_threshold)
4167 (memory_full_cons_threshold): Revert declaration.
4168 (maybe_gc): Remove prototype, define as inline.
4169 * alloc.c: Remove old commented-out code.
4170 (consing_since_gc, gc_relative_threshold)
4171 (memory_full_cons_threshold): Revert to global.
4172 (maybe_gc): Remove.
4173
d7ea76b4
DA
41742012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4175
4176 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4177 * lisp.h (build_unibyte_string): New function.
4178 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4179 * sysdep.c, w32fns.c, xfns.c: Use it.
4180 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4181 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4182 Adjust users accordingly.
4183 * font.h (font_open_by_name): Adjust prototype.
4184
765e61e3
DA
41852012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4186
4187 Cleanup calls to Fgarbage_collect.
4188 * lisp.h (maybe_gc): New prototype.
4189 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4190 Remove declarations.
4191 * alloc.c (maybe_gc): New function.
4192 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4193 Make them static.
4194 * bytecode.c (MAYBE_GC): Use maybe_gc.
4195 * eval.c (eval_sub, Ffuncall): Likewise.
4196 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4197 to avoid dependency from auto-save feature.
4198
52b852c7
PE
41992012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4200
4201 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4202 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4203 'for_each_per_buffer_object_at'.
4204 All uses changed. It's better to use upper-case for macros that
4205 cannot be implemented as functions, to give the reader a clue
4206 that they're special.
4207
5db81e33
SM
42082012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4209
4210 * alloc.c (Fgarbage_collect): Tweak docstring.
4211
5b835e1d
DA
42122012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4213
4214 Tweak the value returned from Fgarbage_collect again.
4215 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4216 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4217 Adjust documentation.
4218 (total_vector_bytes): Rename to total_vector_slots, adjust
4219 accounting.
4220 (total_free_vector_bytes): Rename to total_free_vector_slots,
4221 adjust accounting.
4222 (Qstring_bytes, Qvector_slots): New symbols.
4223 (syms_of_alloc): DEFSYM them.
4224
9cd47b72
DA
42252012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4226
4227 Buffer compaction primitive which may be used from Lisp.
4228 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4229 (syms_of_buffer): Register Fcompact_buffer.
4230 * alloc.c (Fgarbage_collect): Use compact_buffer.
4231 * buffer.h (compact_buffer): New prototype.
4232 (struct buffer_text): New member.
4233
d17337e5
DA
42342012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4235
4236 New macro to iterate over all buffers, miscellaneous cleanups.
4237 * lisp.h (all_buffers): Remove declaration.
4238 * buffer.h (all_buffers): Add declaration, with comment.
4239 (for_each_buffer): New macro.
4240 * alloc.c (Fgarbage_collect, mark_object): Use it.
4241 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4242 (init_buffer): Likewise.
4243 * data.c (Fset_default): Likewise.
4244 * coding.c (code_conversion_restore): Remove redundant check
4245 for dead buffer.
4246 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4247
60cfd278
AS
42482012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4249
4250 Fix bug that created negative-length intervals.
4251 * intervals.c (merge_interval_right, merge_interval_left):
4252 Do not zero out this interval if it is absorbed by its children,
4253 as this interval's total length doesn't change in that case. See
4254 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4255
d06714cb
PE
42562012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4257
83713154
PE
4258 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4259 when invoking (make-bool-vector N t) and N is a positive
4260 multiple of 8 -- the last 8 bits were mistakenly cleared.
4261
d06714cb
PE
4262 Remove some struct layout assumptions in bool vectors.
4263 * alloc.c (bool_header_size): New constant.
4264 (header_size, word_size): Move earlier, as they're now used earlier.
4265 Use 'word_size' in a few more places, where it's appropriate.
4266 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4267 padding before the data member of a bool vector.
4268 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4269 than doing the check by hand with an abort ().
4270
464d5a5e
SM
42712012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4272
5fbc0409
SM
4273 * eval.c (Fdefvar): Don't check constants since we only set the var if
4274 it's not yet defined anyway (bug#11904).
4275
464d5a5e
SM
4276 * lisp.h (last_undo_boundary): Declare new var.
4277 * keyboard.c (command_loop_1): Set it.
4278 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4279 were auto-added by the command loop (bug#11774).
4280
8dc2e44a
AS
42812012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4282
4283 * w32font.c (Qsymbol): Remove local definition.
4284 (syms_of_w32font): Don't DEFSYM it.
4285
169925ec
DA
42862012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4287
4288 Fix sweep_vectors to handle large bool vectors correctly.
4289 * alloc.c (sweep_vectors): Account total_vector_bytes for
4290 bool vectors larger than VBLOCK_BYTES_MAX.
4291
5fbfb018
CY
42922012-07-18 Chong Yidong <cyd@gnu.org>
4293
4294 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4295 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4296
3ab6e069
DA
42972012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4298
4299 Return more descriptive data from Fgarbage_collect.
4300 Suggested by Stefan Monnier in
4301 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4302 * alloc.c (bounded_number): New function.
4303 (total_buffers, total_vectors): New variable.
4304 (total_string_size): Rename to total_string_bytes, adjust users.
4305 (total_vector_size): Rename to total_vector_bytes, adjust users.
4306 (sweep_vectors): Account total_vectors and total_vector_bytes.
4307 (Fgarbage_collect): New return value. Adjust documentation.
4308 (gc_sweep): Account total_buffers.
4309 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4310 (VECTOR_SIZE): Remove.
4311 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4312 (Qinterval, Qmisc): New symbols.
4313 (syms_of_data): Initialize them.
4314 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4315 (Qcons, Qbuffer): New declarations.
4316
6d02fe5b
PE
43172012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4318
4319 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4320 Round up, not down. Improve doc.
4321
b7ffe040
DA
43222012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4323
4324 Restore old code in allocate_string_data to avoid Faset breakage.
4325 Reported by Julien Danjou <julien@danjou.info> in
4326 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4327 * alloc.c (allocate_string_data): Restore old code with minor
4328 adjustments, fix comment to explain this subtle issue.
4329
4dc7c8d5
SM
43302012-07-17 Eli Zaretskii <eliz@gnu.org>
4331
4332 Remove FILE_SYSTEM_CASE.
4333 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4334
4335 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4336 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4337 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4338 call-process-region passes it through expand-file-name.
4339
4340 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4341
43422012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4343
4344 Fix crash when creating indirect buffer (Bug#11917)
4345 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4346 Don't handle unbound variables specially if non-zero.
4347 (Fbuffer_local_variables): Pass zero.
4348 (clone_per_buffer_values): Pass non-zero.
4349
43502012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4351
4352 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4353 to make the loop interruptible.
4354
43552012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4356
4357 * gnutls.c (emacs_gnutls_handshake): Only retry if
4358 GNUTLS_E_INTERRUPTED.
4359
cce7fefc
DA
43602012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4361
4362 Cleanup and convert miscellaneous checks to eassert.
4363 * alloc.c (mark_interval): Fix comment, partially rephrase
4364 old comment from intervals.h (see below).
4365 * intervals.c (find_interval, adjust_intervals_for_insertion)
4366 (delete_interval, adjust_intervals_for_deletion)
4367 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4368 Convert to eassert.
4369 (adjust_intervals_for_insertion, make_new_interval):
4370 Remove obsolete and unused code.
4371 * intervals.h (struct interval): Remove obsolete comment.
4372 * textprotp.c (erase_properties): Remove unused code.
4373 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4374 (Fremove_list_of_text_properties): Convert to eassert.
4375
9ea10cc3
CY
43762012-07-17 Chong Yidong <cyd@gnu.org>
4377
4378 * editfns.c (Finsert_char): Doc fix.
4379
3900d5de
DA
43802012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4381
4382 Fix previous change to make Fmemory_free always accurate.
4383 * alloc.c (make_interval): Update total_free_intervals.
4384 (make_float): Likewise for total_free_floats.
4385 (free_cons, Fcons): Likewise for total_free_conses.
4386 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4387 Likewise for total_free_vector_bytes.
4388 (Fmake_symbol): Likewise for total_free_symbols.
4389 (bytes_free): Remove.
4390
7098646f
DA
43912012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4392
4393 Simple free memory accounting feature.
4394 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4395 (sweep_vectors): Accumulate size of free vectors.
4396 (Fgarbage_collect): Setup bytes_free.
4397 (Fmemory_free): New function.
4398 (syms_of_alloc): Register it.
4399
22657b40
DA
44002012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4401
4402 Cleanup overlays checking.
4403 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4404 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4405 eassert and OVERLAYP.
4406 (sort_overlays): Change to use OVERLAYP.
4407
ddfc8813
RK
44082012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4409
4410 * editfns.c (Finsert_char): Make it interactive, and make the
4411 second arg optional. Copy interactive spec and docstring from
4412 ucs-insert.
4413
7c26cf3c
PE
44142012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4415
4416 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4417 Unlike the other wrapped functions, fabs has an unspecified
4418 effect on errno.
4419
5d127af9
JD
44202012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4421
4422 * nsterm.m (keyDown): Interpret flags without left/right bits
4423 as the left key (Bug#11670).
4424
6a0dd1d7
DA
44252012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4426
4427 Remove empty and useless init functions.
4428 * lisp.h (init_character_once, init_fns, init_image)
4429 (init_filelock, init_sound): Remove prototype.
4430 * character.c (init_character_once): Remove.
4431 * filelock.c (init_filelock): Likewise.
4432 * fns.c (init_fns): Likewise.
4433 * image.c (init_image): Likewise.
4434 * sound.c (init_sound): Likewise.
4435 * emacs.c (main): Adjust accordingly.
4436
7a6136fd
DA
44372012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4438
4439 * gtkutil.h: Tiny cleanups.
4440 (use_old_gtk_file_dialog): Remove useless declaration.
4441 (xg_uses_old_file_dialog): Add suggested const attribute.
4442
ce811ad9
EZ
44432012-07-15 Eli Zaretskii <eliz@gnu.org>
4444
4445 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4446 (bidi_paragraph_init): Use it to limit search forward for a strong
4447 directional character in abnormally large paragraphs full of
4448 neutral or weak characters. (Bug#11943)
4449
c9adfeaa
SF
44502012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4451
4452 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4453 the toolbar (Bug#9451).
4454 (xg_make_tool_item): Give the widget event box a transparent
4455 background.
4456
fff62aa9
DA
44572012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4458
4459 Cleanup basic allocation variables and functions.
4460 * alloc.c (ignore_warnings, init_intervals, init_float)
4461 (init_cons, init_symbol, init_marker): Remove.
4462 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4463 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4464 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4465 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4466 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4467 (staticidx, init_alloc_once, init_strings, free_ablock):
4468 Remove redundant initialization.
4469 * fns.c (init_weak_hash_tables): Remove.
4470 * lisp.h (init_weak_hash_tables): Remove prototype.
4471
9730daca
DA
44722012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4473
4474 Use zero_vector where appropriate.
4475 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4476 accordingly.
4477 * lisp.h (zero_vector): New declaration.
4478 * font.c (null_vector): Remove.
4479 (syms_of_font): Remove initialization and staticpro.
4480 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4481 * keymap.c (Faccessible_keymaps): Likewise.
4482
2e2d2a13
LL
44832012-07-15 Leo Liu <sdl.web@gmail.com>
4484
4485 * fringe.c: Fix typo in comments.
4486
cd276f6e
LL
44872012-07-14 Leo Liu <sdl.web@gmail.com>
4488
4489 * fringe.c: Add a new bitmap exclamation-mark.
4490
5a1131d9
EZ
44912012-07-14 Eli Zaretskii <eliz@gnu.org>
4492
4493 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4494
4495 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4496 (HAVE_MENUS): Don't define, defined by editing config.in with
4497 msdos/sed2v2.inp.
4498 (GMALLOC_INHIBIT_VALLOC): Don't define.
4499 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4500
22e983b7
JB
45012012-07-14 Juanma Barranquero <lekktu@gmail.com>
4502
4503 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4504
5b3f250f
GM
45052012-07-14 Glenn Morris <rgm@gnu.org>
4506
4507 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4508 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4509 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4510
33d63ff4
GM
45112012-07-13 Glenn Morris <rgm@gnu.org>
4512
5b633342
GM
4513 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4514
33d63ff4
GM
4515 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4516 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4517
b55b9f85
JD
45182012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4519
0dc8cf50
JD
4520 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4521 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4522 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4523 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4524 where appropriate.
4525 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4526 as boolean expression.
4527 (x_set_window_size): Remove unused variable toolbar.
4528 (ns_get_color_default, ns_mod_to_lisp): Remove.
4529 (ns_mouse_position): Remove unused variables xchar and ychar.
4530 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4531 (ns_set_vertical_scroll_bar): Remove unused variable count.
4532 (ns_delete_terminal): Remove unused variable i.
4533 (ns_term_init): Remove unused variables r, g and b.
4534 (mouseDown): Remove unused variable window.
4535 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4536 (initFrameFromEmacs): Remove unused variable vbextra.
4537 (mouseEntered): Remove unused variables p and dpyinfo.
4538 (mouseExited): Remove unused variables p and r.
4539 (ns_define_frame_cursor, ns_clear_frame_area)
4540 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4541 (menuDown): Assign [sender tag] to variable and cast the variable.
4542
4543 * nsterm.h (menuDown): Add id as type to argument sender.
4544 (ns_display_info_for_name): Add Lisp_Object argument.
4545 (ns_term_init): Add Lisp_Object argument.
4546 (ns_map_event_to_object): Add void argument.
4547 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4548 prototype with arguments and only declare if __OBJC__.
4549 (nxatoms_of_nsselect): Add void argument.
4550 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4551 (ns_alloc_autorelease_pool): Add void argument.
4552 (ns_release_autorelease_pool): Add void* argument.
4553 (ns_get_defaults_value): Add const char* argument.
4554
4555 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4556 (initFromContents): Use SSDATA where appropriate.
4557 (ns_update_menubar): Add braces to ambigous if-else.
4558 (initWithTitle): Put () around assignment in if statement.
4559 (ns_menu_show): Remove unused variables window and keymap.
4560 (update_frame_tool_bar): Remove unused variable selected_p.
4561 (initWithContentRect): Remove unused variable this_cmd_name.
4562
4563 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4564 appropriate.
4565 (setXBMColor): Remove unused variable len.
4566 (setPixmapData): Put () around assignment in loop statement.
4567
4568 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4569 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4570 where appropriate.
4571 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4572 around assignment in loop statement.
4573 (nsfont_open): Remove unused variable i.
4574 (nsfont_open): Remove unused variable len.
4575 (nsfont_draw): Remove unused variable cs.
4576
4577 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4578 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4579 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4580 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4581 (Fns_font_name, Fns_perform_service)
4582 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4583 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4584 (ns_set_name): Remove unused variable view.
4585 (x_set_menu_bar_lines): Remove unused variable olines.
4586 (x_set_tool_bar_lines): Remove unused variable root_window.
4587 (Fns_list_colors): Put () around assignment in while statement.
4588 (Fns_perform_service): Remove unused variable len.
4589 (Fns_display_usable_bounds): Remove unused variable top.
4590 (syms_of_nsfns): Remove unused variable i.
4591
b55b9f85
JD
4592 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4593 memcpy (Bug#11907).
4594
ed9265fc 45952012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
4596
4597 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4598 and free it with DestroyExceptionInfo (Bug#11558).
4599
ef099b57
JB
46002012-07-13 Juanma Barranquero <lekktu@gmail.com>
4601
4602 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4603 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4604 Set here, not in nt/config.nt.
4605
ea814a5d
EZ
46062012-07-13 Eli Zaretskii <eliz@gnu.org>
4607
4608 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4609 cursor overflow into the last glyph on display line when the right
4610 fringe is off. (Bug#11832)
4611
1a952767
PE
46122012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4613
4614 * xdisp.c (produce_special_glyphs): Now static.
4615 * dispextern.h (produce_special_glyphs): Remove decl.
4616
983188fd
GM
46172012-07-13 Glenn Morris <rgm@gnu.org>
4618
8d7c7eed 4619 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
4620 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4621
983188fd
GM
4622 * s/usg5-4-common.h (USG, USG5):
4623 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4624 * s/sol2-6.h (SOLARIS2):
4625 * s/irix6-5.h (IRIX6_5):
4626 * s/hpux10-20.h (USG, USG5, HPUX):
4627 * s/gnu-linux.h (USG, GNU_LINUX):
4628 * s/freebsd.h (BSD_SYSTEM):
4629 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4630 * s/cygwin.h (CYGWIN):
4631 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4632 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4633
d1e68667 46342012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
4635
4636 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 4637
6de0e799
GM
46382012-07-13 Glenn Morris <rgm@gnu.org>
4639
739ae010
GM
4640 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4641
dbee5793
GM
4642 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4643
6de0e799
GM
4644 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4645 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4646
b82da769
GM
46472012-07-12 Glenn Morris <rgm@gnu.org>
4648
4fae5a7a 4649 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
4650
4651 * process.c (init_process_emacs): Rename from init_process.
4652 The old name is also the name of a Mach system call.
4653 * lisp.h, emacs.c: Update for this name change.
4654 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4655 longer needed.
4656
5a979817
EZ
46572012-07-12 Eli Zaretskii <eliz@gnu.org>
4658
4659 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4660 memmove call that removes glyphs covered by the left truncation
4661 glyph. Improve commentary.
4662 (display_line): Fix display of continuation glyphs on GUI frames
4663 when the right fringe is turned off and variable-size fonts are
4664 used in the window. Move the code that appends a stretch glyph to
4665 produce_special_glyphs, so that it could be used for truncation
4666 and continuation glyphs alike.
4667 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4668 glyph of a suitably computed width, to align the special glyphs at
4669 the window margin. Code moved from display_line. (Bug#11832)
4670
3e91a053
GM
46712012-07-12 Glenn Morris <rgm@gnu.org>
4672
ba9e4b84
GM
4673 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4674
4675 * s/gnu-linux.h, s/hpux10-20.h:
4676 Do not unconditionally define HAVE_XRMSETDATABASE.
4677
3e91a053
GM
4678 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4679
b300b1f4
PE
46802012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4681
4682 Fix typos that broke OS X build.
4683 Reported by Randal L. Schwartz in
4684 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4685 * nsterm.m (ns_timeout): Add missing local decl.
4686 (ns_get_color): snprintf -> sprintf, to fix typo.
4687
6e777848
GM
46882012-07-12 Glenn Morris <rgm@gnu.org>
4689
3f922c37
GM
4690 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4691 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4692 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4693 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4694
0ab7b23a
GM
4695 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4696 Move PTY_OPEN to configure.
4697
6e777848
GM
4698 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4699 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4700 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4701
4a7edc24
DA
47022012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4703
4704 Use empty_unibyte_string where applicable.
4705 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4706 * lread.c (read1): Likewise.
4707 * xsettings.c (syms_of_xsettings): Likewise.
4708
308aab79
GM
47092012-07-12 Glenn Morris <rgm@gnu.org>
4710
42bd1719
GM
4711 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4712 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
4713 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4714 * s/hpux10-20.h (RUN_TIME_REMAP):
4715 * s/bsd-common.h (TABDLY): Move to configure.
4716
4717 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4718
4719 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4720
ea0bbd17 4721 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 4722 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
4723
4724 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 4725
308aab79
GM
4726 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4727 * s/template.h: Move NARROWPROTO to configure.
4728
ee1cf5cf
GM
47292012-07-11 Glenn Morris <rgm@gnu.org>
4730
30fe9bf4
GM
4731 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4732 unused since 2011-01-17 change to systty.h.
4733
ee1cf5cf
GM
4734 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4735 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4736 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4737
63e47e07
PE
47382012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4739
4740 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4741
c43fb4c3
GM
47422012-07-11 Glenn Morris <rgm@gnu.org>
4743
4744 * s/darwin.h, s/gnu-linux.h, s/template.h:
4745 Move INTERRUPT_INPUT to configure.
4746
e8df9267
DA
47472012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4748
4749 Minor adjustments to interning code.
4750 * lisp.h (intern, intern_c_string): Redefine as static inline
4751 wrappers for intern_1 and intern_c_string_1, respectively.
4752 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
4753 * lread.c (intern_1, intern_c_string_1, oblookup):
4754 Simplify Vobarray checking.
e8df9267
DA
4755 * font.c (font_intern_prop): Likewise. Adjust comment.
4756 * w32font.c (intern_font_name): Likewise.
4757
34348bd4
AS
47582012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4759
d96a1e0c
AS
4760 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4761
34348bd4
AS
4762 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4763 of Fcar/Fcdr if possible.
4764 * font.c (check_otf_features): Likewise.
4765 * fontset.c (Fnew_fontset): Likewise.
4766 * gnutls.c (Fgnutls_boot): Likewise.
4767 * minibuf.c (read_minibuf): Likewise.
4768 * msdos.c (IT_set_frame_parameters): Likewise.
4769 * xmenu.c (Fx_popup_dialog): Likewise.
4770 * w32menu.c (Fx_popup_dialog): Likewise.
4771
c8add24e
GM
47722012-07-11 Glenn Morris <rgm@gnu.org>
4773
4b575b3c
GM
4774 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4775 since nothing has defined it on these platforms.
4776
09f4e3b0
GM
4777 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4778 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4779
172bedef
GM
4780 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4781 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4782 Move CLASH_DETECTION to configure.
4783
249685df
GM
4784 * s/gnu.h: Remove file, which is now empty.
4785
c8add24e
GM
4786 * s/gnu.h, s/gnu-linux.h:
4787 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4788
b41253a3
JW
47892012-07-11 John Wiegley <johnw@newartisans.com>
4790
4791 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4792 function attribute, so we only use it if it exists in the
4793 compiler.
4794
d923b542
DA
47952012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4796
4797 Avoid call to strlen in fast_c_string_match_ignore_case.
4798 * search.c (fast_c_string_match_ignore_case): Change to use
4799 length argument. Adjust users accordingly.
4800 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4801
5ebbef1d
PE
48022012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4803
bb352260
PE
4804 Assume mkdir, rmdir.
4805 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4806 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4807
57054ddd
PE
4808 Assume rename.
4809 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4810
b747d3f7
PE
4811 Assume perror.
4812 * s/hpux10-20.h (HAVE_PERROR): Remove.
4813 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4814 Remove dummy definition, as this problem was obsolete long ago.
4815
5ebbef1d
PE
4816 Assume strerror.
4817 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4818
984e7f30
DA
48192012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4820
4821 Avoid calls to strlen in font processing functions.
4822 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
4823 (font_open_by_name): Change to use length argument.
4824 Adjust users accordingly.
d923b542
DA
4825 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4826 Adjust prototypes.
4827 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4828 Change to return ptrdiff_t.
984e7f30
DA
4829 (xfont_list_pattern, xfont_match): Use length returned by
4830 xfont_decode_coding_xlfd.
4831 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4832
20e94fdd
GM
48332012-07-11 Glenn Morris <rgm@gnu.org>
4834
9d596af3
GM
4835 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4836 Move DONT_REOPEN_PTY to configure.
4837
20e94fdd
GM
4838 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4839 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4840
e99a530f
PE
48412012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4842
22ffb973
PE
4843 Remove "#define unix" that is no longer needed (Bug#11905).
4844 * s/aix4-2.h (unix): Remove; no longer needed.
4845
e9a9ae03
PE
4846 EMACS_TIME simplification (Bug#11875).
4847 This replaces macros (which typically do not work in GDB)
4848 with functions, typedefs and enums, making the code easier to debug.
4849 The functional style also makes code easier to read and maintain.
4850 * systime.h: Include <sys/time.h> on all hosts, not just if
4851 WINDOWSNT, since 'struct timeval' is needed in general.
4852 (EMACS_TIME): Now a typedef, not a macro.
4853 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4854 not macros.
4855 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4856 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4857 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4858 (EMACS_TIME_LE): Now functions, not macros.
4859 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4860 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4861 which are not functions. All uses rewritten to use:
4862 (make_emacs_time): New function.
4863 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4864 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4865 not functions. All uses rewritten to use the following, respectively:
4866 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4867 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 4868 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
4869 * fileio.c (Fcopy_file):
4870 * xterm.c (XTflash): Get the current time closer to when it's used.
4871 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4872
ffacb126
PE
4873 * bytecode.c (targets): Suppress -Woverride-init warnings.
4874
e99a530f
PE
4875 Simplify by avoiding confusing use of strncpy etc.
4876 * doc.c (Fsnarf_documentation):
4877 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4878 * frame.c (Fmake_terminal_frame):
4879 * gtkutil.c (get_utf8_string):
4880 * lread.c (openp):
4881 * nsmenu.m (ns_update_menubar):
4882 * regex.c (regerror):
4883 Prefer memcpy to strncpy and strncat when either will do.
4884 * fileio.c (Fsubstitute_in_file_name):
4885 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4886 (menu_separator_name_p):
4887 * nsmenu.m (ns_update_menubar):
4888 Prefer memcmp to strncmp when either will do.
4889 * nsterm.m: Include <ftoastr.h>.
4890 (ns_get_color):
4891 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4892 Prefer snprintf to strncpy.
4893 * nsterm.m (ns_term_init):
4894 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4895 * nsterm.m (ns_term_init):
4896 Avoid the need for strncpy, by using build_string or
4897 make_unibyte_string directly. Use dtoastr, not snprintf.
4898 * process.c (Fmake_network_process): Diagnose service names that
4899 are too long, rather than silently truncating them or creating
4900 non-null-terminated names.
4901 (Fnetwork_interface_info): Likewise, for interface names.
4902 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4903 Prefer sprintf to strncat.
4904 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4905 Prefer vsnprintf to vsprintf + strncpy.
4906
c59592b3
GM
49072012-07-10 Glenn Morris <rgm@gnu.org>
4908
4909 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4910 Clarify fallback case.
4911
7d7bbefd
DA
49122012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4913
4914 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4915 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4916 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 4917 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
4918 where argument type is known to be a Lisp_Cons.
4919
3a4c8000
TT
49202012-07-10 Tom Tromey <tromey@redhat.com>
4921
4922 * bytecode.c (BYTE_CODE_THREADED): New macro.
4923 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4924 (enum byte_code_op): New type.
4925 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4926 (exec_byte_code): Use them. Use token threading when applicable.
4927
2a0213a6
DA
49282012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4929
4930 Optimize pure C strings initialization.
4931 * lisp.h (make_pure_string): Fix prototype.
4932 (build_pure_c_string): New function, defined as static inline. This
4933 provides a better opportunity to optimize away calls to strlen when
4934 the function is called with compile-time constant argument.
4935 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4936 argument, adjust users accordingly. Use build_pure_c_string where
4937 appropriate.
4938 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4939 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4940 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4941
cb1caeaf
DA
49422012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4943
4944 Avoid calls to strlen in miscellaneous functions.
4945 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4946 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4947 * lread.c (openp): Likewise.
4948
c293e30c
DA
49492012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4950
4951 Avoid calls to strlen in path processing functions.
4952 * fileio.c (file_name_as_directory): Add comment. Change to add
4953 srclen argument and return the length of result. Adjust users
4954 accordingly.
4955 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
4956 swap 1st and 2nd arguments to obey the common convention.
4957 Adjust users accordingly.
c293e30c
DA
4958 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4959
9e059e3f
GM
49602012-07-10 Glenn Morris <rgm@gnu.org>
4961
d02eb359
GM
4962 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4963 Move PENDING_OUTPUT_COUNT definition to configure.
4964
882cf227
GM
4965 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4966 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4967 * s/gnu.h (DATA_START): Move definitions to configure.
4968
af6e839f
GM
4969 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4970 We include usg5-4-common.h, which defines them both.
4971
40289a12
GM
4972 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4973 O_RDONLY already includes it).
4974
9e059e3f
GM
4975 Stop ns builds setting the EMACSLOADPATH environment variable.
4976 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4977 Now it does not set EMACSLOADPATH, just returns the load-path string.
4978 * nsterm.h: Update accordingly.
4979 * lread.c [HAVE_NS]: Include nsterm.h.
4980 (init_lread) [HAVE_NS]: Use ns_load_path.
4981 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4982
7c4e8ec0
GM
49832012-07-09 Glenn Morris <rgm@gnu.org>
4984
d4f600ff
GM
4985 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4986 since the included bsd-common.h does so.
4987
cbb31951
GM
4988 Stop ns builds setting the EMACSPATH environment variable.
4989 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4990 (ns_init_paths): Do not set EMACSPATH.
4991 * nsterm.h (ns_exec_path): Add it.
4992 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4993 Use ns_exec_path.
4994
7c4e8ec0
GM
4995 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4996
26bccfae
PE
49972012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4998
a0bee46f
PE
4999 * process.c (wait_reading_process_output): 'waitchannels' was unset
5000 when read_kbd || !NILP (wait_for_cell); fix this.
5001
5994c183
PE
5002 Add GCC-style 'const' attribute to functions that can use it.
5003 * character.h (char_resolve_modifier_mask):
5004 * keyboard.h (make_ctrl_char):
5005 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5006 (init_character_once, next_almost_prime, init_fns, init_image)
5007 (flush_pending_output, init_sound):
5008 * mem-limits.h (start_of_data):
5009 * menu.h (finish_menu_items):
5010 Add ATTRIBUTE_CONST.
5011 * emacs.c (DEFINE_DUMMY_FUNCTION):
5012 Declare the dummy function with ATTRIBUTE_CONST.
5013 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5014 Add decls with ATTRIBUTE_CONST.
5015
26bccfae
PE
5016 Minor improvements to make_formatted_string.
5017 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5018 where int is good enough, as vsprintf returns an int.
5019 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5020
a8290ec3
DA
50212012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5022
5023 Use make_formatted_string to avoid double length calculation.
5024 * lisp.h (make_formatted_string): New prototype.
5025 * alloc.c (make_formatted_string): New function.
5026 * buffer.c (Fgenerate_new_buffer_name): Use it.
5027 * dbus.c (syms_of_dbusbind): Likewise.
5028 * editfns.c (Fcurrent_time_zone): Likewise.
5029 * filelock.c (get_boot_time): Likewise.
5030 * frame.c (make_terminal_frame, set_term_frame_name)
5031 (x_report_frame_params): Likewise.
5032 * image.c (gs_load): Likewise.
5033 * minibuf.c (get_minibuffer): Likewise.
5034 * msdos.c (dos_set_window_size): Likewise.
5035 * process.c (make_process): Likewise.
5036 * xdisp.c (ensure_echo_area_buffers): Likewise.
5037 * xsettings.c (apply_xft_settings): Likewise.
5038
d01ba2f1
GM
50392012-07-09 Glenn Morris <rgm@gnu.org>
5040
5041 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5042 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5043 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5044 * nsterm.h (ns_etc_directory): Add it.
5045 * callproc.c [HAVE_NS]: Include nsterm.h.
5046 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5047
f1f924b6
DA
50482012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5049
5050 Move marker debugging code under MARKER_DEBUG.
5051 * marker.c (MARKER_DEBUG): Move marker debugging code under
5052 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5053 for bootstrap with --enable-checking (~3x slowdown reported
5054 by Juanma Barranquero <lekktu@gmail.com>).
5055 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5056
ab531b66
PE
50572012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5058
5059 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5060 See <http://bugs.gnu.org/11825#29>.
5061
c4b3bc8a
EZ
50622012-07-08 Eli Zaretskii <eliz@gnu.org>
5063
5064 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5065 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
5066 (display_line): Add commentary about displaying truncation glyphs
5067 on GUI frames.
5068 (produce_special_glyphs): Move here from term.c.
5069
5070 * term.c (produce_special_glyphs): Move to xdisp.c.
5071
5072 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5073 section.
c4b3bc8a 5074
b676b881
AS
50752012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5076
f17c5273
AS
5077 * xdisp.c (display_line): Avoid warning about implicit declaration
5078 of FRAME_FONT.
5079
298819b9
AS
5080 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5081
b676b881
AS
5082 * lisp.h: Remove empty conditional.
5083
6045c4fd
PE
50842012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5085
b3350bf9
PE
5086 * lread.c (load_path_check): Now static.
5087
6045c4fd
PE
5088 Fix some minor --with-ns problems found by static checking.
5089 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5090 (x_set_font) [!HAVE_X_WINDOWS]:
5091 * image.c (xpm_load_image) [HAVE_NS]:
5092 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5093 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5094 Remove unused local.
5095 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5096 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5097 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5098 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5099 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5100 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5101 Fix pointer signedness problem.
5102 * xfaces.c (FRAME_X_FONT_TABLE):
5103 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5104
929e7845
GM
51052012-07-07 Glenn Morris <rgm@gnu.org>
5106
5107 * lread.c (load_path_check): New function, split from init_lread.
5108 (init_lread): Reorganize. Motivation:
5109 If EMACSLOADPATH is set, check/warn about that rather than the
5110 defaults, which we are not going to use. Hence we can remove
5111 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5112 Don't warn if site-lisp directories are missing.
5113 If not installed, start from a blank load-path, since
5114 PATH_LOADSEARCH refers to the eventual installation directories.
5115
58dd0aa4
EZ
51162012-07-07 Eli Zaretskii <eliz@gnu.org>
5117
5118 Support truncation and continuation glyphs on GUI frames, when
5119 fringes are disabled. (Bug#11832)
5120 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
5121 continuation glyphs even if on GUI frames.
5122 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
5123 or both, are absent.
5124 (start_display, move_it_in_display_line_to): Handle the case of a
5125 GUI frame without a fringe to display continuation or truncation
5126 glyphs.
5127 (insert_left_trunc_glyphs): Support GUI frames: make sure
5128 truncation glyphs overwrite enough glyphs from the current line to
5129 have sufficient space in pixels.
5130 (display_line): Support truncation and continuation glyphs on GUI
5131 frames. If some spare pixels are left on the line after inserting
5132 the truncation glyphs, fill that space with a stretch glyph of a
5133 suitably computed width.
5134
5135 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5136 produce_glyphs, to support GUI sessions.
5137
31571fd7
PE
51382012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5139
5a16b9bc
PE
5140 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5141
f3047c75
PE
5142 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5143
31571fd7
PE
5144 Do not require float-time's arg to fit in time_t (Bug#11825).
5145 This works better on hosts where time_t is unsigned, and where
5146 float-time is applied to the (negative) difference between two times.
5147 * editfns.c (decode_time_components): Last arg is now double *,
5148 not int *, and means to store all the result as a double, without
5149 worrying about whether the seconds part fits in time_t.
5150 All callers changed.
5151 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5152 All callers changed.
5153 (Ffloat_time): Do not fail merely because the specified time falls
5154 outside of time_t range.
5155
4516fbef
GM
51562012-07-07 Glenn Morris <rgm@gnu.org>
5157
5158 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5159 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5160 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5161
07adc2c6
JB
51622012-07-07 Juanma Barranquero <lekktu@gmail.com>
5163
5164 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5165 Update dependencies.
5166
5167 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5168
fd573f31
PE
51692012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5170
fee5959d
PE
5171 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5172 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5173 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5174 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5175 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5176 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5177
fd573f31
PE
5178 * xfont.c (compare_font_names): Redo to omit the need for casts.
5179
ddadbc0e
AS
51802012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5181
fca8d6b6
AS
5182 * xfns.c (Fx_change_window_property): Doc fix.
5183 * w32fns.c (Fx_change_window_property): Doc fix.
5184
ddadbc0e
AS
5185 * w32fns.c (Fx_window_property): Accept the same arguments as the
5186 X Windows version. Doc fix.
5187 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5188
ed9265fc 51892012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
5190 Eli Zaretskii <eliz@gnu.org>
5191
5192 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5193 Windows-specific code from nt/config.nt moved here.
5194 Obsolete settings removed.
5195
216ee680
PE
51962012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5197
5198 * process.c: Avoid unnecessary calls to gettime.
5199 (wait_reading_process_output): Don't get the time of day
5200 when gobbling data immediately and not waiting, as there's no need
5201 for it in that case. This removes a FIXME.
5202
bdd091e4
JD
52032012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5204
5205 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5206 is defined (Bug#11768).
5207
9d44f8ce
DA
52082012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5209
5210 Fix marker debugging code.
5211 * marker.c (byte_char_debug_check): Do not perform the check
5212 if buffer is not multibyte.
090bd7cb
JB
5213 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5214 Call byte_char_debug_check with correct arguments.
9d44f8ce 5215
90fc4786
DA
52162012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5217
5218 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
5219 * marker.c (byte_char_debug_check, count_markers):
5220 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
5221 (byte_debug_flag): Remove.
5222 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5223 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5224
7b7ae965
DA
52252012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5226
4e57b342
DA
5227 Avoid code repetition in marker-related functions.
5228 * marker.c (attach_marker): New function.
5229 (Fset_marker, set_marker_restricted, set_marker_both)
5230 (set_marker_restricted_both): Use it.
5231 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5232 Consistently rename charno to charpos.
5233 (marker_position): Add eassert.
5234 (marker_byte_position): Convert to eassert.
5235
52362012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5237
5238 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 5239 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 5240 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 5241
657924ff
DA
52422012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5243
5244 Introduce fast path for the widely used marker operation.
5245 * alloc.c (build_marker): New function.
5246 * lisp.h (build_marker): New prototype.
5247 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5248 * composite.c (autocmp_chars): Likewise.
5249 * editfns.c (buildmark): Remove.
5250 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5251 (save_restriction_save): Use build_marker.
5252 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5253 * window.c (save_window_save): Likewise.
5254
041a49a6
DA
52552012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5256
5257 Do not use Fdelete_overlay in delete_all_overlays
5258 to avoid redundant calls to unchain_overlay.
5259 * buffer.c (drop_overlay): New function.
5260 (delete_all_overlays, Fdelete_overlay): Use it.
5261 * minibuf.c (get_minibuffer): Fix comment.
5262
7dca65a4
PE
52632012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5264
5265 Port to OpenBSD 5.1 amd64.
5266 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5267 This is needed for OpenBSD, and should be harmless on all BSD systems.
5268 Also, include <sys/sysctl.h>, as it should be available on all
5269 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5270 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5271 use p_pid member, not kp_proc.pid.
5272
8eb876e2
GM
52732012-07-06 Glenn Morris <rgm@gnu.org>
5274
5275 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5276
38182d90
PE
52772012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5278
5279 More xmalloc and related cleanup.
5280 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5281 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5282 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5283 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5284 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5285 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5286 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5287 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5288 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5289 * xterm.c:
5290 Omit needless casts involving void * pointers and allocation.
5291 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5292 as the former is more robust if P's type is changed.
5293 Prefer xzalloc to xmalloc + memset 0.
5294 Simplify malloc-or-realloc to realloc.
5295 Don't worry about xmalloc returning a null pointer.
5296 Prefer xstrdup to xmalloc + strcpy.
5297 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5298 growing it.
5299 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5300 alloca of a constant.
5301
6dd5a677
EZ
53022012-07-05 Eli Zaretskii <eliz@gnu.org>
5303
5304 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5305 hscroll is larger than the line width. Fixes long and futile
5306 looping inside extend_face_to_end_of_line (on a TTY) producing
5307 glyphs that are not needed and thrown away.
5308
6b312f0f
DA
53092012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5310
5311 * marker.c (set_marker_restricted_both): Simplify by using
5312 clip_to_bounds.
5313
f520ef9b
PE
53142012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5315
5316 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5317
383b7c95
JD
53182012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5319
5320 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5321 not defined (Bug#11768).
5322 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5323 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5324 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5325 followed by gtk_box_set_homogeneous (Bug#11768).
5326 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
5327 (update_theme_scrollbar_width, xg_create_scroll_bar):
5328 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
5329 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5330 (is_box_type): New function (Bug#11768).
5331 (xg_tool_item_stale_p): Call is_box_type.
5293d758 5332 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
5333 with default display (Bug#11768).
5334
d6e7bf45
EZ
53352012-07-05 Eli Zaretskii <eliz@gnu.org>
5336
5337 * xdisp.c (window_hscroll_limited): New function.
5338 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5339 coordinates when window's hscroll is set to insanely large
5340 values. (Bug#11857)
5341
431391ec
JB
53422012-07-05 Juanma Barranquero <lekktu@gmail.com>
5343
5344 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5345 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5346
23f86fce
DA
53472012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5348
5349 Cleanup xmalloc.
5350 * lisp.h (xzalloc): New prototype. Omit needless casts.
5351 * alloc.c (xzalloc): New function. Omit needless casts.
5352 * charset.c: Omit needless casts. Convert all calls to
5353 xmalloc with following memset to xzalloc.
5354 * dispnew.c: Likewise.
5355 * fringe.c: Likewise.
5356 * image.c: Likewise.
5357 * sound.c: Likewise.
5358 * term.c: Likewise.
5359 * w32fns.c: Likewise.
5360 * w32font.c: Likewise.
5361 * w32term.c: Likewise.
5362 * xfaces.c: Likewise.
5363 * xfns.c: Likewise.
5364 * xterm.c: Likewise.
5365 * atimer.c: Omit needless casts.
5366 * buffer.c: Likewise.
5367 * callproc.c: Likewise.
5368 * ccl.c: Likewise.
5369 * coding.c: Likewise.
5370 * composite.c: Likewise.
5371 * doc.c: Likewise.
5372 * doprnt.c: Likewise.
5373 * editfns.c: Likewise.
5374 * emacs.c: Likewise.
5375 * eval.c: Likewise.
5376 * filelock.c: Likewise.
5377 * fns.c: Likewise.
5378 * gtkutil.c: Likewise.
5379 * keyboard.c: Likewise.
5380 * lisp.h: Likewise.
5381 * lread.c: Likewise.
5382 * minibuf.c: Likewise.
5383 * msdos.c: Likewise.
5384 * print.c: Likewise.
5385 * process.c: Likewise.
5386 * region-cache.c: Likewise.
5387 * search.c: Likewise.
5388 * sysdep.c: Likewise.
5389 * termcap.c: Likewise.
5390 * terminal.c: Likewise.
5391 * tparam.c: Likewise.
5392 * w16select.c: Likewise.
5393 * w32.c: Likewise.
5394 * w32reg.c: Likewise.
5395 * w32select.c: Likewise.
5396 * w32uniscribe.c: Likewise.
5397 * widget.c: Likewise.
5398 * xdisp.c: Likewise.
5399 * xmenu.c: Likewise.
5400 * xrdb.c: Likewise.
5401 * xselect.c: Likewise.
5402
0497dc44
PE
54032012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5404
5405 * fileio.c (time_error_value): Check the right error number.
5406 Problem reported by Troels Nielsen in
5407 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5408
356e7178
PE
54092012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5410
4e71fd89
PE
5411 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5412 This should be fixed in a better way; see Eli Zaretskii in
5413 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5414 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5415
f0941253
PE
5416 * fileio.c (time_error_value): Rename from special_mtime.
5417 The old name's problems were noted by Eli Zaretskii in
5418 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5419
065c9eb4
PE
5420 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5421 This variable's comment says Emacs needs at least one GDB-visible
5422 symbol of type enum pvec_type, to work around GDB problems.
5423 The symbol's value doesn't matter.
5424
356e7178
PE
5425 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5426 that causes compilation to fail on pre-C99 compilers.
5427
ed9265fc 54282012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
5429
5430 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5431 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5432
3884d954
DA
54332012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5434
d209e2fb 5435 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
5436 headers for buffer_defaults and buffer_local_symbols.
5437 Reported by Juanma Barranquero <lekktu@gmail.com>.
5438
ee28be33
SM
54392012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5440
5441 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5442 * lisp.h (enum pvec_type): Use fewer bits.
5443 (PSEUDOVECTOR_SIZE_BITS): New constant.
5444 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5445 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5446 change in pvec_type.
5447 (PSEUDOVECTOR_TYPEP): New macro.
5448 (TYPED_PSEUDOVECTORP): Use it.
5449 * fns.c (internal_equal): Adapt code to extract pvectype.
5450 * emacs.c (gdb_pvec_type): Update type.
5451 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5452 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5453 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5454 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5455 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5456 abusing vector->header.next.nbytes.
5457 (live_vector_p): Use PVEC_TYPE.
5458 (mark_object): Adapt code to extract pvectype. Use switch.
5459
c7f2cd7f
PE
54602012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5461
5462 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5463 Tighten new eassert a bit.
5464
8ce70ed2
DA
54652012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5466
5467 Fix compilation with --enable-gcc-warnings and -O1
5468 optimization level.
5469 * doprnt.c (doprnt): Change type of tem to int, initialize
5470 to avoid compiler warning. Add eassert.
5471 * search.c (simple_search): Initialize match_byte to avoid
5472 compiler warning. Add eassert.
5473
dea7f1e5
PE
54742012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5475
24a212eb
PE
5476 Avoid weird behavior with large horizontal scrolls.
5477 Without this change, for example, large hscroll values would
5478 mess up Emacs's display on Fedora 15 x86, presumably due to
5479 overflows in int calculations in the display code.
5480 Also, if buffers had long lines, Emacs would freeze.
5481 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5482 (set_window_hscroll): New function, containing the old guts of
5483 Fset_window_hscroll. Return the clipped value.
5484 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5485 This avoids the need to check against PTRDIFF_MAX.
5486
dea7f1e5
PE
5487 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5488
76046526
DA
54892012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5490
5491 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5492
39adff0d
PE
54932012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5494
63807d47
PE
5495 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5496 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5497 since GCC 4.4.6 issues a bogus warning for them.
5498
39adff0d
PE
5499 Fix bugs in file timestamp newness comparisons.
5500 * fileio.c (Ffile_newer_than_file_p):
5501 * lread.c (Fload): Use full timestamp resolution of files,
5502 not just the 1-second resolution, so that files that are only
5503 slightly newer still count as newer.
5504 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5505 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5506
dbeed9a6
PE
55072012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5508
5509 * fileio.c: Improve handling of file time marker. (Bug#11852)
5510 (special_mtime): New function.
5511 (Finsert_file_contents, Fverify_visited_file_modtime):
5512 Use it to set special mtime values consistently.
5513
636334d6
AS
55142012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5515
5516 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5517 marker for non-existing file. (Bug#11852)
5518
e2017fe2
GM
55192012-07-03 Glenn Morris <rgm@gnu.org>
5520
5521 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5522 and did not make it into globals.h).
5523
404dbd37
TT
55242012-07-03 Tom Tromey <tromey@redhat.com>
5525
5526 * window.c (Fset_window_margins, Fset_window_fringes)
5527 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5528 * textprop.c (Fprevious_property_change): No longer static.
5529 * syntax.c (Fsyntax_table_p): No longer static.
5530 * process.c (Fget_process, Fprocess_datagram_address): No longer
5531 static.
5532 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5533 * keyboard.c (Fcommand_execute): No longer static.
5534 Remove EXFUN.
5535 * insdel.c (Fcombine_after_change_execute): No longer static.
5536 * image.c (Finit_image_library): No longer static.
5537 * fileio.c (Fmake_symbolic_link): No longer static.
5538 * eval.c (Ffetch_bytecode): No longer static.
5539 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
5540 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5541 No longer static.
404dbd37
TT
5542 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5543 static.
5544 * dired.c (Ffile_attributes): No longer static.
5545 * composite.c (Fcomposition_get_gstring): No longer static.
5546 * callproc.c (Fgetenv_internal): No longer static.
5547
5548 * ccl.h: Remove EXFUNs.
5549 * buffer.h: Remove EXFUNs.
5550 * dispextern.h: Remove EXFUNs.
5551 * intervals.h: Remove EXFUNs.
5552 * fontset.h: Remove EXFUN.
5553 * font.h: Remove EXFUNs.
5554 * dosfns.c (system_process_attributes): Remove EXFUN.
5555 * keymap.h: Remove EXFUNs.
5556 * lisp.h: Remove EXFUNs.
5557 * w32term.h: Remove EXFUNs.
5558 * window.h: Remove EXFUNs.
5559 * xsettings.h: Remove EXFUN.
5560 * xterm.h: Remove EXFUN.
5561
8e4fd1e1
GM
55622012-07-03 Glenn Morris <rgm@gnu.org>
5563
5564 * lisp.h (Frandom): Make it visible to C.
5565 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5566 buffer for invisible buffers. (Bug#1229)
5567
ca95b3eb
DA
55682012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5569
5570 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5571 values which aren't power of 2.
14ae4239
BT
5572 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5573 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
5574 accordingly.
5575
7555c33f
SM
55762012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5577
5578 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5579
5580 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5581
d12e8f5a
DA
55822012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5583
5584 * alloc.c (allocate_vector_block): Remove redundant
5585 calls to mallopt if DOUG_LEA_MALLOC is defined.
5586 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5587 avoid calls to mallopt if zero_vector is returned.
5588
296094c3
DA
55892012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5590
5591 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5592 is enabled, avoid dereferencing NULL current_sblock if
5593 running undumped.
5594
36429c89
DA
55952012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5596
5597 Cleanup basic buffer management.
5598 * buffer.h (struct buffer): Change layout to use generic vector
5599 marking code. Fix some comments. Change type of 'clip_changed'
5600 to bitfield. Remove unused #ifndef old.
5601 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5602 (GET_OVERLAYS_AT): Fix indentation.
5603 (for_each_per_buffer_object_at): New macro.
5604 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5605 (Fbuffer_local_variables): Use it.
5606 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5607 * alloc.c (allocate_buffer): Adjust to match new layout of
5608 struct buffer. Fix comment.
5609 (mark_overlay): New function.
5610 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5611 Lisp area of struct buffer.
5612 (mark_object): Use it. Adjust marking of misc objects
5613 and related comments.
5614
3b3e4cac
PE
56152012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5616
5617 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5618 wrapper that is not needed because the wrapped code is a no-op (zero
5619 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5620 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5621
cf5c0175
DA
56222012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5623
5624 * alloc.c (mark_buffer): Simplify. Remove prototype.
5625 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 5626 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
5627 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5628 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 5629
ca26824c
GM
56302012-06-30 Glenn Morris <rgm@gnu.org>
5631
2e4c5312
GM
5632 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5633
ca26824c
GM
5634 * epaths.in (PATH_SITELOADSEARCH): New.
5635 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5636 This is rather than relying on --enable-locallisppath elements
5637 having "site-lisp" in their names. (Bug#10208#25, 11658)
5638
0d23c240
EZ
56392012-06-30 Eli Zaretskii <eliz@gnu.org>
5640
c9240d7a
EZ
5641 * w32proc.c (sys_select): Accept and ignore one more argument.
5642
5643 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5644
0d23c240 5645 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 5646 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
5647
5648 * sysdep.c: Don't include dos.h and dosfns.h.
5649
5650 * process.c (sys_select):
5651 * msdos.c (sys_select): Accept one more argument and ignore it.
5652
5653 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5654 adapt data types and code to that.
5655
5656 * dosfns.c:
5657 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5658 which clashes with the gnulib function of the same name.
5659
af5a5a98
AS
56602012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5661
c5e4379c
AS
5662 * font.c (font_style_to_value, font_style_symbolic)
5663 (font_prop_validate_style): Add type checks for values in
5664 font_style_table.
5665
af5a5a98
AS
5666 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5667 argument.
5668 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5669 uses.
5670
8d38f461
EZ
56712012-06-29 Eli Zaretskii <eliz@gnu.org>
5672
2e5a6631
EZ
5673 * xdisp.c (try_window_id): Undo last change.
5674
8d38f461
EZ
5675 * w32.c (getwd): Adjust commentary about startup_dir.
5676 (init_environment): Always call sys_access, even in non-MSVC
5677 builds. Don't chdir to the directory of the Emacs executable.
5678 This undoes code from 1997 which was justified by the need to
5679 "avoid conflicts when removing and renaming directories". But its
5680 downside was that every relative file name was being interpreted
5681 relative to the directory of the Emacs executable, which can never
5682 be TRT. In particular, it broke sys_access when called with
5683 relative file names.
5684 (sys_access): Map GetLastError to errno.
5685
2af3565e
DA
56862012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5687
5688 * window.h (struct window): Change type of 'fringes_outside_margins'
5689 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 5690 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
5691 Adjust comment.
5692 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5693 to ptrdiff_t.
5694
c8d3a25c 56952012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 5696
c8d3a25c
GM
5697 * gnutls.c (emacs_gnutls_handshake):
5698 Add QUIT to make the loop interruptible.
57570cd3 5699
c8d3a25c 57002012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 5701
c8d3a25c
GM
5702 * charset.c (init_charset): Make lack of etc/charsets fatal.
5703
3e984ee8
DA
57042012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5705
5706 * editfns.c (region_limit): Fix type mismatch.
5707
ef884f23
DA
57082012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5709
5710 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5711 undefined. Convert from xassert to eassert.
5712 * nsmenu.m: Convert from xassert to eassert.
5713 * nsterm.m: Likewise.
5714
7d7e0027
SM
57152012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5716
5717 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5718
aa754e6a
PE
57192012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5720
5721 Avoid integer overflow on scroll-left and scroll-right.
5722 * window.c (HSCROLL_MAX): New macro.
5723 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5724 overflow when requested scroll falls outside ptrdiff_t range.
5725
80b00b08
DA
57262012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5727
5728 * window.h (struct window): Change type of 'hscroll',
5729 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5730 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5731 Adjust users accordingly.
5732 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5733 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5734 from EMACS_INT to ptrdiff_t.
5735 (make_window): Omit redundant initialization.
5736
62b2bcf6
JB
57372012-06-28 Juanma Barranquero <lekktu@gmail.com>
5738
5739 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5740
45942c7d
DA
57412012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5742
5743 * window.h (struct window): Change type of 'use_time' and
5744 'sequence_number' from Lisp_Object to int.
5745 * frame.c (make_frame): Adjust users accordingly.
5746 * print.c (print_object): Likewise.
5747 * window.c (select_window, Fwindow_use_time, make_parent_window)
5748 (make_window): Likewise.
5749
e509cfa6
DA
57502012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5751
5752 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5753 enabled with --enable-checking=[all,glyphs] configure option.
5754 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5755 adjust comments accordingly.
5756 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5757 undefined, adjust comments accordingly.
5758 * image.c: Likewise.
5759 * scroll.c: Likewise.
5760 * w32fns.c: Likewise.
5761 * w32term.c: Likewise.
5762 * xdisp.c: Likewise.
5763 * xfaces.c: Likewise.
5764 * xfns.c: Likewise.
5765 * xterm.c: Likewise.
5766
a54e2c05
DA
57672012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5768
5769 Generalize run-time debugging checks.
5770 * dispextern.h (XASSERTS): Remove.
5771 * fontset.c (xassert): Remove.
5772 Convert from xassert to eassert.
5773 * alloc.c: Convert from xassert to eassert.
5774 * bidi.c: Likewise.
5775 * dispnew.c: Likewise.
5776 * fns.c: Likewise.
5777 * fringe.c: Likewise.
5778 * ftfont.c: Likewise.
5779 * gtkutil.c: Likewise.
5780 * image.c: Likewise.
5781 * keyboard.c: Likewise.
5782 * menu.c: Likewise.
5783 * process.c: Likewise.
5784 * scroll.c: Likewise.
5785 * sound.c: Likewise.
5786 * term.c: Likewise.
5787 * w32console.c: Likewise.
5788 * w32fns.c: Likewise.
5789 * w32term.c: Likewise.
5790 * window.c: Likewise.
5791 * xdisp.c: Likewise.
5792 * xfaces.c: Likewise.
5793 * xfns.c: Likewise.
5794 * xselect.c: Likewise.
5795 * xterm.c: Likewise.
5796
1ec4b7b2
SM
57972012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5798
5799 * fns.c (maybe_resize_hash_table): Output message when growing the
5800 purify-hashtable.
5801
2014308a
DA
58022012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5803
5804 * alloc.c (allocate_string_data): Remove dead code.
5805 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5806 avoid GCC warning about unused macro.
5807
246155eb
DA
58082012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5809
5810 * alloc.c (allocate_string): Omit intervals initialization.
5811 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5812 as in make_pure_string and make_pure_c_string.
5813
43184b7b
DA
58142012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5815
d209e2fb 5816 * alloc.c (allocate_string): Fix last change.
43184b7b 5817
3fe6dd74
DA
58182012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5819
d209e2fb 5820 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
5821 to memset, add explicit initialization where appropriate.
5822
1ba6038a
GM
58232012-06-27 Glenn Morris <rgm@gnu.org>
5824
5825 * lisp.mk (lisp): Remove paths.elc.
5826
c89926a5
CY
58272012-06-27 Chong Yidong <cyd@gnu.org>
5828
5829 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5830
ed6b3510
JW
58312012-06-26 John Wiegley <johnw@newartisans.com>
5832
1ec4b7b2 5833 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
5834 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5835
ed6b3510
JW
5836 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5837 when building with Clang.
5838
8edd4a2b
SM
58392012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5840
5841 * eval.c (Fapply): Allow calling it with a single argument.
5842
f6f62d1b
EZ
58432012-06-26 Eli Zaretskii <eliz@gnu.org>
5844
5845 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5846 _stricmp and _strnicmp.
5847 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5848
62efea5e
DA
58492012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5850
5851 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5852 allocated window.
5853 (allocate_process): Likewise for new process.
8edd4a2b 5854 (allocate_terminal): Change to use offsetof.
62efea5e
DA
5855 (allocate_frame): Likewise.
5856 * frame.c (make_frame): Omit redundant initialization.
5857 * window.c (make_parent_window): Use memset.
5858 (make_window): Omit redundant initialization.
5859 * process.c (make_process): Omit redundant initialization.
5860 * terminal.c (create_terminal): Likewise.
5861
42997f4d
DA
58622012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5863
5864 * term.c (delete_tty): Remove redundant call to memset.
5865
1130ecfc
DA
58662012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5867
5868 * alloc.c: Remove build_string.
5869 * lisp.h: Define build_string as static inline. This provides
5870 a better opportunity to optimize away calls to strlen when the
5871 function is called with compile-time constant argument.
5872 * image.c (imagemagick_error): Convert to build_string.
5873 * w32proc.c (sys_spawnve): Likewise.
5874 * xterm.c (x_term_init): Likewise.
5875
cf38a720
PE
58762012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5877
99027bdd
PE
5878 Use sprintf return value instead of invoking strlen on result.
5879 In the old days this wasn't portable, since some sprintf
5880 implementations returned char *. But they died out years ago and
5881 Emacs already assumes sprintf returns int.
5882 Similarly for float_to_string.
5883 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5884 * ccl.c (ccl_driver):
5885 * character.c (string_escape_byte8):
5886 * data.c (Fnumber_to_string):
5887 * doprnt.c (doprnt):
5888 * print.c (print_object):
5889 * xdisp.c (message_dolog):
5890 * xfns.c (syms_of_xfns):
5891 Use sprintf or float_to_string result to avoid need to call strlen.
5892 * data.c (Fnumber_to_string):
5893 Use make_unibyte_string, since the string must be ASCII.
5894 * lisp.h, print.c (float_to_string): Now returns int length.
5895 * term.c (produce_glyphless_glyph):
5896 Use sprintf result rather than recomputing it.
5897
cf38a720
PE
5898 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5899 * Makefile.in (ALL_CFLAGS):
5900 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5901 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5902
3511c784
DA
59032012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5904
0a08eb21 5905 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
5906 strcasecmp if available.
5907 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5908
fb7da12e
AS
59092012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5910
5911 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5912 Avoid comma operator.
5913 * menu.c (push_submenu_start, push_submenu_end)
5914 (push_left_right_boundary, push_menu_pane): Likewise.
5915 * msdos.c (dos_rawgetc): Likewise.
5916
afa2ffd8
DA
59172012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5918
5919 * xfns.c (xic_create_fontsetname): Remove redundant calls
5920 to memset.
5921
b3b4476b
PE
59222012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5923
4495ff38
PE
5924 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5925 sprintf already null-terminates its output.
5926
b3b4476b
PE
5927 * xfns.c (x_window): Remove redundant cast.
5928
b00876c9
DA
59292012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5930
5931 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5932 `const char *' to `char *' to avoid compiler warning.
5933
d188e26b
PE
59342012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5935
885d1d74
PE
5936 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5937 instead of truncating it to 63 (admittedly a generous limit).
5938
d188e26b
PE
5939 * process.c: Fix spelling and caps in comments.
5940
e2f560b1
DN
59412012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5942
e86db54b 5943 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
5944 * sysdep.c (setpgrp): Remove definition, not used in this file.
5945
7583a3a1
JB
59462012-06-24 Juanma Barranquero <lekktu@gmail.com>
5947
5948 * makefile.w32-in: Update dependencies.
5949
696056c2
EZ
59502012-06-24 Eli Zaretskii <eliz@gnu.org>
5951
5952 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5953 (SYSTIME_H): Add nt/inc/sys/time.h.
5954
5955 * systime.h [WINDOWSNT]: Include sys/time.h.
5956
5957 * s/ms-w32.h (struct timespec): Definition moved from
5958 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5959
845ca893
PE
59602012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5961
5962 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5963 * buffer.h (buffer_slot_type_mismatch):
5964 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5965 * eval.c (unwind_to_catch):
5966 * image.c (my_png_error, my_error_exit):
5967 * keyboard.c (quit_throw_to_read_char, user_error)
5968 (Fexit_recursive_edit, Fabort_recursive_edit):
5969 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5970 (wrong_type_argument, buffer_overflow, __executable_start)
5971 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5972 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5973 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5974 (fatal):
5975 (child_setup) [!DOS_NT]:
5976 * lread.c (end_of_file_error, invalid_syntax):
5977 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5978 * puresize.h (pure_write_error):
5979 * search.c (matcher_overflow):
5980 * sound.c (sound_perror, alsa_sound_perror):
5981 * sysdep.c, syssignal.h (croak):
5982 * term.c (maybe_fatal, vfatal):
5983 * textprop.c (text_read_only):
5984 * undo.c (user_error):
5985 * unexmacosx.c (unexec_error):
5986 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5987 Use _Noreturn rather than NO_RETURN.
5988 No need for separate decl merely because of _Noreturn.
5989 * sound.c (sound_warning, parse_sound):
5990 Remove unnecessary forward decls.
5991
f1dd8073
PE
59922012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5993
5994 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5995 * lisp.h (WAIT_READING_MAX): New macro.
5996 * dispnew.c (Fsleep_for, sit_for):
5997 * keyboard.c (kbd_buffer_get_event):
5998 * process.c (Faccept_process_output):
5999 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6000 This improves on the previous patch, which introduced a bug
6001 when time_t is unsigned and as wide as intmax_t.
6002 See <http://bugs.gnu.org/9000#51>.
6003
b82c1755
EZ
60042012-06-23 Eli Zaretskii <eliz@gnu.org>
6005
6006 * dispnew.c (sit_for, Fsleep_for):
6007 * keyboard.c (kbd_buffer_get_event):
6008 * process.c (Faccept_process_output): Avoid compiler warnings when
6009 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6010
ca300656
JB
60112012-06-23 Juanma Barranquero <lekktu@gmail.com>
6012
049ec95b
JB
6013 * makefile.w32-in: Update dependencies.
6014
ca300656
JB
6015 * w32.c (ltime): Add return type and declare static.
6016 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6017
db7b8d06
PE
60182012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6019
6020 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6021 Privately reported by Herbert J. Skuhra.
6022 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6023 All uses changed.
6024 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6025 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6026
0bd8297f
EZ
60272012-06-23 Eli Zaretskii <eliz@gnu.org>
6028
96512555
EZ
6029 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6030 last argument of make_unibyte_string.
6031
0bd8297f
EZ
6032 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6033 language ID in the event parameters.
6034
6035 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6036 event.code, not the obscure "character set ID".
6037
63def6b6
CY
60382012-06-23 Chong Yidong <cyd@gnu.org>
6039
6040 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6041
e8a02204
EZ
60422012-06-23 Eli Zaretskii <eliz@gnu.org>
6043
388cdec0
EZ
6044 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6045 * w32.c (fdutimens): New function.
6046
6047 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6048
6049 * s/ms-w32.h (pselect): Redirect to sys_select.
6050
6051 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6052
e8a02204
EZ
6053 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6054 in the logic of incrementing and decrementing the value of
6055 use_relocatable_buffers.
6056
d054f3fb
PE
60572012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6058
6059 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6060 Privately reported by Herbert J. Skuhra.
6061 [__FreeBSD__]: Remove "*/" typo after "#include".
6062 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6063 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6064 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6065 Don't assume EMACS_TIME and struct timeval are the same type.
6066
d35af63c
PE
60672012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6068
6069 Support higher-resolution time stamps (Bug#9000).
6070 The time stamps are only nanosecond-resolution at the C level,
6071 since that's the best that any real-world system supports now.
6072 But they are picosecond-resolution at the Lisp level, as that's
6073 easy, and leaves room for future OS improvements.
6074
6075 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6076 (LIBES): Use it.
6077
6078 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6079 Don't get current time unless it's needed.
6080
6081 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6082 now provides it if it's absent.
6083 (start_atimer): Port to higher-res time stamps.
6084 Check for time stamp overflow. Don't get current time more
6085 often than is needed.
6086
6087 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6088 Include systime.h, not time.h.
6089 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6090
6091 * dired.c: Include stat-time.h.
6092 (Ffile-attributes): File times now have higher resolution.
6093
6094 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6095 (struct image): Timestamp now has higher resolution.
6096
6097 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6098 has at least microseconds now. All uses removed.
6099 (update_frame, update_single_window, update_window, update_frame_1)
6100 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 6101 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
6102
6103 * editfns.c (time_overflow): Now extern.
6104 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6105 (float-time, Fformat_time_string, Fcurrent_time_string)
6106 (Fcurrent_time_zone): Accept and generate higher-resolution
6107 time stamps.
6108 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6109 (decode_time_components, lisp_seconds_argument): New functions.
6110 (make_time): Now static.
6111 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6112 Report an error if the time is invalid, rather than having the caller
6113 do that.
6114
6115 * fileio.c: Include <stat-time.h>
6116 (Fcopy_file): Copy higher-resolution time stamps.
6117 Prefer to set the time stamp via a file descriptor if that works.
6118 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6119 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6120 (Fvisited_file_modtime, Fset_visited_file_modtime):
6121 Support higher-resolution time stamps.
6122
6123 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6124
6125 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6126
6127 * image.c (prepare_image_for_display, clear_image_cache)
6128 (lookup_image): Port to higer-resolution time stamps.
6129
6130 * keyboard.c (start_polling, bind_polling_period):
6131 Check for time stamp overflow.
6132 (read_char, kbd_buffer_get_event, timer_start_idle)
6133 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6134 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6135 Port to higher-resolution time stamps. Do not assume time_t is signed.
6136 (decode_timer): New function. Timers are now vectors of length 9,
6137 not 8, to accommodate the picosecond component.
6138 (timer_check_2): Use it.
6139
6140 * nsterm.m (select_timeout, timeval_subtract): Remove.
6141 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6142 as they're a bit more accurate and handle overflow better.
6143 (ns_select): Change prototype to be compatible with pselect.
6144 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6145 * nsterm.h (ns_select): Adjust prototype.
6146
6147 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6148 us-resolution time stamps.
6149 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6150
6151 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6152
6153 * lisp.h (time_overflow): New decl.
6154 (wait_reading_process_output): First arg is now intmax_t, not int,
6155 to accommodate larger waits.
6156
6157 * process.h (struct Lisp_Process.read_output_delay):
6158 Now counts nanoseconds, not microseconds.
6159 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6160 EMACS_HAS_USECS.
6161 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6162 (wait_reading_process_output):
6163 Port to ns-resolution time stamps.
6164 (Faccept_process_output, wait_reading_process_output):
6165 Check for time stamp overflow. Do not assume time_t is signed.
6166 (select_wrapper): Remove; we now use pselect.
6167 (Fprocess_attributes): Now generates ns-resolution time stamps.
6168
6169 * sysdep.c: Include utimens.h. Don't include utime.h
6170 or worry about struct utimbuf; gnulib does that for us now.
6171 (gettimeofday): Remove; gnulib provides a substitute.
6172 (make_timeval): New function.
6173 (set_file_times): Now sets ns-resolution time stamps.
6174 New arg FD; all uses changed.
6175 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6176 (system_process_attributes):
6177 Now returns ns-resolution time stamp. All uses changed.
6178 Check for time stamp overflow.
6179
6180 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6181 provides a substitute now.
6182
6183 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6184 since it guarantees struct timespec.
6185 (EMACS_TIME): Now struct timespec, so that we can support
6186 ns-resolution time stamps.
6187 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6188 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6189 (EMACS_USECS): Remove.
6190 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6191 so multiply the arg by 1000 before storing it.
6192 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6193 New macros.
6194 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6195 Port to ns-resolution time stamps.
6196 (EMACS_TIME_NEG_P): Remove; replaced by....
6197 (EMACS_TIME_SIGN): New macro.
6198 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6199 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6200 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6201 (make_timeval, make_lisp_time, decode_time_components): New decls.
6202 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6203 that it mishandled time_t overflow. You can't compare by subtracting!
6204 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6205 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6206
6207 * term.c: Include <sys/time.h>.
6208 (timeval_to_Time): New function, for proper overflow wraparound.
6209 (term_mouse_position, term_mouse_click): Use it.
6210
6211 * undo.c (record_first_change): Support higher-resolution time stamps
6212 in the undo buffer.
6213 (Fprimitive_undo): Use them when restoring time stamps.
6214
6215 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6216 (w32_get_internal_run_time):
6217 Port to higher-resolution Emacs time stamps.
6218 (ltime): Now accepts single 64-bit integer, as that's more convenient
6219 for callers.
6220
6221 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6222
6223 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6224 for compatibility with pselect. Support ns-resolution time stamps.
6225
6226 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6227
6228 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6229 Check for time stamp overflow, and support ns-resolution time stamps.
6230
6231 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6232 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6233 (timeval_subtract): Remove; no longer needed.
6234 (XTflash, XTring_bell, x_wait_for_event):
6235 Port to ns-resolution time stamps. Don't assume time_t is signed.
6236
b6a92dfe
CY
62372012-06-22 Chong Yidong <cyd@gnu.org>
6238
6239 * xdisp.c (x_consider_frame_title): Revert last change.
6240
d251c37c
EZ
62412012-06-22 Eli Zaretskii <eliz@gnu.org>
6242
6243 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6244 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6245 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6246 staticidx goes up to 1597 out of 1600 = 0x640.)
6247
f10deafb
PE
62482012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6249
6250 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6251 Otherwise, the umask might be mistakenly 0 while handling input signals.
6252
ec6de1e2
SM
62532012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6254
6255 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6256
28be1ada
DA
62572012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6258
6259 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6260 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6261 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6262 access to `contents' member of Lisp_Vector objects with AREF and ASET
6263 where appropriate.
6264
c6bf3022
CY
62652012-06-19 Chong Yidong <cyd@gnu.org>
6266
6267 * frame.c (delete_frame): When selecting a frame on a different
6268 text terminal, do not alter the terminal's top-frame.
6269
6270 * xdisp.c (format_mode_line_unwind_data): Record the target
6271 frame's selected window and its terminal's top-frame.
6272 (unwind_format_mode_line): Restore them.
6273 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6274 Callers changed.
6275 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6276 since tty frames can be explicitly named.
6277 (prepare_menu_bars): Likewise.
6278
6279 * term.c (Ftty_top_frame): New function.
6280
defd4196
PE
62812012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6282
6283 Port byte-code-meter to modern targets.
6284 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6285 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 6286 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
6287 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6288 (METER_1, METER_2): Simplify.
6289
1053a871
SM
62902012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6291
6292 * data.c (Fdefalias): Return `symbol' (bug#11686).
6293
b7e8d081
MR
62942012-06-18 Martin Rudalics <rudalics@gmx.at>
6295
6296 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
6297 gets killed during executing of this function (Bug#11665).
6298 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
6299 (Vkill_buffer_query_functions): In doc-string say that functions
6300 run by this hook should not change the current buffer.
6301
7ea2b339
PE
63022012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6303
6304 Fix recently-introduced process.c problems found by static checking.
6305 * process.c (write_queue_push, write_queue_pop, send_process):
6306 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6307 (write_queue_pop): Fix pointer signedness problem.
6308 (send_process): Remove unused local.
6309
96a313a1
CY
63102012-06-17 Chong Yidong <cyd@gnu.org>
6311
6312 * xdisp.c (redisplay_internal): No need to redisplay terminal
6313 frames that are not on top.
6314
20ca2e94
TN
63152012-06-17 Troels Nielsen <bn.troels@gmail.com>
6316
6317 * process.c (make_process): Initialize write_queue.
6318 (write_queue_push, write_queue_pop): New functions.
6319 (send_process): Use them to maintain correct ordering of process
6320 writes (Bug#10815).
6321
9a900ca9
PE
63222012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6323
310fbfa8
PE
6324 * lisp.h (eassert): Assume C89 or later.
6325 This removes the need for CHECK.
6326 (CHECK): Remove. Its comments about always evaluating its
6327 argument were confusing, as 'eassert' typically does not evaluate
6328 its argument.
6329
27bb1ca4
PE
6330 * coding.c (produce_chars): Use ptrdiff_t, not int.
6331
9a900ca9
PE
6332 * xterm.c (x_draw_underwave): Check for integer overflow.
6333 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6334
41b7f8bc 63352012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
6336
6337 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6338 referenced (Bug#11583).
6339
9b0e3eba
AA
63402012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6341
6342 Implement wave-style variant of underlining.
6343 * dispextern.h (face_underline_type): New enum.
6344 (face): Add field for underline type.
6345 * nsterm.m (ns_draw_underwave): New function.
6346 (ns_draw_text_decoration): Use it.
6347 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6348 New functions.
6349 (x_draw_glyph_string): Use them.
6350 * xfaces.c (Qline, Qwave): New Lisp objects.
6351 (check_lface_attrs, merge_face_ref)
1053a871
SM
6352 (Finternal_set_lisp_face_attribute, realize_x_face):
6353 Handle wave-style underline face attributes.
9b0e3eba
AA
6354 * xterm.c (x_draw_underwave): New function.
6355 (x_draw_glyph_string): Use it.
6356
0fb52f11
JB
63572012-06-16 Juanma Barranquero <lekktu@gmail.com>
6358
6359 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6360 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6361 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6362 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6363 ($(BLD)/w32select.$(O)): Update dependencies.
6364
e5560ff7
AS
63652012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6366
6367 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6368 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6369 * character.c (_fetch_multibyte_char_p): Remove.
6370 * alloc.c: Include "character.h" before "buffer.h".
6371 * bidi.c: Likewise.
6372 * buffer.c: Likewise.
6373 * bytecode.c: Likewise.
6374 * callint.c: Likewise.
6375 * callproc.c: Likewise.
6376 * casefiddle.c: Likewise.
6377 * casetab.c: Likewise.
6378 * category.c: Likewise.
6379 * cmds.c: Likewise.
6380 * coding.c: Likewise.
6381 * composite.c: Likewise.
6382 * dired.c: Likewise.
6383 * dispnew.c: Likewise.
6384 * doc.c: Likewise.
6385 * dosfns.c: Likewise.
6386 * editfns.c: Likewise.
6387 * emacs.c: Likewise.
6388 * fileio.c: Likewise.
6389 * filelock.c: Likewise.
6390 * font.c: Likewise.
6391 * fontset.c: Likewise.
6392 * fringe.c: Likewise.
6393 * indent.c: Likewise.
6394 * insdel.c: Likewise.
6395 * intervals.c: Likewise.
6396 * keyboard.c: Likewise.
6397 * keymap.c: Likewise.
6398 * lread.c: Likewise.
6399 * macros.c: Likewise.
6400 * marker.c: Likewise.
6401 * minibuf.c: Likewise.
6402 * nsfns.m: Likewise.
6403 * nsmenu.m: Likewise.
6404 * print.c: Likewise.
6405 * process.c: Likewise.
6406 * regex.c: Likewise.
6407 * region-cache.c: Likewise.
6408 * search.c: Likewise.
6409 * syntax.c: Likewise.
6410 * term.c: Likewise.
6411 * textprop.c: Likewise.
6412 * undo.c: Likewise.
6413 * unexsol.c: Likewise.
6414 * w16select.c: Likewise.
6415 * w32fns.c: Likewise.
6416 * w32menu.c: Likewise.
6417 * window.c: Likewise.
6418 * xdisp.c: Likewise.
6419 * xfns.c: Likewise.
6420 * xmenu.c: Likewise.
6421 * xml.c: Likewise.
6422 * xselect.c: Likewise.
6423
2f07e6af
EZ
64242012-06-16 Eli Zaretskii <eliz@gnu.org>
6425
1053a871
SM
6426 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6427 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 6428 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
6429 row.
6430 (handle_face_prop): Use chunk-relative overlay string index when
6431 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
6432 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6433 the rightmost. (Bug#11720)
2f07e6af 6434
29b83cec
AS
64352012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6436
6437 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6438 (CATEGORY_MEMBER): Enforce 1/0 value.
6439 * category.c (_temp_category_set): Remove.
6440
4c5501e9
EZ
64412012-06-16 Eli Zaretskii <eliz@gnu.org>
6442
6443 * window.c (Fdelete_other_windows_internal)
6444 (Fdelete_window_internal): Don't access frame's mouse highlight
6445 info of the initial frame. (Bug#11677)
6446
2b570124
PE
64472012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6448
e93864f9
PE
6449 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6450 Assume USE_2_TAGS_FOR_INTS.
6451 (xreload): Adjust $tagmask width to match recent lisp.h change.
6452
2b570124
PE
6453 Simplify lisp.h in minor ways that should not affect code.
6454 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6455 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6456 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6457 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6458 (INTTYPEBITS): New macro, for clarity.
6459 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
6460 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6461 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
6462 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6463 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6464
81755f69
JB
64652012-06-13 Juanma Barranquero <lekktu@gmail.com>
6466
6467 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6468
16192a57
GM
64692012-06-13 Glenn Morris <rgm@gnu.org>
6470
6471 * s/bsd-common.h (BSD4_3):
6472 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6473
646b5f55
AS
64742012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6475
6476 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6477 instead of union.
6478 (XLI, XIL): Define.
1053a871
SM
6479 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6480 Use them.
6481 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 6482 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 6483 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
6484 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6485 * frame.c (delete_frame): Remove outdated comment.
6486 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6487 USE_LISP_UNION_TYPE.
6488 (Fw32_unregister_hot_key): Likewise.
6489 (Fw32_toggle_lock_key): Likewise.
6490 * w32menu.c (add_menu_item): Likewise.
6491 (w32_menu_display_help): Use XIL instead of checking
6492 USE_LISP_UNION_TYPE.
6493 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6494 (init_heap): Likewise.
6495 * w32term.c (w32_read_socket): Update comment.
6496
1d3823c9
GM
64972012-06-13 Glenn Morris <rgm@gnu.org>
6498
c62ff706
GM
6499 * s/usg5-4-common.h, src/s/unixware.h:
6500 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6501
1d3823c9
GM
6502 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6503
bfe3e0a2
PE
65042012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6505
6506 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6507 * alloc.c (make_number) [!defined make_number]:
6508 Remove, as lisp.h always defines this now.
6509 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6510 (roundup_size): Verify that it is a power of 2.
6511 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6512 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6513 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6514 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6515 USE_LSB_TAG now is always defined to be either 0 or 1.
6516 All uses changed.
6517 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6518 code works fine either way, and efficiency is not a concern here,
6519 as the union type is for debugging, not for production.
6520 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6521 Use an inline function on all platforms when using the union type,
6522 since this is simpler and 'static inline' can be used portably
6523 within Emacs now.
6524 (LISP_INITIALLY_ZERO): New macro.
6525 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6526 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6527
45fa9c0f
GM
65282012-06-12 Glenn Morris <rgm@gnu.org>
6529
b4492cba
GM
6530 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6531
6532 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 6533
45fa9c0f
GM
6534 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6535 Move BROKEN_SIGIO to configure.
6536
6537 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6538 Move NO_TERMIO to configure.
6539
0e25d334
CY
65402012-06-12 Chong Yidong <cyd@gnu.org>
6541
6542 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6543 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6544 MagickExportImagePixels is undefined.
6545
43682bb6
PE
65462012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6547
6548 * image.c (imagemagick_load_image): Remove unused label.
6549
a9be7d2b
GM
65502012-06-11 Glenn Morris <rgm@gnu.org>
6551
6552 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6553 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6554 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6555 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6556
3017f87f
SM
65572012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6558
6559 * alloc.c (make_byte_code): New function.
6560 (Fmake_byte_code): Use it. Don't purify here.
6561 * lread.c (read1): Use it as well to avoid extra allocation.
6562
1b9b4cf4
CY
65632012-06-11 Chong Yidong <cyd@gnu.org>
6564
6565 * image.c (imagemagick_load_image): Implement transparency.
6566
95988fcf
AS
65672012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6568
6569 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6570 account for preceding backslashes. (Bug#11663)
6571
cd4eb164
CY
65722012-06-09 Chong Yidong <cyd@gnu.org>
6573
6574 * term.c: Support italics in capable terminals (Bug#9652).
6575 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6576 (turn_on_face): Output using TS_enter_italic_mode if available.
6577 Don't handle unused blinking and alt-charset cases.
6578 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6579 and tty_alt_charset_p cases.
6580 (tty_capable_p, init_tty): Support italics.
6581
6582 * termchar.h (struct tty_display_info): Add field for italics.
6583 Remove unused blink field.
6584
6585 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6586 Handle slant.
6587
6588 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6589 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6590 tty_alt_charset_p. Add tty_italic_p.
6591
ff88beb8
MA
65922012-06-09 Michael Albinus <michael.albinus@gmx.de>
6593
6594 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6595 dbus_type_is_basic if available.
6596 (xd_extract_signed, xd_extract_unsigned): Rename from
6597 extract_signed and extract_unsigned, respectively. Adapt callers.
6598
44286096
CY
65992012-06-09 Chong Yidong <cyd@gnu.org>
6600
1682701f
CY
6601 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6602
44286096
CY
6603 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6604 case (Bug#9752).
6605
d86feb17
PE
66062012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6607
6608 * xdisp.c (vmessage): Treat frame message as multibyte.
6609 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6610 would generate the diagnostic "Making \302\247 buffer-local while
6611 let-bound!".
6612
d5c20fe8
EZ
66132012-06-08 Eli Zaretskii <eliz@gnu.org>
6614
6615 * dispnew.c (showing_window_margins_p): Undo last change, which
6616 was done due to an inadvertent commit.
6617 (adjust_frame_glyphs_for_frame_redisplay): Do call
6618 showing_window_margins_p.
6619
513749ee
SM
66202012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6621
6622 * eval.c (Fmake_var_non_special): New primitive.
6623 (syms_of_eval): Defsubr it.
6624 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6625
d4a8f5c1
JB
66262012-06-08 Juanma Barranquero <lekktu@gmail.com>
6627
6628 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6629 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6630
8bbbc977
EZ
66312012-06-08 Eli Zaretskii <eliz@gnu.org>
6632
6633 * alloc.c (allocate_vectorlike): Fix last change.
6634
f3372c87
DA
66352012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6636
6637 Block-based vector allocation of small vectors.
6638 * lisp.h (struct vectorlike_header): New field `nbytes',
6639 adjust comment accordingly.
6640 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 6641 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
6642 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6643 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6644 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6645 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6646 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6647 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6648 (roundup_size): New constant.
6649 (struct vector_block): New data type.
6650 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 6651 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
6652 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6653 (sweep_vectors): New functions.
6654 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 6655 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
6656 or equal to VBLOCK_BYTES_MAX.
6657 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6658 (init_alloc_once): Add call to init_vectors.
6659
4f18a4ed
SM
66602012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6661
6662 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6663
86f158bc
PE
66642012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6665
6666 * doprnt.c (doprnt): Truncate multibyte char correctly.
6667 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6668 would mishandle a string argument "Xc" if X was a multibyte
6669 character of length 2: it would truncate after X's first byte
6670 rather than including all of X.
6671
c5cfcbe0
CY
66722012-06-06 Chong Yidong <cyd@gnu.org>
6673
6674 * buffer.c (word_wrap): Doc fix.
6675
c05cf390
PE
66762012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6677
6678 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6679
0c3461de
GM
66802012-06-03 Glenn Morris <rgm@gnu.org>
6681
6682 * xdisp.c (tool-bar-style): Doc fix.
6683
c71232db
UM
66842012-06-03 Ulrich Müller <ulm@gentoo.org>
6685
6686 * Makefile.in (PAXCTL): Define.
6687 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6688 binary via PaX flags if the paxctl utility is available.
6689 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6690 Restore PaX flags to their default. (Bug#11398)
6691
383f7350
CY
66922012-06-03 Chong Yidong <cyd@gnu.org>
6693
6694 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6695 buffer (Bug#11226).
6696
5f2c76c6
CY
66972012-06-03 Chong Yidong <cyd@gnu.org>
6698
6699 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6700 (note_mode_line_or_margin_highlight): If there is no help echo,
6701 use mode-line-default-help-echo. Handle the case where the mouse
6702 position is past the end of the mode line string.
6703
6704 * buffer.c (buffer_local_value_1): New function, split from
6705 Fbuffer_local_value; can return Qunbound.
6706 (Fbuffer_local_value): Use it.
6707 (Vmode_line_format): Docstring tweaks.
6708
773d47f6
PE
67092012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6710
6711 * sysdep.c (system_process_attributes): Improve comment.
6712
f2d6a3df
SM
67132012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6714
6715 * keyboard.c: Export real-this-command to Elisp.
6716 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6717 and DEFVAR it. Update all users.
6718
63810350
PE
67192012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6720
7bd5c1f4
PE
6721 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6722
63810350
PE
6723 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6724 Convert pctcpu and pctmem to Lisp float properly.
6725 Let the compiler fold better, as 100.0/0x8000 is exact.
6726
a2821611
AS
67272012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6728
6729 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6730 cons_block.
6731
5fceba1d
PE
67322012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6733
6734 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6735
c98ff5dd
DA
67362012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6737
6738 For a 'struct window', replace some Lisp_Object fields to
6739 bitfields where appropriate, remove unused fields.
6740 * window.h (struct window): Remove unused 'last_mark_x' and
6741 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6742 change it's type from Lisp_Object to bitfield.
6743 Change type of 'force_start', 'optional_new_start',
6744 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 6745 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 6746
ca34e0be
PE
67472012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6748
6749 Pacify gcc -Wdouble-precision when using Xaw.
6750 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6751 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6752 Use 'float' consistently, rather than 'float' in most places
6753 and 'double' in a couple of places.
6754
efc00ab1 67552012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
6756
6757 * xdisp.c (handle_stop): Detect whether we have overlay strings
6758 loaded by testing it->current.overlay_string_index to be
6759 non-negative, instead of checking whether n_overlay_strings is
6760 positive. (Bug#11587)
6761
efc00ab1 67622012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
6763
6764 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6765
6766 * doc.c (Fsubstitute_command_keys): Doc fix.
6767
efc00ab1 67682012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
6769
6770 * search.c (search_buffer): Remove calls to
6771 r_alloc_inhibit_buffer_relocation, as it is now called by
6772 maybe_unify_char, which was the cause of relocation of buffer text
6773 in bug#11519.
6774
efc00ab1 67752012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
6776
6777 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6778 for the duration of call to load_charset, to avoid problems with
6779 callers of maybe_unify_char that access buffer text through C
6780 pointers.
6781
6782 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6783 decrement the inhibition flag, instead of just setting or
6784 resetting it.
6785
ba93a187
PE
67862012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6787
6788 Remove obsolete '#define static' cruft.
6789 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6790 This #undef was "temporary" in 2000; it is no longer needed
6791 now that '#define static' has gone away.
6792 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6793 (gray_bitmap_bits): Remove; no longer needed.
6794 All uses replaced with definiens.
6795 * xterm.c: Include "bitmaps/gray.xbm".
6796
9e4bf381
PE
67972012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6798
6799 Clean up __executable_start, monstartup when --enable-profiling.
6800 The following changes affect the code only when profiling.
6801 * dispnew.c (__executable_start): Rename from safe_bcopy.
6802 Define only on platforms that need it.
6803 * emacs.c: Include <sys/gmon.h> when profiling.
6804 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6805 (__executable_start): Remove decl, since lisp.h does it now.
6806 (safe_bcopy): Remove decl; no longer has that name.
6807 (main): Coalesce #if into single bit of code, for simplicity.
6808 Cast pointers to uintptr_t, since standard libraries want integers
6809 and not pointers.
6810 * lisp.h (__executable_start): New decl.
6811
32d72c2f
GM
68122012-05-31 Glenn Morris <rgm@gnu.org>
6813
6814 * image.c (Fimagemagick_types): Doc fix.
6815
baac5bc7
JM
68162012-05-30 Jim Meyering <meyering@redhat.com>
6817
6818 * callproc.c (Fcall_process_region): Include directory component
6819 in mkstemp error message (Bug#11586).
6820
72cb32cf
PE
68212012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6822
6823 * alloc.c, lisp.h (make_pure_vector): Now static.
6824
61b108cc
SM
68252012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6826
6827 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6828 Move to byte-run.el.
6829 (Fautoload): Do the hash-doc more carefully.
6830 * data.c (Fdefalias): Purify definition, except for keymaps.
6831 (Qdefun): Move from eval.c.
6832 * lisp.h (Qdefun): Remove.
6833 * lread.c (read1): Tiny simplification.
6834
471fe23d
TN
68352012-05-29 Troels Nielsen <bn.troels@gmail.com>
6836
934f3f58 6837 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
6838 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6839 Bug#9642, but explicitly check that the buffer the overlay would
6840 be moved to is live and rearrange lines to make sure that errors
6841 will not put the overlay in an inconsistent state.
6842 (Fdelete_overlay): Cosmetics.
6843
85d0efd1
EZ
68442012-05-28 Eli Zaretskii <eliz@gnu.org>
6845
6846 * w32term.c (my_bring_window_to_top): New function.
6847 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
6848 could be different from the original one.
6849 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
6850 (Bug#11513)
6851
6852 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6853 by calling BringWindowToTop.
6854
6855 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6856 (WM_EMACS_END): Increase by one.
6857
da92a98c
PE
68582012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6859
6860 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6861 This avoids undefined behavior that might cause the eassert
6862 to not catch an out-of-range value.
6863
74d1f848
JB
68642012-05-28 Juanma Barranquero <lekktu@gmail.com>
6865
6866 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6867 Update dependencies.
6868
9e1a06fc
EZ
68692012-05-27 Eli Zaretskii <eliz@gnu.org>
6870
6871 * bidi.c (bidi_mirror_char): Fix last change.
6872
f3dd7312
AS
68732012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6874
6875 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6876 when referring to sectname field in printf format.
6877
81899c91
PE
68782012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6879
57b81a9f
PE
6880 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6881 Only r_alloc_inhibit_buffer_relocation needed to be added;
6882 the others were already declared.
6883
81899c91
PE
6884 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6885 before checking whether it's out of range. Put the check inside
6886 eassert. See
6887 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6888
33017faf 68892012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
6890
6891 * callproc.c (Fcall_process): Restore a line that was accidentally
6892 commented out in the 2011-02-13 change (bug#11547).
6893
33017faf 68942012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
6895
6896 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6897 defined on ralloc.c.
6898
6899 * buffer.c [REL_ALLOC]: Remove prototypes of
6900 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6901 they are now on lisp.h.
6902
6903 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6904
6905 * search.c (search_buffer): Use it to inhibit relocation of buffer
6906 text while re_search_2 is doing its job, because re_search_2 is
6907 passed C pointers to buffer text. (Bug#11519)
6908
23415acf
EZ
6909 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6910 Update value to 24.
6911
44e27368
EZ
6912 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6913 state after an additional call to move_it_in_display_line_to, keep
6914 the values of it->max_ascent and it->max_descent found for the
6915 entire line.
6916 (pos_visible_p): Revert the comparison against bottom_y to what it
6917 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6918 (Bug#11464)
6919
c1892f11
PE
69202012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6921
6922 Fix coding-related core dumps with gcc -ftrapv.
6923 The code was computing A - B, where A and B are pointers, and B is
6924 random garbage. This can lead to core dumps on platforms that
6925 have special pointer registers, and it also leads to core dumps on
6926 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6927 A - B only when B is initialized properly.
6928 * coding.c (coding_set_source, coding_set_destination): Return void.
6929 (coding_change_source, coding_change_destinations): New functions,
6930 with the old behaviors of coding_set_source and coding_set_destination.
6931 All callers that need an offset changed to use these new functions.
6932
eb7afdad
GM
69332012-05-26 Glenn Morris <rgm@gnu.org>
6934
6935 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6936
f12fdf02
EZ
69372012-05-26 Eli Zaretskii <eliz@gnu.org>
6938
53a63be6 6939 Extend mouse support on W32 text-mode console.
61b108cc
SM
6940 * xdisp.c (draw_row_with_mouse_face):
6941 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 6942
eb3f6f01 6943 * w32console.c: Include window.h.
61b108cc
SM
6944 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6945 New functions.
eb3f6f01
EZ
6946 (initialize_w32_display): Initialize mouse-highlight data.
6947
53a63be6
EZ
6948 * w32inevt.c: Include termchar.h and window.h.
6949 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6950 moves, call note_mouse_highlight. If help_echo changed, call
6951 gen_help_event to produce help-echo message in the echo area.
6952 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6953 highlight info.
6954
4cfd81f6
PE
69552012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6956
6957 * lread.c (read1): Simplify slightly to avoid an overflow warning
6958 with GCC 4.7.0 on x86-64.
6959
4446092a
EZ
69602012-05-26 Eli Zaretskii <eliz@gnu.org>
6961
6962 * bidi.c (bidi_mirror_char): Revert last change: an int is
6963 definitely wide enough here.
6964
42b2a986 69652012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 6966
42b2a986 6967 Fix integer width and related bugs (Bug#9874).
eb106a49 6968 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
6969 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6970 (string_bytes, check_sblock, allocate_string_data):
6971 (compact_small_strings, Fmake_bool_vector, make_string)
6972 (make_unibyte_string, make_multibyte_string)
6973 (make_string_from_bytes, make_specified_string)
6974 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6975 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6976 (mark_vectorlike):
6977 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6978 (allocate_pseudovector):
6979 Use int, not EMACS_INT, where int is wide enough.
6980 (inhibit_garbage_collection, Fgarbage_collect):
6981 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6982 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6983 int might not be wide enough.
6984 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6985 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6986 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6987 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6988 (bidi_level_of_next_char, bidi_move_to_visually_next):
6989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6990 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6991 (Fkill_buffer, Fset_buffer_major_mode)
6992 (advance_to_char_boundary, Fbuffer_swap_text)
6993 (Fset_buffer_multibyte, overlays_at, overlays_in)
6994 (overlay_touches_p, struct sortvec, record_overlay_string)
6995 (overlay_strings, recenter_overlay_lists)
6996 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6997 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6998 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6999 (Foverlay_recenter, last_overlay_modification_hooks_used)
7000 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7001 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
7002 (validate_region): Omit unnecessary test for b <= e,
7003 since that's guaranteed by the previous test.
d311d28c
PE
7004 (adjust_overlays_for_delete): Avoid pos + length overflow.
7005 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7006 (report_overlay_modification):
7007 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7008 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7009 Omit pointer cast, which isn't needed anyway, and doesn't work
7010 after the EMACS_INT -> ptrdiff_t change.
02481186 7011 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
7012 * buffer.h: Adjust decls to match defn changes elsewhere.
7013 (struct buffer_text, struct buffer):
7014 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7015 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
7016 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7017 not int, to avoid needless 32-bit limit on 64-bit hosts.
7018 (exec_byte_code): Use tighter memory-full test, one that checks
7019 for alloca overflow. Don't compute the address of the object just
7020 before an array, as that's not portable. Use EMACS_INT, not
7021 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
7022 * callint.c (Fcall_interactively):
7023 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7024 * callproc.c (call_process_kill, Fcall_process):
7025 Don't assume pid_t fits into an Emacs fixnum.
7026 (call_process_cleanup, Fcall_process, child_setup):
7027 Don't assume pid_t fits into int.
7028 (call_process_cleanup, Fcall_process, delete_temp_file)
7029 (Fcall_process_region):
7030 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7031 (Fcall_process): Simplify handling of volatile integers.
7032 Use int, not EMACS_INT, where int will do.
7033 * casefiddle.c (casify_object, casify_region, operate_on_word)
7034 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7035 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7036 (casify_object): Avoid integer overflow when overallocating buffer.
7037 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 7038 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
7039 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7040 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7041 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7042 integers are now checked earlier. All uses replaced with XINT.
7043 (ccl_driver):
7044 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7045 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
7046 (ccl_driver, Fregister_code_conversion_map):
7047 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
7048 (resolve_symbol_ccl_program): Check that vector header is in range.
7049 Always copy the vector, so that we can check its contents reliably
7050 now rather than having to recheck each instruction as it's being
7051 executed. Check that vector words fit in 'int'.
7052 (ccl_get_compiled_code, Fregister_ccl_program)
7053 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7054 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7055 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7056 contents are in range.
7057 (Fccl_execute_on_string): Check that status is in range.
7058 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7059 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7060 Accept and return EMACS_INT, not int, because callers can pass values
7061 out of 'int' range.
7062 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7063 (multibyte_chars_in_text, parse_str_as_multibyte)
7064 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7065 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7066 (string_escape_byte8, Fget_byte):
7067 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 7068 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
7069 avoid mishandling large integers.
7070 * character.h: Adjust decls to match defn changes elsewhere.
7071 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7072 (Ffind_charset_region):
7073 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7074 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7075 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 7076 Don't assume fixnum fits in int.
d311d28c
PE
7077 (load_charset_map_from_vector, Fmap_charset_chars):
7078 Remove now-unnecessary CHECK_NATNUMs.
7079 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
7080 Don't rely on undefined behavior with signed left shift overflow.
7081 Don't assume unsigned int fits into fixnum, or that fixnum fits
7082 into unsigned int. Don't require max_code to be a valid fixnum;
7083 that's not true for gb10830 4-byte on a 32-bit host. Allow
7084 invalid_code to be a cons, for the same reason. Require code_offset
7085 to be a character. Avoid int overflow if max_char is close
7086 to INT_MAX.
7087 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7088 this is intended anyway and avoids some undefined behavior.
7089 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7090 INDEX_TO_CODE_POINT, as that's what it expects.
7091 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
7092 * charset.h (DECODE_CHAR): Return int, not unsigned;
7093 this is what was intended anyway, and it avoids undefined behavior.
7094 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7095 integer-overflow issues.
7096 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7097 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7098 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
7099 * chartab.c (Fmake_char_table, Fset_char_table_range)
7100 (uniprop_get_decoder, uniprop_get_encoder):
7101 Don't assume fixnum fits in int.
7102 * cmds.c (move_point): New function, that does the gist of
7103 Fforward_char and Fbackward_char, but does so while checking
7104 for integer overflow more accurately.
c96e5d6a 7105 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
7106 (Fforward_line, Fend_of_line, internal_self_insert)
7107 (internal_self_insert):
7108 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7109 Fix a FIXME, by checking for integer overflow when calculating
7110 target_clm and actual_clm.
7111 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 7112 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
7113 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7114 (coding_alloc_by_making_gap, alloc_destination)
7115 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7116 (encode_coding_utf_16, detect_coding_emacs_mule)
7117 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7118 (detect_coding_iso_2022, decode_coding_iso_2022)
7119 (encode_invocation_designation, encode_designation_at_bol)
7120 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7121 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7122 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7123 (encode_coding_ccl, encode_coding_raw_text)
7124 (detect_coding_charset, decode_coding_charset)
7125 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7126 (produce_composition, produce_charset, produce_annotation)
7127 (decode_coding, handle_composition_annotation)
7128 (handle_charset_annotation, consume_chars, decode_coding_gap)
7129 (decode_coding_object, encode_coding_object, detect_coding_system)
7130 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7131 (code_convert_region, code_convert_string)
8f50130c
PE
7132 (Fdefine_coding_system_internal)
7133 (coding_set_source, coding_set_destination):
d311d28c
PE
7134 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7135 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7136 (Fdefine_coding_system_internal):
7137 Don't assume fixnums fit in int.
7138 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 7139 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
7140 (Funencodable_char_position, Fcheck_coding_systems_region)
7141 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 7142 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 7143 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 7144 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 7145 Don't access memory outside of the args array.
d311d28c 7146 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
7147 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7148 result of ENCODE_CHAR.
d311d28c
PE
7149 * coding.h: Adjust decls to match defn changes elsewhere.
7150 (struct coding_system):
7151 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7152 * composite.c (get_composition_id, find_composition)
7153 (run_composition_function, update_compositions)
7154 (compose_text, composition_gstring_put_cache)
7155 (composition_gstring_p, composition_gstring_width)
7156 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7157 (composition_compute_stop_pos, composition_reseat_it)
7158 (composition_update_it, struct position_record)
7159 (find_automatic_composition, composition_adjust_point)
7160 (Fcomposition_get_gstring, Ffind_composition_internal):
7161 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7162 (update_compositions):
7163 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7164 * composite.h: Adjust decls to match defn changes elsewhere.
7165 (struct composition):
7166 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7167 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7168 Do not attempt to compute the address of the object just before a
7169 buffer; this is not portable.
7170 (Faref, Faset):
7171 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7172 (Faset): Use int, not EMACS_INT, where int is wide enough.
7173 (Fstring_to_number): Don't assume fixnums fit in int.
7174 (Frem): Don't assume arg is nonnegative.
7175 * dbusbind.c (xd_append_arg): Check for integers out of range.
7176 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 7177 (extract_signed, extract_unsigned): New functions.
243e0530
PE
7178 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7179 (xd_get_connection_references): Return ptrdiff_t, not int.
7180 All uses changed.
7181 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7182 (xd_read_message_1):
7183 Use int, not unsigned, where the dbus API uses int.
7184 (Fdbus_message_internal): Don't overflow mtype.
7185 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
7186 * dired.c (directory_files_internal, file_name_completion, scmp)
7187 (file_name_completion_stat):
7188 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7189 (file_name_completion): Don't overflow matchcount.
7190 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7191 * dispextern.h: Adjust decls to match defn changes elsewhere.
7192 (struct text_pos, struct glyph, struct bidi_saved_info)
7193 (struct bidi_string_data, struct bidi_it, struct composition_it)
7194 (struct it):
7195 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7196 (struct display_pos, struct composition_it, struct it):
7197 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7198 * dispnew.c (increment_matrix_positions)
7199 (increment_row_positions, mode_line_string)
7200 (marginal_area_string):
7201 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 7202 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
7203 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7204 (duration_to_sec_usec): New function, to check for overflow better.
7205 (Fsleep_for, sit_for): Use it.
7206 * doc.c (get_doc_string, store_function_docstring):
7207 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7208 (get_doc_string, Fsnarf_documentation):
7209 Use int, not EMACS_INT, where int is wide enough.
7210 (get_doc_string):
7211 Use SAFE_ALLOCA, not alloca.
7212 Check for overflow when converting EMACS_INT to off_t.
7213 * doprnt.c (doprnt):
7214 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7215 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7216 Don't assume uid_t fits into fixnum.
7217 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7218 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7219 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7220 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7221 (general_insert_function)
7222 (Finsert_char, make_buffer_string, make_buffer_string_both)
7223 (update_buffer_properties, Fbuffer_substring)
7224 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7225 (Fsubst_char_in_region, check_translation)
7226 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7227 (transpose_markers, Ftranspose_regions):
7228 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7229 (clip_to_bounds): Move to lisp.h as an inline function).
7230 (Fconstrain_to_field): Don't assume integers are nonnegative.
7231 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7232 (Fsubst_char_in_region, Fsave_restriction):
7233 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7234 (Femacs_pid): Don't assume pid_t fits into fixnum.
7235 (lo_time): Use int, not EMACS_INT, when int suffices.
7236 (lisp_time_argument): Check for usec out of range.
7237 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
7238 (Fuser_login_name, Fuser_full_name): Signal an error
7239 if a uid argument is out of range, rather than relying on
7240 undefined behavior.
c8d5c857
PE
7241 (Fformat_time_string): Remove now-unnecessary check.
7242 lisp_time_argument checks for out-of-range usec now.
243e0530 7243 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
7244 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7245 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7246 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7247 (init_cmdargs, Fdump_emacs):
7248 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7249 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7250 the bottom (typically) 32 bits of the fixnum.
7251 * eval.c (specpdl_size, call_debugger):
7252 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7253 (when_entered_debugger, Fbacktrace_debug):
7254 Don't assume fixnum can fit in int.
7255 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7256 the object just before a buffer; this is not portable.
7257 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7258 (grow_specpdl, unbind_to):
7259 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7260 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7261 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 7262 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
7263 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7264 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7265 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7266 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7267 (a_write, e_write):
7268 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7269 (Fcopy_file, non_regular_nbytes, read_non_regular)
7270 (Finsert_file_contents):
7271 Use int, not EMACS_INT, where int is wide enough.
7272 (READ_BUF_SIZE): Verify that it fits in int.
7273 (Finsert_file_contents): Check that counts are in proper range,
7274 rather than assuming fixnums fit into ptrdiff_t etc.
7275 Don't assume fixnums fit into int.
125b3835 7276 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
7277 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7278 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
7279 (string_char_to_byte, string_byte_to_char)
7280 (string_make_multibyte, string_to_multibyte)
7281 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7282 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7283 (substring_both, Fdelete, internal_equal, Ffillarray)
7284 (Fclear_string, mapcar1)
7285 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7286 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7287 (larger_vector, make_hash_table, maybe_resize_hash_table)
7288 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7289 (Fmaphash, secure_hash):
7290 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7291 (concat): Check for string index and length overflow.
7292 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7293 (Frequire):
7294 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7295 (larger_vector): New API (vec, incr_min, size_max) replaces old
7296 one (vec, new_size, init). This catches size overflow.
7297 INIT was removed because it was always Qnil.
7298 All callers changed.
7299 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7300 the upper bound on a hash table index size.
7301 (make_hash_table, maybe_resize_hash_table): Use it.
7302 (secure_hash): Computer start_byte and end_byte only after
7303 they're known to be in ptrdiff_t range.
7304 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7305 (Ffont_get_glyphs, Ffont_at):
7306 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7307 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7308 (Flist_fonts, Fopen_font):
7309 Don't assume fixnum can fit in int.
7310 (check_gstring): Don't assume index can fit in int.
7311 (font_match_p): Check that fixnum is a character, not a nonnegative
7312 fixnum, since the later code needs to stuff it into an int.
7313 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7314 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7315 conversion overflow issues.
7316 (Fopen_font): Check for integer out of range.
7317 (Ffont_get_glyphs): Don't assume index can fit in int.
7318 * font.h: Adjust decls to match defn changes elsewhere.
7319 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7320 integer overflow.
7321 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7322 printmax_t, where ptrdiff_t is wide enough.
7323 (Finternal_char_font):
7324 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7325 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7326 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7327 (Fset_frame_position, x_set_frame_parameters)
7328 (x_set_line_spacing, x_set_border_width)
7329 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7330 Check that fixnums are in proper range for system types.
7331 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7332 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7333 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7334 Use SAFE_ALLOCA_LISP, not alloca.
7335 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7336 intptr_t is wide enough.
7337 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7338 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7339 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7340 Check for fixnum out of range.
7341 * ftfont.c (ftfont_list): Don't assume index fits in int.
7342 Check that fixnums are in proper range for system types.
7343 (ftfont_shape_by_flt):
7344 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
7345 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7346 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7347 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7348 Check that fixnums are in proper range for system types.
7349 * gnutls.h: Adjust decls to match defn changes elsewhere.
7350 * gtkutil.c (xg_dialog_run):
7351 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7352 (update_frame_tool_bar):
7353 Check that fixnums are in proper range for system types.
7354 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 7355 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
7356 * indent.c (last_known_column, last_known_column_point):
7357 (current_column_bol_cache):
7358 (skip_invisible, current_column, check_display_width):
7359 (check_display_width, scan_for_column, current_column_1)
7360 (Findent_to, Fcurrent_indentation, position_indentation)
7361 (indented_beyond_p, Fmove_to_column, compute_motion):
7362 (Fcompute_motion, Fvertical_motion):
7363 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7364 (last_known_column_modified): Use EMACS_INT, not int.
7365 (check_display_width):
7366 (Fcompute_motion):
7367 Check that fixnums and floats are in proper range for system types.
7368 (compute_motion): Don't assume index or fixnum fits in int.
7369 (compute_motion, Fcompute_motion):
7370 Use int, not EMACS_INT, when it is wide enough.
7371 (vmotion): Omit local var start_hpos that is always 0; that way
7372 we don't need to worry about overflow in expressions involving it.
7373 * indent.h: Adjust decls to match defn changes elsewhere.
7374 (struct position):
7375 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7376 Use int, not EMACS_INT, where int is wide enough.
7377 Remove unused members ovstring_chars_done and tab_offset;
7378 all uses removed.
7379 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7380 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7381 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7382 (make_gap, copy_text, insert, insert_and_inherit)
7383 (insert_before_markers, insert_before_markers_and_inherit)
7384 (insert_1, count_combining_before, count_combining_after)
7385 (insert_1_both, insert_from_string)
7386 (insert_from_string_before_markers, insert_from_string_1)
7387 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7388 (adjust_after_replace, adjust_after_insert, replace_range)
7389 (replace_range_2, del_range, del_range_1, del_range_byte)
7390 (del_range_both, del_range_2, modify_region)
7391 (prepare_to_modify_buffer, signal_before_change)
7392 (signal_after_change, Fcombine_after_change_execute):
7393 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7394 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7395 (balance_an_interval, split_interval_right, split_interval_left)
7396 (find_interval, next_interval, update_interval)
7397 (adjust_intervals_for_insertion, delete_node, delete_interval)
7398 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7399 (static_offset_intervals, offset_intervals)
7400 (merge_interval_right, merge_interval_left, make_new_interval)
7401 (graft_intervals_into_buffer, temp_set_point_both)
7402 (temp_set_point, set_point, adjust_for_invis_intang)
7403 (set_point_both, move_if_not_intangible, get_property_and_range)
7404 (get_local_map, copy_intervals, copy_intervals_to_string)
7405 (compare_string_intervals, set_intervals_multibyte_1):
7406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7407 * intervals.h: Adjust decls to match defn changes elsewhere.
7408 (struct interval):
7409 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7410 * keyboard.c (this_command_key_count, this_single_command_key_start)
7411 (before_command_key_count, before_command_echo_length, echo_now)
7412 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7413 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7414 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7415 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7416 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7417 (last_non_minibuf_size, last_point_position, echo_truncate)
7418 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7419 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7420 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7421 (stuff_buffered_input):
7422 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7423 (last_auto_save, command_loop_1, read_char):
7424 Use EMACS_INT, not int, to avoid integer overflow.
7425 (record_char): Avoid overflow in total_keys computation.
7426 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7427 * keyboard.h: Adjust decls to match defn changes elsewhere.
7428 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7429 (Fkey_description, Fdescribe_vector, Flookup_key):
7430 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7431 (click_position): New function, to check that positions are in range.
7432 (Fcurrent_active_maps):
7433 (describe_command):
7434 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7435 (Faccessible_keymaps, Fkey_description):
7436 (preferred_sequence_p):
7437 Don't assume fixnum can fit into int.
7438 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7439 Check for integer overflow in size calculations.
7440 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7441 avoid mishandling large integers.
7442 * lisp.h: Adjust decls to match defn changes elsewhere.
7443 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7444 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7445 (struct Lisp_Marker):
7446 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7447 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
7448 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7449 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7450 All callers changed.
7451 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7452 Assume the arg has valid form, since it always does.
7453 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7454 unsigned integer system type.
7455 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7456 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7457 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7458 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7459 (duration_to_sec_usec): New decl.
7460 * lread.c (read_from_string_index, read_from_string_index_byte)
7461 (read_from_string_limit, readchar, unreadchar, openp)
7462 (read_internal_start, read1, oblookup):
7463 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7464 (Fload, readevalloop, Feval_buffer, Feval_region):
7465 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7466 (openp): Check for out-of-range argument to 'access'.
7467 (read1): Use int, not EMACS_INT, where int is wide enough.
7468 Don't assume fixnum fits into int.
6efdadfd 7469 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
7470 (read_filtered_event): Use duration_to_sec_usec
7471 to do proper overflow checking on durations.
d311d28c
PE
7472 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7473 in size calculation.
7474 (Fexecute_kbd_macro):
7475 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7476 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7477 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7478 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7479 (set_marker_both, set_marker_restricted_both, marker_position)
7480 (marker_byte_position, Fbuffer_has_markers_at):
7481 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7482 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 7483 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
7484 It now merely ensures that the menu is large enough, without
7485 necessarily growing it, as this avoids some integer overflow issues.
7486 All callers changed.
7487 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7488 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7489 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7490 Use SAFE_ALLOCA_LISP, not alloca.
7491 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7492 to EMACS_INT. Check that fixnums are in proper range for system types.
7493 * minibuf.c (minibuf_prompt_width, string_to_object)
7494 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7495 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7496 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7497 (get_minibuffer, read_minibuf_unwind):
7498 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7499 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7500 this simplifies overflow checking. All callers changed.
7501 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7502 (Ftest_completion):
7503 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7504 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7505 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7506 Check that fixnums are in proper range for system types.
7507 (Fx_create_frame, Fx_show_tip):
7508 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7509 * nsfont.m (ns_findfonts, nsfont_list_family):
7510 Don't assume fixnum fits in long.
7511 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7512 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7513 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7514 wide enough.
17fdb222 7515 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
7516 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7517 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7518 (PRINTDECLARE, PRINTPREPARE):
7519 (strout, print_string):
7520 (print, print_preprocess, print_check_string_charset_prop)
7521 (print_object):
7522 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7523 (PRINTDECLARE):
7524 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7525 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7526 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 7527 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 7528 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
7529 (print_error_message): Use SAFE_ALLOCA, not alloca.
7530 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
7531 (print_depth, new_backquote_output, print_number_index):
7532 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
7533 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7534 (Fset_process_window_size, Fformat_network_address)
7535 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 7536 (sigchld_handler):
d311d28c 7537 Check that fixnums are in proper range for system types.
d44287d4 7538 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
7539 Check for process-ids out of pid_t range rather than relying on
7540 undefined behavior.
e4d81efc 7541 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
7542 (Fformat_network_address, read_process_output, send_process)
7543 (Fprocess_send_region, status_notify):
7544 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7545 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7546 (wait_reading_process_output, read_process_output, exec_sentinel):
7547 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7548 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7549 (Faccept_process_output): Use duration_to_sec_usec to do proper
7550 overflow checking on durations.
dde14581
PE
7551 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7552 Don't assume pid_t fits in int.
02481186
PE
7553 * process.h (struct Lisp_Process): Members tick and update_tick
7554 are now of type EMACS_INT, not int.
b62b53e8
PE
7555 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7556 configured --with-wide-int.
d311d28c
PE
7557 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7558 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7559 * search.c (looking_at_1, string_match_1):
7560 (fast_string_match, fast_c_string_match_ignore_case)
7561 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7562 (scan_newline, find_before_next_newline, search_command)
7563 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7564 (set_search_regs, wordify):
7565 (Freplace_match):
7566 (Fmatch_data):
7567 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7568 (string_match_1, search_buffer, set_search_regs):
7569 (Fmatch_data):
7570 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7571 (wordify): Check for overflow in size calculation.
7572 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7573 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7574 Check that fixnums are in proper range for system types.
7575 * sound.c (struct sound_device)
7576 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7577 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7578 (Fplay_sound_internal):
7579 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 7580 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
7581 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7582 (Fparse_partial_sexp):
7583 Don't assume fixnums can fit in int.
7584 (struct lisp_parse_state, find_start_pos, find_start_value)
7585 (find_start_value_byte, find_start_begv)
7586 (update_syntax_table, char_quoted, dec_bytepos)
7587 (find_defun_start, prev_char_comend_first, back_comment):
7588 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7589 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7590 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7591 (Finternal_describe_syntax_value): Check that match_lisp is a
7592 character, not an integer, since the code stuffs it into int.
7593 (scan_words, scan_sexps_forward):
7594 Check that fixnums are in proper range for system types.
7595 (Fforward_word):
7596 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7597 (scan_sexps_forward):
7598 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7599 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7600 * syntax.h: Adjust decls to match defn changes elsewhere.
7601 (struct gl_state_s):
7602 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
7603 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7604 MOST_POSITIVE_FIXNUM.
d311d28c
PE
7605 * sysdep.c (wait_for_termination_1, wait_for_termination)
7606 (interruptible_wait_for_termination, mkdir):
7607 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7608 (emacs_read, emacs_write):
7609 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
7610 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7611 and double all fit in int.
d311d28c
PE
7612 * term.c (set_tty_color_mode):
7613 Check that fixnums are in proper range for system types.
7614 * termhooks.h (struct input_event):
7615 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7616 * textprop.c (validate_interval_range, interval_of)
7617 (Fadd_text_properties, set_text_properties_1)
7618 (Fremove_text_properties, Fremove_list_of_text_properties)
7619 (Ftext_property_any, Ftext_property_not_all)
7620 (copy_text_properties, text_property_list, extend_property_ranges)
7621 (verify_interval_modification):
7622 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7623 (Fnext_single_char_property_change)
7624 (Fprevious_single_char_property_change):
7625 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
7626 (copy_text_properties):
7627 Check for integer overflow in index calculation.
d311d28c
PE
7628 * undo.c (last_boundary_position, record_point, record_insert)
7629 (record_delete, record_marker_adjustment, record_change)
7630 (record_property_change):
7631 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7632 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7633 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7634 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7635 (Fx_hide_tip, Fx_file_dialog):
7636 * w32menu.c (set_frame_menubar):
7637 Use ptrdiff_t, not int, for consistency with rest of code.
7638 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7639 (select_window, Fdelete_other_windows_internal)
7640 (window_scroll_pixel_based, window_scroll_line_based)
7641 (Frecenter, Fset_window_configuration):
7642 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7643 (Fset_window_hscroll, run_window_configuration_change_hook)
7644 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 7645 (Fscroll_other_window, Frecenter):
d311d28c
PE
7646 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7647 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7648 Don't assume fixnum fits in int.
7649 (Fset_window_scroll_bars):
7650 Check that fixnums are in proper range for system types.
7651 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7652 (string_pos, c_string_pos, number_of_chars, init_iterator)
7653 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7654 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7655 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
7656 (face_before_or_after_it_pos, handle_invisible_prop)
7657 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
7658 (display_prop_intangible_p, string_buffer_position_lim)
7659 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7660 (get_overlay_strings_1, get_overlay_strings)
7661 (iterate_out_of_display_property, forward_to_next_line_start)
7662 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7663 (get_next_display_element, set_iterator_to_next)
7664 (get_visually_first_element, compute_stop_pos_backwards)
7665 (handle_stop_backwards, next_element_from_buffer)
7666 (move_it_in_display_line_to, move_it_in_display_line)
7667 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7668 (add_to_log, message_dolog, message_log_check_duplicate)
7669 (message2, message2_nolog, message3, message3_nolog
7670 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7671 (current_message_1, truncate_echo_area, truncate_message_1)
7672 (set_message, set_message_1, store_mode_line_noprop)
7673 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7674 (text_outside_line_unchanged_p, check_point_in_composition)
7675 (reconsider_clip_changes)
7676 (redisplay_internal, set_cursor_from_row, try_scrolling)
7677 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7678 (redisplay_window, find_last_unchanged_at_beg_row)
7679 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7680 (trailing_whitespace_p, find_row_edges, display_line)
7681 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7682 (display_mode_element, store_mode_line_string)
7683 (pint2str, pint2hrstr, decode_mode_spec)
7684 (display_count_lines, display_string, draw_glyphs)
7685 (x_produce_glyphs, x_insert_glyphs)
7686 (rows_from_pos_range, mouse_face_from_buffer_pos)
7687 (fast_find_string_pos, mouse_face_from_string_pos)
7688 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7689 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7690 (safe_call, init_from_display_pos, handle_fontified_prop)
7691 (handle_single_display_spec, load_overlay_strings)
7692 (with_echo_area_buffer, setup_echo_area_for_printing)
7693 (display_echo_area, echo_area_display)
7694 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7695 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
7696 (redisplay_window, dump_glyph_row, display_mode_line)
7697 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 7698 (handle_display_spec, display_prop_string_p):
d311d28c
PE
7699 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7700 (handle_single_display_spec, build_desired_tool_bar_string)
7701 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7702 (get_specified_cursor_type):
7703 Check that fixnums are in proper range for system types.
7704 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7705 (Flookup_image_map):
7706 Don't assume fixnums fit in int.
7707 (compare_overlay_entries):
7708 Avoid mishandling comparisons due to subtraction overflow.
7709 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7710 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7711 (handle_tool_bar_click):
7712 Use int, not unsigned, since we prefer signed and the signedness
7713 doesn't matter here.
7714 (get_next_display_element, next_element_from_display_vector):
7715 Use int, not EMACS_INT, when int is wide enough.
7716 (start_hourglass): Use duration_to_sec_usec to do proper
7717 overflow checking on durations.
7718 * xfaces.c (Fbitmap_spec_p):
7719 Check that fixnums are in proper range for system types.
7720 (compare_fonts_by_sort_order):
7721 Avoid mishandling comparisons due to subtraction overflow.
7722 (Fx_family_fonts, realize_basic_faces):
7723 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7724 (Fx_family_fonts):
7725 Don't assume fixnum fits in int.
7726 Use SAFE_ALLOCA_LISP, not alloca.
7727 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7728 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7729 (face_at_buffer_position, face_for_overlay_string)
7730 (face_at_string_position):
7731 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7732 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7733 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7734 (Fx_show_tip):
7735 Check that fixnums are in proper range for system types.
7736 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7737 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7738 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7739 (Fx_change_window_property): Don't assume fixnums fit in int.
7740 * xfont.c (xfont_chars_supported):
7741 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7742 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7743 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7744 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7745 * xml.c (parse_region):
7746 * xrdb.c (magic_file_p):
7747 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7748 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7749 (x_get_local_selection, x_reply_selection_request)
7750 (x_handle_selection_request, wait_for_property_change):
7751 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7752 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7753 short is wide enough.
7754 (x_send_client_event): Don't assume fixnum fits in int.
7755 * xterm.c (x_x_to_emacs_modifiers):
7756 Don't assume EMACS_INT overflows nicely into int.
7757 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7758 may come from Lisp.
7759 (handle_one_xevent): NATNUMP can eval its arg twice.
7760 (x_connection_closed):
7761 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7762 * xterm.h: Adjust decls to match defn changes elsewhere.
7763 (struct scroll_bar): Use struct vectorlike_header
7764 rather than rolling our own approximation.
7765 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7766
c6574eb5
GM
77672012-05-25 Glenn Morris <rgm@gnu.org>
7768
7769 * lisp.mk (lisp): Update for more files being compiled now.
7770
e8d32c7e
SM
77712012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7772
48def666
SM
7773 * lread.c: Remove `read_pure' which makes no difference.
7774 (read_pure): Remove var.
7775 (unreadpure): Remove function.
7776 (readevalloop): Don't call read_list with -1 flag.
7777 (read1, read_vector): Don't test read_pure any more.
7778 (read_list): Simplify.
7779
e8d32c7e
SM
7780 * fileio.c, character.h: Minor style tweaks.
7781
4b2addb7
DA
77822012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7783
7784 * window.h (clip_changed): Remove useless declaration.
7785
584461b2
JB
77862012-05-22 Juanma Barranquero <lekktu@gmail.com>
7787
7788 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7789 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7790
34374650
PE
77912012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7792
7793 Remove src/m/*.
7794 This directory predates autoconf and is no longer needed nowadays.
7795 Move its few remaining bits of functionality to where they're needed.
7796 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7797 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7798 * m/template.h: Remove.
7799 * Makefile.in (M_FILE): Remove. All uses removed.
7800 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7801 * lisp.h (USE_LSB_TAG):
7802 * mem-limits.h (EXCEEDS_LISP_PTR):
7803 Use VAL_MAX, not VALBITS, in #if.
7804 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7805 (EMACS_UINT): Define unconditionally now.
7806 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7807 (BITS_PER_EMACS_INT): New constants, replacing
7808 what used to be in config.h, but not useful in #if.
7809 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7810 define them any more.
7811 (VAL_MAX): New macro.
7812 (VALMASK): Use it.
7813 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7814 BITS_PER_EMACS_INT, in #if.
7815 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7816 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7817 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7818 * s/ms-w32.h (DATA_START):
7819 Move here from removed file m/intel386.h.
7820 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7821 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7822
261cb4bb
PE
78232012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7824
7825 Assume C89 or later.
7826 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7827 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7828 (xrealloc):
7829 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7830 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7831 * textprop.c, tparam.c (NULL): Remove.
7832 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7833 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7834 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7835 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7836 * xterm.c (input_signal_count): Assume volatile works.
7837
ff23cd9f
KB
78382012-05-21 Ken Brown <kbrown@cornell.edu>
7839
7840 * xgselect.c (xg_select): Fix first argument in call to 'select'
7841 (bug#11508).
7842
1b170bc6
KB
78432012-05-20 Ken Brown <kbrown@cornell.edu>
7844
7845 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 7846 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 7847
b2f4d39f
KB
78482012-05-19 Ken Brown <kbrown@cornell.edu>
7849
7850 * xfns.c (x_in_use): Remove `static' qualifier.
7851 * xterm.h (x_in_use): Declare.
7852 * xgselect.c: Include xterm.h.
7853 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7854 and `display_arg' (bug#9754).
7855
003fdae2
PE
78562012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7857
9232a6d9
PE
7858 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7859
003fdae2
PE
7860 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7861 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7862
784b56e2
EZ
78632012-05-18 Eli Zaretskii <eliz@gnu.org>
7864
7865 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7866
7867 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 7868 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
7869
7870 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7871 reference to image_cache->refcount.
7872 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7873
a0a79cde
JL
78742012-05-17 Juri Linkov <juri@jurta.org>
7875
7876 * search.c (Fword_search_regexp, Fword_search_backward)
7877 (Fword_search_forward, Fword_search_backward_lax)
7878 (Fword_search_forward_lax): Move functions to isearch.el
7879 (bug#10145, bug#11381).
7880
b0572523
PE
78812012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7882
7883 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7884
9660f5fc
SM
78852012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7886
7887 * lread.c (init_obarray): Declare Qt and Qnil as special.
7888
4374de83
GM
78892012-05-14 Glenn Morris <rgm@gnu.org>
7890
7891 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 7892 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 7893
dc44c39a
PE
78942012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7895
078c97cb
PE
7896 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7897
dc44c39a
PE
7898 * unexaix.c: Port to more-recent AIX compilers.
7899 (report_error, report_error_1, make_hdr, copy_sym)
7900 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7901 Make arguments const char *, not char *, to avoid violations of C
7902 standard and to fix some AIX warnings reported by Gilles Pion.
7903
e18afed7 79042012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
7905
7906 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7907 already have overlays loaded.
7908 (handle_single_display_spec): Before returning without displaying
7909 fringe bitmap, synchronize the bidi iterator with the main display
7910 iterator, by calling iterate_out_of_display_property.
7911 (iterate_out_of_display_property): Detect buffer iteration by
7912 testing that it->string is a Lisp string.
7913 (get_next_display_element): When the current object is exhausted,
7914 and there's something on it->stack, call set_iterator_to_next to
7915 proceed with what's on the stack, instead of returning zero.
7916 (set_iterator_to_next): If called at the end of a Lisp string,
7917 proceed to consider_string_end without incrementing string
7918 position. Don't increment display vector index past the end of
7919 the display vector. (Bug#11417)
c8fb9dc6
EZ
7920 (pos_visible_p): Don't report a position visible when move_it_to
7921 stopped at the last line of window, which happens to be scanned
7922 backwards by the bidi iteration. (Bug#11464)
ac268e67 7923
e18afed7 79242012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
7925
7926 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7927 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
7928 are on a TTY, and thus unable to display on the fringes.
7929 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
7930 so we need to signal to the caller that this is a "replacing"
7931 display spec. This fixes display when the spec is invalid or we
7932 are on a TTY.
7933
e18afed7 79342012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
7935
7936 * unexaix.c (make_hdr): Fix typo in prototype.
7937 This bug broke the build on AIX. Problem reported by Gilles Pion.
7938
9d0a235a
MA
79392012-05-14 Michael Albinus <michael.albinus@gmx.de>
7940
7941 * keyboard.c (kbd_buffer_get_event): Read special events also in
7942 batch mode. (Bug#11415)
7943
9e6b06ed
GM
79442012-05-12 Glenn Morris <rgm@gnu.org>
7945
7946 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7947
c1a1d7a3
EZ
79482012-05-12 Eli Zaretskii <eliz@gnu.org>
7949
7950 * lisp.mk (lisp): Add newcomment.elc.
7951
3fe7cdc8
GM
79522012-05-12 Glenn Morris <rgm@gnu.org>
7953
7954 * Makefile.in (MKDIR_P): New, set by configure.
7955 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7956
53f7d2c0
PE
79572012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7958
7959 Remove unused function hourglass_started.
7960 * dispextern.h (hourglass_started):
7961 * w32fns.c (hourglass_started):
7962 * xdisp.c (hourglass_started): Remove.
7963
75aafb17
JB
79642012-05-10 Juanma Barranquero <lekktu@gmail.com>
7965
7966 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7967 Update dependencies.
7968
12959e8e
PE
79692012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7970
97107e2e
PE
7971 * xgselect.c (xg_select): Put maxfds+1 into a var.
7972 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7973
12959e8e
PE
7974 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7975
836d29b3
DA
79762012-05-10 Dave Abrahams <dave@boostpro.com>
7977
7978 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7979 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7980
5cb67954
MA
79812012-05-09 Michael Albinus <michael.albinus@gmx.de>
7982
7983 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7984 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7985 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7986 Initialize xd_registered_buses.
7987
3478ec45
PE
79882012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7989
b263a6b0
PE
7990 Untag more efficiently if USE_LSB_TAG.
7991 This is based on a proposal by YAMAMOTO Mitsuharu in
7992 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7993 For an admittedly artificial (nth 8000 longlist) benchmark on
7994 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7995 Emacs's overall text size by 1%.
7996 * lisp.h (XUNTAG): New macro.
7997 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7998 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7999 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8000 * eval.c (Fautoload):
8001 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8002 * frame.h (XFRAME): Use XUNTAG.
8003
3478ec45
PE
8004 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8005 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8006 Remove unportable assumptions about print widths of types like
8007 dbus_uint32_t.
8008 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8009 intptr_t when converting between pointer and integer, to avoid GCC
8010 warnings about wrong width.
8011
666b903b 80122012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
8013
8014 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8015 stack for each reader_thread, instead of defaulting to 8MB
8016 determined by the linker. This avoids failures in creating
8017 subprocesses on Windows 7, see the discussion in this thread:
8018 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8019
b120cc17
JC
80202012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8021
8022 Fix up display of the *Minibuf-0* buffer in the mini window.
8023 * keyboard.c (read_char): Don't clear the echo area if there's no
8024 message to clear.
8025 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 8026 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 8027
9a4b36f8
MA
80282012-05-07 Michael Albinus <michael.albinus@gmx.de>
8029
8030 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8031 batch mode.
8032
e5f9458f
CY
80332012-05-06 Chong Yidong <cyd@gnu.org>
8034
8035 * lisp.mk (lisp): Update.
8036
eceeb5fc 80372012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
8038
8039 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8040
71873e2b
SM
80412012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8042
8043 * data.c (PUT_ERROR): New macro.
8044 (syms_of_data): Use it. Add new error type `user-error'.
8045 * undo.c (user_error): New function.
8046 (Fprimitive_undo): Use it.
8047 * print.c (print_error_message): Adjust print style for `user-error'.
8048 * keyboard.c (user_error): New function.
8049 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8050
ab0fa4e4
PE
80512012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8052
8053 Do not limit current-time-string to years 1000..9999.
8054 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8055 (Fcurrent_time_string): Support any year that is supported by the
8056 underlying localtime representation. Don't use asctime, as it
8057 has undefined behavior for years outside the range -999..9999.
8058
7ed806a7
PE
80592012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8060
8061 Fix race conditions involving setenv, gmtime, localtime, asctime.
8062 Without this fix, interrupts could mess up code that uses these
8063 nonreentrant functions, since setting TZ invalidates existing
8064 tm_zone or tzname values, and since most of these functions return
8065 pointers to static storage.
8066 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8067 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8068 Grow the critical sections to include not just invoking
8069 localtime/gmtime, but also accessing these functions' results
8070 including their tm_zone values if any, and any related TZ setting.
8071 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
8072 so that the struct tm is saved in the critical section.
8073 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
8074 motivated by the fact that memory allocation needs to be outside
8075 the critical section.
8076
0c16dfed
DA
80772012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8078
8079 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8080 with RESET_INTERVAL.
8081
8082 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8083 Remove duplicated buffer name initialization.
8084
3f83ace8
JM
80852012-05-02 Jim Meyering <jim@meyering.net>
8086
8087 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8088
c7b8541e
JM
8089 * xfns.c (x_window): Use xstrdup (Bug#11375).
8090
90207a15 80912012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
8092
8093 * xdisp.c (pos_visible_p): If already at a newline from the
8094 display string before the 'while' loop, don't walk back the glyphs
8095 from it3.glyph_row. Solves assertion violation when the display
8096 string begins with a newline (egg.el). (Bug#11367)
8097
b593d6a9
AH
80982012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8099
8100 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8101 Move to simple.el.
8102
4737362e
GM
81032012-05-01 Glenn Morris <rgm@gnu.org>
8104
99cf43f9
GM
8105 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8106 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8107 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8108 All were removed before 23.1.
8109
9311dcff
GM
8110 * dispnew.c: Remove HAVE_LIBNCURSES test;
8111 it is always true on relevant platforms.
8112
4d5c6349
GM
8113 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8114 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8115
4737362e
GM
8116 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8117
74dd3a6b
AS
81182012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8119
8120 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8121 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8122 Remove.
8123
13c379ee
PE
81242012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8125
8126 Do not avoid creating empty evaporating overlays (Bug#9642).
8127 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8128 That is, do not delete an evaporating overlay if it becomes
8129 empty after its bounds are adjusted to fit within its buffer.
8130 This fix caused other problems, and I'm reverting it until we get
8131 to the bottom of them.
8132
a8e7d6d7 81332012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
8134
8135 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8136
a8e7d6d7 81372012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
8138
8139 * xdisp.c (pos_visible_p): If the window start position is beyond
8140 ZV, start the display from buffer beginning. Prevents assertion
8141 violation in init_iterator when the minibuffer window is scrolled
8142 via the scroll bar.
8143
8144 * window.c (window_scroll_pixel_based): Likewise.
8145
a8e7d6d7 81462012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
8147
8148 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8149
a8e7d6d7 81502012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
8151
8152 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8153 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8154
a8e7d6d7 81552012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 8156
b593d6a9
AH
8157 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8158 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 8159
1c6900d9
EZ
81602012-04-26 Eli Zaretskii <eliz@gnu.org>
8161
4c3fa1d9
EZ
8162 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8163 display element, check also the underlying string or buffer
8164 character. (Bug#11341)
8165
1c6900d9
EZ
8166 * w32menu.c: Include w32heap.h.
8167 (add_menu_item): If the call to AppendMenuW (via
8168 unicode_append_menu) fails, disable Unicode menus only if we are
8169 running on Windows 9X/Me.
8170
42bf8205
AS
81712012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8172
8173 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8174 (xgetint): Add missing shift for LSB tags.
8175
b1bac16e
MR
81762012-04-24 Martin Rudalics <rudalics@gmx.at>
8177
8178 * keyboard.c (read_char): Don't wipe echo area for select window
8179 events: These might get delayed via `mouse-autoselect-window'
8180 (Bug#11304).
8181
d69621cc
JB
81822012-04-24 Juanma Barranquero <lekktu@gmail.com>
8183
8184 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8185 manipulation of :loaded-from data.
8186
02fd101b
JB
81872012-04-23 Juanma Barranquero <lekktu@gmail.com>
8188
8189 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8190 now a cons (bug#11311).
8191
888bec30
PE
81922012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8193
89a438bd
PE
8194 Do not create empty overlays with the evaporate property (Bug#9642).
8195 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8196 if it becomes empty after its bounds are adjusted to fit within
8197 its buffer. Without this fix, in a nonempty buffer (let ((o
8198 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8199 yields an empty overlay that has the evaporate property, which is
8200 not supposed to happen.
8201
1068fe4d
PE
8202 Fix minor GTK3 problems found by static checking.
8203 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8204 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8205 (struct _EmacsFixedClass, emacs_fixed_get_type):
8206 Move decls here from emacsgtkfixed.h, since they needn't be public.
8207 (emacs_fixed_get_type): Now static.
8208 (emacs_fixed_class_init): Omit unused local.
8209 (emacs_fixed_child_type): Remove; unused.
8210 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8211 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8212 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8213 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8214 (EMACS_FIXED_GET_CLASS): Remove; unused.
8215 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8216
888bec30
PE
8217 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8218 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8219
de85e130
PE
82202012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8221
d0baac98 8222 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 8223 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
8224 (__malloc_size_t, __malloc_ptrdiff_t):
8225 Remove. All uses removed, replaced by the definiens if needed,
8226 since we can assume C89 or better now.
8227 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8228 (protect_malloc_state, align, get_contiguous_space)
8229 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8230 (malloc_atfork_handler_child, malloc_enable_thread)
8231 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8232 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8233 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8234 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8235 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8236 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8237 Define using prototypes, not old style.
8238 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8239 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8240 (align): Don't assume that signed integer overflow wraps around.
8241 Omit unused local var.
8242 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8243 (_free_internal_nolock, memalign, mallochook, reallochook):
8244 Omit no-longer-needed casts.
8245 (valloc): Use getpagesize, not __getpagesize.
8246 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8247 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8248
de85e130
PE
8249 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8250
dcbf5805
MA
82512012-04-22 Michael Albinus <michael.albinus@gmx.de>
8252
8253 Move functions from C to Lisp. Make non-blocking method calls
8254 the default. Implement further D-Bus standard interfaces.
8255
8256 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8257 (QCdbus_request_name_allow_replacement)
8258 (QCdbus_request_name_replace_existing)
8259 (QCdbus_request_name_do_not_queue)
8260 (QCdbus_request_name_reply_primary_owner)
8261 (QCdbus_request_name_reply_in_queue)
8262 (QCdbus_request_name_reply_exists)
8263 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8264 (QCdbus_registered_serial, QCdbus_registered_method)
8265 (QCdbus_registered_signal): New Lisp objects.
8266 (XD_DEBUG_MESSAGE): Use sizeof.
8267 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8268 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8269 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8270 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8271 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8272 (xd_signature, xd_append_arg): Allow float for integer types.
8273 (xd_get_connection_references): New function.
b593d6a9
AH
8274 (xd_get_connection_address): Rename from xd_initialize.
8275 Return cached address.
dcbf5805
MA
8276 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8277 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8278 level.
8279 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 8280 Return number of refcounts.
dcbf5805
MA
8281 (Fdbus_get_unique_name): Make stronger parameter check.
8282 (Fdbus_message_internal): New defun.
8283 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8284 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8285 (Fdbus_send_signal, Fdbus_register_service)
8286 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8287 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8288 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8289 (Vdbus_compiled_version, Vdbus_runtime_version)
8290 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8291 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8292 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
8293 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8294 Adapt docstring.
dcbf5805 8295
52828e02
PE
82962012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8297
da05bc4c
PE
8298 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8299 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8300 Do not assume ptrdiff_t is the same width as 'int'.
8301
52828e02
PE
8302 * alloc.c: Handle unusual debugging option combinations.
8303 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8304 since the two debugging options are incompatible.
8305 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8306 is defined.
8307 (mem_init, mem_insert, mem_insert_fixup):
8308 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8309 (NEED_MEM_INSERT): Remove; no longer needed.
8310
f01769f9
LL
83112012-04-22 Leo Liu <sdl.web@gmail.com>
8312
8313 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8314
5790543d
PE
83152012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8316
8317 * sysdep.c [__FreeBSD__]: Minor cleanups.
8318 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8319 Use Emacs indenting style more consistently. Avoid some casts.
8320 Use 'double' consistently rather than mixing 'float' and 'double'.
8321
b91b7e4d
EW
83222012-04-21 Eduard Wiebe <usenet@pusto.de>
8323
b593d6a9
AH
8324 * sysdep.c (list_system_processes, system_process_attributes):
8325 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 8326
6114eb15
AS
83272012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8328
8329 * lisp.mk (lisp): Update.
8330
2f38dff7
PE
83312012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8332
8333 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8334 It is never used otherwise.
8335
4ae29f89
SM
83362012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8337
8338 * print.c (print_preprocess): Only check print_depth if print-circle
8339 is nil.
8340 (print_object): Check for cycles even when print-circle is nil and
8341 print-gensym is t, but only check print_depth if print-circle is nil.
8342
f30d612a
CY
83432012-04-20 Chong Yidong <cyd@gnu.org>
8344
8345 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8346 set the status to "failed" and ensure that sentinel is run.
8347
c07a4c0b 83482012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
8349
8350 * process.c (Fset_process_inherit_coding_system_flag)
8351 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 8352 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 8353
c07a4c0b 83542012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
8355
8356 * xdisp.c (string_buffer_position_lim): Limit starting position to
8357 BEGV.
8358 (set_cursor_from_row): If called for a mode-line or header-line
8359 row, return zero immediately.
8360 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
8361 farther than the first row after the header line, if any.
8362 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
8363 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8364
c07a4c0b 83652012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8366
4ae29f89
SM
8367 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8368 (bug#11238).
ad3a2b41 8369
c07a4c0b 83702012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 83712012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
8372
8373 configure: new option --enable-gcc-warnings (Bug#11207)
8374 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8375 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8376 (ALL_CFLAGS): Use new macros rather than old.
8377 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8378 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8379 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8380 -Wunused-result, -Wunused-variable. This should go away once
8381 the Emacs and Gnulib regex code is merged.
8382 (xmalloc, xrealloc): Now static.
8383
aba027e8
PE
83842012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8385
8386 * dired.c (Fsystem_groups): Remove unused local.
8387
e5a36063
GM
83882012-04-17 Glenn Morris <rgm@gnu.org>
8389
8390 * dired.c (Fsystem_users): Doc fix.
8391
316411f0
DA
83922012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8393
8394 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8395 (syms_of_dired): Add them.
8396
9426aba4
PE
83972012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8398
b62a57be
PE
8399 Fix minor alloc.c problems found by static checking.
8400 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8401 New extern decls, to avoid calling undeclared functions.
8402 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8403 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8404 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8405 (NEED_MEM_INSERT): New macro.
8406 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 8407 Remove one incorrect comment and fix another.
b62a57be 8408
3539f31f
PE
8409 Fix minor ralloc.c problems found by static checking.
8410 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8411 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8412 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8413 (r_alloc_sbrk): Now static.
8414
a041960a
PE
8415 Improve ralloc.c interface checking.
8416 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8417 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8418 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8419 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8420 [REL_ALLOC]: ... to here, to check interface.
8421 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8422 Remove decls. This fixes an "It stinks!".
8423
9426aba4
PE
8424 * alloc.c (which_symbols): Fix alignment issue / type clash.
8425
d55c12ed
AS
84262012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8427
8428 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8429 (struct Lisp_Misc_Any): Likewise.
8430 (struct Lisp_Free): Likewise.
8431 * alloc.c (union aligned_Lisp_Symbol): Define.
8432 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8433 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8434 (union aligned_Lisp_Misc): Define.
8435 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8436 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 8437 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 8438
b948ce8b
PE
84392012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8440
8441 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8442 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8443 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8444 * s/netbsd.h, s/sol2-6.h:
8445 Remove definition of GC_MARK_STACK, since the default now works.
8446 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8447 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8448 no longer the default.
8449 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8450
35dc09a1 84512012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8452
35dc09a1
GM
8453 * lread.c (lisp_file_lexically_bound_p):
8454 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 8455
35dc09a1
GM
84562012-04-14 Eli Zaretskii <eliz@gnu.org>
8457
8458 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8459 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8460
84612012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8462
8463 * nsterm.m (constrainFrameRect): Always constrain when there is only
8464 one screen (Bug#10962).
8465
bcd86815
KB
84662012-04-13 Ken Brown <kbrown@cornell.edu>
8467
8468 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8469
c25df26e
RT
84702012-04-13 Reuben Thomas <rrt@sc3d.org>
8471
8472 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8473
0fc59f1e
DC
84742012-04-11 Daniel Colascione <dancol@dancol.org>
8475
8476 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8477 against is gone. It's better to use vfork now so that when Cygwin
8478 gains a new, working vfork, we use it automatically (bug#10398).
8479
de8c03dc
SM
84802012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8481
8482 * window.c (save_window_save): Obey window-point-insertion-type.
8483
2f097256
GM
84842012-04-11 Glenn Morris <rgm@gnu.org>
8485
8486 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8487
453b951e
SM
84882012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8489
8490 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8491
75f1671a 84922012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
8493
8494 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8495 (force_quit_count): New var.
8496 (handle_interrupt): Use it.
8497
2a8ce227
JB
84982012-04-10 Juanma Barranquero <lekktu@gmail.com>
8499
8500 * w32.c (w32_delayed_load): Record the full path of the library
8501 being loaded (bug#10424).
8502
935396c0
GM
85032012-04-09 Glenn Morris <rgm@gnu.org>
8504
05920a43
GM
8505 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8506 not just in the obarray, before snarfing them. (Bug#11036)
8507
935396c0
GM
8508 * Makefile.in ($(leimdir)/leim-list.el):
8509 Pass EMACS rather than BUILT_EMACS.
8510
a18ecafa
TZ
85112012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8512
8513 * process.c (make_process):
8514 * process.h: Add integer `gnutls_handshakes_tried' member to
8515 process struct.
8516
6bbef4e5
JC
8517 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8518 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
8519
8520 * gnutls.c (gnutls_log_function2i): Convenience log function.
8521 (emacs_gnutls_read): Use new log functions,
8522 `gnutls_handshakes_tried' process member, and
8523 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8524 attempts per process (connection).
8525
b4d3bc10
CY
85262012-04-09 Chong Yidong <cyd@gnu.org>
8527
8528 * eval.c (Fuser_variable_p, user_variable_p_eh)
8529 (lisp_indirect_variable): Functions deleted.
8530 (Fdefvar): Caller changed.
8531
8532 * callint.c (Finteractive, Fcall_interactively):
8533 * minibuf.c (Fread_variable): Callers changed.
8534
70f4d973
EZ
85352012-04-09 Eli Zaretskii <eliz@gnu.org>
8536
8537 * xdisp.c (set_cursor_from_row): If the display string appears in
8538 the buffer at position that is closer to point than the position
8539 after the display string, display the cursor on the first glyph of
8540 the display string. Fixes cursor display when a 'display' text
8541 property immediately follows invisible text. (Bug#11094)
8542
cb3c2e3e
PE
85432012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8544
8545 composite.c: use 'double' consistently
8546 * composite.c (get_composition_id): Use 'double' consistently
8547 instead of converting 'float' to 'double' and vice versa; this is
8548 easier to understand and avoids a GCC warning.
8549
fd06db5d
GM
85502012-04-09 Glenn Morris <rgm@gnu.org>
8551
50fe702a
GM
8552 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8553 preparation for dumping it with emacs. (Bug#4789)
8554 (leimdir): New variable.
8555 ($(leimdir)/leim-list.el): New rule.
8556 (emacs$(EXEEXT)): Depend on leim-list.el.
8557
fd06db5d
GM
8558 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8559 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8560 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8561
55c131ee
AS
85622012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8563
8564 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8565 proper alignment.
8566
9209588f
JB
85672012-04-07 Juanma Barranquero <lekktu@gmail.com>
8568
8569 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8570 Remove unused local variable.
8571
e3fb2efb
PE
85722012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8573
8574 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8575 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8576 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8577 objects, as mark_maybe_pointer will catch them otherwise.
8578 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8579 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8580
b5385551
PE
85812012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8582
8583 Fix typo that broke non-Windows builds.
8584 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8585
9078ead6
EZ
85862012-04-07 Eli Zaretskii <eliz@gnu.org>
8587
8588 Support building on MS-Windows with libxml2.
8589
8590 * makefile.w32-in (OBJ2): Add xml.$(O).
8591 (GLOBAL_SOURCES): Add xml.c.
8592 ($(BLD)/xml.$(O)): New dependency list.
8593
8594 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8595 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8596 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8597 [!WINDOWSNT]: New macros.
8598 (init_libxml2_functions, libxml2_loaded_p): New functions.
8599 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8600 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8601 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8602 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8603 linked in).
6bbef4e5
JC
8604 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8605 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
8606 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8607
8608 * emacs.c: Don't include libxml/parser.h.
8609 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8610 xmlCleanupParser directly.
8611
8612 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8613
3811fdf3
EZ
86142012-04-07 Eli Zaretskii <eliz@gnu.org>
8615
8616 * indent.c (Fvertical_motion): If there is a display string at
8617 point, use it.vpos to compute how many lines to backtrack after
8618 move_it_to point. (Bug#11133)
8619
2f8e16b2
EZ
86202012-04-06 Eli Zaretskii <eliz@gnu.org>
8621
8622 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8623 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8624 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8625 macros related to unification of CJK characters. For the details,
8626 see the discussion following the message here:
8627 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8628
3d439cd1
CY
86292012-04-04 Chong Yidong <cyd@gnu.org>
8630
8631 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8632
8bc53d00
EZ
86332012-04-01 Eli Zaretskii <eliz@gnu.org>
8634
8635 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8636 instead of alloca. (Bug#11138)
8637
3b0512a3
AS
86382012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8639
8640 * w32menu.c (is_simple_dialog): Properly check lisp types.
8641 (Bug#11141)
8642
8427ddd2
EZ
86432012-03-31 Eli Zaretskii <eliz@gnu.org>
8644
979022ef
EZ
8645 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8646 position we get to after a call to move_it_to fails the
8647 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8648 only if we wind up in a string from display property. (Bug#11063)
8649
a6b1c7cc
EZ
8650 * window.c (Fdelete_other_windows_internal): Invalidate the row
8651 and column information about mouse highlight, so that redisplay
8652 restores it after reallocating the glyph matrices. (Bug#7464)
8653
8427ddd2
EZ
8654 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8655 string comes from a `display' text property, use the buffer
8656 position of that property as if we actually saw that position in
8657 the row's glyphs.
697ba24b
EZ
8658 (move_it_by_lines): Remove the assertion that
8659 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8660 violated when there's a before-string at the beginning of a line.
8661 (Bug#11063)
8427ddd2 8662
65a0a738
EZ
86632012-03-30 Eli Zaretskii <eliz@gnu.org>
8664
8665 * xdisp.c (append_space_for_newline): If the default face was
8666 remapped, use the remapped face for the appended newline.
8667 (extend_face_to_end_of_line): Use the remapped default face for
8668 extending the face to the end of the line.
8669 (display_line): Call extend_face_to_end_of_line when the default
8670 face was remapped. (Bug#11068)
8671
581355cc
EZ
86722012-03-29 Eli Zaretskii <eliz@gnu.org>
8673
8674 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8675
e8fc049f
SM
86762012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8677
8678 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8679
4fb9a543
GM
86802012-03-27 Glenn Morris <rgm@gnu.org>
8681
8682 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8683 Doc fixes.
8684
679910f1
KH
86852012-03-26 Kenichi Handa <handa@m17n.org>
8686
8687 * dispextern.h (struct glyph): Fix previous change. Change the
8688 bit length of glyphless.ch to 25 (Bug#11082).
8689
90d49b7f
CY
86902012-03-26 Chong Yidong <cyd@gnu.org>
8691
8692 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8693 (command_loop_1): Use it; inhibit selection update for
8694 handle-select-window too (Bug#8996).
8695
f514f6f0
FP
86962012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8697
e8fc049f 8698 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 8699
bf43fa51
KH
87002012-03-25 Kenichi Handa <handa@m17n.org>
8701
8702 * dispextern.h (struct glyph): Change the bit length of
8703 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8704
8a0c01dd
EZ
87052012-03-24 Eli Zaretskii <eliz@gnu.org>
8706
8707 * s/ms-w32.h (tzname): Include time.h before redirecting to
8708 _tzname. Fixes the MSVC build. (Bug#9960)
8709
7d1c3a76
AS
87102012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8711
8ed79523
AS
8712 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8713 characters.
8714
7d1c3a76
AS
8715 * xterm.c (XTread_socket): Only modify handling_signal if
8716 !SYNC_INPUT. (Bug#11080)
8717
e99a9b8b
EZ
87182012-03-23 Eli Zaretskii <eliz@gnu.org>
8719
8720 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8721 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8722 when fetching a multibyte character consumes more bytes than
8723 CHAR_BYTES returns, due to unification of CJK characters in
8724 string_char. (Bug#11073)
8725
5063c0e1
TN
87262012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8727
8728 * process.c (wait_reading_process_output): Handle pty disconnect
8729 by refraining from sending oneself a SIGCHLD (bug#10933).
8730
9f851fbd
CY
87312012-03-22 Chong Yidong <cyd@gnu.org>
8732
8733 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8734
5063c0e1 8735 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
8736 Mark string as coming from a prefix property.
8737 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8738 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8739
fb5b8aca
CY
87402012-03-21 Chong Yidong <cyd@gnu.org>
8741
8742 * xfaces.c (Vface_remapping_alist): Doc fix.
8743
62356a1b
EZ
87442012-03-20 Eli Zaretskii <eliz@gnu.org>
8745
8746 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
8747 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8748 Doc fixes.
62356a1b 8749
025de85b
CY
87502012-03-20 Chong Yidong <cyd@gnu.org>
8751
8752 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8753 to reflect default non-nil value of redisplay-dont-pause.
8754
4827f94e
KH
87552012-03-19 Kenichi Handa <handa@m17n.org>
8756
8757 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8758 it fit in a valid range (Bug#11003).
8759
e50a24a2
EZ
87602012-03-18 Eli Zaretskii <eliz@gnu.org>
8761
8762 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8763 that is not from display property, accept the row as a "cursor
8764 row" if one of the string's character has a non-nil `cursor'
8765 property. Fixes cursor positioning when there are newlines in
8766 overlay strings, e.g. in icomplete.el. (Bug#11035)
8767
9af5ed87
PE
87682012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8769
8770 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8771
d1f55f16
CY
87722012-03-12 Chong Yidong <cyd@gnu.org>
8773
8774 * eval.c (inhibit_lisp_code): Rename from
8775 inhibit_window_configuration_change_hook; move from window.c.
8776
8777 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8778 * window.c (run_window_configuration_change_hook)
8779 (syms_of_window): Callers changed.
8780
66c5eebd
CY
87812012-03-11 Chong Yidong <cyd@gnu.org>
8782
413df973
CY
8783 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8784
66c5eebd
CY
8785 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8786
1de11f56
CY
87872012-03-10 Chong Yidong <cyd@gnu.org>
8788
8789 * frame.c (other_visible_frames): Don't assume the selected frame
8790 is visible (Bug#10955).
8791
cae07000
SM
87922012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8793
8794 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8795
89c94350
JD
87962012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8797
8798 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8799 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8800 zero (Bug#10954).
8801
999dd333
GM
88022012-03-03 Glenn Morris <rgm@gnu.org>
8803
01a6dcc8 8804 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 8805
de0100f2
EZ
88062012-03-02 Eli Zaretskii <eliz@gnu.org>
8807
8808 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8809 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
8810 (redisplay_window, next_element_from_string): Fix typos in
8811 comments.
3e441275
EZ
8812 (redisplay_window): Pass to move_it_vertically the margin in
8813 pixels, not in screen lines.
de0100f2 8814
96a72ee9
GM
88152012-03-02 Glenn Morris <rgm@gnu.org>
8816
8817 * buffer.c (buffer-list-update-hook): Doc fix.
8818
312508d7
EZ
88192012-02-29 Eli Zaretskii <eliz@gnu.org>
8820
8821 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8822 push_it before setting up the iterator for the first overlay
8823 string, even if we have an empty string loaded.
8824 (next_overlay_string): If there's an empty string on the iterator
8825 stack, pop the stack. (Bug#10903)
8826
27f3c637
PE
88272012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8828
8829 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8830 Suggested by Stefan Monnier in
8831 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8832 * alloc.c (widen_to_Lisp_Object): New static function.
8833 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8834 and widening them to Lisp_Objects. This would work even if
8835 USE_LSB_TAG is defined and wide integers are used, which might
8836 happen in a future version of Emacs.
8837
3c9dfce6
CY
88382012-02-25 Chong Yidong <cyd@gnu.org>
8839
fa74b241
CY
8840 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8841 Doc fix.
8842
3c9dfce6
CY
8843 * xselect.c (Fx_selection_exists_p): Doc fix.
8844 (x_clipboard_manager_save_all): Print an informative message
8845 before saving to clipboard manager.
8846
9486df08
CY
88472012-02-24 Chong Yidong <cyd@gnu.org>
8848
8849 * keyboard.c (process_special_events): Handle all X selection
8850 requests in kbd_buffer, not just the next one (Bug#8869).
8851
f01d3321
CY
88522012-02-23 Chong Yidong <cyd@gnu.org>
8853
8854 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8855 call when setting menu-bar-lines and tool-bar-lines parameters.
8856 (unwind_create_frame_1): New helper function.
8857
8858 * window.c (inhibit_window_configuration_change_hook): New var.
8859 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 8860 (syms_of_window): Initialize it.
f01d3321 8861
86b847b6
CY
88622012-02-22 Chong Yidong <cyd@gnu.org>
8863
8864 * xterm.c (x_draw_image_relief): Add missing type check for
8865 Vtool_bar_button_margin (Bug#10743).
8866
a59225b1
CY
88672012-02-21 Chong Yidong <cyd@gnu.org>
8868
8869 * fileio.c (Vfile_name_handler_alist): Doc fix.
8870
8871 * buffer.c (Fget_file_buffer): Protect against invalid file
8872 handler return value.
8873
310f5bd4
PE
88742012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8875
cb3a28cc
PE
8876 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8877 when computing $valmask.
8878
310f5bd4
PE
8879 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8880 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8881 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8882 It's useless in that case, and it can cause problems on hosts
8883 that allocate halves of EMACS_INT values separately.
8884 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8885 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8886 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8887 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8888 it avoids undefined behavior on hosts where shifting right by more
8889 than the word width has undefined behavior.
8890
2375c96a
CY
88912012-02-19 Chong Yidong <cyd@gnu.org>
8892
8893 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8894 (Funhandled_file_name_directory, Ffile_name_as_directory)
8895 (Fdirectory_file_name, Fexpand_file_name)
8896 (Fsubstitute_in_file_name): Protect against invalid file handler
8897 return values (Bug#10845).
8898
3eb49e71
EZ
88992012-02-18 Eli Zaretskii <eliz@gnu.org>
8900
8901 * .gdbinit (pitx): Fix incorrect references to fields of the
8902 iterator stack.
8903
7b926f3f
CY
89042012-02-17 Chong Yidong <cyd@gnu.org>
8905
8906 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8907
11273115
PE
89082012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8909
8910 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8911 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8912
c3a70e2b
CY
89132012-02-15 Chong Yidong <cyd@gnu.org>
8914
8915 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8916 marked as special. Also, starting docstrings with * is obsolete.
8917
0ca43699
AS
89182012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8919
8920 * gnutls.c (emacs_gnutls_write): Fix last change.
8921
2e8f3c56
LI
89222012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8923
8924 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8925 send_process.
8926
af70074f
SM
89272012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8928
8929 * keymap.c (Fsingle_key_description): Handle char ranges.
8930
95986d52
CY
89312012-02-12 Chong Yidong <cyd@gnu.org>
8932
afd83bd1
CY
8933 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8934 as that creates a dangerous corner case.
8935
95986d52
CY
8936 * window.c (Fdelete_window_internal): Invalidate the mouse
8937 highlight (Bug#9904).
8938
bd7da63e
GM
89392012-02-12 Glenn Morris <rgm@gnu.org>
8940
8941 * xselect.c (Fx_own_selection_internal)
8942 (Fx_get_selection_internal, Fx_disown_selection_internal)
8943 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8944 * nsselect.m (Fx_own_selection_internal)
8945 (Fx_disown_selection_internal, Fx_selection_exists_p)
8946 (Fx_selection_owner_p, Fx_get_selection_internal):
8947 Sync docs and argument specs with the xselect.c versions.
8948
77abcbc2
LI
89492012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8950
8951 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8952
90b671e2
EZ
89532012-02-11 Eli Zaretskii <eliz@gnu.org>
8954
1c0ca0b7
EZ
8955 * w32select.c (Fx_selection_exists_p): Sync doc string and
8956 argument list with xselect.c. (Bug#10783)
8957
8958 * w16select.c (Fx_selection_exists_p): Sync doc string and
8959 argument list with xselect.c. (Bug#10783)
90b671e2 8960
49241268
GM
89612012-02-10 Glenn Morris <rgm@gnu.org>
8962
8963 * fns.c (Fsecure_hash): Doc fix.
8964
f998bbe7 89652012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
8966
8967 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8968
0992bd9c
CY
89692012-02-07 Chong Yidong <cyd@gnu.org>
8970
8971 * buffer.c (Fbuffer_local_variables)
8972 (buffer_lisp_local_variables): Handle unbound vars correctly;
8973 don't let Qunbound leak into Lisp.
8974
af008560
GM
89752012-02-07 Glenn Morris <rgm@gnu.org>
8976
dd605cc4
GM
8977 * image.c (Fimagemagick_types): Doc fix.
8978
af008560
GM
8979 * image.c (imagemagick-render-type): Change it from a lisp object
8980 to an integer. Move the doc here from the lisp manual.
8981 Treat all values not equal to 0 the same.
8982
1449fa1d
CY
89832012-02-06 Chong Yidong <cyd@gnu.org>
8984
8985 * doc.c (store_function_docstring): Avoid applying docstring of
8986 alias to base function (Bug#2603).
8987
3723ec07
AS
89882012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8989
8990 * .gdbinit (pp1, pv1): Remove redundant defines.
8991 (pr): Use pp.
8992
79c1cc1e
CY
89932012-02-04 Chong Yidong <cyd@gnu.org>
8994
8995 * nsterm.m: Declare a global (Bug#10694).
8996
d7f29f8e
EZ
89972012-02-04 Eli Zaretskii <eliz@gnu.org>
8998
cae07000
SM
8999 * w32.c (get_emacs_configuration_options):
9000 Include --enable-checking, if specified, in the return value.
d7f29f8e 9001
3b95a6f9
MR
90022012-02-04 Martin Rudalics <rudalics@gmx.at>
9003
9004 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9005 after rounding frame sizes. (Bug#9723)
9006
d6fa96a6
EZ
90072012-02-04 Eli Zaretskii <eliz@gnu.org>
9008
9009 * keyboard.c (adjust_point_for_property): Don't position point
9010 before BEGV. (Bug#10696)
9011
df0b2940
PE
90122012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9013
9014 Handle overflow when computing char display width (Bug#9496).
9015 * character.c (char_width): Return EMACS_INT, not int.
9016 (char_width, c_string_width): Check for overflow when
9017 computing the width; this is possible now that individual
9018 characters can have unbounded width. Problem introduced
9019 by merge from Emacs 23 on 2012-01-19.
9020
6bee44d6
MA
90212012-02-02 Michael Albinus <michael.albinus@gmx.de>
9022
9023 * dbusbind.c (Fdbus_register_method): Mention the return value
9024 :ignore in the docstring.
9025
44f92739
GM
90262012-02-02 Glenn Morris <rgm@gnu.org>
9027
1b9f60cc
GM
9028 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9029
44f92739
GM
9030 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9031 Unconditionally set to t. (Bug#10673)
9032 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9033 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9034 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9035
c5d3843c
KH
90362012-02-02 Kenichi Handa <handa@m17n.org>
9037
9038 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9039 0, do not call append_composite_glyph.
9040
159462d4 90412012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
9042
9043 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9044 NULL (Bug#6988).
9045 (x_produce_glyphs): If the component of a composition is a null
9046 string, set it->pixel_width to 1 to avoid zero-width glyph.
9047
78cef877
EZ
90482012-02-01 Eli Zaretskii <eliz@gnu.org>
9049
9050 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9051 first 2 arguments are identical. This makes inserting large
9052 output from a subprocess an order of magnitude faster on
9053 MS-Windows, where all sbrk'ed memory is always contiguous.
9054
97897668
GM
90552012-01-31 Glenn Morris <rgm@gnu.org>
9056
9057 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 9058 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
9059 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9060
31fd3586
GM
90612012-01-29 Glenn Morris <rgm@gnu.org>
9062
9063 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9064
0e24a8b2
CY
90652012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9066
9067 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9068
cc0adcb0
CY
90692012-01-28 Chong Yidong <cyd@gnu.org>
9070
9071 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9072
acc28cb9
CY
90732012-01-26 Chong Yidong <cyd@gnu.org>
9074
9c69cfb7
CY
9075 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9076
acc28cb9
CY
9077 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9078 repeat counts (Bug#10507).
9079
48da7392
GM
90802012-01-26 Glenn Morris <rgm@gnu.org>
9081
9082 * lread.c (syms_of_lread): Doc fix.
9083
14af5f7f
CY
90842012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9085
9086 * coding.c (encode_designation_at_bol): Change return value to
9087 EMACS_INT.
9088
0b21c100
CY
90892012-01-25 Chong Yidong <cyd@gnu.org>
9090
9091 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9092
3c2907f7
CY
90932012-01-21 Chong Yidong <cyd@gnu.org>
9094
9095 * floatfns.c (Fcopysign): Make the second argument non-optional,
9096 since nil is not allowed anyway.
9097
959ad23f
AS
90982012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9099
9100 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9101 (send_process): Likewise.
9102
34a02f46
MR
91032012-01-19 Martin Rudalics <rudalics@gmx.at>
9104
9105 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
9106 (Vwindow_persistent_parameters): Do not use Qstate.
9107 Rewrite doc-strings.
34a02f46 9108
1259009a 91092012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
9110
9111 * character.c (char_width): New function.
70d4fdf6
GM
9112 (Fchar_width, c_string_width, lisp_string_width):
9113 Use char_width (Bug#9496).
25ed9e61 9114
6a6ee00d
MR
91152012-01-16 Martin Rudalics <rudalics@gmx.at>
9116
9117 * window.c (Vwindow_persistent_parameters): New variable.
9118 (Fset_window_configuration, save_window_save): Handle persistent
9119 window parameters.
9120
c85efaf7
EZ
91212012-01-14 Eli Zaretskii <eliz@gnu.org>
9122
9123 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9124 thrashing the stack of the thread. (Bug#9087)
9125
5944709e
PE
91262012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9127
9128 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9129
e71f5d99
EZ
91302012-01-11 Eli Zaretskii <eliz@gnu.org>
9131
9132 * xdisp.c (rows_from_pos_range): Handle the case where the
9133 highlight ends on a newline. (Bug#10464)
9134 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9135 he end column for display of highlight that ends on a newline
9136 before a R2L line.
9137
ce316182
GM
91382012-01-11 Glenn Morris <rgm@gnu.org>
9139
9140 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9141 from load-path also when installation-directory is nil. (Bug#10208)
9142
5b43da69
GM
91432012-01-10 Glenn Morris <rgm@gnu.org>
9144
74cc8ff9
GM
9145 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9146
7d8d6e4e
GM
9147 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9148 Update template values to be closer to their typical values these days.
5b43da69 9149
a0db8d43
EZ
91502012-01-09 Eli Zaretskii <eliz@gnu.org>
9151
9152 * xdisp.c (rows_from_pos_range): Accept additional argument
9153 DISP_STRING, and accept any glyph in a row whose object is that
9154 string as eligible for mouse highlight. Fixes mouse highlight of
9155 display strings from overlays. (Bug#10464)
9156
9a0115ab 91572012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 9158
b9110d6a 9159 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
9160 * fileio.c (auto_saving_dir_umask): New static var.
9161 (Fmake_directory_internal): Use it.
9162 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9163 creating the directory. The old code temporarily assigns
9164 too-generous permissions to the directory.
9165 (do_auto_save_eh): Clear it.
b9110d6a 9166 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
9167 that the var is always cleared.
9168
6c1bd3f3
EZ
91692012-01-07 Eli Zaretskii <eliz@gnu.org>
9170
9171 * search.c (scan_buffer): Pass character positions to
9172 know_region_cache, not byte positions. (Bug#6540)
9173
069d2b50
L
91742012-01-07 LynX <_LynX@bk.ru> (tiny change)
9175
9176 * w32.c (sys_rename): Report EXDEV when rename of a directory
9177 fails because the target is on another logical disk. (Bug#10284)
9178
75bf0d33
DB
91792012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9180
9181 * xterm.c (x_embed_request_focus): New function.
9182
9183 * xterm.h: Add prototype.
9184
9185 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9186
1c6e5a32
GM
91872012-01-05 Glenn Morris <rgm@gnu.org>
9188
9189 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9190
651e947e
EZ
91912012-01-01 Eli Zaretskii <eliz@gnu.org>
9192
9193 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9194 Load gnutls_transport_set_lowat only if GnuTLS version is below
9195 2.11.1.
9196 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9197 GnuTLS versions below 2.11.1.
9198
3778cdd8
AL
91992011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9200
9201 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9202 to the doc string advising against its use for altering the way
9203 windows are scrolled.
9204
0e5317f7
KH
92052011-12-28 Kenichi Handa <handa@m17n.org>
9206
9207 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9208 coding-system ASCII compatible only when it does not produce BOM
9209 on encoding (Bug#10383).
9210
93d5ca1f
JD
92112011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9212
9213 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9214 can scroll.
9215 (create_and_show_popup_menu): Always use menu_position_func for
9216 Gtk3 (Bug#10361).
9217
ca22b785
AS
92182011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9219
9220 * callint.c (Fcall_interactively): Don't truncate prompt string.
9221
d048e1e6
EZ
92222011-12-23 Eli Zaretskii <eliz@gnu.org>
9223
9224 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9225 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 9226 resumed from there (after widening). (Bug#10360)
d048e1e6 9227
5ccaba1f
JD
92282011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9229
9230 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9231
204ee57f
JD
92322011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9233
b81d40f0
JB
9234 * nsterm.m (x_free_frame_resources):
9235 Release f->output_data.ns->miniimage.
204ee57f
JD
9236 (ns_index_color): Fix indentation. Do not retain
9237 color_table->colors[i].
9238
9239 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9240 before returning.
9241
9242 * nsfns.m (x_set_background_color): Assign return value from
9243 ns_index_color to face-background instead of NSColor*.
9244 (ns_implicitly_set_icon_type): Fix indentation.
9245 Change assignment in for loop to comparison.
9246
9247 * emacs.c (ns_pool): New variable.
9248 (main): Assign ns_pool.
9249 (Fkill_emacs): Call ns_release_autorelease_pool.
9250
9251 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9252 autorelease fdesc, release fdAttrs and tdict.
9253 (ns_get_covering_families): Release charset.
9254 (ns_findfonts): Release NSFontDescriptor created with new.
9255 (ns_uni_to_glyphs): Fix indentation.
9256 (setString): Release attrStr before assigning new value.
9257
c803b2b7
JD
92582011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9259
678f4426
JD
9260 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9261 and NS_IMPL_COCOA.
9262 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9263 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9264
cd394be1 92652011-12-18 David Reitter <reitter@cmu.edu>
678f4426 9266
5fecd5fc
JD
9267 * nsterm.m (ns_term_init): Subscribe for notifications
9268 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9269 to method trackingNotification in EmacsMenu.
9270
9271 * nsmenu.m (trackingMenu): New variable.
3771cb17 9272 (trackingNotification): New method (from Aquamacs).
5fecd5fc 9273 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 9274 from Aquamacs (Bug#7030).
678f4426
JD
9275
92762011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 9277
c803b2b7
JD
9278 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9279 (symbol_to_nsstring): Fix indentation.
9280 (ns_symbol_to_pb): New function.
cae07000
SM
9281 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9282 (Fns_rotate_cut_buffers_internal): Remove.
9283 (Fns_store_selection_internal): Rename from
c803b2b7
JD
9284 Fns_store_cut_buffer_internal.
9285 (ns_get_foreign_selection, Fx_own_selection_internal)
9286 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
9287 (Fns_get_selection_internal, Fns_store_selection_internal):
9288 Use ns_symbol_to_pb and check if return value is nil.
9289 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9290 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
9291 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9292 renamed to Sns_store_selection_internal.
9293 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9294 and remove this function.
9295 (ns_handle_selection_clear): Remove, never used.
9296 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9297 here.
9298
e1b01a3a
KB
92992011-12-17 Ken Brown <kbrown@cornell.edu>
9300
9301 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9302 GID is unknown (Bug#10257).
9303
2adb6e85
PE
93042011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9305
9306 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9307 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9308 which caused a build failure on GNU/Linux IA-64. This problem was
9309 introduced by my 2011-10-07 patch.
9310
d1d7b339
JL
93112011-12-15 Juri Linkov <juri@jurta.org>
9312
9313 * image.c (imagemagick_error): New function. (Bug#10112)
9314 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9315 Use `imagemagick_error' where ImageMagick functions return
9316 `MagickFalse'.
9317 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9318 proper order.
9319
100d5755
KH
93202011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9321
9322 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9323 fill background (Bug#8992).
9324
454592a6
MR
93252011-12-13 Martin Rudalics <rudalics@gmx.at>
9326
9327 * window.c (Vwindow_combination_resize)
9328 (Vwindow_combination_limit): Use t instead of non-nil in
9329 doc-strings.
61d4b438
MR
9330 (Vrecenter_redisplay): Add first sentence of doc-string on
9331 separate line.
53524d93 9332 (Frecenter): Fix doc-string typo.
454592a6 9333
3633e3aa
KH
93342011-12-11 Kenichi Handa <handa@m17n.org>
9335
9336 * coding.c (Funencodable_char_position): Pay attention to the
9337 buffer text relocation (Bug#9389).
9338
7b9d523a 93392011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 9340
7b9d523a
JD
9341 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9342 gtk_init (Bug#10100).
9343
b73189c6
EZ
93442011-12-10 Eli Zaretskii <eliz@gnu.org>
9345
9346 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9347 IT->string is nil. (Bug#10263)
9348
f7dfe5d6
JD
93492011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9350
83faebb4
JD
9351 * nsterm.h (x_free_frame_resources): Declare.
9352
f7dfe5d6
JD
9353 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9354 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9355
9356 * nsterm.h (ns_get_defaults_value): Declare.
9357
9358 * nsterm.m (ns_default): Call ns_get_defaults_value.
9359
7cd4e72c
EZ
93602011-12-09 Eli Zaretskii <eliz@gnu.org>
9361
9362 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9363 (Bug#10170)
9364
b34d7317
YM
93652011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9366
9367 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9368 that where the value of an _OBJC_* symbol points to is in the .bss
9369 section (Bug#10240).
9370
76470ad1
KH
93712011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9372
9373 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 9374 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 9375
745fff94
KH
93762011-12-08 Kenichi Handa <handa@m17n.org>
9377
9378 * ftfont.c (get_adstyle_property): Fix previous change
9379 (Bug#10233).
9380
6e44397c
JB
93812011-12-07 Juanma Barranquero <lekktu@gmail.com>
9382
9383 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9384 dirs from the default value of EMACSLOADPATH (bug#10208).
9385
7efa6272
GM
93862011-12-07 Glenn Morris <rgm@gnu.org>
9387
9388 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9389 installation and source directories as well. (Bug#10208)
9390
f6fc4d87
CY
93912011-12-06 Chong Yidong <cyd@gnu.org>
9392
9393 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9394
2bf26180
GM
93952011-12-06 Glenn Morris <rgm@gnu.org>
9396
9397 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9398 as an error, not just -1. (Bug#10217)
9399
3a6ad4f0
CY
94002011-12-05 Chong Yidong <cyd@gnu.org>
9401
9402 * keyboard.c (process_special_events): New function.
9403 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9404
75a3b399
PE
94052011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9406
9407 * coding.c (encode_designation_at_bol): Don't use uninitialized
9408 local variable (Bug#9318).
9409
c3c9e25e
KH
94102011-12-05 Kenichi Handa <handa@m17n.org>
9411
9412 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9413 return Qnil (Bug#8046, Bug#10193).
9414
5eb05ea3
KH
94152011-12-05 Kenichi Handa <handa@m17n.org>
9416
9417 * coding.c (encode_designation_at_bol): New args charbuf_end and
9418 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
9419 (coding_set_source): Return how many bytes coding->source was
9420 relocated.
9421 (coding_set_destination): Return how many bytes
9422 coding->destination was relocated.
9423 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 9424 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
9425
94262011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9427
9428 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9429 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9430 macro (Bug#9318).
9431
94322011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9433
9434 The following changes are to fix Bug#9318.
9435
a79703f5 9436 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
9437 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9438 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 9439 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 9440
7dbda6df
JB
94412011-12-05 Juanma Barranquero <lekktu@gmail.com>
9442
9443 * lisp.h (process_quit_flag): Fix external declaration.
9444
6d5eb5b0
SM
94452011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9446
9447 Don't macro-inline non-performance-critical code.
9448 * eval.c (process_quit_flag): New function.
9449 * lisp.h (QUIT): Use it.
9450
a0c3fad0
JD
94512011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9452
9453 * nsfns.m (get_geometry_from_preferences): New function.
9454 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9455
6c07aac2
AS
94562011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9457
9458 * emacs.c (Qkill_emacs): Define.
9459 (syms_of_emacs): Initialize it.
9460 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9461 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
9462 (quit_throw_to_read_char): Add parameter `from_signal'.
9463 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
9464 * lisp.h (QUIT): Call Fkill_emacs if requested.
9465
c052ead4
JD
94662011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9467
9468 * widget.c (update_wm_hints): Return if wmshell is null.
9469 (widget_update_wm_size_hints): New function.
9470
9471 * widget.h (widget_update_wm_size_hints): Declare.
9472
9473 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9474 widget_update_wm_size_hints (Bug#10104).
9475
9e49252b
EZ
94762011-12-03 Eli Zaretskii <eliz@gnu.org>
9477
9478 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9479 before a newline, prepare the bidi iterator for consuming the
9480 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 9481 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 9482
02b16839
JL
94832011-12-02 Juri Linkov <juri@jurta.org>
9484
9485 * search.c (Fword_search_regexp): New Lisp function created from
9486 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9487 (Fword_search_backward, Fword_search_forward)
9488 (Fword_search_backward_lax, Fword_search_forward_lax):
9489 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9490 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9491
0068070e
SM
94922011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9493
9494 * fileio.c (Finsert_file_contents): Move after-change-function call
9495 to before the "handled:" label, since all "goto handled" appear in
9496 cases where the *-change-functions have already been properly called
9497 (bug#10117).
9498
3360a3fc
AS
94992011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9500
9501 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9502 waiting for input. (Bug#10169)
9503
73d6c093
EZ
95042011-11-30 Eli Zaretskii <eliz@gnu.org>
9505
9506 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9507 verifies glyph row's hash code--we have just reallocated the
9508 glyphs, so their contents can be complete garbage. (Bug#10164)
9509
febe6bea
JB
95102011-11-30 Juanma Barranquero <lekktu@gmail.com>
9511
9512 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9513
801a4313
EZ
95142011-11-30 Eli Zaretskii <eliz@gnu.org>
9515
9516 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9517 attributes are tested _before_ calling verify_row_hash, to protect
9518 against GCC re-ordering of the tests. (Bug#10164)
9519
2b56b87e
JD
95202011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9521
9522 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9523
9524 * xterm.c (handle_one_xevent): Only set async_visible and friends
9525 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 9526 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
9527 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9528
dbf31225
PE
95292011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9530
9531 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9532 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9533 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9534 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9535 All uses changed to use GCPRO1 etc.
9536 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9537 Revert to old implementation (i.e., before 2011-03-11).
9538
1305621b
YM
95392011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9540
9541 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9542 of scroll runs so as to avoid assigning disabled bogus rows and
9543 unnecessary graphics copy operations.
9544
8c9afb46
EZ
95452011-11-27 Eli Zaretskii <eliz@gnu.org>
9546
9547 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9548 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9549 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9550 (malloc, free, realloc, calloc): Redirect to e_* only when
9551 compiling Emacs.
9552
9553 * lisp.h (GCTYPEBITS): Move before first use.
9554 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9555 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9556 this macro definition.
9557
9558 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9559 _MSC_VER.
9560
54e9e3bf
JD
95612011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9562
6d5eb5b0
SM
9563 * gtkutil.c (xg_create_frame_widgets):
9564 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
9565 present with Gtk+ 2.0.
9566
83aca1cb
PE
95672011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9568
9569 * fileio.c (Finsert_file_contents): Undo previous change; see
9570 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9571
5b76caa4
PE
95722011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9573
9574 Rename locals to avoid shadowing.
9575 * fileio.c (Finsert_file_contents):
9576 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9577 * process.c (wait_reading_process_output):
9578 Rename inner 'proc' to 'p' to avoid shadowing.
9579 Indent for consistency with usual Emacs style.
9580
8c535114
EZ
95812011-11-25 Eli Zaretskii <eliz@gnu.org>
9582
9583 * xdisp.c (redisplay_window): If cursor row is not fully visible
9584 after recentering, and scroll-conservatively is set to a large
9585 number, scroll window by a few more lines to make the cursor fully
9586 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
9587 (start_display): Don't move to the next line if the display should
9588 start at a newline that is part of a display vector or an overlay
9589 string. (Bug#10119)
8c535114 9590
fa4fdb5c
JL
95912011-11-24 Juri Linkov <juri@jurta.org>
9592
9593 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9594 after the `MagickPingImage' call. (Bug#10112)
9595
90ec88df
CY
95962011-11-23 Chong Yidong <cyd@gnu.org>
9597
9598 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9599
56e2e794
MR
96002011-11-23 Martin Rudalics <rudalics@gmx.at>
9601
9602 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9603 making another buffer current. (Bug#10114)
9604
b6e64c41
GM
96052011-11-23 Glenn Morris <rgm@gnu.org>
9606
9607 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9608
6b21de18
CY
96092011-11-23 Chong Yidong <cyd@gnu.org>
9610
9611 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9612 using it (Bug#5984).
9613
b12cd789
EZ
96142011-11-22 Eli Zaretskii <eliz@gnu.org>
9615
9616 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9617 and header-lines, as they don't have one computed for them.
9618 (Bug#10098)
9619
9620 * .gdbinit (prow): Make displayed values more self-explaining.
9621 Add row's hash code.
9622
261b6fd4
LMI
96232011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9624
9625 * process.c (wait_reading_process_output): Fix asynchrounous
9626 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 9627 (wait_reading_process_output): Add comment and URL.
261b6fd4 9628
e7cfd277
JD
96292011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9630
9631 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9632
a9b9b7f5
CY
96332011-11-21 Chong Yidong <cyd@gnu.org>
9634
9635 * window.c (Fnext_window, Fprevious_window): Doc fix.
9636
b0d15b4f
SM
96372011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9638
9639 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9640
fe7a3057
JB
96412011-11-20 Juanma Barranquero <lekktu@gmail.com>
9642
9643 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9644
d2999b1a
MR
96452011-11-20 Martin Rudalics <rudalics@gmx.at>
9646
9647 * window.c (Fset_window_combination_limit): Rename argument
9648 STATUS to LIMIT.
9649 (Vwindow_combination_limit): Remove "status" from doc-string.
9650
d5ff9cd0
AS
96512011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9652
9653 * m/ibms390.h: Remove.
9654 * m/ibms390x.h: Don't include "ibms390.h".
9655
a5bb9bd3
SM
96562011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9657
9658 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9659 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9660
cd1181db
JB
96612011-11-20 Juanma Barranquero <lekktu@gmail.com>
9662
9663 * casetab.c (Fset_case_table):
9664 * charset.c (Fcharset_after): Fix typos.
9665
615a3b8d 96662011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 9667
17e845af
PE
9668 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9669 Otherwise, valgrind does not work on some platforms.
9670 Problem reported by Andreas Schwab in
6a0bf43d
PE
9671 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9672 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9673 is set, removing the need for VIRT_ADDRESS_VARIES.
9674 (PURE_P): Use a more-efficient implementation that needs just one
9675 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9676 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9677 to 4 (xorl, subq, cmpq, setbe).
9678 * alloc.c (pure): Always extern now, since that's the
9679 VIRT_ADDR_VARIES behavior.
9680 (PURE_POINTER_P): Use a single comparison, not two, for
9681 consistency with the new puresize.h.
9682 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9683 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9684 Remove VIRT_ADDR_VARIES no longer needed.
9685
f8fe6f96
EZ
96862011-11-19 Eli Zaretskii <eliz@gnu.org>
9687
9688 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9689 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9690 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9691 behave as if the cursor position were at the window margin.
9692
9693 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9694 and the cursor position is out of bounds, behave as if the cursor
9695 position were at the window margin. (Bug#10075)
9696
df05a53c
CY
96972011-11-18 Chong Yidong <cyd@gnu.org>
9698
9699 * window.c (Fwindow_combination_limit): Make first argument
9700 non-optional, since it is meaningless for live windows like the
9701 selected window.
61ccba97 9702
2071918e
DA
97032011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9704
9705 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9706
b50a28de
SM
97072011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9708
9709 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9710 (graft_intervals_into_buffer): Simplify.
9711
015137db
EZ
97122011-11-18 Eli Zaretskii <eliz@gnu.org>
9713
9714 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9715 hash values of the two rows.
9716 (copy_row_except_pointers): Preserve the used[] arrays and the
9717 hash values of the two rows. (Bug#10035)
68c95424 9718 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
9719
9720 * xdisp.c (row_hash): New function, body extracted from
9721 compute_line_metrics.
9722 (compute_line_metrics): Call row_hash, instead of computing the
9723 hash code inline.
9724
9725 * dispnew.c (verify_row_hash): Call row_hash for computing the
9726 hash code of a row, instead of duplicating code from xdisp.c.
9727
9728 * dispextern.h (row_hash): Add prototype.
9729
a2addb04
TH
97302011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9731
9732 * frame.c (delete_frame): Don't delete the terminal when the last
9733 X frame is closed if emacs is built with GTK toolkit.
9734
df85d315
JB
97352011-11-17 Juanma Barranquero <lekktu@gmail.com>
9736
9737 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9738
a0c2d0ae
MR
97392011-11-17 Martin Rudalics <rudalics@gmx.at>
9740
9741 * window.c (Vwindow_splits): Rename to
9742 Vwindow_combination_resize. Suggested by Juri Linkov.
9743 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9744 of Vwindow_splits.
9745
58179cce
JB
97462011-11-16 Juanma Barranquero <lekktu@gmail.com>
9747
7877f373
JB
9748 * nsfns.m (Fns_font_name):
9749 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 9750
b6f67890
MR
97512011-11-16 Martin Rudalics <rudalics@gmx.at>
9752
9753 * window.h (window): Rename slot "nest" to "combination_limit".
9754 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9755 (Fset_window_nest): Rename to Fset_window_combination_limit.
9756 (Vwindow_nest): Rename to Vwindow_combination_limit.
9757 (recombine_windows, make_parent_window, make_window)
9758 (Fsplit_window_internal, saved_window)
9759 (Fset_window_configuration, save_window_save): Rename all
9760 occurrences of window_nest to window_combination_limit.
9761
c7015153
JB
97622011-11-15 Juanma Barranquero <lekktu@gmail.com>
9763
9764 * image.c (imagemagick_load_image): Fix typo.
9765
322ad6ec
EZ
97662011-11-14 Eli Zaretskii <eliz@gnu.org>
9767
9768 * xdisp.c (display_line): Move the call to
9769 highlight_trailing_whitespace before the call to
9770 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
9771 faces of all the glyphs to compute ROW's hash value.
9772 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 9773
f067b8ec
JB
97742011-11-14 Juanma Barranquero <lekktu@gmail.com>
9775
9776 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9777 just return (bug#10044).
9778
1e5b2111
EZ
97792011-11-12 Eli Zaretskii <eliz@gnu.org>
9780
7ef3cbd5
EZ
9781 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9782 with user-defined heap size. Bump the default size of the temacs
9783 heap to 27MB, to avoid memory warning when running temacs.
9784 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9785
1e5b2111
EZ
9786 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9787 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
9788 (verify_row_hash) [XASSERTS]: New function.
9789 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9790 that the hash value of glyph rows is correct.
1e5b2111 9791
89d61221
MR
97922011-11-12 Martin Rudalics <rudalics@gmx.at>
9793
9794 * window.h (window): Remove splits slot.
9795 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9796 (Fdelete_other_windows_internal, make_parent_window)
9797 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9798 (Fset_window_configuration, save_window_save): Don't deal with
9799 split status of windows.
9800 (saved_window): Remove splits slot.
9801 (Vwindow_splits): Rewrite doc-string.
9802
97f18cc8
JD
98032011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9804
9805 * xfns.c (unwind_create_frame):
9806 * nsfns.m (unwind_create_frame):
9807 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9808 Vframe_list (Bug#9999).
9809
22a648b4
DA
98102011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9811
0b381c7e 9812 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 9813
659afede
KH
98142011-11-11 Kenichi Handa <handa@m17n.org>
9815
9816 * callproc.c (Fcall_process): Set the member dst_multibyte of
9817 process_coding.
9818
9ac0394b
KH
98192011-11-11 Johan Bockgård <bojohan@gnu.org>
9820
9821 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9822 avoid a crash (bug#9496).
9823
2fbdc249
CY
98242011-11-09 Chong Yidong <cyd@gnu.org>
9825
9826 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9827 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9828
ac6b1f81
PE
98292011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9830
9831 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9832
09db192c
PE
98332011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9834
9835 Avoid some portability problems by eschewing 'extern inline' functions.
9836 The trivial performance wins aren't worth the portability hassles; see
9837 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9838 et seq.
9839 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9840 (window_box_width, window_box_left, window_box_left_offset)
9841 (window_box_right, window_box_right_offset): Undo previous change,
9842 by removing the "extern"s.
9843 * intervals.c (adjust_intervals_for_insertion)
9844 (adjust_intervals_for_deletion): Undo previous change,
9845 making these static again.
9846 (offset_intervals, temp_set_point_both, temp_set_point)
9847 (copy_intervals_to_string): No longer inline.
9848 * xdisp.c (window_text_bottom_y, window_box_width)
9849 (window_box_height, window_box_left_offset)
9850 (window_box_right_offset, window_box_left, window_box_right)
9851 (window_box): No longer inline.
9852
105216ed
CY
98532011-11-08 Chong Yidong <cyd@gnu.org>
9854
9855 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
9856 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9857 Signal an error if not a live window.
105216ed
CY
9858 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9859 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9860
ae9e237f
JB
98612011-11-07 Juanma Barranquero <lekktu@gmail.com>
9862
9863 * lisp.h (syms_of_abbrev): Remove declaration.
9864 Reported by CHENG Gao <chenggao@royau.me>.
9865
c7aa8333
EZ
98662011-11-07 Eli Zaretskii <eliz@gnu.org>
9867
9868 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9869 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9870 of temacs in GUI mode.
9871
be7f5545
MR
98722011-11-07 Martin Rudalics <rudalics@gmx.at>
9873
9874 * window.h: Declare delete_all_child_windows instead of
9875 delete_all_subwindows.
9876 * window.c (Fwindow_nest, Fset_window_nest)
9877 (Fset_window_new_total, Fset_window_new_normal)
9878 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9879 (delete_all_subwindows): Rename to delete_all_child_windows.
9880 (Fdelete_other_windows_internal, Fset_window_configuration):
9881 Call delete_all_child_windows instead of delete_all_subwindows.
9882 * frame.c (delete_frame): Call delete_all_child_windows instead
9883 of delete_all_subwindows.
9884
ca78dc43
PE
98852011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9886
9887 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9888 This is also needed for porting to any host where GC_MARK_STACK is
9889 not GC_MAKE_GCPROS_NOOPS.
9890 (which_symbols): Use it.
9891
a0241d01
KH
98922011-11-07 Kenichi Handa <handa@m17n.org>
9893
9894 * coding.c (coding_set_destination): Check coding->src_pos only
9895 when coding->src_object is a buffer (bug#9910).
9896
9897 * process.c (send_process): Set the member src_multibyte of coding
9898 to 0 (bug#9911) when sending a unibyte text.
9899
9900 * callproc.c (Fcall_process): Set the member src_multibyte of
9901 process_coding to 0 (bug#9912).
9902
a64bfdfa 99032011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
9904
9905 * xmenu.c (cleanup_widget_value_tree): New function.
9906 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9907 calling free_menubar_widget_value_tree directly (Bug#9830).
9908
cb41b32a
PE
99092011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9910
9911 Fix some portability problems with 'inline'.
9912 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9913 (window_box_width, window_box_left, window_box_left_offset)
9914 (window_box_right, window_box_right_offset): Declare extern.
9915 Otherwise, these inline functions do not conform to C99 and
9916 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9917 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9918 * intervals.c (adjust_intervals_for_insertion)
9919 (adjust_intervals_for_deletion): Now extern, because otherwise the
9920 extern inline functions 'offset_intervals' couldn't refer to it.
9921 (static_offset_intervals): Remove.
9922 (offset_intervals): Rewrite using the old contents of
9923 static_offset_intervals. The old version didn't conform to C99
9924 because an extern inline function contained a reference to an
9925 identifier with static linkage.
9926
b7041366
AS
99272011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9928
9929 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9930 GC.
9931
88a37c4d
EZ
99322011-11-06 Eli Zaretskii <eliz@gnu.org>
9933
9934 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9935 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9936 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9937 return Qleft_to_right.
9938
49745b39
CY
99392011-11-06 Chong Yidong <cyd@gnu.org>
9940
9941 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9942 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9943 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9944 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9945 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9946 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9947 (Fwindow_vscroll): Doc fix.
9948 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9949 argument, since it makes no sense to pass a live window and for
9950 consistency with window-child.
9951
1f05cd82
CS
99522011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9953
9954 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9955 support MSVC.
9956
22610910
JR
99572011-11-05 Jason Rumney <jasonr@gnu.org>
9958
9959 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9960 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9961 fonts (Bug#6029).
9962 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9963 bitwise arithmetic preventing use of unicode-sip and non-truetype
9964 opentype fonts.
9965
a06776b2
EZ
99662011-11-05 Eli Zaretskii <eliz@gnu.org>
9967
3ad924ba
EZ
9968 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9969 "emacs"-only part.
9970
a06776b2
EZ
9971 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9972 initialization code to keep similarity to xfns.c after changes
9973 from 2011-11-05.
9974
c9e7db78
JD
99752011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9976
a97f8f3f
JD
9977 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9978 (unwind_create_frame): New function (Bug#9943).
9979 (Fx_create_frame): Restructure code to be more similar to the one in
9980 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9981 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9982 Move terminal->reference_count++ just before making the frame official
9983 (Bug#9943).
9984
9985 * nsterm.m (x_free_frame_resources): New function.
9986 (x_destroy_window): Move code to x_free_frame_resources.
9987
c9e7db78 9988 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
9989 (Fx_create_frame, x_create_tip_frame):
9990 Move terminal->reference_count++ just before making the frame
75f1671a 9991 official. Move initialization of image_cache_refcount and
c9e7db78
JD
9992 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9993
a6fc3b5c
EZ
99942011-11-05 Eli Zaretskii <eliz@gnu.org>
9995
9996 Support MSVC build with newer versions of Visual Studio.
9997 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9998 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9999 nt/gmake.defs.
10000
10001 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10002 which are not supported by MSVC.
10003 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10004 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10005 bitfields.
10006 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10007 types in bitfields.
10008 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10009
10010 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10011
58179cce 100122011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
10013
10014 Support MSVC build with newer versions of Visual Studio.
10015 * w32.c: Don't include w32api.h for MSVC.
10016 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10017
10018 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10019 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10020 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10021 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10022 e_* cousins.
10023 (alloca) [_MSC_VER]: Define to _alloca.
10024
10025 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10026
10027 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10028
a58c13ed
EZ
100292011-11-04 Eli Zaretskii <eliz@gnu.org>
10030
10031 * xdisp.c (note_mouse_highlight): If either of
10032 previous/next-single-property-change returns nil, treat that as
10033 the beginning or the end of the buffer. (Bug#9955)
10034
fe0b6370
JD
100352011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10036
a58c13ed 10037 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
10038 label is not null (Bug#9951).
10039 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10040 may be NULL.
10041
89bd5ee1
EZ
100422011-11-04 Eli Zaretskii <eliz@gnu.org>
10043
10044 * window.c (Fwindow_body_size): Mention in the doc string that the
10045 return value is in frame's canonical units. (Bug#9949)
10046
84c3edb9
EZ
100472011-11-03 Eli Zaretskii <eliz@gnu.org>
10048
4e2fb5c7
EZ
10049 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10050
84c3edb9 10051 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 10052 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 10053 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 10054
bc17a887
EZ
100552011-11-01 Eli Zaretskii <eliz@gnu.org>
10056
10057 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10058 Don't stop backward scan on the continuation glyph, even though
10059 its CHARPOS is positive.
6d5eb5b0
SM
10060 (mouse_face_from_buffer_pos, note_mouse_highlight):
10061 Rename cover_string to disp_string.
bc17a887 10062
4ee88440
MR
100632011-11-01 Martin Rudalics <rudalics@gmx.at>
10064
10065 * window.c (temp_output_buffer_show): Don't use
10066 Vtemp_buffer_show_specifiers.
10067 (Vtemp_buffer_show_specifiers): Remove unused variable.
10068
c2ff3c02
EZ
100692011-10-30 Eli Zaretskii <eliz@gnu.org>
10070
10071 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10072 past the beginning of the current glyph matrix.
10073
58179cce 100742011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
10075
10076 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10077 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10078 HAVE_GTK3 (Bug#9869).
b77a6a7f 10079
3b574623
JD
10080 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10081 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10082
b77a6a7f
JD
10083 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10084
10085 * xterm.c: Declare x_handle_net_wm_state to return int.
10086 (handle_one_xevent): Check if we are iconified but don't have
10087 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10088 (get_current_wm_state): Return non-zero if not hidden,
10089 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10090 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10091 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10092 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10093
196e41e4
PE
100942011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10095
10096 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10097 so that this new function doesn't get optimized away by a
10098 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10099
021f2e1a
AS
101002011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10101
10102 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10103
8b058d44
EZ
101042011-10-29 Eli Zaretskii <eliz@gnu.org>
10105
10106 Fix the `xbytecode' command.
10107 * .gdbinit (xprintbytestr): New command.
b50a28de 10108 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
10109 (xbytecode): Print the byte-code string as well.
10110
4452fb80
EZ
101112011-10-29 Kim Storm <storm@cua.dk>
10112
8b058d44
EZ
10113 * alloc.c (which_symbols): New function.
10114
21b72067
AS
101152011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10116
10117 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10118 line. (Bug#9903)
10119
83ed7b5c
GM
101202011-10-29 Glenn Morris <rgm@gnu.org>
10121
10122 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10123 Not clear what it was for, and it causes various bugs. (Bug#9839)
10124
5a7a728b
EZ
101252011-10-28 Eli Zaretskii <eliz@gnu.org>
10126
10127 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10128 possible random value that matches one of those tested as
10129 condition to clear the mouse face.
10130
d3d0842f
CY
101312011-10-28 Chong Yidong <cyd@gnu.org>
10132
10133 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10134
31b39d13
DN
101352011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10136
10137 * window.c (make_window): Initialize phys_cursor_on_p.
10138
9aba6043
SM
101392011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10140
10141 * lisp.h (struct Lisp_Symbol): Update comments.
10142
c20992f4
JB
101432011-10-28 Juanma Barranquero <lekktu@gmail.com>
10144
10145 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10146
db4f02f2
EZ
101472011-10-28 Eli Zaretskii <eliz@gnu.org>
10148
10149 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10150 <oslsachem@gmail.com> for helping to debug this.
10151
10152 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10153 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10154 (g_b_init_get_glyph_outline_w): New static variables.
10155 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10156 (GetGlyphOutlineW_Proc): New typedefs.
10157 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
10158 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10159 New functions.
10160 (w32font_open_internal, compute_metrics):
10161 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
10162 instead of calling the "wide" APIs directly.
10163
10164 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10165
10166 * w32.h (syms_of_w32font): Add prototype.
10167
87e68db4
JB
101682011-10-27 Juanma Barranquero <lekktu@gmail.com>
10169
10170 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10171 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10172 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10173 (Fmove_to_window_line): Doc fix.
10174
435c1d67
CY
101752011-10-27 Chong Yidong <cyd@gnu.org>
10176
10177 * process.c (make_process): Set gnutls_state to NULL.
10178
10179 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10180 non-NULL, regardless of GNUTLS_INITSTAGE.
10181 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10182 an error. Set process slots as soon as we allocate them.
10183
10184 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10185
9c6c6f49
CY
101862011-10-27 Chong Yidong <cyd@gnu.org>
10187
9aba6043
SM
10188 * gnutls.c (emacs_gnutls_deinit): New function.
10189 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
10190 (Fgnutls_deinit, Fgnutls_boot): Use it.
10191
10192 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10193 (deactivate_process): Call emacs_gnutls_deinit.
10194
657d08d3
JB
101952011-10-27 Juanma Barranquero <lekktu@gmail.com>
10196
10197 * image.c (x_create_x_image_and_pixmap):
10198 * w32.c (sys_rename, w32_delayed_load):
10199 * w32font.c (fill_in_logfont):
10200 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10201
5430d399
JB
102022011-10-26 Juanma Barranquero <lekktu@gmail.com>
10203
10204 * w32fns.c (w32_default_color_map): New function,
10205 extracted from Fw32_default_color_map.
a7ef684b 10206 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 10207
fe0055fa
PE
102082011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10209
10210 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10211
e6346438
SM
102122011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10213
10214 * keyboard.c (test_undefined): New function (bug#9751).
10215 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10216
e112cc37
ET
102172011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10218
10219 * sysdep.c (init_sys_modes): Fix the check for the controlling
10220 terminal (Bug#6649).
10221
7b5d6677
EZ
102222011-10-20 Eli Zaretskii <eliz@gnu.org>
10223
10224 * dispextern.h (struct bidi_it): New member next_en_type.
10225
10226 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10227 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10228 current character, check also for next_en_type being WEAK_EN.
10229 (bidi_resolve_weak): Don't enter the expensive loop if the current
10230 position is before next_en_pos. Record the bidi type of the first
10231 non-ET, non-BN character we find, in addition to its position.
10232 (bidi_level_of_next_char): Invalidate next_en_type when
10233 next_en_pos is over-stepped.
10234
7da0b018
PE
102352011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10236
10237 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10238 * editfns.c: Rewrite current-time-zone so that it invokes
10239 the equivalent of (format-time-string "%Z") to get the time zone name.
10240 This fixes a bug when the time zone name contains characters that
10241 need converting from the system time locale to Emacs internal format.
10242 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10243 that patch fixed format-time-string to do the conversion, but
10244 I forgot to fix current-time-zone.
10245 (format_time_string): New function, containing most of
10246 what Fformat_time_string used to contain.
10247 (Fformat_time_string): Rewrite in terms of format_time_string.
10248 This doesn't change this function's behavior.
10249 (current-time-zone): Rewrite to use format_time_string.
10250 This fixes the bug reported by Michael Schierl in
10251 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10252 Jason Rumney's 2007-06-07 change worked around this bug, but
10253 didn't fix it.
10254 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10255
8547b010
EZ
102562011-10-19 Eli Zaretskii <eliz@gnu.org>
10257
10258 * xdisp.c (start_display): If the character at POS is displayed
10259 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
10260 (try_window_reusing_current_matrix): If a line ends in a display
10261 vector or the next line starts in a display vector, continue
10262 redrawing the window even though the character position of
10263 start_row was reached.
8547b010
EZ
10264 (Bug#9771, part 2)
10265
4e948d15
CY
102662011-10-18 Chong Yidong <cyd@gnu.org>
10267
10268 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10269 with nobreak-char-display too.
10270
4787455f
EZ
102712011-10-18 Eli Zaretskii <eliz@gnu.org>
10272
10273 Fix part 3 of bug#9771.
10274 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10275 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10276 non-neutral characters if the current character is a paragraph
10277 separator (a.k.a. Newline). This avoids running the same
10278 expensive loop twice, once when we consume the preceding newline
10279 and the other time when the line actually needs to be displayed.
10280 Avoid the loop when we see neutrals on the base embedding level
10281 following a character whose directionality is the same as the
10282 paragraph's. This avoids running the expensive loop when a line
10283 ends in a long sequence of neutrals, like control characters.
10284 Add assertion against STRONG_AL type. Slightly rearrange code
10285 that determines the type of a neutral given the first non-neutral
10286 that follows it.
10287 (bidi_level_of_next_char): Set next_en_pos to zero when
10288 invalidating its info.
10289
2c91f553
EZ
102902011-10-17 Eli Zaretskii <eliz@gnu.org>
10291
10292 * xdisp.c (push_display_prop): Determine whether to record string
10293 or buffer position by IT->string, not by IT->method. Allow
10294 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
10295 (move_it_vertically_backward): Don't look for character position
10296 immediately after the newline when in a continuation line.
10297 (Bug#9771, part 1)
2c91f553 10298
c7b08b0d
MR
102992011-10-15 Martin Rudalics <rudalics@gmx.at>
10300
10301 * window.c (coordinates_in_window): Rewrite and delabelize
10302 vertical border check. (Bug#5357) (Bug#9618)
10303
6b02f655
SM
103042011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10305
10306 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10307 errors in XSetWindowBorder (bug#9310).
10308
81d40c92
DA
103092011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10310
10311 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10312 avoid crash when xmalloc overrun checking is enabled.
10313
d4172c3b
EZ
103142011-10-13 Eli Zaretskii <eliz@gnu.org>
10315
10316 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10317 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10318 cursor motion with <left> and <right> arrow keys.
10319
10320 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10321 some callers set that themselves.
10322
b00eea75
EZ
103232011-10-12 Eli Zaretskii <eliz@gnu.org>
10324
10325 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10326 display string and the previous row comes from the same string and
10327 is empty. (Bug#9739) (Bug#9738)
10328
8fe012c4
SM
103292011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10330
10331 * doc.c (get_doc_string): Encode file name (bug#9735).
10332
0074aef2
EZ
103332011-10-12 Eli Zaretskii <eliz@gnu.org>
10334
79beb178
EZ
10335 * bidi.c (bidi_level_of_next_char):
10336 * xdisp.c (get_visually_first_element): Remove old incorrect
10337 comments regarding the Unicode Line Separator character.
10338
0074aef2
EZ
10339 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10340
6e4b3fbe
DA
103412011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10342
10343 * alloc.c (Fgc_status): Do not access beyond zombies array
10344 boundary if nzombies > MAX_ZOMBIES.
10345 * alloc.c (dump_zombies): Add missing format specifier.
10346
0324f3af
PE
103472011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10348
b5525cac
PE
10349 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10350 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10351
0324f3af
PE
10352 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10353 Some packages use them to denote characters with modifiers.
10354
e9b5f888
AS
103552011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10356
10357 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10358 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10359 matching a pp-number. Rename parameter var to var1.
10360
127827c0
SM
103612011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10362
10363 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10364
c8fd3bd0
GM
103652011-10-08 Glenn Morris <rgm@gnu.org>
10366
10367 * callint.c (Fcall_interactively): Give a more explicit error for the
10368 'c' case with a non-character input. (Bug#8479)
10369
352ec8ff
EZ
103702011-10-08 Eli Zaretskii <eliz@gnu.org>
10371
03669ccb
EZ
10372 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10373 lines.
7061c986
EZ
10374 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10375 lines that are hscrolled on the left.
03669ccb 10376
352ec8ff
EZ
10377 * dispnew.c (buffer_posn_from_coords): Account for a possible
10378 presence of header-line. (Bug#4426)
10379
a66cfb1c
SM
103802011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10381
6b02f655
SM
10382 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10383 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 10384
7c5ee88e
PE
103852011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10386
10387 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10388 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10389 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10390 this makes Emacs dump core during garbage collection on rare
10391 occasions. sizeof is obviously inferior to offsetof here, so
10392 stick with offsetof.
10393 (GC_POINTER_ALIGNMENT): New macro.
10394 (mark_memory): Omit 3rd (offset) arg; caller changed.
10395 Don't assume EMACS_INT alignment is the same as pointer alignment.
10396
df1bbe5b
SM
103972011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10398
10399 * keyboard.c (read_key_sequence_remapped): New var.
10400 (read_key_sequence): Compute remapping in the right buffer.
10401 (command_loop_1): Use read_key_sequence's remapping directly.
10402
51553db6
SM
104032011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10404
32c1fffd
SM
10405 * dired.c (file_name_completion): Don't expand file name.
10406 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10407 before checking file name handler.
10408
51553db6
SM
10409 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10410 they've been requested explicitly (bug#9591).
10411
b6bd1599 104122011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
10413
10414 * keymap.c (Fsingle_key_description): Use make_specified_string
10415 instead of build_string to build string from push_key_description.
10416 (Bug#5193)
10417
f701dc2a
PE
104182011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10419
4222c55d
PE
10420 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10421 This fixes a Y2038 bug on 64-bit hosts.
10422 * buffer.c (reset_buffer):
10423 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10424 (Fclear_buffer_auto_save_failure):
10425 Use 0, not -1, to represent an unset failure time, since time_t
10426 might not be signed.
10427
f701dc2a
PE
10428 Remove dependency on glibc malloc internals.
10429 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10430 Move back here from lisp.h, but with their new implementations.
10431 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10432 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10433 * charset.c (charset_table_init): New static var.
10434 (syms_of_charset): Use it instead of xmalloc. This removes a
10435 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10436 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10437 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10438 Move back to alloc.c.
10439 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10440 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10441
9ceebf39
JD
104422011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10443
10444 * nsterm.m (windowDidResize): Call x_set_window_size only when
10445 ns_in_resize is true. Otherwise set pixelwidth/height and
10446 call change_frame_size (Bug#9628).
10447
cb993c58
PE
104482011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10449
3930c88b
PE
10450 Port --enable-checking=all to Fedora 14 x86-64.
10451 * charset.c (syms_of_charset): Also account for glibc malloc's
10452 internal overhead when calculating the initial malloc maximum.
10453
cb993c58
PE
10454 Port --enable-checking=all to Fedora 14 x86.
10455 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10456 Move to lisp.h.
10457 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10458 (overrun_check_realloc, overrun_check_free):
10459 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10460 That way, xmalloc returns a properly-aligned pointer even if
10461 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10462 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10463 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10464 into account when calculating the initial malloc maximum.
10465 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10466 Move here from alloc.c, so that charset.c can use it too.
10467 Properly align; the old code wasn't right for common 32-bit hosts
10468 when configured with --enable-checking=all.
10469 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10470 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10471
31bed486
EZ
104722011-09-29 Eli Zaretskii <eliz@gnu.org>
10473
04c70788 10474 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
10475 use EDOM.
10476
fbcaa2f3
EZ
104772011-09-28 Eli Zaretskii <eliz@gnu.org>
10478
10479 * xdisp.c (compute_display_string_end): If there's no display
10480 string at CHARPOS, return -1.
10481
10482 * bidi.c (bidi_fetch_char): When compute_display_string_end
10483 returns a negative value, treat the character as a normal
10484 character not covered by a display string. (Bug#9624)
10485
a239d4e9
JB
104862011-09-28 Juanma Barranquero <lekktu@gmail.com>
10487
10488 * lread.c (Fread_from_string): Fix typo in docstring.
10489
88652fd5
EZ
104902011-09-27 Eli Zaretskii <eliz@gnu.org>
10491
10492 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10493 newline, reseat the iterator instead of bidi-iterating there one
10494 character at a time. (Bug#9610)
32c1fffd
SM
10495 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10496 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 10497
ed497dd4
AS
104982011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10499
10500 * lread.c (readevalloop): Use correct code for NBSP.
10501 (read1): Likewise. (Bug#9608)
10502
b2bf61aa
MA
105032011-09-25 Michael Albinus <michael.albinus@gmx.de>
10504
10505 * dbusbind.c (Fdbus_register_signal): When service is not
10506 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10507
32bbb17c
GM
105082011-09-25 Glenn Morris <rgm@gnu.org>
10509
10510 * buffer.c (truncate-lines): Doc fix.
10511
94e0933e
CY
105122011-09-24 Chong Yidong <cyd@stupidchicken.com>
10513
10514 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10515 (Fset_window_next_buffers): Doc fix.
10516
cddde921
GM
105172011-09-24 Glenn Morris <rgm@gnu.org>
10518
10519 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10520
1260aef1
PE
105212011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10522
25b4bfa0
PE
10523 Fix minor problems found by static checking.
10524 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
10525 * indent.c (Fvertical_motion): Fix == vs = typo.
10526
e3cbd34b
EZ
105272011-09-24 Eli Zaretskii <eliz@gnu.org>
10528
a66cfb1c
SM
10529 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10530 Default value is now t. Doc fix.
6bf7006f 10531
e3cbd34b 10532 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 10533 logic when moving up, not only when moving down. Fix the
e3cbd34b 10534 confusing name and values of the it_overshoot_expected variable;
32c1fffd 10535 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
10536
10537 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10538 CHARPOS is covered by a display string which includes newlines.
10539 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10540 is covered by a display string with embedded newlines.
10541
a3de0cbd
MA
105422011-09-24 Michael Albinus <michael.albinus@gmx.de>
10543
10544 * dbusbind.c (Fdbus_register_signal): Add match rule to
10545 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
10546 (Fdbus_register_method, Vdbus_registered_objects_table):
10547 Fix docstring.
a3de0cbd 10548
b260039d
JM
105492011-09-24 Jim Meyering <meyering@redhat.com>
10550
32c1fffd 10551 do not ignore write error for any output size
b260039d
JM
10552 The previous change was incomplete.
10553 While it makes emacs --batch detect the vast majority of stdout
10554 write failures, errors were still ignored whenever the output size is
10555 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10556 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10557 && echo FAIL: ignored write error
10558 FAIL: ignored write error
10559 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10560 && echo FAIL: ignored write error
10561 FAIL: ignored write error
10562 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10563
8eca8a7c
AS
105642011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10565
10566 * emacs.c (Fkill_emacs): In noninteractive mode exit
10567 non-successfully if a write error occurred on stdout. (Bug#9574)
10568
3341db62
EZ
105692011-09-21 Eli Zaretskii <eliz@gnu.org>
10570
10571 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10572 the xassert test.
10573
10574 * dispextern.h (struct it): Update the comment documenting what
10575 can it->OBJECT be.
10576
8c203dbf
EZ
105772011-09-20 Eli Zaretskii <eliz@gnu.org>
10578
10579 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10580 a display string, extend search for cursor position to end of row.
10581 (find_row_edges): If the row ends in a newline from a display
10582 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10583 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
10584 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10585 non-empty line. Fixes confusing cursor motion with arrow keys at
10586 the beginning of a line that starts with whitespace.
8c203dbf 10587
a4824228
LMI
105882011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10589
10590 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10591 (bug#9493).
10592
33ed493b
CY
105932011-09-18 Chong Yidong <cyd@stupidchicken.com>
10594
10595 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10596 boolean (Bug#9154).
10597
56cd55c8
EZ
105982011-09-18 Eli Zaretskii <eliz@gnu.org>
10599
10600 * xdisp.c (display_line): Record maximum and minimum buffer
10601 positions even if no glyphs were produced (e.g., by a zero-width
10602 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10603 buffer positions that will be removed from the glyph row because
10604 they don't fit.
c02dcedf
EZ
10605 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10606 column is beyond frame width: don't subtract 1 "pixel" when
10607 computing width of the stretch.
3e62b7e0
EZ
10608 (reseat_at_next_visible_line_start): Undo the change made on
10609 2011-09-17 that saved paragraph information and restored it after
10610 the call to `reseat'. (Bug#9545)
56cd55c8 10611
5ed99d36 106122011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
10613
10614 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10615 and turn window cursor on if cleared (Bug#9415).
10616
5ed99d36 106172011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
10618
10619 * search.c (boyer_moore): Take unibyte characters from pattern
10620 literally. (Bug#9458)
10621
9bade7b2
EZ
106222011-09-18 Eli Zaretskii <eliz@gnu.org>
10623
10624 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10625
e5e9d610
PE
106262011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10627
87e4427a
PE
10628 Fix minor problem found by static checking.
10629 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10630 initialized, to pacify gcc -Wuninitialized.
10631
e5e9d610
PE
10632 * fileio.c: Report proper errno when syscall falls.
10633 (Finsert_file_contents): Save and restore errno,
10634 so that report_file_error outputs the correct diagnostic.
10635 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10636
a1674f0b
EZ
106372011-09-18 Eli Zaretskii <eliz@gnu.org>
10638
10639 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10640
fbfb6dd4
EZ
106412011-09-17 Eli Zaretskii <eliz@gnu.org>
10642
10643 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10644 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10645
bb187662
EZ
106462011-09-17 Eli Zaretskii <eliz@gnu.org>
10647
1137e8b8 10648 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 10649 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
10650
10651 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10652 (bidi_find_paragraph_start): Search back for paragraph beginning
10653 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10654 (bidi_move_to_visually_next): Only trigger paragraph-related
10655 computations when the last character is a newline or at EOB, not
10656 just any NEUTRAL_B. (Bug#9470)
10657
bb187662
EZ
10658 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10659 truncated lines if point is covered by a display string. (Bug#9524)
10660
2e621251
PE
106612011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10662
10663 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10664 (cons_to_x_long): New function.
10665 (lisp_data_to_selection_data): Use it. Correct the test for
10666 short-versus-long data; it was negated. Break out of vector
10667 loop, for efficiency, when a long datum is discovered.
10668
91a15bc6
SM
106692011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10670
10671 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10672
b41c3a35
EZ
106732011-09-16 Eli Zaretskii <eliz@gnu.org>
10674
10675 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10676 GCC PR/17406) by declaring this function with external scope.
10677
7812ba2d
PE
106782011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10679
10680 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10681 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10682
cf7edc2a
AS
106832011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10684
10685 * editfns.c (Fformat): Correctly handle text properties on "%%".
10686
bd01620e
EZ
106872011-09-15 Eli Zaretskii <eliz@gnu.org>
10688
10689 * xterm.c (x_draw_composite_glyph_string_foreground):
10690 * w32term.c (x_draw_composite_glyph_string_foreground):
10691 * term.c (encode_terminal_code):
10692 * composite.c (composition_update_it, get_composition_id):
10693 * xdisp.c (get_next_display_element)
10694 (fill_composite_glyph_string): Add comments about special meaning
10695 of TAB characters in a composition.
10696
a02719a3
PE
106972011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10698
10699 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
10700 This occurs when processing a multibyte format.
10701 Problem reported by Wolfgang Jenker.
a02719a3 10702
72589a3c
JB
107032011-09-15 Johan Bockgård <bojohan@gnu.org>
10704
10705 * xdisp.c (try_cursor_movement): Only check for exact match if
10706 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10707
1c14176c
PE
107082011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10709
10710 Remove unused external symbols.
10711 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10712 * xdisp.c (calc_pixel_width_or_height): Now static.
10713 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10714 * indent.c (check_display_width):
10715 * w32term.c: Fix comment to match code.
10716 * xterm.c, xterm.h (x_catching_errors): Remove.
10717
d2eea5b5
PE
107182011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10719
10720 * xselect.c: Use signed conversions more consistently (Bug#9498).
10721 (selection_data_to_lisp_data): Assume incoming selection data are
10722 signed integers, not unsigned. This is to be consistent with
10723 outgoing selection data, which was modified to use signed integers
10724 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10725 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10726 expects long, not unsigned long.
10727
46888499
EZ
107282011-09-14 Eli Zaretskii <eliz@gnu.org>
10729
10730 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10731 computation of loop end. Reported by Johan Bockgård
10732 <bojohan@gnu.org>.
10733
ef8ef9fb
CY
107342011-09-13 Chong Yidong <cyd@stupidchicken.com>
10735
10736 * frame.c (Fother_visible_frames_p): Function deleted.
10737
fa819fed
EZ
107382011-09-12 Eli Zaretskii <eliz@gnu.org>
10739
10740 * indent.c (compute_motion): Process display vector front to back
10741 rather than the other way around. (Bug#2496)
10742
2ba8e008
SM
107432011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10744
10745 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10746
20f53c69
CY
107472011-09-11 Chong Yidong <cyd@stupidchicken.com>
10748
10749 * minibuf.c (Fread_from_minibuffer): Doc fix.
10750
d562d7a4
EZ
107512011-09-11 Eli Zaretskii <eliz@gnu.org>
10752
10753 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10754 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10755
1c4d7f3d
LMI
107562011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10757
10758 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10759 value for non-existent files.
10760
b885bf36
EZ
107612011-09-11 Eli Zaretskii <eliz@gnu.org>
10762
10763 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10764 set its "size" to -1. This will set the modtime_size field of
10765 the corresponding buffer to -1, which is what
10766 verify-visited-file-modtime expects for files that do not exist.
10767 (Bug#9139)
10768
6612f0bf
PE
107692011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10770
10771 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10772 here ...
10773 * lisp.h: ... from here. push_key_description is no longer
10774 defined in keyboard.c, so its declaration should not be in
10775 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10776 logically belongs with push_key_description.
10777
dfb3f755
PE
107782011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10779
10780 * buffer.h: Include <sys/types.h> instead of <time.h>.
10781 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10782 Problem reported by Herbert J. Skuhra.
10783
3134906c
LMI
107842011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10785
10786 * xml.c (parse_region): Make the parsing work for
10787 non-comment-starting XML files again (bug#9144).
10788
8d903f4e
AS
107892011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10790
10791 * image.c (gif_load): Fix calculation of bottom and right corner.
10792 (Bug#9468)
10793
80ad64f4
EZ
107942011-09-10 Eli Zaretskii <eliz@gnu.org>
10795
10796 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10797 redisplay in small windows.
10798
208a048d
EZ
107992011-09-09 Eli Zaretskii <eliz@gnu.org>
10800
10801 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10802
9b1c252e
MR
108032011-09-08 Martin Rudalics <rudalics@gmx.at>
10804
10805 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10806 Operate on live windows only.
10807
2949f33b
JB
108082011-09-08 Juanma Barranquero <lekktu@gmail.com>
10809
10810 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10811
e08dcafd
EZ
108122011-09-07 Eli Zaretskii <eliz@gnu.org>
10813
10814 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10815 only under bidi iteration.
10816
115b96bd
JD
108172011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10818
10819 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10820
c8199d0f
PE
108212011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10822
10823 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10824 Without this fix, the command to link temacs failed due to an
10825 undefined symbol __builtin_isnan. This is because
10826 /usr/include/iso/math_c99.h #defines isnan(x) to
10827 __builtin_isnan(x), but the bundled gcc, which identifies itself
10828 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10829 a __builtin_isnan.
10830 * floatfns.c (isnan): #undef, and then #define to a clone of
10831 what's in data.c.
10832 (Fisnan): Always define, since it's always available now.
10833 (syms_of_floatfns): Always define isnan at the Lisp level.
10834
e39b275c 108352011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
10836
10837 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10838
b2db44d9 108392011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 10840
f4af5137 10841 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
10842 The previous code assumed that file offsets (off_t values) fit in
10843 EMACS_INT variables, which is not true on typical 32-bit hosts.
10844 The code messed up by falsely reporting buffer overflow in cases
10845 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10846 when "big" contains more than 2**29 bytes, even though this
10847 inserts just one byte and does not overflow the buffer.
10848 (Finsert_file_contents): Store file offsets as off_t
10849 values, not as EMACS_INT values. Check for overflow when
10850 converting between EMACS_INT and off_t. When checking for
10851 buffer overflow or for overlap, take the offsets into account.
10852 Don't use EMACS_INT for small values where int suffices.
10853 When checking for overlap, fix a typo: ZV was used where
10854 ZV_BYTE was intended.
10855 (Fwrite_region): Don't assume off_t fits into 'long'.
10856 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10857
ecfc0a49
MA
108582011-09-05 Michael Albinus <michael.albinus@gmx.de>
10859
10860 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10861
6511acf2 108622011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 10863
0999621a 10864 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
10865
10866 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 10867 (esprintf, exprintf, evxprintf): New functions.
62f19c19 10868 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 10869 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
10870 (modify_event_symbol): Do not assume that the length of
10871 name_alist_or_stem is safe to alloca and fits in int.
10872 (Fexecute_extended_command): Likewise for function name and binding.
10873 (Frecursion_depth): Wrap around reliably on integer overflow.
10874 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10875 since some callers pass EMACS_INT values.
10876 (Fsingle_key_description): Don't crash if symbol name contains more
10877 than MAX_ALLOCA bytes.
10878 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10879 (get_minibuffer): Arg is now EMACS_INT, not int.
10880 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 10881 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
10882 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10883
2be7d702
PE
10884 * dbusbind.c (signature_cat): New function.
10885 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
10886 Do not overrun buffer; instead, report string overflow.
10887
9d1df220
PE
10888 * dispnew.c (add_window_display_history): Don't overrun buffer.
10889 Truncate instead; this is OK since it's just a log.
10890
33ef5c64
PE
10891 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10892 even if the time zone offset is outlandishly large.
10893 Don't mishandle offset == INT_MIN.
10894
66c6fdd5
PE
10895 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10896 when creating daemon; the previous buffer-overflow check was incorrect.
10897
d749b01b
PE
10898 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10899 which has the guts of the old verror function.
10900
b5cd1905
PE
10901 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10902 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10903
6e1a67fb
PE
10904 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10905 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 10906 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 10907 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
10908 length of string rather than counting it via multiple sprintfs;
10909 that's simpler and more reliable.
c21721cc
PE
10910 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10911 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10912 sprintf, in case result does not fit in int.
10913
c57b67fc
PE
10914 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10915 (fontset_from_font): Print it.
10916
8a401434
PE
10917 * frame.c (tty_frame_count): Now printmax_t, not int.
10918 (make_terminal_frame, set_term_frame_name): Print it.
10919 (x_report_frame_params): In X, window IDs are unsigned long,
10920 not signed long, so print them as unsigned.
10921 (validate_x_resource_name): Check for implausibly long names,
10922 and don't assume name length fits in 'int'.
10923 (x_get_resource_string): Don't blindly alloca invocation name;
10924 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10925 not fit in int.
10926
6e1a67fb
PE
10927 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10928 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
10929 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10930
0df02bf3
PE
10931 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10932 Use esprintf, not sprintf, in case result does not fit in int.
10933
48e30793
PE
10934 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10935 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10936 it as a large positive number.
10937 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10938 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10939
a66ff6d8
PE
10940 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10941 in case result does not fit in int.
10942
aca216ff
PE
10943 * print.c (float_to_string): Detect width overflow more reliably.
10944 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10945 buffer overrun. Don't assume list length fits in 'int'. Treat
10946 print length of 0 as 0, not as infinity; to be consistent with other
10947 uses of print length in this function. Don't overflow print length
10948 index. Don't assume hash table size fits in 'long', or that
10949 vectorlike size fits in 'unsigned long'.
10950
31c286f7
PE
10951 * process.c (make_process): Use printmax_t, not int, to format
10952 process-name gensyms.
10953
55e5faa1
PE
10954 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10955
80f2e268
PE
10956 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10957 to avoid potential buffer overrun.
10958
670741ab
PE
10959 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10960 if X resource line is longer than 512 bytes.
10961
b7163a50
PE
10962 * xfns.c (x_window): Make sprintf buffer a bit bigger
10963 to avoid potential buffer overrun.
10964
ae58ff1f
PE
10965 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10966
c43c8a6a
PE
10967 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10968
3f8236f4
PE
109692011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10970
53e9fe90 10971 Integer overflow fixes for scrolling, etc.
6511acf2
PE
10972 Without these, Emacs silently mishandles large integers sometimes.
10973 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
10974 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10975
6511acf2
PE
10976 * xdisp.c (try_window_id): Check Emacs fixnum range before
10977 converting to 'int'.
806add1d 10978
6511acf2 10979 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
10980 Check that an Emacs fixnum is in range before assigning it to 'int'.
10981 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10982 values converted from Emacs fixnums.
10983 (Frecenter): Don't wrap around a line count if it is out of 'int'
10984 range; instead, treat it as an extreme value.
10985 (Fset_window_configuration, compare_window_configurations):
10986 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10987
6511acf2
PE
10988 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10989 that can exceed INT_MAX. Check that EMACS_INT value is in range
10990 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
10991 (match_limit): Don't assume that a fixnum can fit in 'int'.
10992
6511acf2 10993 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
10994 exceed INT_MAX.
10995
6511acf2 10996 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
10997 (Fvertical_motion): Don't wrap around LINES values that don't fit
10998 in 'int'. Instead, treat them as extreme values. This is good
10999 enough for windows, which can't have more than INT_MAX lines anyway.
11000
fcb901a7
LMI
110012011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11002
0f2f6b6d
LMI
11003 * Require libxml/parser.h to avoid compilation warning.
11004
fcb901a7
LMI
11005 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11006
11007 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11008 since this reportedly can destroy thread storage.
11009
6e20a0d4
CY
110102011-08-30 Chong Yidong <cyd@stupidchicken.com>
11011
11012 * syntax.c (find_defun_start): Update all cache variables if
11013 exiting early (Bug#9401).
11014
148ae00e
EZ
110152011-08-30 Eli Zaretskii <eliz@gnu.org>
11016
f6cfbd8f
EZ
11017 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11018
148ae00e
EZ
11019 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11020 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11021 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11022
11023 * term.c (tty_append_glyph): New function.
11024 (produce_stretch_glyph): Static function and its prototype deleted.
11025
a66cfb1c
SM
11026 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11027 Add prototypes.
148ae00e 11028
c4a07a4c
PE
110292011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11030
11031 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11032 when checking :margin (Bug#9390).
11033 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 11034 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
11035 so that the name doesn't mislead. All uses changed.
11036
6bc8cd65
JB
110372011-08-28 Johan Bockgård <bojohan@gnu.org>
11038
11039 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11040 set_tty_hooks.
11041
dca4927e
EZ
110422011-08-27 Eli Zaretskii <eliz@gnu.org>
11043
11044 * xdisp.c (move_it_to): Don't bail out early when reaching
11045 position beyond to_charpos, if we are scanning backwards.
11046 (move_it_vertically_backward): When DY == 0, make sure we get to
11047 the first character in the line after the newline.
11048
f2cad773
PE
110492011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11050
11051 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11052 (ccl_driver): Do not generate an out-of-range pointer.
11053 (Fccl_execute_on_string): Remove unnecessary check for
11054 integer overflow, noted by Stefan Monnier in
11055 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11056 Remove a FIXME that didn't need fixing.
11057 Simplify the newly-introduced buffer reallocation code.
11058
0cae2cdb
JB
110592011-08-27 Juanma Barranquero <lekktu@gmail.com>
11060
11061 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11062
5fc295a4 110632011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 11064
70c60eb2 11065 Integer and memory overflow issues (Bug#9196).
726e0ab1 11066
d31850da
PE
11067 * doc.c (get_doc_string): Rework so that
11068 get_doc_string_buffer_size is the actual buffer size, rather than
11069 being 1 less than the actual buffer size; this makes xpalloc more
11070 convenient.
11071
a69fbedb
PE
11072 * image.c (x_allocate_bitmap_record, cache_image):
11073 * xselect.c (Fx_register_dnd_atom):
11074 Simplify previous changes by using xpalloc.
11075
fe5c5d37
PE
11076 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11077 since either will do and ptrdiff_t is convenient with xpalloc.
11078
0065d054
PE
11079 * charset.c (charset_table_size)
11080 (struct charset_sort_data.priority): Now ptrdiff_t.
11081 (charset_compare): Don't overflow if priorities differ greatly.
11082 (Fsort_charsets): Don't assume list length fits in int.
11083 Check for size-calculation overflow when allocating sort data.
11084 (syms_of_charset): Allocate an initial charset table that is
11085 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11086
11087 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11088
11089 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11090 The actual value is always <= INT_MAX, and leaving it unsigned made
11091 overflow checking harder.
11092
11093 * dispextern.h (struct glyph_matrix.rows_allocated)
11094 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11095 with xpalloc. The values are still always <= INT_MAX.
11096
11097 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11098
11099 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11100 (SAFE_NALLOCA): New macro.
11101
11102 * region-cache.c (struct boundary.pos, find_cache_boundary)
11103 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11104 (set_cache_region, invalidate_region_cache)
11105 (revalidate_region_cache, know_region_cache, region_cache_forward)
11106 (region_cache_backward, pp_cache):
11107 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11108 so that ptrdiff_t * can be passed to xpalloc.
11109 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11110 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11111 (pp_cache): Don't assume cache_len fits in int.
11112 * region-cache.h: Adjust extern decls to match.
11113
11114 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11115 EMACS_INT, since either will do, for xpalloc.
11116
11117 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11118 (xnmalloc, xnrealloc, xpalloc): New functions.
11119
726e0ab1
PE
11120 * bidi.c (bidi_shelve_header_size): New constant.
11121 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11122 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11123
51f30bc5 11124 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
11125 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11126 (overlay_strings):
11127 Don't update size of array until after memory allocation succeeds,
11128 because xmalloc/xrealloc may not return.
0065d054
PE
11129 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11130 now that we have proper integer overflow checking.
11131 (record_overlay_string, overlay_strings): Catch overflows when
11132 calculating size of overlay_str_buf.
726e0ab1 11133
0065d054
PE
11134 * callproc.c (Fcall_process): Check for size overflow when
11135 calculating size of args2.
11136 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11137 Normally we prefer signed values, but sticking with ptrdiff_t would
11138 require adding more-complicated checks.
726e0ab1
PE
11139
11140 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11141 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11142 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 11143 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
11144
11145 * character.c (Fstring): Check for size-calculation overflow.
11146
11147 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11148 unnecessary integer overflow. Check for size overflow.
11149 (encode_coding_object): Don't update size until xmalloc succeeds.
11150
11151 * composite.c (get_composition_id): Check for overflow in glyph
11152 length calculations.
11153
11154 Integer and memory overflow fixes for display code.
11155 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11156 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11157 (scrolling_window): Check for overflow in size calculations.
11158 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11159 Don't assume glyph table len fits in int.
11160 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11161 (row_table_size): Now ptrdiff_t, not int.
11162 (scrolling_window): Avoid overflow in size calculations.
11163 Don't update size until allocation succeeds.
11164 * fns.c (concat): Check for overflow in size calculations.
11165 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11166 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11167 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11168
11169 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11170 (get_doc_string): Check for size calculation overflow.
11171 Don't update size until allocation succeeds.
11172 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11173 EMACS_INT, where ptrdiff_t will do.
11174 (Fsubstitute_command_keys): Check for string overflow.
11175
11176 * editfns.c (set_time_zone_rule): Don't assume environment length
11177 fits in int.
11178 (message_length): Now ptrdiff_t, not int.
11179 (Fmessage_box): Don't update size until allocation succeeds.
11180 Don't assume message length fits in int.
11181 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11182
0065d054
PE
11183 * emacs.c (main): Do not reallocate argv, since there is a null at
11184 the end that can be overwritten, and this way there's no need to
11185 worry about size-calculation overflow.
11186 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
11187
11188 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11189 alloc succeeds.
11190 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11191
11192 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11193 (x_set_scroll_bar_width, x_figure_window_size):
11194 Check for integer overflow.
11195 (x_set_alpha): Do not assume XINT fits in int.
11196
11197 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11198 This is for the members text_lines, text_cols, total_lines, total_cols,
11199 where the system imposes an 'int' limit.
11200
11201 * fringe.c (Fdefine_fringe_bitmap):
11202 Don't update size until alloc works.
11203
11204 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11205 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11206
11207 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11208 Check for size-calculation overflow.
11209 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11210 do, as we prefer signed integers.
11211 (id_to_widget.max_size, id_to_widget.used)
11212 (xg_store_widget_in_map, xg_remove_widget_from_map)
11213 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11214 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11215 Use and return ptrdiff_t, not int.
11216 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11217 * gtkutil.h: Change prototypes to match the above.
11218
11219 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11220 are duplicate now that they've been promoted to lisp.h.
11221 (x_allocate_bitmap_record, x_alloc_image_color)
11222 (make_image_cache, cache_image, xpm_load):
11223 Don't update size until alloc is done.
11224 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11225 (x_detect_edges):
3256efce 11226 Check for size calculation overflow.
726e0ab1
PE
11227 (ct_colors_allocated_max): New constant.
11228 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11229 overflow.
3256efce 11230
726e0ab1
PE
11231 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11232 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11233 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11234 Use ptrdiff_t, not int, to count maps.
11235 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
11236 calculations. Don't update size until allocation succeeds.
11237 Redo calculations to avoid overflow.
726e0ab1
PE
11238 * keyboard.h: Change prototypes to match the above.
11239
11240 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11241 to count maps.
11242 (current_minor_maps): Check for size calculation overflow.
11243 * keymap.h: Change prototypes to match the above.
11244
11245 * lread.c (read1, init_obarray): Don't update size until alloc done.
11246
11247 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11248 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11249
726e0ab1
PE
11250 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11251 Now ptrdiff_t, not int.
11252 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11253 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11254
11255 * process.c (Fnetwork_interface_list): Check for overflow
11256 in size calculation.
11257
11258 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11259
11260 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11261 overflow. Don't bother calling xmalloc when xrealloc will do.
11262
11263 * search.c (Freplace_match): Check for size calculation overflow.
11264 (Fset_match_data): Don't assume list lengths fit in 'int'.
11265
11266 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11267 for command line length. Do not attempt to address one before the
11268 beginning of an array, as that's not portable.
11269
11270 * term.c (max_frame_lines): Remove; unused.
11271 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11272 not int.
11273 (encode_terminal_code, calculate_costs): Check for size
11274 calculation overflow.
11275 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11276 table lengths and related sizes. Don't update size until alloc
11277 done. Redo calculations to avoid overflow.
11278 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11279
11280 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11281 subtracting pointers.
11282 (gobble_line): Check for overflow more carefully. Don't update size
11283 until alloc done.
11284
11285 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11286 Don't update size until alloc done.
11287 Redo size calculations to avoid overflow.
11288 Check for size calculation overflow.
0065d054 11289 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
11290
11291 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11292 Use ptrdiff_t, not int, for sizes.
11293 (store_mode_line_noprop_char): Don't update size until alloc done.
11294
0065d054
PE
11295 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11296 Use ptrdiff_t, not int, for sizes.
11297 (Finternal_make_lisp_face, cache_face):
11298 Check for size calculation overflow.
11299 (cache_face): Treat size calculation overflows as if they were
11300 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
11301
11302 * xfns.c (x_encode_text, x_set_name_internal)
11303 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11304 sizes, since they can exceed INT_MAX in size. Check for size
11305 calculation overflow.
11306
0065d054
PE
11307 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11308 (xg_select): Check for size calculation overflow.
726e0ab1
PE
11309 Don't update size until alloc done.
11310
0065d054 11311 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 11312 as sprintf is limited to int lengths.
1d526e2f 11313
252c5ee1
PE
11314 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11315 (X_LONG_MIN): New macros.
864d7ce7
PE
11316 Use them to make the following changes clearer.
11317 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11318 This change doesn't affect the value now, but it may help remind
11319 future maintainers not to raise the value too much later.
11320 (SELECTION_QUANTUM): Remove, replacing with ...
11321 (selection_quantum): ... new function, which avoids overflow.
11322 All uses changed.
11323 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11324 assumption that selection length fits in 'int'.
11325 (x_reply_selection_request, x_handle_selection_request)
11326 (x_get_window_property, receive_incremental_selection)
11327 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11328 (lisp_data_to_selection_data, clean_local_selection_data):
11329 Use ptrdiff_t, not int, to record length of selection.
11330 (x_reply_selection_request, x_get_window_property)
11331 (receive_incremental_selection, x_property_data_to_lisp):
11332 Redo calculations to avoid overflow.
11333 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 11334 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
11335 something.
11336 (x_get_window_property, receive_incremental_selection)
11337 (lisp_data_to_selection_data, x_property_data_to_lisp):
11338 Check for size-calculation overflow.
11339 (x_get_window_property, receive_incremental_selection)
11340 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11341 Don't store size until memory allocation succeeds.
11342 (x_get_window_property): Plug memory leak on memory exhaustion.
11343 Don't double-block input; malloc is safe here. Don't assume 2**34
11344 - 4 fits in unsigned long. Add an xassert to check
11345 XGetWindowProperty overflow. Be more careful about overflow
11346 calculations, and distinguish size from memory overflow better.
11347 (receive_incremental_selection): When tracing, don't assume
11348 unsigned int is less than INT_MAX.
11349 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11350 harmful) conversions of unsigned short to int.
11351 (lisp_data_to_selection_data): Don't assume that integers
11352 in the range -65535 through -1 fit in an X unsigned short.
11353 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11354 result parameters unless successful. Rely on cons_to_unsigned
11355 to report problems with elements; the old code wasn't right anyway.
11356 (x_check_property_data): Check for int overflow; we cannot use
11357 a wider type due to X limits.
11358 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11359
726e0ab1 11360 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 11361
0065d054
PE
11362 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11363 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
11364 (x_color_cells): Don't store size until memory allocation succeeds.
11365 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 11366 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
11367 (x_term_init): Don't assume length fits in int (sprintf is limited
11368 to int size).
bc18e09d 11369
ebfa62c0
PE
11370 Use ptrdiff_t for composition IDs.
11371 * character.c (lisp_string_width):
11372 * composite.c (composition_table_size, n_compositions)
11373 (get_composition_id, composition_gstring_from_id):
11374 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11375 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11376 * window.c (Frecenter):
11377 Use ptrdiff_t, not int, for composition IDs.
11378 * composite.c (get_composition_id): Check for integer overflow.
11379 * composite.h: Adjust prototypes to match the above changes.
11380
d3411f89
PE
11381 Use ptrdiff_t for hash table indexes.
11382 * category.c (hash_get_category_set):
11383 * ccl.c (ccl_driver):
11384 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11385 * coding.c (coding_system_charset_list, detect_coding_system):
11386 * coding.h (struct coding_system.id):
11387 * composite.c (get_composition_id, gstring_lookup_cache):
11388 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11389 * image.c (xpm_get_color_table_h):
11390 * lisp.h (hash_lookup, hash_put):
11391 * minibuf.c (Ftest_completion):
11392 Use ptrdiff_t for hash table indexes, not int (which is too
11393 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11394 32-bit --with-wide-int hosts).
11395
e097a6fa
PE
11396 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11397 Add a FIXME comment about memory leaks.
11398 (syms_of_charset): Don't assume xmalloc returns.
11399
5637687f
PE
11400 Don't assume that stated character widths fit in int.
11401 * character.c (Fchar_width, c_string_width, lisp_string_width):
11402 * character.h (CHAR_WIDTH):
11403 * indent.c (MULTIBYTE_BYTES_WIDTH):
11404 Use sanitize_char_width to avoid undefined and/or bad behavior
11405 with outlandish widths.
a66cfb1c 11406 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
11407 now that we have two such functions. All uses changed.
11408 (sanitize_char_width): New inline function.
11409
a2271ba2
PE
11410 Don't assume that tab-width fits in int.
11411 * character.h (sanitize_width): New inline function.
11412 (SANE_TAB_WIDTH): New macro.
11413 (ASCII_CHAR_WIDTH): Use it.
11414 * indent.c (sane_tab_width): Remove. All uses replaced by
11415 SANE_TAB_WIDTH (current_buffer).
11416 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11417
18c52557
PE
11418 * fileio.c: Integer overflow issues with file modes.
11419 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11420
caeeedc1
PE
11421 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11422 Remove unreachable code.
11423 (read_hex, load_charset_map_from_file): Check for integer overflow.
11424
6df6ae42 11425 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
11426 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11427 (x_send_scroll_bar_event): Likewise. Check that the size does not
11428 exceed limits imposed by XClientMessageEvent, as well as the usual
11429 ptrdiff_t and size_t limits.
11430
b13995db
PE
11431 * keyboard.c: Overflow, signedness and related fixes.
11432 (make_lispy_movement): Use same integer type in forward decl
11433 that is used in the definition.
11434 (read_key_sequence, keyremap_step):
11435 Change bufsize argument back to int, undoing my 2011-03-30 change.
11436 We prefer signed types, and int is wide enough here.
11437 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11438 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11439 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11440 length, not size_t. Use ptrdiff_t for index, not int.
11441 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11442 possibility of integer overflow.
11443
13464394
PE
11444 Overflow, signedness and related fixes for images.
11445
11446 * dispextern.h (struct it.stack[0].u.image.image_id)
11447 (struct_it.image_id, struct image.id, struct image_cache.size)
11448 (struct image_cache.used, struct image_cache.ref_count):
11449 * gtkutil.c (update_frame_tool_bar):
11450 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11451 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11452 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11453 * nsmenu.m (update_frame_tool_bar):
11454 * xdisp.c (calc_pixel_width_or_height):
11455 * xfns.c (image_cache_refcount):
11456 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11457 on typical 64-bit hosts.
11458
11459 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11460 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11461 Omit unnecessary casts to int.
11462 (parse_image_spec): Check that integers fall into 'int' range
11463 when the callers expect that.
11464 (image_ascent): Redo ascent calculation to avoid int overflow.
11465 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11466 (lookup_image): Remove unnecessary tests.
11467 (xbm_image_p): Locals are now of int, not EMACS_INT,
11468 since parse_image_check makes sure they fit into int.
11469 (png_load, gif_load, svg_load_image):
11470 Prefer int to unsigned where either will do.
11471 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
11472 old tiff_error_handler and tiff_warning_handler.
11473 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
11474 stack buffer overflows. It uses only the features of vsnprintf
11475 that are common to both POSIX and native Microsoft.
11476 (tiff_error_handler, tiff_warning_handler): Use it.
11477 (tiff_load, gif_load, imagemagick_load_image):
11478 Don't assume :index value fits in 'int'.
11479 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11480 (imagemagick_load_image): Check that crop parameters fit into
11481 the integer types that MagickCropImage accepts. Don't assume
11482 Vimagemagick_render_type has a nonnegative value. Don't assume
11483 size_t fits in 'long'.
11484 (gs_load): Use printmax_t to print the widest integers possible.
11485 Check for integer overflow when computing image height and width.
11486
c11821d4
EZ
114872011-08-26 Eli Zaretskii <eliz@gnu.org>
11488
11489 * xdisp.c (redisplay_window): Don't force window start if point
11490 will be invisible in the resulting window. (Bug#9324)
11491
0c95fcf7
EZ
114922011-08-25 Eli Zaretskii <eliz@gnu.org>
11493
11494 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11495 the display spec is of the form `(space ...)'.
11496 (handle_display_spec): Return the value returned by
11497 handle_single_display_spec, not just 1 or zero.
11498 (handle_single_display_spec): If the display spec is of the form
11499 `(space ...)', and specifies display in the text area, return 2
11500 rather than 1.
fee65a97 11501 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
11502 accurately, and prefer exact match for point under bidi.
11503 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
11504
11505 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11506 into disp_prop; all users changed.
11507
11508 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11509 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11510 for the text covered by the display property.
11511
e4ed06f1
CY
115122011-08-25 Chong Yidong <cyd@stupidchicken.com>
11513
11514 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11515 Change return value to nil.
11516 (Frecord_buffer): Delete unused function.
11517
f67cdd7f
EZ
115182011-08-24 Eli Zaretskii <eliz@gnu.org>
11519
5980d4c6
EZ
11520 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11521 buffers, return left-to-right.
8610fe8b
EZ
11522 (set_cursor_from_row): Consider candidate row a win if its glyph
11523 represents a newline and point is on that newline. Fixes cursor
11524 positioning on the newline at EOL of R2L text within L2R
11525 paragraph, and vice versa.
11526 (try_cursor_movement): Check continued rows, in addition to
11527 continuation rows. Fixes unwarranted scroll when point enters a
11528 continued line of R2L text within an L2R paragraph, or vice versa.
11529 (cursor_row_p): Consider the case of point being equal to
11530 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11531 from the end of a short line to the beginning of a continued line
11532 of R2L text within L2R paragraph.
11533 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11534 composed characters.
5980d4c6 11535
f67cdd7f
EZ
11536 * bidi.c (bidi_check_type): Use xassert.
11537 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11538 members.
11539
bca633fb
EZ
115402011-08-23 Eli Zaretskii <eliz@gnu.org>
11541
11542 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11543 a character.
11544
4a5885a7
CY
115452011-08-23 Chong Yidong <cyd@stupidchicken.com>
11546
11547 * nsfont.m (ns_otf_to_script): Fix typo.
11548
0902a04e
KH
115492011-08-22 Kenichi Handa <handa@m17n.org>
11550
11551 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11552 extra slot even if the purpose is char-code-property-table.
11553
1a2e6670
EZ
115542011-08-23 Eli Zaretskii <eliz@gnu.org>
11555
8ddde651
EZ
11556 * xdisp.c (redisplay_window): When computing centering_position,
11557 account for the height of the header line. (Bug#8874)
11558
425cc014
EZ
11559 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11560 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11561 candidate is selected by the mouse, and that candidate has a
11562 composed character under the mouse.
11563
1a2e6670
EZ
11564 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11565 coordinates reported by pos-visible-in-window-p for a composed
11566 character in column zero.
11567
8b76d6f8
SM
115682011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11569
11570 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11571
dac347dd
EZ
115722011-08-22 Eli Zaretskii <eliz@gnu.org>
11573
11574 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11575 consider it a hit if to_charpos is anywhere in the range of the
11576 composed buffer positions.
11577
e013fb34
CY
115782011-08-22 Chong Yidong <cyd@stupidchicken.com>
11579
11580 * image.c (gif_load): Don't assume that each subimage has the same
11581 dimensions as the base image. Handle disposal method that is
11582 "undefined" by the gif spec (Bug#9335).
11583
bd1ba3e8
CY
115842011-08-20 Chong Yidong <cyd@stupidchicken.com>
11585
11586 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 11587 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 11588
54a1215b
EZ
115892011-08-19 Eli Zaretskii <eliz@gnu.org>
11590
823564e5
EZ
11591 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11592 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11593 from an Org mode buffer to a Speedbar frame.
11594
54a1215b
EZ
11595 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11596 a composition, take its buffer position from IT->cmp_it.charpos.
11597 Fixes cursor positioning at the beginning of a line that begins
11598 with a composed character.
11599
9778ebcc
EZ
116002011-08-18 Eli Zaretskii <eliz@gnu.org>
11601
0be6ee06
EZ
11602 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11603 character bidirectional type, use STRONG_L instead. Fixes crashes
11604 in a buffer produced by `describe-categories'.
11605
9778ebcc
EZ
11606 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11607 members before the level stack, so they would be saved and
11608 restored when copying iterator state. Fixes incorrect reordering
11609 around TABs covered by display properties.
11610
156bffbe
AS
116112011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11612
6b02f655 11613 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 11614
72ad093b
CY
116152011-08-17 Chong Yidong <cyd@stupidchicken.com>
11616
11617 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
11618 (internal_condition_case_2, internal_condition_case_n):
11619 Remove unnecessary aborts (Bug#9081).
72ad093b 11620
35774242
EZ
116212011-08-17 Eli Zaretskii <eliz@gnu.org>
11622
11623 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11624 has no `load' handler, try opening the file locally. (Bug#9311)
11625
db76dd85
KB
116262011-08-16 Ken Brown <kbrown@cornell.edu>
11627
11628 * gmalloc.c: Expand comment.
11629
b215eee5
EZ
116302011-08-16 Eli Zaretskii <eliz@gnu.org>
11631
11632 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11633 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11634
a4579d33
KB
116352011-08-16 Ken Brown <kbrown@cornell.edu>
11636
11637 Fix memory allocation problems in Cygwin build (Bug#9273).
11638
11639 * unexcw.c ( __malloc_initialized): Declare external variable.
11640 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11641
8b76d6f8
SM
11642 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11643 New variables.
a4579d33
KB
11644 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11645 dumped emacs.
11646 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11647 in the static heap.
11648 [CYGWIN] (special_realloc): New function.
11649 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11650 requests to realloc storage in the static heap.
11651
3ebec551
PE
116522011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11653
11654 * bidi.c (bidi_initialize): Remove unused local.
11655
9fd8be00
EZ
116562011-08-15 Eli Zaretskii <eliz@gnu.org>
11657
6b02f655
SM
11658 * bidimirror.h:
11659 * biditype.h: Remove file.
11660 * makefile.w32-in ($(BLD)/bidi.$(O)):
11661 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
11662
11663 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11664
11665 * chartab.c: Improve commentary for the uniprop_table API.
11666
32413314
EZ
11667 * bidi.c (bidi_paragraph_init): Support zero value of
11668 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
11669 (bidi_initialize): Use uniprop_table instead of including
11670 biditype.h and bidimirror.h.
32413314 11671
9fd8be00
EZ
11672 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11673 coordinates of the iterator when restoring from ppos_it.
11674 (Bug#9296)
11675
5cf2b69b
KH
116762011-08-14 Kenichi Handa <handa@m17n.org>
11677
11678 * process.c (create_process): Call setup_process_coding_systems
72ad093b 11679 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 11680
daf17d00
EZ
116812011-08-14 Eli Zaretskii <eliz@gnu.org>
11682
11683 * xdisp.c (move_it_in_display_line_to): Don't invoke
11684 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11685 ppos_it. Fixes vertical cursor motion when line beginning is
11686 covered by an image. (Bug#9296)
11687
08e3161a
JD
116882011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11689
11690 * nsterm.h (ns_run_ascript): Declare.
11691 (NSAPP_DATA2_RUNASSCRIPT): Define.
11692
11693 * nsfns.m (as_script, as_result, as_status): New static variables.
11694 (ns_run_ascript): New function.
5e617bc2 11695 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
11696 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11697 the event loop. Get status from as_status (Bug#7276).
11698
11699 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11700 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11701 the event loop (Bug#7276).
11702
a3720aa2
AS
117032011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11704
11705 * gnutls.c (QCgnutls_bootprop_priority)
11706 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11707 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11708 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11709 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11710 (QCgnutls_bootprop_verify_hostname_error)
11711 (QCgnutls_bootprop_callbacks_verify): Rename from
11712 Qgnutls_bootprop_..., all uses changed.
11713
11714 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11715 uses changed.
11716
0a0d27fb
PE
117172011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11718
19d5c50c
PE
11719 * xfaces.c (Qframe_set_background_mode): Now static.
11720 * dispextern.h (Qframe_set_background_mode): Remove decl.
11721
0a0d27fb
PE
11722 * process.c (Fnetwork_interface_info): Declare local only if needed.
11723
377538cb
JD
117242011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11725
11726 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11727 (Fnetwork_interface_list): Allocate in increments of bytes instead
11728 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11729 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11730 sockaddr.
11731 (struct ifflag_def): notrailers is smart on OSX.
11732 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11733 Get hardware address with getifaddrs if available.
11734
08fff70c
EZ
117352011-08-12 Eli Zaretskii <eliz@gnu.org>
11736
11737 * xdisp.c (iterate_out_of_display_property): xassert that
11738 IT->position is set to within IT->object's boundaries. Break from
11739 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
11740 when IT->position is set up wrongly due to some bug.
11741 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
11742 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11743 entry. Force push_it to save on the stack the current
11744 buffer/string position, to be restored by pop_it. Fix flags in
11745 the iterator structure wrt the object coming from a display
11746 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11747 properties. (Bug#9284)
11748
7be1c708 117492011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 11750
7be1c708
CY
11751 * fontset.c (fontset_get_font_group): Add proper type checks.
11752 (Bug#9172)
aac0c6e3 11753
7be1c708 117542011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 11755
7be1c708
CY
11756 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11757 and LC_VERSION_MIN_MACOSX.
11758 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11759 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 11760
97bb72a6
EZ
117612011-08-08 Eli Zaretskii <eliz@gnu.org>
11762
11763 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
11764 no-display-properties-and-no-overlays under bidi display.
11765 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 11766 properties and overlays.
97bb72a6 11767
d5617611
CY
117682011-08-08 Chong Yidong <cyd@stupidchicken.com>
11769
37e11a63
CY
11770 * editfns.c (Fset_time_zone_rule): Document relationship with the
11771 setenv function.
11772
d5617611
CY
11773 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11774 the font entity extracted from the cache (Bug#8109).
11775
58872834
CY
117762011-08-07 Chong Yidong <cyd@stupidchicken.com>
11777
11778 * composite.c (autocmp_chars): Don't reset point. That is done by
11779 restore_point_unwind (Bug#5984).
11780
75bfc667
JL
117812011-08-07 Juri Linkov <juri@jurta.org>
11782
11783 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11784 to show the arg `TIME' instead of `TIMEVAL'.
11785
d1410150
EZ
117862011-08-06 Eli Zaretskii <eliz@gnu.org>
11787
11788 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11789 display property strides EOL and includes a newline, as in
11790 longlines-mode. (Bug#9254)
75b771e4
EZ
11791 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11792 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
11793
11794 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11795 is non-zero, even if the data buffer is NULL. Fixes a crash in
11796 vertical-motion with longlines-mode. (Bug#9254)
11797
35928349
EZ
117982011-08-05 Eli Zaretskii <eliz@gnu.org>
11799
ec7cc85b
EZ
11800 * bidi.c <bidi_cache_total_alloc>: Now static.
11801 (bidi_initialize): Initialize bidi_cache_total_alloc.
11802
8b76d6f8 11803 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
11804 cache. (Bug#9221)
11805
11806 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11807 amount allocated this far in `bidi_cache_total_alloc'.
11808 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11809 non-zero, only free the data buffer without restoring the cache
11810 contents. All callers changed.
11811
11812 * dispextern.h (bidi_unshelve_cache): Update prototype.
11813
11814 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11815 (move_it_in_display_line, move_it_to)
11816 (move_it_vertically_backward, move_it_by_lines): Replace the call
11817 to xfree to an equivalent call to bidi_unshelve_cache.
11818 (move_it_in_display_line_to): Fix logic of returning
412b6358 11819 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 11820
e2e2423b
EZ
118212011-08-05 Eli Zaretskii <eliz@gnu.org>
11822
11823 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11824 came from a string character with a `cursor' property. (Bug#9229)
11825
ae9e757a
JD
118262011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11827
11828 * Makefile.in (LIB_PTHREAD): New variable.
11829 (LIBES): Add LIB_PTHREAD (Bug#9216).
11830
11831 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11832 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11833
213bd7f2
AS
118342011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11835
6b02f655 11836 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 11837
99aaf75f
JD
118382011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11839
11840 * xterm.c (x_find_topmost_parent): New function.
11841 (x_set_frame_alpha): Find topmost parent window with
11842 x_find_topmost_parent and set the property there also (bug#9181).
11843 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11844
c74e9d86
PE
118452011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11846
11847 * callproc.c (Fcall_process): Avoid vfork clobbering
11848 the local vars buffer, coding_systems, current_dir.
11849
640c8776
SM
118502011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11851
11852 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11853
f26d0e4c
PE
118542011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11855
8a10d76c
PE
11856 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11857 so that it is not optimized away.
11858
f26d0e4c
PE
11859 * xdisp.c (compute_display_string_pos): Remove unused local.
11860
55439c61
EZ
118612011-08-02 Eli Zaretskii <eliz@gnu.org>
11862
11863 Fix slow cursor motion and scrolling in large buffers with
11864 selective display, like Org Mode buffers. (Bug#9218)
11865
11866 * dispextern.h (struct bidi_it): New member disp_prop_p.
11867
11868 * xdisp.c: Remove one-slot cache of display string positions.
11869 (compute_display_string_pos): Accept an additional argument
5e617bc2 11870 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
11871 for a display string or property. If found, set DISP_PROP_P
11872 non-zero.
11873
11874 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
11875 DISP_PROP_P, and pass it to compute_display_string_pos.
11876 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
11877 non-zero. All callers of bidi_fetch_char changed.
11878
fb33fa43
SM
118792011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11880
11881 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11882
b099e063
DM
118832010-12-03 Don March <don@ohspite.net>
11884
11885 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11886 last character M-[char] is translated to ESC [char] (bug#7541).
11887
5cc7f7af
KH
118882011-08-02 Kenichi Handa <handa@m17n.org>
11889
d0fffa3f 11890 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
11891
11892 * chartab.c (uniprop_table): Make it non-static.
11893
525d5e6e
EZ
118942011-08-01 Eli Zaretskii <eliz@gnu.org>
11895
11896 * xdisp.c (forward_to_next_line_start): Accept additional argument
11897 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11898 on the newline.
11899 (reseat_at_next_visible_line_start): Use the bidi iterator state
11900 returned by forward_to_next_line_start to restore the state of
11901 it->bidi_it after backing up to previous newline. (Bug#9212)
11902
31011111
AS
119032011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11904
11905 * regex.c (re_comp): Protoize.
11906 (re_exec): Fix return type.
11907 (regexec): Fix type of `ret'. (Bug#9203)
11908
476371c4
PE
119092011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11910
e5d76069
PE
11911 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11912 This is needed if max-image-size is a floating-point number.
11913
9a79b20c
AS
119142011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11915
11916 * print.c (print_object): Print empty symbol as ##.
11917
11918 * lread.c (read1): Read ## as empty symbol.
11919
d8c2fa78
AA
119202011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11921
11922 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11923 setting frame foreground color (Bug#9175).
11924 (x_set_background_color): Likewise.
11925
ffe57a7a
AA
11926 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11927 contents (Bug#9176).
11928 (EmacsTooltip -init): Remove bezels and add shadows to
11929 tooltip windows.
11930
bf3492a5
AA
11931 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11932 or scroll bar (Bug#8470).
11933
d55e9c53
AA
11934 * nsfont.m (nsfont_open): Remove assignment to voffset and
11935 unnecessary vars hshink, expand, hd, full_height, min_height.
11936 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11937
11938 * nsterm.h (nsfont_info): Remove voffset field.
11939
d8c2fa78 119402011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
11941
11942 Implement strike-through and overline on NextStep (Bug#8863).
11943
11944 * nsfont.m (nsfont_open): Use underline position provided by font,
11945 instead of hard-coded value of 2.
11946 (nsfont_draw): Call ns_draw_text_decoration instead.
11947
11948 * nsterm.h: Add declaration for ns_draw_text_decoration.
11949
11950 * nsterm.m (ns_draw_text_decoration): New function for drawing
11951 underline, overline, and strike-through.
11952 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11953 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 11954 accommodate underlining, etc.
4843aac3 11955
4cc60b9b
EZ
119562011-07-28 Eli Zaretskii <eliz@gnu.org>
11957
bc7ece87
EZ
11958 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11959 default.
4cc60b9b 11960
476371c4
PE
119612011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11962
66606eea
PE
11963 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11964 Without this fix, if a signal arrives just after memory fills up,
11965 'malloc' might be invoked reentrantly.
11966
476371c4
PE
11967 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11968 In other words, assume that every image size is allowed, on non-X
11969 hosts. This assumption is probably wrong, but it lets Emacs compile.
11970
f3fcc40d
AS
119712011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11972
11973 * regex.c (re_iswctype): Convert return values to boolean.
11974
350c992f
EZ
119752011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11976
11977 * xdisp.c (compute_display_string_pos): Don't use cached display
11978 string position if the buffer had its restriction changed.
11979 (Bug#9184)
11980
5266b4bb
PE
119812011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11982
11983 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11984
2573a837 119852011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 11986
41f55ccd 11987 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 11988
39e378da
PE
11989 * bidi.c: Integer size and overflow fixes.
11990 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11991 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11992 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11993 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11994 (bidi_find_other_level_edge):
11995 Use ptrdiff_t instead of EMACS_INT where either will do.
11996 This works better on 32-bit hosts configured --with-wide-int.
11997 (bidi_cache_ensure_space): Check for size-calculation overflow.
11998 Use % rather than repeated addition, for better worst-case speed.
11999 Don't set bidi_cache_size until after xrealloc returns, because it
12000 might not return.
12001 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
12002 (bidi_cache_ensure_space): Also check that the bidi cache size
12003 does not exceed that of the largest Lisp string or buffer. See Eli
12004 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 12005
5e927815
PE
12006 * alloc.c (__malloc_size_t): Remove.
12007 All uses replaced by size_t. See Andreas Schwab's note
12008 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12009
ca4aa935
PE
12010 * image.c: Improve checking for integer overflow.
12011 (check_image_size): Assume that f is nonnull, since
12012 it is always nonnull in practice. This is one less thing to
12013 worry about when checking for integer overflow later.
12014 (x_check_image_size): New function, which checks for integer
12015 overflow issues inside X.
12016 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12017 This removes the need for a memory_full check.
12018 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12019 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12020 (xbm_read_bitmap_data): Change locals back to 'int', since
12021 their values must fit in 'int'.
12022 (xpm_load_image, png_load, tiff_load):
12023 Invoke x_create_x_image_and_pixmap earlier,
12024 to avoid much needless work if the image is too large.
12025 (tiff_load): Treat overly large images as if
12026 x_create_x_image_and_pixmap failed, not as malloc failures.
12027 (gs_load): Use x_check_image_size.
12028
5f8f9cc2
PE
12029 * gtkutil.c: Omit integer casts.
12030 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12031 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12032
5adf60bc
PE
12033 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12034
c8907a93
PE
12035 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12036 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12037 would wrongly return t on a 64-bit host.
12038
e3c25c68
PE
12039 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12040 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12041 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12042 and therefore cause GCC to emit a bogus diagnostic in some cases.
12043
3f791afe
PE
12044 * image.c: Integer signedness and overflow and related fixes.
12045 This is not an exhaustive set of fixes, but it's time to
12046 record what I've got.
12047 (lookup_pixel_color, check_image_size): Remove redundant decls.
12048 (check_image_size): Don't assume that arbitrary EMACS_INT values
12049 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12050 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12051 (tiff_load, imagemagick_load_image):
12052 Check for overflow in size calculations.
12053 (x_create_x_image_and_pixmap): Remove unnecessary test for
12054 xmalloc returning NULL; that can't happen.
12055 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12056 (xpm_color_bucket): Use better integer hashing function.
12057 (xpm_cache_color): Don't possibly over-allocate memory.
12058 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12059 (gif_memory_source):
12060 Use ptrdiff_t, not int or size_t, to record sizes.
12061 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12062 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12063 either works, as we prefer signed integers.
12064 (tiff_read_from_memory, tiff_write_from_memory):
12065 Return tsize_t, not size_t, since that's what the TIFF API wants.
12066 (tiff_read_from_memory): Don't fail simply because the read would
12067 go past EOF; instead, return a short read.
12068 (tiff_load): Omit no-longer-needed casts.
12069 (Fimagemagick_types): Don't assume size fits into 'int'.
12070
3cc5a532
PE
12071 Improve hashing quality when configured --with-wide-int.
12072 * fns.c (hash_string): New function, taken from sxhash_string.
12073 Do not discard information about ASCII character case; this
12074 discarding is no longer needed.
12075 (sxhash-string): Use it. Change sig to match it. Caller changed.
12076 * lisp.h: Declare it.
12077 * lread.c (hash_string): Remove, since we now use fns.c's version.
12078 The fns.c version returns a wider integer if --with-wide-int is
12079 specified, so this should help the quality of the hashing a bit.
12080
b312a492
PE
12081 * emacs.c: Integer overflow minor fix.
12082 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12083 Define only if GNU_LINUX.
12084 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12085
dfd153ae
PE
12086 * dispnew.c: Integer signedness and overflow fixes.
12087 Remove unnecessary forward decls, that were a maintenance hassle.
12088 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12089 All uses changed.
12090 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12091 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12092 (prepare_desired_row, line_draw_cost):
12093 Use int, not unsigned, where either works.
12094 (save_current_matrix, restore_current_matrix):
12095 Use ptrdiff_t, not size_t, where either works.
12096 (init_display): Check for overflow more accurately, and without
12097 relying on undefined behavior.
12098
a81d11a3
PE
12099 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12100 Remove, replacing with the new symbols in lisp.h. All uses changed.
12101 * fileio.c (make_temp_name):
12102 * filelock.c (lock_file_1, lock_file):
12103 * xdisp.c (message_dolog):
12104 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12105 Use pMd etc. instead.
12106 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12107 replacing the pWIDE etc. symbols removed from editfns.c.
12108
3300e6fd
PE
12109 * keyboard.h (num_input_events): Now uintmax_t.
12110 This is (very slightly) less likely to mess up due to wraparound.
12111 All uses changed.
12112
fd05c7e9
PE
12113 * buffer.c: Integer signedness fixes.
12114 (alloc_buffer_text, enlarge_buffer_text):
12115 Use ptrdiff_t rather than size_t when either will do, as we prefer
12116 signed integers.
12117
903fe15d
PE
12118 * alloc.c: Integer signedness and overflow fixes.
12119 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12120 (__malloc_size_t): Default to size_t, not to int.
12121 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12122 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12123 Prefer ptrdiff_t to size_t when either would do, as we prefer
12124 signed integers.
12125 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12126 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12127 Now const. Initialize with values that are in range even if char
12128 is signed.
12129 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12130 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12131 These functions do the right thing with sizes > 2**32.
12132 (check_depth): Now ptrdiff_t, not int.
12133 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12134 Adjust to new way of storing sizes. Check for size overflow bugs
12135 in rest of code.
12136 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12137 slightly wrong anyway, as it missed one instance of
12138 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12139 (refill_memory_reserve): Omit needless cast to size_t.
12140 (mark_object_loop_halt): Mark as externally visible.
12141
ac82cc6a
PE
12142 * xselect.c: Integer signedness and overflow fixes.
12143 (Fx_register_dnd_atom, x_handle_dnd_message):
12144 Use ptrdiff_t, not size_t, since we prefer signed.
12145 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12146 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12147 x_dnd_atoms_size and x_dnd_atoms_length.
12148
c2d1e36d
PE
12149 * doprnt.c: Prefer signed to unsigned when either works.
12150 * eval.c (verror):
12151 * doprnt.c (doprnt):
12152 * lisp.h (doprnt):
12153 * xdisp.c (vmessage):
12154 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12155 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12156 prefer signed arithmetic to avoid comparison confusion.
12157 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12158 but is a bit tricky.
12159
0e926e56
PE
12160 Assume freestanding C89 headers, string.h, stdlib.h.
12161 * data.c, doprnt.c, floatfns.c, print.c:
12162 Include float.h unconditionally.
12163 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12164 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12165 * regex.c: Likewise for stddef.h, string.h.
12166 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12167 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12168 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12169 (STDC_HEADERS): Remove obsolete defines.
12170 * sysdep.c: Include limits.h unconditionally.
12171
9cfdb3ec
PE
12172 Assume support for memcmp, memcpy, memmove, memset.
12173 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12174 * regex.c (memcmp, memcpy):
12175 Remove; we assume C89 now.
12176
12177 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12178 (__malloc_safe_bcopy): Remove; no longer needed.
12179
cf950e6b 12180 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
12181 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12182 well either way, and we prefer signed to unsigned.
12183
dbf38e02
LMI
121842011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12185
12186 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12187 closes the connection while we're reading (bug#9182).
12188
d6f0886c 121892011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 12190
d6f0886c
JD
12191 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12192 are specified (Bug#9168).
24e0f6b1 12193
2eb1f9e6
PE
121942011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12195
12196 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12197 Found by GCC static checking and --with-wide-int on a 32-bit host.
12198
22381272 121992011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
12200
12201 * xdisp.c (compute_display_string_pos): Fix logic of caching
12202 previous display string position. Initialize cached_prev_pos to
12203 -1. Fixes slow-down at the beginning of a buffer.
12204
f25e39b4
EZ
122052011-07-24 Eli Zaretskii <eliz@gnu.org>
12206
12207 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12208 for attrs[LFACE_FONTSET_INDEX].
12209
04c4b52e
PE
122102011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12211
12212 * xml.c (parse_region): Remove unused local
12213 that was recently introduced.
12214
c1734fbd
EZ
122152011-07-23 Eli Zaretskii <eliz@gnu.org>
12216
be18c5a5
EZ
12217 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12218 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12219
c1734fbd
EZ
12220 * xdisp.c (move_it_in_display_line_to): Record the best matching
12221 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
12222 exit if none of the characters scanned was an exact match.
12223 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
12224 when exact match is impossible due to invisible text, and the
12225 lines are truncated.
12226
a258d627
JD
122272011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12228
12229 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12230 for OSX >= 10.7.
12231
b6d5a689
EZ
122322011-07-22 Eli Zaretskii <eliz@gnu.org>
12233
0f74f785
EZ
12234 Fix a significant slow-down of cursor motion with C-n, C-p,
12235 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12236 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 12237 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
12238 (next_element_from_buffer): Call compute_stop_pos_backwards to
12239 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
12240 base_level_stop.
12241 (reseat): Don't look for prev_stop, as that could mean a very long
12242 run.
12243 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12244 <cached_disp_overlay_modiff>: Cache for last found display string
12245 position.
551918c1 12246 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
12247 about the same buffer in the same area of character positions, and
12248 the buffer wasn't changed since the time the display string
12249 position was cached.
551918c1 12250
b2d0c91a
EZ
122512011-07-22 Eli Zaretskii <eliz@gnu.org>
12252
12253 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12254 is an integer, which is important for empty lines. (Bug#9149)
12255
043604ee
CY
122562011-07-22 Chong Yidong <cyd@stupidchicken.com>
12257
12258 * frame.c (Fmodify_frame_parameters): In tty case, update the
12259 default face if necessary (Bug#4238).
12260
da4adb04
CY
122612011-07-21 Chong Yidong <cyd@stupidchicken.com>
12262
12263 * editfns.c (Fstring_to_char): No need to explain what a character
12264 is in the docstring (Bug#6576).
12265
9abd0532
LMI
122662011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12267
12268 * xml.c (parse_region): Make sure we always return a tree.
12269
36881d16
HK
122702011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12271
12272 * xml.c (parse_region): If a document contains only comments,
12273 return that, too.
12274
1e98674d
LMI
122752011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12276
12277 * xml.c (make_dom): Return comments, too.
12278
590bd467
PE
122792011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12280
12281 Port to OpenBSD.
12282 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12283 and the surrounding thread.
12284 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12285 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12286 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12287 timer goes off.
12288 * s/openbsd.h (BROKEN_SIGIO): Define.
12289 * unexelf.c (unexec) [__OpenBSD__]:
12290 Don't update the .mdebug section of the Alpha COFF symbol table.
12291
f41628b2
LMI
122922011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12293
12294 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12295 (bug#8460).
12296
b59b67c5
PE
122972011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12298
15e3a074
PE
12299 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12300 This fixes some race conditions on the permissions of any newly
12301 created file.
12302
41bed37d
PE
12303 * alloc.c (valid_pointer_p): Use pipe, not open.
12304 This fixes some permissions issues when debugging.
12305
b59b67c5
PE
12306 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12307 If fchown fails to set both uid and gid, try to set just gid,
12308 as that is sometimes allowed. Adjust the file's mode to eliminate
12309 setuid or setgid bits that are inappropriate if fchown fails.
12310
925a6be7
SM
123112011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12312
12313 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12314 to compare Lisp_Objects.
12315 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12316 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12317 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12318
52968808
AS
123192011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12320
0a6a104b
AS
12321 * lread.c (read_integer): Unread even EOF character.
12322 (read1): Likewise. Properly record start position of symbol.
12323
52968808
AS
12324 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12325 symbol character follows.
12326
9e381cdd
PE
123272011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12328
12329 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12330 This works around a problem with the previous change to Fcopy_file.
12331 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12332 and without this change, GCC might complain about discarding
12333 fchown's return value.
12334
b5641435
JB
123352011-07-16 Juanma Barranquero <lekktu@gmail.com>
12336
12337 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12338
a8031457
PE
123392011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12340
12341 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12342
dd889327
LMI
123432011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12344
750c33f7
LMI
12345 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12346 it's used from the C level.
12347
dd889327
LMI
12348 * process.c: Use the same condition for POLL_FOR_INPUT in both
12349 keyboard.c and process.c (bug#1858).
12350
87e86684
LM
123512011-07-09 Lawrence Mitchell <wence@gmx.li>
12352
12353 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12354 (Fgnutls_boot): Use it.
12355
64348f40
AS
123562011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12357
12358 * doc.c (Fsubstitute_command_keys): Revert last change.
12359
1d698799
LMI
123602011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12361
f863868c
LMI
12362 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12363 quotes the next character, and doesn't affect other longer
12364 sequences (bug#8935).
12365
1d698799
LMI
12366 * lread.c (syms_of_lread): Clarify that is isn't only
12367 `eval-buffer' and `eval-defun' that's affected by
12368 `lexical-binding' (bug#8460).
12369
aa4b6df6
EZ
123702011-07-15 Eli Zaretskii <eliz@gnu.org>
12371
12372 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 12373 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 12374
5d856da6
PE
123752011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12376
ad6042bb
PE
12377 Fix minor problems found by static checking.
12378 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12379 (elsz): Now a signed constant, not a size_t var. We prefer signed
12380 types to unsigned, to avoid integer comparison confusion. Without
12381 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12382 "cannot optimize loop, the loop counter may overflow", a symptom
12383 of the confusion.
f00bbb22 12384 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
12385 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12386
6468f31c
LMI
123872011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12388
49080b10
LMI
12389 * search.c (Fre_search_backward): Mention `case-fold-search' in
12390 all the re_search_* functions (bug#8138).
12391
6468f31c
LMI
12392 * keyboard.c (Fopen_dribble_file): Document when the file is
12393 closed (bug#8056).
12394
c965adc5
EZ
123952011-07-14 Eli Zaretskii <eliz@gnu.org>
12396
df9733bf
EZ
12397 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12398 bidi_cache_idx.
12399
0bb23927
EZ
12400 Support bidi reordering of display and overlay strings.
12401 * xdisp.c (compute_display_string_pos)
12402 (compute_display_string_end): Accept additional argument STRING.
12403 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12404 (reseat_to_string): Initialize bidi_it->string.s and
12405 bidi_it->string.schars.
12406 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
12407 NULL (avoids a crash in bidi_paragraph_init).
12408 Initialize itb.string.lstring.
0bb23927
EZ
12409 (init_iterator): Call bidi_init_it only of a valid
12410 buffer position was specified. Initialize paragraph_embedding to
12411 L2R.
12412 (reseat_to_string): Initialize the bidi iterator.
12413 (display_string): If we need to ignore text properties of
12414 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12415 original value of -1 will not work with bidi.)
12416 (compute_display_string_pos): First arg is now struct
12417 `text_pos *'; all callers changed. Support display properties on
12418 Lisp strings.
12419 (compute_display_string_end): Support display properties on Lisp
12420 strings.
12421 (init_iterator, reseat_1, reseat_to_string): Initialize the
12422 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12423 when iterating on a string not from display properties).
640c8776
SM
12424 (compute_display_string_pos, compute_display_string_end):
12425 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
12426 arrow keys.
12427 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
12428 base_level_stop; instead, set base_level_stop to BEGV.
12429 Fixes crashes in vertical-motion.
0bb23927
EZ
12430 (next_element_from_buffer): Improve commentary for when
12431 the iterator is before prev_stop.
12432 (init_iterator): Initialize bidi_p from the default value of
12433 bidi-display-reordering, not from buffer-local value. Use the
12434 buffer-local value only if initializing for buffer iteration.
12435 (handle_invisible_prop): Support invisible properties on strings
12436 that are being bidi-reordered.
12437 (set_iterator_to_next): Support bidi reordering of C strings and
12438 Lisp strings.
12439 (next_element_from_string): Support bidi reordering of Lisp
12440 strings.
12441 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
12442 (display_string): Support display of R2L glyph rows.
12443 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
12444 (init_iterator): Don't initialize it->bidi_p for strings
12445 here.
12446 (reseat_to_string): Initialize it->bidi_p for strings here.
12447 (next_element_from_string, next_element_from_c_string)
12448 (next_element_from_buffer): Add xassert's for correspondence
12449 between IT's object being iterated and it->bidi_it.string
12450 structure.
12451 (face_before_or_after_it_pos): Support bidi iteration.
12452 (next_element_from_c_string): Handle the case of the first string
12453 character that is not the first one in the visual order.
12454 (get_visually_first_element): New function, refactored from common
12455 parts of next_element_from_buffer, next_element_from_string, and
12456 next_element_from_c_string.
12457 (tool_bar_lines_needed, redisplay_tool_bar)
12458 (display_menu_bar): Force left-to-right direction. Add a FIXME
12459 comment for making that be controlled by a user option.
12460 (push_it, pop_it): Save and restore the state of the
12461 bidi iterator. Save and restore the bidi_p flag.
12462 (pop_it): Iterate out of display property for string iteration as
12463 well.
12464 (iterate_out_of_display_property): Support iteration over strings.
12465 (handle_single_display_spec): Set up it->bidi_it for iteration
12466 over a display string, and call bidi_init_it.
12467 (handle_single_display_spec, next_overlay_string)
12468 (get_overlay_strings_1, push_display_prop): Set up the bidi
12469 iterator for displaying display or overlay strings.
12470 (forward_to_next_line_start): Don't use the shortcut if
12471 bidi-iterating.
12472 (back_to_previous_visible_line_start): If handle_display_prop
12473 pushed the iterator stack, restore the internal state of the bidi
12474 iterator by calling bidi_pop_it same number of times.
12475 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12476 and we are bidi-iterating, don't decrement the iterator position;
12477 instead, set the first_elt flag in the bidi iterator, to produce
12478 the same effect.
12479 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12480 (push_display_prop): xassert that we are iterating a buffer.
12481 (push_it, pop_it): Save and restore paragraph_embedding member.
12482 (handle_single_display_spec, next_overlay_string)
12483 (get_overlay_strings_1, reseat_1, reseat_to_string)
12484 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12485 correctly. Don't assume unibyte strings are not bidi-reordered.
12486 (compute_display_string_pos)
12487 (compute_display_string_end): Fix handling the case of C string.
12488 (push_it, pop_it): Save and restore from_disp_prop_p.
12489 (handle_single_display_spec, push_display_prop): Set the
12490 from_disp_prop_p flag.
12491 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12492 (pop_it): Call iterate_out_of_display_property only if we are
12493 popping after iteration over a string that came from a display
12494 property. Fix a typo in popping stretch info. Add an assertion
12495 for verifying that the iterator position is in sync with the bidi
12496 iterator.
12497 (handle_single_display_spec, get_overlay_strings_1)
12498 (push_display_prop): Fix initialization of paragraph direction for
12499 string when that of the parent object is not yet determined.
12500 (reseat_1): Call bidi_init_it to resync the bidi
12501 iterator with IT's position. (Bug#7616)
12502 (find_row_edges): If ROW->start.pos gives position
12503 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12504 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12505 Reset the from_disp_prop_p flag.
12506 (SAVE_IT, RESTORE_IT): New macros.
12507 (pos_visible_p, face_before_or_after_it_pos)
12508 (back_to_previous_visible_line_start)
12509 (move_it_in_display_line_to, move_it_in_display_line)
12510 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12511 (try_scrolling, redisplay_window, display_line): Use them when
12512 saving a temporary copy of the iterator and restoring it back.
12513 (back_to_previous_visible_line_start, reseat_1)
12514 (init_iterator): Empty the bidi cache "stack".
12515 (move_it_in_display_line_to): If iterator ended up at
12516 EOL, but we never saw any buffer positions smaller than
12517 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12518 motion in bidi-reordered lines.
12519 (move_it_in_display_line_to): Record prev_method and prev_pos
12520 immediately before the call to set_iterator_to_next. Fixes cursor
12521 motion in bidi-reordered lines with stretch glyphs and strings
12522 displayed in margins. (Bug#8133) (Bug#8867)
12523 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12524 TO_CHARPOS.
640c8776
SM
12525 (pos_visible_p): Support positions in bidi-reordered lines.
12526 Save and restore bidi cache.
0bb23927
EZ
12527
12528 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12529 (bidi_paragraph_info): Delete unused struct.
12530 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12531 (bidi_cache_start): New variable.
12532 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12533 to zero.
12534 (bidi_cache_fetch_state, bidi_cache_search)
12535 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12536 (bidi_cache_find, bidi_peek_at_next_level)
12537 (bidi_level_of_next_char, bidi_find_other_level_edge)
12538 (bidi_move_to_visually_next): Compare cache index with
12539 bidi_cache_start rather than with zero.
12540 (bidi_fetch_char): Accept new argument STRING; all callers
12541 changed. Support iteration over a string. Support strings with
12542 display properties. Support unibyte strings. Fix the type of
12543 `len' according to what STRING_CHAR_AND_LENGTH expects.
12544 (bidi_paragraph_init, bidi_resolve_explicit_1)
12545 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
12546 (bidi_level_of_next_char, bidi_move_to_visually_next):
12547 Support iteration over a string.
0bb23927
EZ
12548 (bidi_set_sor_type, bidi_resolve_explicit_1)
12549 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12550 can now be zero (for strings); special values 0 and -1 were
12551 changed to -1 and -2, respectively.
12552 (bidi_char_at_pos): New function.
12553 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12554 Call it instead of FETCH_MULTIBYTE_CHAR.
12555 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12556 initialized to valid values.
12557 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12558 values.
12559 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12560 the test for valid cached positions. Fix the logic for looking up
12561 the sentinel state in the cache. GCPRO the Lisp string we are
12562 iterating.
12563 (bidi_push_it, bidi_pop_it): New functions.
12564 (bidi_initialize): Initialize the bidi cache start stack pointer.
12565 (bidi_cache_ensure_space): New function, refactored from part of
12566 bidi_cache_iterator_state. Don't assume the required size is just
12567 one BIDI_CACHE_CHUNK away.
12568 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12569 (bidi_count_bytes, bidi_char_at_pos): New functions.
12570 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12571 always valid if bidi_cache_idx is valid.
12572 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12573 is valid if it's going to be used.
12574 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12575 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
12576 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12577 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
12578 (bidi_find_other_level_edge, bidi_cache_start_stack):
12579 All variables related to cache indices are now EMACS_INT.
c965adc5 12580
0bb23927
EZ
12581 * dispextern.h (struct bidi_string_data): New structure.
12582 (struct bidi_it): New member `string'. Make flag members be 1-bit
12583 fields, and put them last in the struct.
640c8776
SM
12584 (compute_display_string_pos, compute_display_string_end):
12585 Update prototypes.
0bb23927
EZ
12586 (bidi_push_it, bidi_pop_it): Add prototypes.
12587 (struct iterator_stack_entry): New members bidi_p,
12588 paragraph_embedding, and from_disp_prop_p.
12589 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
12590 (bidi_shelve_cache, bidi_unshelve_cache):
12591 Declare prototypes.
0bb23927
EZ
12592
12593 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12594 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12595 and vector-like objects.
12596
12597 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12598 cache around display iteration.
12599
12600 * window.c (Fwindow_end, window_scroll_pixel_based)
12601 (displayed_window_lines, Frecenter): Save and restore the bidi
12602 cache around display iteration.
12603
3bbd2265
LMI
126042011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12605
12606 * editfns.c (Fdelete_region): Clarify the use of the named
12607 parameters (bug#6788).
12608
adc47434
MR
126092011-07-14 Martin Rudalics <rudalics@gmx.at>
12610
12611 * indent.c (Fvertical_motion): Set and restore w->pointm when
12612 saving and restoring the window's buffer (Bug#9006).
12613
837c31f8
LMI
126142011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12615
12616 * editfns.c (Fstring_to_char): Clarify just what is returned
12617 (bug#6576). Text by Eli Zaretskii.
12618
ac389d0c
JB
126192011-07-13 Juanma Barranquero <lekktu@gmail.com>
12620
12621 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12622
0be0ce47
EZ
126232011-07-13 Eli Zaretskii <eliz@gnu.org>
12624
12625 * buffer.c (mmap_find): Fix a typo.
12626
cd18e7e3
JB
126272011-07-13 Johan Bockgård <bojohan@gnu.org>
12628
12629 Fix execution of x selection hooks.
12630 * xselect.c (Qx_lost_selection_functions)
12631 (Qx_sent_selection_functions): New vars.
12632 (syms_of_xselect): DEFSYM them.
12633 (x_handle_selection_request): Pass Qx_sent_selection_functions
12634 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12635 (x_handle_selection_clear,x_clear_frame_selections):
12636 Pass Qx_lost_selection_functions rather than
12637 Vx_lost_selection_functions to Frun_hook_with_args.
12638
47ea7f44
PE
126392011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12640
ac389d0c 12641 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
12642 The old code sometimes used this field without initializing it.
12643
47ea7f44
PE
12644 * alloc.c (gc_sweep): Don't read past end of array.
12645 In theory, the old code could also have corrupted Emacs internals,
12646 though it'd be very unlikely.
12647
bc985c87
AS
126482011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12649
12650 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 12651 argument. (Bug#4026)
bc985c87 12652
0cf34688
LMI
126532011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12654
b3dadd76
LMI
12655 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12656 key" (bug#4257).
12657
0cf34688
LMI
12658 * window.c (Fset_window_start): Doc fix (bug#4199).
12659 (Fset_window_hscroll): Ditto.
12660
270768cd
PE
126612011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12662
077e3dda 12663 Fix minor new problems caught by GCC 4.6.1.
270768cd 12664 * term.c (init_tty): Remove unused local.
490011a6 12665 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 12666 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 12667 not used otherwise.
270768cd 12668
b1f58454
CY
126692011-07-12 Chong Yidong <cyd@stupidchicken.com>
12670
12671 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12672
22b9578d
LMI
126732011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12674
6e70ab07
LMI
12675 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12676 are the mini-buffer and the echo area (bug#3320).
12677
22b9578d
LMI
12678 * term.c (init_tty): Remove support for supdup, c10 and perq
12679 terminals, which are no longer supported (bug#1482).
12680
8974cc9f
JB
126812011-07-10 Johan Bockgård <bojohan@gnu.org>
12682
12683 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12684
a560d974
JD
126852011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12686
12687 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12688 for non-popups (Bug#3642).
12689
1dae0f0a
AS
126902011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12691
268c2c36 12692 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 12693 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
12694 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12695 * cm.c (losecursor): Likewise.
1dae0f0a
AS
12696 * data.c (fmod): Likewise.
12697 * dispnew.c (swap_glyphs_in_rows): Likewise.
12698 * emacs.c (memory_warning_signal): Likewise.
12699 * floatfns.c (float_error): Likewise.
12700 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12701 (otf_open, font_otf_capability, generate_otf_features)
12702 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12703 Likewise.
12704 * image.c (pbm_read_file): Likewise.
12705 * indent.c (string_display_width): Likewise.
12706 * intervals.c (check_for_interval, search_for_interval)
12707 (inc_interval_count, count_intervals, root_interval)
12708 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12709 * lread.c (defalias): Likewise.
268c2c36 12710 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
12711 * regex.c (set_image_of_range_1, set_image_of_range)
12712 (regex_grow_registers): Likewise.
12713 * sysdep.c (strerror): Likewise.
12714 * termcap.c (valid_filename_p, tprint, main): Likewise.
12715 * tparam.c (main): Likewise.
12716 * unexhp9k800.c (run_time_remap, save_data_space)
12717 (update_file_ptrs, read_header, write_header, calculate_checksum)
12718 (copy_file, copy_rest, display_header): Likewise.
12719 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12720 Likewise.
12721 * xdisp.c (check_it): Likewise.
12722 * xfaces.c (register_color, unregister_color, unregister_colors):
12723 Likewise.
12724 * xfns.c (print_fontset_result): Likewise.
12725 * xrdb.c (member, fatal, main): Likewise.
12726
99033785
PE
127272011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12728
12729 Fix minor problems found by static checking (Bug#9031).
12730 * chartab.c (char_table_set_range, map_sub_char_table):
12731 Remove unused locals.
12732 (uniprop_table): Now static.
12733 * composite.c (_work_char): Remove unused static var.
12734
9cb2ac56
JB
127352011-07-09 Juanma Barranquero <lekktu@gmail.com>
12736
12737 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12738
f25661f0
JD
127392011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12740
12741 * gtkutil.c (qttip_cb): Remove code without function.
12742
8278c4fe
EZ
127432011-07-09 Eli Zaretskii <eliz@gnu.org>
12744
12745 * w32.c (pthread_sigmask): New stub.
12746
1692ae2d 127472011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 12748
8a6ebd58 12749 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
12750 sigprocmask is portable only for single-threaded applications, and
12751 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
12752 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12753 (LIBES): Use it.
12754 * callproc.c (Fcall_process):
12755 * process.c (create_process):
12756 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12757 Use pthread_sigmask, not sigprocmask.
123403e4 12758
1b854618
JD
127592011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12760
12761 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12762 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12763 wrong (Bug#8591).
12764
3fe4b549
JD
127652011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12766
0ce7e563
JD
12767 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12768 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12769 (xg_hide_tooltip): Fix comment.
12770
3fe4b549
JD
12771 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12772 in registerServicesMenuSendTypes.
12773 (validRequestorForSendType): Don't check ns_return_types.
12774
12775 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12776 ns_return_type.
12777
5df75e47
JR
127782011-07-08 Jason Rumney <jasonr@gnu.org>
12779
22610910
JR
12780 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12781 SH_SHOW for hidden windows (Bug#5482).
12782
5df75e47
JR
12783 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12784 frame struct members of non-existent frames (Bug#6284).
12785
699c10bd
JD
127862011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12787
4393663b
JD
12788 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12789 variable firstTime not needed on OSX >= 10.6.
12790 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12791 >= 10.5. Use setKnobProportion, setDoubleValue.
12792
12793 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12794 (MAC_OS_X_VERSION_10_5): Define if not defined.
12795 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12796 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12797 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12798
12799 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 12800 cString and lossyCString on OSX >= 10.4.
4393663b 12801
58179cce 12802 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
12803 sizeToFit on OSX >= 10.2.
12804
12805 * nsimage.m (allocInitFromFile): Don't use deprecated method
12806 bestRepresentationForDevice on OSX >= 10.6.
12807
12808 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12809 to avoid warning.
12810
12811 * emacs.c: Declare unexec_init_emacs_zone.
12812
a63e0781
JD
12813 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12814
699c10bd
JD
12815 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12816
12817 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12818 on svcsMenu (Bug#8842).
12819
12820 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12821 ns_return_types.
12822 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12823
12824 * nsterm.m (QUTF8_STRING): Declare.
12825 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12826 (validRequestorForSendType): Return type is (id).
12827 Change indexOfObjectIdenticalTo to indexOfObject.
12828 Check if we have local selection before returning self (Bug#8842).
12829 (writeSelectionToPasteboard): Put local selection into paste board
12830 if we have a local selection (Bug#8842).
12831 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12832
12833 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12834 (ns_get_local_selection): Declare.
12835
54e10184
LMI
128362011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12837
9888ff71
LMI
12838 * keymap.c (describe_map_tree): Don't insert a double newline at
12839 the end of the buffer (bug#1169) and return whether we inserted
12840 something.
12841
54e10184
LMI
12842 * callint.c (Fcall_interactively): Change "reading args" to
12843 "providing args" to try to clarify what it does (bug#1010).
12844
15fa4783
KH
128452011-07-07 Kenichi Handa <handa@m17n.org>
12846
12847 * composite.c (composition_compute_stop_pos): Ignore a static
12848 composition starting before CHARPOS (Bug#8915).
12849
12850 * xdisp.c (handle_composition_prop): Likewise.
12851
a8815b00
EZ
128522011-07-07 Eli Zaretskii <eliz@gnu.org>
12853
12854 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12855 (Bug#9015)
12856
ef7b981d 128572011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
12858
12859 * character.h (unicode_category_t): New enum type.
12860
12861 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12862 (Qchar_code_property_table): New variable.
12863 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12864 (UNIPROP_COMPRESSED_FORM_P): New macros.
12865 (char_table_ascii): Uncompress the compressed values.
12866 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12867 Uncompress the compressed values.
ac389d0c 12868 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
12869 (char_table_ref_and_range): Uncompress the compressed values.
12870 (sub_char_table_set): New arg is_uniprop. Callers changed.
12871 Uncompress the compressed values.
12872 (sub_char_table_set_range): Args changed. Callers changed.
12873 (char_table_set_range): Adjuted for the above change.
12874 (map_sub_char_table): Delete args default_val and parent. Add arg
12875 top. Give decoded values to a Lisp function.
640c8776 12876 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
12877 values to a Lisp function. Gcpro more variables.
12878 (uniprop_table_uncompress)
12879 (uniprop_decode_value_run_length): New functions.
12880 (uniprop_decoder, uniprop_decoder_count): New variables.
12881 (uniprop_get_decoder, uniprop_encode_value_character)
12882 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12883 New functions.
12884 (uniprop_encoder, uniprop_encoder_count): New variables.
12885 (uniprop_get_encoder, uniprop_table)
12886 (Funicode_property_table_internal, Fget_unicode_property_internal)
12887 (Fput_unicode_property_internal): New functions.
12888 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12889 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 12890 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
12891 char-code-property-alist.
12892
640c8776 12893 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
12894 Vunicode_category_table.
12895
640c8776 12896 * font.c (font_range): Adjust for the change of
c805dec0
KH
12897 Vunicode_category_table.
12898
76b397fb
DN
128992011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12900
12901 * m/iris4d.h: Remove file, move contents ...
12902 * s/irix6-5.h: ... here.
12903
22b4128e
PE
129042011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12905
12906 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
12907 * alloc.c (mark_buffer):
12908 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12909 (clone_per_buffer_values): Don't assume that
22b4128e
PE
12910 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12911 This isn't true in general, and it's particularly not true
12912 if Emacs is configured with --with-wide-int.
12913 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12914 New macros, used in the buffer.c change.
12915
869795d6
JD
129162011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12917
12918 * xsettings.c: Use both GConf and GSettings if both are available.
12919 (store_config_changed_event): Add comment.
12920 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12921 (store_tool_bar_style_changed): New functions.
5e617bc2 12922 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
12923 (struct xsettings): Move font inside HAVE_XFT.
12924 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 12925 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 12926 Move inside HAVE_XFT.
640c8776 12927 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
12928 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12929 also.
12930 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 12931 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 12932 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
12933 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12934 (parse_settings): Move check for font inside HAVE_XFT.
12935 (read_settings, apply_xft_settings): Add comment.
12936 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12937 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12938 call store_font_name_changed.
12939 (xft_settings_event): Add comment.
12940 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12941 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12942 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12943 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12944 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
12945 (xsettings_get_system_font, xsettings_get_system_normal_font):
12946 Add comment.
869795d6 12947
d8ed26bd
PE
129482011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12949
12950 Random fixes. E.g., (random) never returned negative values.
12951 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12952 subseconds part to the entropy, as that's a bit more random.
12953 Prefer signed to unsigned, since the signedness doesn't matter and
12954 in general we prefer signed. When given a limit, use a
12955 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12956 latter isn't right if USE_2_TAGS_FOR_INTS.
12957 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12958 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12959
cabf1cac
SM
129602011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12961
12962 * textprop.c (text_property_stickiness):
12963 Obey Vtext_property_default_nonsticky.
12964 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12965 * w32fns.c (syms_of_w32fns):
12966 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12967
6e9b2be9
PE
129682011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12969
12970 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12971 This is more efficient than Ffile_directory_p and avoids a minor race.
12972
90186c68
LMI
129732011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12974
7c301272
LMI
12975 * buffer.c (Foverlay_put): Say what the return value is
12976 (bug#7835).
12977
c4f2d8d4
LMI
12978 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12979 is a directory before asking whether to use the file name
12980 (bug#7564).
ad637907
LMI
12981 (barf_or_query_if_file_exists): Make the "File is a directory"
12982 error be more correct.
c4f2d8d4 12983
90186c68
LMI
12984 * fns.c (Frequire): Remove the mention of the .gz files, since
12985 that's installation-specific, but keep the mention of
12986 `get-load-suffixes'.
12987
da64016e
PE
129882011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12989
12990 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12991 Report string overflow if the output is too long.
12992
7d47b580
JB
129932011-07-04 Juanma Barranquero <lekktu@gmail.com>
12994
a555cb87
JB
12995 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12996 (syms_of_gnutls): Remove duplicate DEFSYM for
12997 Qgnutls_bootprop_verify_hostname_error, an error for
12998 Qgnutls_bootprop_verify_error (which is no longer used).
12999
7d47b580
JB
13000 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13001 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13002 Also (re)move comments that are misplaced or no longer relevant.
13003
1e49bfab
LMI
130042011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13005
13006 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13007
1485f4c0
CY
130082011-07-03 Chong Yidong <cyd@stupidchicken.com>
13009
13010 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13011 and background color parameters if they have been changed.
13012
a9ab721e
LMI
130132011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13014
13015 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13016
cf7cff57
PE
130172011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13018
2e13213d
PE
13019 * xsettings.c (SYSTEM_FONT): Define only when used.
13020 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13021
cf7cff57
PE
13022 * keymap.c (access_keymap_1): Now static.
13023
7a8e04f7
CY
130242011-07-02 Chong Yidong <cyd@stupidchicken.com>
13025
13026 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13027 leave any prefix arg for the up event (Bug#1586).
13028
61352f62
LMI
130292011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13030
69bb1ef7
LMI
13031 * lread.c (syms_of_lread): Mention single symbols defined by
13032 `defvar' or `defconst' (bug#7154).
13033
61352f62 13034 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 13035 (Frequire): Mention get-load-suffixes.
61352f62 13036
28545e04
MR
130372011-07-02 Martin Rudalics <rudalics@gmx.at>
13038
13039 * window.h (window): Remove clone_number slot.
13040 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13041 Remove.
13042 (make_parent_window, make_window, saved_window)
13043 (Fset_window_configuration, save_window_save): Don't deal with
13044 clone numbers.
13045 * buffer.c (Qclone_number): Remove declaration.
13046 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13047
3349e122
SM
130482011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13049
13050 Add multiple inheritance to keymaps.
13051 * keymap.c (Fmake_composed_keymap): New function.
13052 (Fset_keymap_parent): Simplify.
13053 (fix_submap_inheritance): Remove.
13054 (access_keymap_1): New function extracted from access_keymap to handle
13055 embedded parents and handle lists of maps.
13056 (access_keymap): Use it.
13057 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13058 (Fcopy_keymap): Handle embedded parents.
13059 (Fcommand_remapping, define_as_prefix): Simplify.
13060 (Fkey_binding): Simplify.
13061 (syms_of_keymap): Move minibuffer-local-completion-map,
13062 minibuffer-local-filename-completion-map,
13063 minibuffer-local-must-match-map, and
13064 minibuffer-local-filename-must-match-map to Elisp.
13065 (syms_of_keymap): Defsubr make-composed-keymap.
13066 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13067 (parse_menu_item): Trivial simplification.
13068
3279eb87
GM
130692011-07-01 Glenn Morris <rgm@gnu.org>
13070
13071 * Makefile.in (SETTINGS_LIBS): Fix typo.
13072
39cb9e56 130732011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
13074
13075 * coding.c (Fencode_coding_string): Record the last coding system
13076 used, as the function doc string says (bug#8738).
13077
0949d2b6
JD
130782011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13079
13080 * xsettings.c (store_monospaced_changed): Take new font as arg and
13081 check for change against current_mono_font.
13082 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13083 (emacs_settings_constructor, emacs_settings_get_property)
13084 (emacs_settings_set_property, emacs_settings_class_init)
13085 (emacs_settings_init, gsettings_obj): Remove.
13086 (something_changedCB): New function for HAVE_GSETTINGS.
13087 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13088 with value as argument.
13089 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13090 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 13091 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
13092 "changed".
13093
13094 * xgselect.c: Add defined (HAVE_GSETTINGS).
13095 (xgselect_initialize): Ditto.
13096
13097 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13098 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13099 xg_select.
13100
bbc6b304
PE
131012011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13102
13103 * eval.c (struct backtrace): Simplify and port the data structure.
13104 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13105 signed bit field, as this assumption is not portable and it makes
13106 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13107 "char debug_on_exit : 1" as this is not portable either; instead,
13108 use the portable "unsigned int debug_on_exit : 1". Remove unused
13109 member evalargs. Remove obsolete comments about cc bombing out.
13110
9851bfc5
JD
131112011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13112
51bb811f 13113 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
13114 Let HAVE_GSETTINGS override HAVE_GCONF.
13115 (store_monospaced_changed): New function.
13116 (EMACS_SETTINGS): A new type derived from GObject to handle
13117 GSettings notifications.
13118 (emacs_settings_constructor, emacs_settings_get_property)
13119 (emacs_settings_set_property, emacs_settings_class_init):
13120 New functions.
13121 (gsettings_client, gsettings_obj): New variables.
13122 (GSETTINGS_SCHEMA): New define.
13123 (something_changedCB): Call store_monospaced_changed.
13124 (init_gsettings): New function.
13125 (xsettings_initialize): Call init_gsettings.
13126 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13127 to NULL.
13128
640c8776 13129 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
13130 GCONF_CFLAGS/LIBS.
13131
5386012d
MR
131322011-06-29 Martin Rudalics <rudalics@gmx.at>
13133
13134 * window.c (resize_root_window, grow_mini_window)
13135 (shrink_mini_window): Rename Qresize_root_window to
13136 Qwindow_resize_root_window and Qresize_root_window_vertically to
13137 Qwindow_resize_root_window_vertically.
13138
f13e0b08
PE
131392011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13140
13141 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13142
94515237
JB
131432011-06-27 Juanma Barranquero <lekktu@gmail.com>
13144
13145 * makefile.w32-in: Redesign dependencies so they reflect more
13146 clearly which files are directly included by each source file,
13147 and not through other includes.
13148
e43b6e43
MR
131492011-06-27 Martin Rudalics <rudalics@gmx.at>
13150
13151 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13152 (sort_overlays, overlay_strings): When an overlay's clone number
13153 matches the window's clone number process the overlay even if
13154 the overlay's window property doesn't match the current window.
13155
d68443dc
MR
13156 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13157 (Fwindow_hchild): Rename to Fwindow_left_child.
13158 (Fwindow_next): Rename to Fwindow_next_sibling.
13159 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
13160 (resize_window_check): Rename to window_resize_check.
13161 (resize_window_apply): Rename to window_resize_apply.
13162 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13163 (Fdelete_other_windows_internal, resize_frame_windows)
13164 (Fsplit_window_internal, Fdelete_window_internal)
13165 (grow_mini_window, shrink_mini_window)
13166 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 13167
c7e73be5
JD
131682011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13169
13170 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13171 (emacs_fixed_set_min_size): Remove.
13172 (emacs_fixed_new): Take frame as argument.
13173
13174 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13175 (_EmacsFixedPrivate): Remove minwidth/height.
13176 Add struct frame *f.
13177 (emacs_fixed_init): Initialize priv->f.
13178 (get_parent_class, emacs_fixed_set_min_size): Remove.
13179 (emacs_fixed_new): Set priv->f to argument.
13180 (emacs_fixed_get_preferred_width)
13181 (emacs_fixed_get_preferred_height): Use min_width/height from
13182 frames size_hint to set minimum and natural (Bug#8919).
13183 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13184 and use min_width/height from frames size_hint to set
13185 min_width/height (Bug#8919).
13186
13187 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
13188 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13189 Fix indentation.
c7e73be5 13190
cf99dcf8
EZ
131912011-06-26 Eli Zaretskii <eliz@gnu.org>
13192
13193 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13194 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13195 called at ZV.
13196
029529ac
CY
131972011-06-26 Chong Yidong <cyd@stupidchicken.com>
13198
13199 * process.c (wait_reading_process_output): Bypass select if
13200 waiting for a cell while ignoring keyboard input, and input is
13201 pending. Suggested by Jan Djärv (Bug#8869).
13202
7a7ef429
PE
132032011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13204
13205 Use gnulib's dup2 module instead of rolling our own.
13206 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13207
11fdef7d 132082011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
13209
13210 * dispnew.c (scrolling_window): Before scrolling, turn off a
13211 mouse-highlight in the window being scrolled.
13212
cd3520a4
JB
132132011-06-24 Juanma Barranquero <lekktu@gmail.com>
13214
13215 Move DEFSYM to lisp.h and use everywhere.
13216
13217 * character.h (DEFSYM): Move declaration...
13218 * lisp.h (DEFSYM): ...here.
13219
13220 * gnutls.c:
13221 * minibuf.c:
13222 * w32menu.c:
13223 * w32proc.c:
13224 * w32select.c: Don't include character.h.
13225
13226 * alloc.c (syms_of_alloc):
13227 * buffer.c (syms_of_buffer):
13228 * bytecode.c (syms_of_bytecode):
13229 * callint.c (syms_of_callint):
13230 * casefiddle.c (syms_of_casefiddle):
13231 * casetab.c (init_casetab_once):
13232 * category.c (init_category_once, syms_of_category):
13233 * ccl.c (syms_of_ccl):
13234 * cmds.c (syms_of_cmds):
13235 * composite.c (syms_of_composite):
13236 * dbusbind.c (syms_of_dbusbind):
13237 * dired.c (syms_of_dired):
13238 * dispnew.c (syms_of_display):
13239 * doc.c (syms_of_doc):
13240 * editfns.c (syms_of_editfns):
13241 * emacs.c (syms_of_emacs):
13242 * eval.c (syms_of_eval):
13243 * fileio.c (syms_of_fileio):
13244 * fns.c (syms_of_fns):
13245 * frame.c (syms_of_frame):
13246 * fringe.c (syms_of_fringe):
13247 * insdel.c (syms_of_insdel):
13248 * keymap.c (syms_of_keymap):
13249 * lread.c (init_obarray, syms_of_lread):
13250 * macros.c (syms_of_macros):
13251 * msdos.c (syms_of_msdos):
13252 * print.c (syms_of_print):
13253 * process.c (syms_of_process):
13254 * search.c (syms_of_search):
13255 * sound.c (syms_of_sound):
13256 * syntax.c (init_syntax_once, syms_of_syntax):
13257 * terminal.c (syms_of_terminal):
13258 * textprop.c (syms_of_textprop):
13259 * undo.c (syms_of_undo):
13260 * w32.c (globals_of_w32):
13261 * window.c (syms_of_window):
13262 * xdisp.c (syms_of_xdisp):
13263 * xfaces.c (syms_of_xfaces):
13264 * xfns.c (syms_of_xfns):
13265 * xmenu.c (syms_of_xmenu):
13266 * xsettings.c (syms_of_xsettings):
13267 * xterm.c (syms_of_xterm): Use DEFSYM.
13268
4228cf16
TZ
132692011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13270
cd3520a4 13271 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 13272
7fcccf1e
PE
132732011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13274
7efb4e0e
PE
13275 Integer and buffer overflow fixes (Bug#8873).
13276
ff5844ad
PE
13277 * print.c (printchar, strout): Check for string overflow.
13278 (PRINTPREPARE, printchar, strout):
13279 Don't set size unless allocation succeeds.
13280
90532f02
PE
13281 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13282 for sizes. Check for string overflow more accurately.
13283 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13284
6d84508d
PE
13285 * macros.c: Integer and buffer overflow fixes.
13286 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13287 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13288 Use ptrdiff_t, not int, for sizes.
13289 Don't increment bufsize until after realloc succeeds.
13290 Check for size-calculation overflow.
13291 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13292
437b2cb4
PE
13293 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13294
8b9ac8b4
PE
13295 * lread.c: Integer overflow fixes.
13296 (read_integer): Radix is now EMACS_INT, not int,
13297 to improve quality of diagnostics for out-of-range radices.
13298 Calculate buffer size correctly for out-of-range radices.
13299 (read1): Check for integer overflow in radices, and in
13300 read-circle numbers.
82cb60d3
PE
13301 (read_escape): Avoid int overflow.
13302 (Fload, openp, read_buffer_size, read1)
13303 (substitute_object_recurse, read_vector, read_list, map_obarray):
13304 Use ptrdiff_t, not int, for sizes.
13305 (read1): Use EMACS_INT, not int, for sizes.
20270765 13306 Check for size overflow.
8b9ac8b4 13307
7fcccf1e
PE
13308 * image.c (cache_image): Check for size arithmetic overflow.
13309
bfbbd7e7
PE
13310 * lread.c: Integer overflow issues.
13311 (saved_doc_string_size, saved_doc_string_length)
13312 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13313 Now ptrdiff_t, not int.
13314 (read1): Don't assume doc string length fits in int. Check for
13315 out-of-range doc string lengths.
13316 (read_list): Don't assume file position fits in int.
39019e54 13317 (read_escape): Check for hex character overflow.
bfbbd7e7 13318
4e323265
LL
133192011-06-22 Leo Liu <sdl.web@gmail.com>
13320
13321 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13322 Move to minibuffer.el.
13323
85fece3e
PE
133242011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13325
20b84ce9 13326 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
13327 The following patches are for when GLYPH_DEBUG && !XASSERT.
13328 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13329 * dispnew.c (flush_stdout):
13330 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13331 Mark as externally visible.
13332 * dispnew.c (check_window_matrix_pointers): Now static.
13333 * dispnew.c (window_to_frame_vpos):
13334 * xfns.c (unwind_create_frame):
13335 * xterm.c (x_check_font): Remove unused local.
13336 * scroll.c (CHECK_BOUNDS):
13337 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13338 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13339 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13340 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13341 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13342 Now static.
13343 (debug_method_add): Use va_list and vsprintf rather than relying
13344 on undefined behavior with wrong number of arguments.
13345 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13346 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13347 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13348 since we're not interested in debugging glyphs with old libraries.
13349 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13350 GCC 4.6.0's static checking.
13351
0766b489
PE
133522011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13353
31fd4b32
PE
13354 Integer overflow and signedness fixes (Bug#8873).
13355 A few related buffer overrun fixes, too.
13356
b79e8648
PE
13357 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13358
0766b489
PE
13359 * dispextern.h (struct face.stipple):
13360 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13361 (x_bitmap_mask, x_allocate_bitmap_record)
13362 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13363 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13364 (x_create_bitmap_from_xpm_data):
13365 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13366 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13367 (.bitmaps_last):
13368 * xfaces.c (load_pixmap):
13369 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13370 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13371 (.bitmaps_last, struct x_output.icon_bitmap):
13372 Use ptrdiff_t, not int, for bitmap indexes.
13373 (x_allocate_bitmap_record): Check for size overflow.
13374 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13375
b081724f
PE
13376 Use ptrdiff_t, not int, for overlay counts.
13377 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13378 * editfns.c (overlays_around, get_pos_property):
13379 * textprop.c (get_char_property_and_overlay):
13380 * xdisp.c (next_overlay_change, note_mouse_highlight):
13381 * xfaces.c (face_at_buffer_position):
21514da7
PE
13382 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13383 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13384 (Fnext_overlay_change, Fprevious_overlay_change)
13385 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 13386 Use ptrdiff_t, not int, for sizes.
21514da7 13387 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 13388
3de73e5e
PE
13389 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13390
2606c57b
PE
13391 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13392 (x_session_initialize): Do not assume string length fits in int.
13393
aaafe47a
PE
13394 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13395 This is unlikely, but can occur if DPI is outlandish.
13396
2674ddc8 13397 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
13398 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13399
28154962
PE
13400 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13401 * xrdb.c (magic_file_p, search_magic_path):
13402 Omit last arg SUFFIX; it was always 0. All callers changed.
13403 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13404
7de51af5
PE
13405 * xfont.c (xfont_match): Avoid need for strlen.
13406
25ed6cc3
PE
13407 * xfns.c: Don't assume strlen fits in int.
13408 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13409
4eab31dd
PE
13410 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13411 not unsigned long, as we prefer signed integers. All callers changed.
13412 Detect integer overflow in repeat count.
13413 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 13414 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 13415
171e2a58
PE
13416 * termcap.c: Don't assume sizes fit in int and never overflow.
13417 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13418 (gobble_line): Check for size-calculation overflow.
13419
ad39faca 13420 * minibuf.c (Fread_buffer):
6e5bb2dc 13421 * lread.c (intern, intern_c_string):
74ca2eb3
PE
13422 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13423 Don't assume string length fits in int.
13424
52c61c22 13425 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
13426 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13427
b5b8c9e5
PE
13428 * font.c: Don't assume string length fits in int.
13429 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13430 Use ptrdiff_t, not int.
ccd6111c
PE
13431 (font_intern_prop): Don't assume string length fits in int.
13432 Don't assume integer property fits in fixnum.
13433 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 13434
882f0d81 13435 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 13436 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
13437 Reformulate so as not to need the command string.
13438 Invoke gzip -cd rather than gunzip, as it's more portable.
13439 (lock_info_type, lock_file_1, lock_file):
13440 Don't assume pid_t and time_t fit in unsigned long.
13441 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13442 (current_lock_owner): Prefer signed type for sizes.
13443 Use memcpy, not strncpy, where memcpy is what is really wanted.
13444 Don't assume (via atoi) that time_t and pid_t fit in int.
13445 Check for time_t and/or pid_t out of range, e.g., via a network share.
13446 Don't alloca where an auto var works fine.
13447
93f4cf88
PE
13448 * fileio.c: Fix some integer overflow issues.
13449 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13450 Don't assume string length fits in int.
13451 (directory_file_name): Don't assume string length fits in long.
13452 (make_temp_name): Don't assume pid fits in int, or that its print
13453 length is less than 20.
13454
f3e92b69
PE
13455 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13456
1bfdaf10
PE
13457 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13458
35016e9a
PE
13459 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13460
3d1e65a1
PE
13461 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13462 We prefer signed integers, even for size calculations.
13463
0b963a93
PE
13464 * emacs.c: Don't assume string length fits in 'int'.
13465 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13466 (main): Don't invoke strlen when not needed.
13467
573f4b54
PE
13468 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13469 (XD_DEBUG_MESSAGE): Don't waste a byte.
13470
989f33ba
PE
13471 * callproc.c (getenv_internal_1, getenv_internal)
13472 (Fgetenv_internal):
965d34eb
PE
13473 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13474
e4d29b33
PE
13475 * lread.c (invalid_syntax): Omit length argument.
13476 All uses changed. This doesn't fix a bug, but it simplifies the
13477 code away from its former Hollerith-constant appearance, and it's
13478 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 13479 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 13480
eb49b136
PE
13481 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13482 This didn't break anything, but it didn't help either.
13483 It's confusing to put a bogus integer in a place where the actual
13484 value does not matter.
9f62aeb1 13485 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 13486 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 13487
15375a22
PE
13488 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13489 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13490 implementation.
b61cc01c
PE
13491 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13492 We prefer signed types, and the value cannot exceed the EMACS_INT
13493 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
13494 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13495 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13496 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 13497
53b2623d
PE
13498 * indent.c (sane_tab_width): New function.
13499 (current_column, scan_for_column, Findent_to, position_indentation)
13500 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 13501 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 13502
51cab52b 13503 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 13504
f2ed8a70
PE
13505 * lisp.h (lint_assume): New macro.
13506 * composite.c (composition_gstring_put_cache):
13507 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13508
abe80cc6
PE
13509 * editfns.c, insdel.c:
13510 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 13511
b02c740e
PE
13512 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13513
ebc96716
PE
13514 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13515
b4e50fa0 13516 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 13517 Use much-faster test for byte-length change.
311d5d7c 13518 Don't assume string byte-length fits in 'int'.
a4cf38e4 13519 Check that character arg fits in 'int'.
85461888 13520 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 13521
c0c1ee9f
PE
13522 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13523
a498d7f4
PE
13524 * fns.c (concat): Catch string overflow earlier.
13525 Do not rely on integer wraparound.
13526
51cab52b
PE
13527 * dispextern.h (struct it.overlay_strings_charpos)
13528 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
13529 * xdisp.c (forward_to_next_line_start)
13530 (back_to_previous_visible_line_start)
13531 (reseat_at_next_visible_line_start, next_element_from_buffer):
13532 Don't arbitrarily truncate the value of 'selective' to int.
13533
76031fad
PE
13534 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13535
5eb55db9
PE
13536 * composite.c: Don't truncate sizes to 'int'.
13537 (composition_gstring_p, composition_reseat_it)
13538 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
13539 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13540 not EMACS_UINT, for indexes.
5eb55db9 13541
0703a717
PE
13542 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13543
d6202519
PE
13544 * buffer.c: Include <verify.h>.
13545 (struct sortvec.priority, struct sortstr.priority):
8961a454 13546 Now EMACS_INT, not int.
c20998a7 13547 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
13548 (struct sortstr.size, record_overlay_string)
13549 (struct sortstrlist.size, struct sortlist.used):
13550 Don't truncate size to int.
13551 (record_overlay_string): Check for size-calculation overflow.
d6202519 13552 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 13553
d5a19415
JM
135542011-06-22 Jim Meyering <meyering@redhat.com>
13555
029529ac 13556 Don't leak an XBM-image-sized buffer
d5a19415
JM
13557 * image.c (xbm_load): Free the image buffer after using it.
13558
a9041e6c
PE
135592011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13560
13561 Port to Sun C.
13562 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13563 that Sun C diagnosed.
13564 * fns.c (secure_hash): Fix pointer signedness issue.
13565 * intervals.c (static_offset_intervals): New function.
13566 (offset_intervals): Use it.
13567
7f3f739f
LL
135682011-06-21 Leo Liu <sdl.web@gmail.com>
13569
13570 * deps.mk (fns.o):
13571 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13572 sha512.h.
13573
13574 * fns.c (secure_hash): Rename from crypto_hash_function and change
13575 the first arg to accept symbols.
5b66d427 13576 (Fsecure_hash): New primitive.
7f3f739f
LL
13577 (syms_of_fns): New symbols.
13578
76147d94
DD
135792011-06-20 Deniz Dogan <deniz@dogan.se>
13580
13581 * process.c (Fset_process_buffer): Clarify return value in
13582 docstring.
13583
7d7d0045
CY
135842011-06-18 Chong Yidong <cyd@stupidchicken.com>
13585
13586 * dispnew.c (add_window_display_history): Use BVAR.
13587
13588 * xdisp.c (debug_method_add): Use BVAR.
13589 (check_window_end, dump_glyph_matrix, dump_glyph)
13590 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13591
13592 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13593 Likewise.
13594
13595 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13596 check till after the cache is created in init_frame_faces.
13597
ff2bc410
SM
135982011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13599
13600 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13601
28177add
PE
136022011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13603
dd3482fe
PE
13604 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13605 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13606 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13607
393d71f3 13608 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
13609 * fileio.c (Finsert_file_contents):
13610 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13611 Remove the old (too-loose) buffer overflow checks.
13612 They weren't needed, since make_gap checks for buffer overflow.
13613 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13614 The old code merely checked for Emacs fixnum overflow, and relied
13615 on undefined (wraparound) behavior. The new code avoids undefined
13616 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13617
2e6813b0 13618 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
13619 Tune. Don't use wider integers than needed. Don't use alloca.
13620 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 13621
599a9e4f
PE
13622 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13623
99561444
PE
13624 * insdel.c, lisp.h (buffer_overflow): New function.
13625 (insert_from_buffer_1, replace_range, replace_range_2):
13626 * insdel.c (make_gap_larger):
13627 * editfns.c (Finsert_char):
13628 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13629
28177add
PE
13630 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13631
e69dafad
PE
136322011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13633
4baa020d 13634 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 13635
b1c46f02
PE
13636 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13637 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13638
e69dafad
PE
13639 * fileio.c: Don't assume EMACS_INT fits in off_t.
13640 (emacs_lseek): New static function.
13641 (Finsert_file_contents, Fwrite_region): Use it.
13642 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13643
566684ea
PE
13644 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13645
e6966cd6
PE
13646 * fns.c: Don't overflow int when computing a list length.
13647 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13648 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13649 truncation on 64-bit hosts. Check for QUIT every
13650 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13651 faster and is responsive enough.
13652 (Flength): Report an error instead of overflowing an integer.
13653 (Fsafe_length): Return a float if the value is not representable
13654 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 13655 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 13656 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 13657
dd0b0efb
PE
13658 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13659 (header_size, word_size): New constants.
13660 (allocate_vectorlike): Don't check size overflow here.
13661 (allocate_vector): Check it here instead, since this is the only
13662 caller of allocate_vectorlike that could cause overflow.
13663 Check that the new vector's length is representable as a fixnum.
13664
86fe5cfe
PE
13665 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13666 The previous code was bogus. For example, next_almost_prime (32)
13667 returned 39, which is undesirable as it is a multiple of 3; and
13668 next_almost_prime (24) returned 25, which is a multiple of 5 so
13669 why was the code bothering to check for multiples of 7?
13670
80e88859
PE
13671 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13672
4a2f0ad6
PE
13673 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13674
f66c7cf8
PE
13675 Variadic C functions now count arguments with ptrdiff_t.
13676 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13677 Back then I didn't know that the Emacs coding style prefers signed int.
13678 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
13679 were being counted with int, which may truncate counts on 64-bit
13680 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
13681 * lisp.h (struct Lisp_Subr.function.aMANY)
13682 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13683 Arg counts are now ptrdiff_t, not size_t.
13684 All variadic functions and their callers changed accordingly.
13685 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13686 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13687 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13688 * callint.c (Fcall_interactively): Check arg count for overflow,
13689 to avoid potential buffer overrun. Use signed char, not 'int',
13690 for 'varies' array, so that we needn't bother to check its size
13691 calculation for overflow.
13692 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13693 * eval.c (apply_lambda):
13694 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13695 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13696 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13697
a1759b76
PE
13698 * callint.c (Fcall_interactively): Don't use index var as event count.
13699
d96be9fc
PE
13700 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13701 * mem-limits.h (SIZE): Remove; no longer used.
13702
a690a978 13703 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 13704
578c21e6
PE
13705 Remove unnecessary casts.
13706 * xterm.c (x_term_init):
13707 * xfns.c (x_set_border_pixel):
13708 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13709 These aren't needed now that we assume ANSI C.
13710
96f53c6c
PE
13711 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13712 It's more likely to cause problems (due to unsigned overflow)
13713 than to cure them.
13714
83c77d31
PE
13715 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13716
ee2079f1
PE
13717 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13718
6da65536
PE
13719 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13720
7147c4a4
PE
13721 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13722
193e32d9
PE
13723 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13724
e5533da6
PE
13725 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13726
9910e595
PE
13727 GLYPH_CODE_FACE returns EMACS_INT, not int.
13728 * dispextern.h (merge_faces):
13729 * xfaces.c (merge_faces):
01103c44
PE
13730 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13731 Don't assume EMACS_INT fits in int.
9910e595 13732
2638320e
PE
13733 * character.h (CHAR_VALID_P): Remove unused parameter.
13734 * fontset.c, lisp.h, xdisp.c: All uses changed.
13735
045eb8d9
PE
13736 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13737
c1f134b5
PE
13738 * fns.c (concat): Minor tuning based on overflow analysis.
13739 This doesn't fix any bugs. Use int to hold character, instead
13740 of constantly refetching from Emacs object. Use XFASTINT, not
13741 XINT, for value known to be a character. Don't bother comparing
13742 a single byte to 0400, as it's always less.
13743
395fcb93 13744 * floatfns.c (Fexpt):
327eeec8
PE
13745 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13746
abbd3d23
PE
13747 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13748 for characters.
13749
684a03ef
PE
13750 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13751
0fed43f3
PE
13752 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13753 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13754 incorrectly succeed when S was a string, because 4294967386 was
13755 truncated before it was used.
13756
8fd02eb7
PE
13757 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13758 Otherwise, an out-of-range integer could cause undefined behavior
13759 on a 64-bit host.
13760
f8c86b69
PE
13761 * composite.c: Use int, not EMACS_INT, for characters.
13762 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13763 EMACS_INT, for values that are known to be in character range.
13764 This doesn't fix any bugs but is the usual style inside Emacs and
13765 may generate better code on 32-bit machines.
13766
34206dd2
PE
13767 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13768 This is for reasons similar to the recent CHAR_STRING fix.
13769 * charset.c (Fencode_char): Check that character arg is actually
13770 a character. Pass an int to ENCODE_CHAR.
13771 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13772 wider than 'int', as a compile-time check to prevent future regressions
13773 in this area.
13774
c5958d4c 13775 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
13776
13777 Make sure a 64-bit char is never passed to CHAR_STRING.
13778 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13779 by silently ignoring the top 32 bits, allowing some values
13780 that were far too large to be valid characters.
13781 * character.h: Include <verify.h>.
13782 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13783 arguments are no wider than unsigned, as a compile-time check
13784 to prevent future regressions in this area.
13785 * data.c (Faset):
01103c44 13786 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
13787 (Fsubst_char_in_region):
13788 * fns.c (concat):
13789 * xdisp.c (decode_mode_spec_coding):
13790 Adjust to CHAR_STRING's new requirement.
13791 * editfns.c (Finsert_char, Fsubst_char_in_region):
13792 * fns.c (concat): Check that character args are actually
13793 characters. Without this test, these functions did the wrong
13794 thing with wildly out-of-range values on 64-bit hosts.
13795
d37ca623
PE
13796 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13797 These casts should not be needed on 32-bit hosts, either.
13798 * keyboard.c (read_char):
13799 * lread.c (Fload): Remove casts to unsigned.
13800
ea204efb
PE
13801 * lisp.h (UNSIGNED_CMP): New macro.
13802 This fixes comparison bugs on 64-bit hosts.
13803 (ASCII_CHAR_P): Use it.
13804 * casefiddle.c (casify_object):
01103c44 13805 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
13806 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13807 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13808 * dispextern.h (FACE_FROM_ID):
13809 * keyboard.c (read_char): Use UNSIGNED_CMP.
13810
41cb286c
PE
13811 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13812 not to EMACS_INT, to avoid GCC warning.
13813
4a1b9832
PE
13814 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13815
55daad71
PE
13816 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13817 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13818 isn't needed on 32-bit machines.
8f95c75c 13819
01103c44
PE
13820 * buffer.c (Fgenerate_new_buffer_name):
13821 Use EMACS_INT for count, not int.
0ceccced 13822 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
13823
13824 * data.c (Qcompiled_function): Now static.
13825
c6f072e7
PE
13826 * window.c (window_body_lines): Now static.
13827
20ce5912
PE
13828 * image.c (gif_load): Rename local to avoid shadowing.
13829
9c4c5f81
PE
13830 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13831 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13832 * alloc.c (make_save_value): Integer argument is now of type
13833 ptrdiff_t, not int.
13834 (mark_object): Use ptrdiff_t, not int.
13835 * lisp.h (pD): New macro.
13836 * print.c (print_object): Use it.
13837
c0c5c8ae
PE
13838 * alloc.c: Use EMACS_INT, not int, to count objects.
13839 (total_conses, total_markers, total_symbols, total_vector_size)
13840 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
13841 (total_free_floats, total_floats, total_free_intervals)
13842 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
13843 Now EMACS_INT, not int. All uses changed.
13844 (Fgarbage_collect): Compute overall total using a double, so that
13845 integer overflow is less likely to be a problem. Check for overflow
13846 when converting back to an integer.
5a25e253
PE
13847 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13848 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13849 These were 'int' variables that could overflow on 64-bit hosts;
13850 they were never used, so remove them instead of repairing them.
211a0b2a 13851 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
13852 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13853 Previously, this ceilinged at INT_MAX, but that doesn't work on
13854 64-bit machines.
e46bb31a 13855 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 13856
c78baabf 13857 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 13858 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
13859 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13860 when a (possibly-narrower) signed value would do just as well.
13861 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 13862
c9d624c6
PE
13863 * alloc.c: Catch some string size overflows that we were missing.
13864 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13865 for convenience in STRING_BYTES_MAX.
13866 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13867 The definition here is exact; the one in lisp.h was approximate.
13868 (allocate_string_data): Check for string overflow. This catches
13869 some instances we weren't catching before. Also, it catches
13870 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13871 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13872 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 13873
c9d624c6
PE
13874 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13875 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 13876 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 13877
353032ce
PE
13878 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13879
2bccce07
PE
13880 * alloc.c (Fmake_string): Check for out-of-range init.
13881
0ac30604
SM
138822011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13883
13884 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13885
c195f2de
JD
138862011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13887
13888 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13889 xg_get_default_scrollbar_width.
13890
13891 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13892 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13893 (style_changed_cb): Call update_theme_scrollbar_width and call
13894 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13895 all frames (Bug#8505).
13896 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13897 Call gtk_window_set_resizable if HAVE_GTK3.
13898 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13899 and height if HAVE_GTK3 (Bug#8505).
13900 (scroll_bar_width_for_theme): New variable.
13901 (update_theme_scrollbar_width): New function.
13902 (xg_get_default_scrollbar_width): Move code to
13903 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13904 (xg_initialize): Call update_theme_scrollbar_width.
13905
13906 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13907
13908 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13909
e10ac9f1
MR
139102011-06-12 Martin Rudalics <rudalics@gmx.at>
13911
13912 * frame.c (make_frame): Call other_buffer_safely instead of
13913 other_buffer.
13914
13915 * window.c (temp_output_buffer_show): Call display_buffer with
13916 second argument Vtemp_buffer_show_specifiers and reset latter
13917 immediately after the call.
13918 (Vtemp_buffer_show_specifiers): New variable.
13919 (auto_window_vscroll_p, next_screen_context_lines)
13920 (Vscroll_preserve_screen_position): Remove leading asterisks from
13921 doc-strings.
13922
2d3c217e 139232011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 13924
7b7f97e8 13925 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
13926 * buffer.c (Qclone_number): Remove for now, as it's unused.
13927 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13928 (record_buffer): Remove unused local.
13929 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13930 (set_frame_buffer_list): Remove; unused.
13931 * frame.h (other_visible_frames): Remove decl.
13932 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13933 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13934 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13935 if HAVE_GPM.
13936 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13937 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13938 Define only if HAVE_GPM.
13939 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13940 (update_hints_inhibit): Remove; never set. All uses removed.
13941 * widgetprv.h (emacsFrameClassRec): Remove decl.
13942 * window.c (delete_deletable_window): Now returns void, since it
13943 wasn't returning anything.
13944 (compare_window_configurations): Remove unused locals.
13945 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13946 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
13947 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13948 the same widths as pointers. This follows up on the 2011-05-06 patch.
13949 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13950 * xterm.h: Likewise.
13951 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13952
1384b89e
JB
139532011-06-12 Juanma Barranquero <lekktu@gmail.com>
13954
13955 * makefile.w32-in: Update dependencies.
13956 (LISP_H): Add lib/intprops.h.
13957
1100a63c
CY
139582011-06-11 Chong Yidong <cyd@stupidchicken.com>
13959
13960 * image.c (gif_load): Add animation frame delay to the metadata.
13961 (syms_of_image): Use DEFSYM. New symbol `delay'.
13962
6198ccd0
MR
139632011-06-11 Martin Rudalics <rudalics@gmx.at>
13964
13965 * window.c (delete_deletable_window): Re-add.
13966 (Fset_window_configuration): Rewrite to handle dead buffers and
13967 consequently deletable windows.
13968 (window_tree, Fwindow_tree): Remove. Supply functionality in
13969 window.el.
13970 (compare_window_configurations): Simplify code.
13971
b6e3633c
AS
139722011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13973
1ab0dee5
AS
13974 * image.c (imagemagick_load_image): Fix type mismatch.
13975 (Fimagemagick_types): Likewise.
13976
b6e3633c
AS
13977 * window.h (replace_buffer_in_windows): Declare.
13978
9397e56f
MR
139792011-06-11 Martin Rudalics <rudalics@gmx.at>
13980
13981 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13982 Qclone_number. Remove external declaration of Qdelete_window.
13983 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13984 code.
640c8776
SM
13985 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13986 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
13987 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13988 buffer list implementation.
13989 (other_buffer_safely): New function.
13990 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13991 calls to replace_buffer_in_windows and
13992 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13993 if allowed.
13994 (record_buffer): Inhibit quitting and rewrite using quittable
13995 functions. Run Qbuffer_list_update_hook if allowed.
13996 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
13997 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13998 Move switch-to-buffer to window.el.
9397e56f
MR
13999 (bury-buffer): Move to window.el.
14000 (Vbuffer_list_update_hook): New variable.
14001
14002 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14003 section.
14004
14005 * window.h (resize_frame_windows): Move up in code.
14006 (Fwindow_frame): Remove EXFUN.
14007 (replace_buffer_in_all_windows): Remove prototype.
14008 (replace_buffer_in_windows_safely): Add prototype.
14009
14010 * window.c: Declare Qdelete_window static again. Move down
14011 declaration of select_count.
14012 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14013 (Fother_window): Move to window.el.
14014 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14015 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14016 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14017 window.el.
14018 (replace_buffer_in_windows): Implement by calling
14019 Qreplace_buffer_in_windows.
14020 (replace_buffer_in_all_windows): Remove with some functionality
14021 moved into replace_buffer_in_windows_safely.
14022 (replace_buffer_in_windows_safely): New function.
14023 (select_window_norecord, select_frame_norecord): Move in front
14024 of run_window_configuration_change_hook. Remove now obsolete
14025 declarations.
640c8776
SM
14026 (Fset_window_buffer): Rewrite doc-string.
14027 Call Qrecord_window_buffer.
9397e56f
MR
14028 (keys_of_window): Move binding for other-window to window.el.
14029
b50691aa
CY
140302011-06-11 Chong Yidong <cyd@stupidchicken.com>
14031
14032 * dispextern.h (struct image): Replace data member, whose int_val
14033 and ptr_val fields were not used by anything, with a single
14034 lisp_val object.
14035
14036 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14037 (gif_clear_image, gif_load, imagemagick_load_image)
14038 (gs_clear_image, gs_load): Callers changed.
14039
3f754b86
PE
140402011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14041
cca69397
PE
14042 * buffer.h: Include <time.h>, for time_t.
14043 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14044
109e28d0
PE
14045 Fix minor problems found by static checking.
14046
60737f02
PE
14047 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14048
4b66faf3
PE
14049 Make identifiers static if they are not used in other modules.
14050 * data.c (Qcompiled_function, Qframe, Qvector):
14051 * image.c (QimageMagick, Qsvg):
14052 * minibuf.c (Qmetadata):
14053 * window.c (resize_window_check, resize_root_window): Now static.
14054 * window.h (resize_window_check, resize_root_window): Remove decls.
14055
109e28d0
PE
14056 * window.c (window_deletion_count, delete_deletable_window):
14057 Remove; unused.
46a4ce9e
PE
14058 (window_body_lines): Now static.
14059 (Fdelete_other_windows_internal): Mark vars as initialized.
14060 Make sure 'resize_failed' is initialized.
14061 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14062 (resize_window_apply): Remove unused local.
14063 * window.h (delete_deletable_window): Remove decl.
14064
109e28d0 14065 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
14066 (imagemagick_load_image): Fix pointer signedness problem by changing
14067 last arg from unsigned char * to char *. All uses changed.
14068 Also, fix a local for similar reasons.
14069 Remove unused locals. Remove locals to avoid shadowing.
14070 (fn_rsvg_handle_free): Remove; unused.
14071 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 14072 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 14073
3f754b86
PE
14074 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14075
2547adb1
CY
140762011-06-10 Chong Yidong <cyd@stupidchicken.com>
14077
14078 * image.c (gif_load): Fix omitted cast error introduced by
14079 2011-06-06 change.
14080
2c8e37d4
MR
140812011-06-10 Martin Rudalics <rudalics@gmx.at>
14082
14083 * window.h (resize_proportionally, orig_total_lines)
14084 (orig_top_line): Remove from window structure.
14085 (set_window_height, set_window_width, change_window_heights)
14086 (Fdelete_window): Remove prototypes.
14087 (resize_frame_windows): Remove duplicate declaration.
14088
440a42e3
EZ
140892011-06-10 Eli Zaretskii <eliz@gnu.org>
14090
14091 * window.h (resize_frame_windows, resize_window_check)
14092 (delete_deletable_window, resize_root_window)
14093 (resize_frame_windows): Declare prototypes.
14094
14095 * window.c (resize_window_apply): Make definition be "static" to
14096 match the prototype.
14097
562dd5e9
MR
140982011-06-10 Martin Rudalics <rudalics@gmx.at>
14099
14100 * window.c: Remove declarations of Qwindow_size_fixed,
14101 window_min_size_1, window_min_size_2, window_min_size,
14102 size_window, window_fixed_size_p, enlarge_window, delete_window.
14103 Remove static from declaration of Qdelete_window, it's
14104 temporarily needed by Fbury_buffer.
14105 (replace_window): Don't assign orig_top_line and
14106 orig_total_lines.
14107 (Fdelete_window, delete_window): Remove. Window deletion is
14108 handled by window.el.
640c8776
SM
14109 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14110 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
14111 (Fdelete_other_windows): Remove. Deleting other windows is
14112 handled by window.el.
14113 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14114 handled in window.el.
14115 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14116 Window minimum sizes are handled in window.el.
14117 (shrink_windows, size_window, set_window_height)
14118 (set_window_width, change_window_heights, window_height)
14119 (window_width, CURBEG, CURSIZE, enlarge_window)
14120 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14121 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14122 handled in window.el.
14123 (make_dummy_parent): Rename to make_parent_window and give it a
14124 second argument horflag.
14125 (make_window): Don't set resize_proportionally any more.
14126 (Fsplit_window): Remove. Windows are split in window.el.
14127 (save_restore_action, save_restore_orig_size)
14128 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14129 Resize mini windows in window.el.
14130 (grow_mini_window, shrink_mini_window): Implement by calling
14131 Qresize_root_window_vertically, resize_window_check and
14132 resize_window_apply.
640c8776
SM
14133 (saved_window, Fset_window_configuration, save_window_save):
14134 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
14135 resize_proportionally.
14136 (window_min_height, window_min_width): Move to window.el.
14137 (keys_of_window): Move bindings for delete-other-windows,
14138 split-window, delete-window and enlarge-window to window.el.
14139
14140 * buffer.c: Temporarily extern Qdelete_window.
14141 (Fbury_buffer): Temporarily call Qdelete_window instead of
14142 Fdelete_window (Fbury_buffer will move to window.el soon).
14143
14144 * frame.c (set_menu_bar_lines_1): Remove code handling
14145 orig_top_line and orig_total_lines.
14146
14147 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14148 set_window_height but set heights directly.
14149 (change_frame_size_1): Use resize_frame_windows.
14150
14151 * xdisp.c (init_xdisp): Don't use set_window_height but set
14152 heights directly.
14153
640c8776
SM
14154 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14155 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
14156 run_window_configuration_change_hook.
14157
14158 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14159 instead of change_window_heights and run
14160 run_window_configuration_change_hook.
14161
1a13852e
MR
141622011-06-09 Martin Rudalics <rudalics@gmx.at>
14163
14164 * window.c (replace_window): Rename second argument REPLACEMENT to
14165 NEW. New third argument SETFLAG. Rewrite.
14166 (delete_window, make_dummy_parent): Call replace_window with
14167 third argument 1.
14168 (window_list_1): Move down in code.
14169 (run_window_configuration_change_hook): Move set_buffer part
14170 before select_frame_norecord part in order to unwind correctly.
14171 Rename count1 to count.
14172 (recombine_windows, delete_deletable_window, resize_root_window)
14173 (Fdelete_other_windows_internal)
14174 (Frun_window_configuration_change_hook, make_parent_window)
14175 (resize_window_check, resize_window_apply, Fresize_window_apply)
14176 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
14177 (Fdelete_window_internal, Fresize_mini_window_internal):
14178 New functions.
1a13852e
MR
14179 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14180
f3d1777e
MR
141812011-06-08 Martin Rudalics <rudalics@gmx.at>
14182
496e208e
MR
14183 * window.h (window): Add some new members to window structure -
14184 normal_lines, normal_cols, new_total, new_normal, clone_number,
14185 splits, nest, prev_buffers, next_buffers.
14186 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 14187 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 14188
f3d1777e
MR
14189 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14190 Remove.
496e208e
MR
14191 (make_dummy_parent): Set new members of windows structure.
14192 (make_window): Move down in code. Handle new members of window
14193 structure.
14194 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14195 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14196 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14197 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
14198 (Fset_window_next_buffers, Fset_window_clone_number):
14199 New functions.
496e208e
MR
14200 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14201 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14202 Doc-string fixes.
14203 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14204 Argument WINDOW can be now internal window too.
14205 (Fwindow_use_time): Move up in code.
14206 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14207 Rewrite doc-string.
14208 (Fset_window_configuration, saved_window)
14209 (Fcurrent_window_configuration, save_window_save): Handle new
14210 members of window structure.
b9e809c2
MR
14211 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14212 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14213 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14214 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14215 Qget_mru_window, Qresize_root_window,
14216 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14217 Qauto_buffer_name; staticpro them.
f3d1777e 14218
abde8f8c
MR
142192011-06-07 Martin Rudalics <rudalics@gmx.at>
14220
14221 * window.c (Fwindow_total_size, Fwindow_left_column)
14222 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14223 (Fwindow_list_1): New functions.
14224 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
14225 (Fwindow_width, Fscroll_left, Fscroll_right):
14226 Use window_body_cols instead of window_box_text_cols.
14227 (delete_window, Fset_window_configuration):
14228 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
14229 (delete_all_subwindows): Take a window as argument and not a
14230 structure. Rewrite.
190b47e6
MR
14231 (window_loop): Remove handling of GET_LRU_WINDOW and
14232 GET_LARGEST_WINDOW.
14233 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
14234
14235 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
14236 window_box_text_cols. delete_all_subwindows now takes a
14237 Lisp_Object as argument.
abde8f8c 14238
640c8776
SM
14239 * indent.c (compute_motion, Fcompute_motion):
14240 Use window_body_cols instead of window_box_text_cols.
abde8f8c 14241
fa8a67e6
MR
14242 * frame.c (delete_frame): Call delete_all_subwindows with root
14243 window as argument.
14244
a54e3482
DC
142452011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14246
14247 * fns.c (Fputhash): Document return value.
14248
60002bf5
CY
142492011-06-06 Chong Yidong <cyd@stupidchicken.com>
14250
14251 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14252
0c671da6 142532011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 14254
b862a52a 14255 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 14256
be44ca6c
PE
14257 Check for overflow when converting integer to cons and back.
14258 * charset.c (Fdefine_charset_internal, Fdecode_char):
14259 Use cons_to_unsigned to catch overflow.
14260 (Fencode_char): Use INTEGER_TO_CONS.
14261 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14262 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14263 * data.c (long_to_cons, cons_to_long): Remove.
14264 (cons_to_unsigned, cons_to_signed): New functions.
14265 These signal an error for invalid or out-of-range values.
14266 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14267 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14268 * font.c (Ffont_variation_glyphs):
14269 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14270 * lisp.h: Include <intprops.h>.
14271 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14272 (cons_to_signed, cons_to_unsigned): New decls.
14273 (long_to_cons, cons_to_long): Remove decls.
14274 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14275 (Fprimitive_undo): Use CONS_TO_INTEGER.
14276 * xfns.c (Fx_window_property): Likewise.
14277 * xselect.c: Include <limits.h>.
14278 (x_own_selection, selection_data_to_lisp_data):
14279 Use INTEGER_TO_CONS.
14280 (x_handle_selection_request, x_handle_selection_clear)
14281 (x_get_foreign_selection, Fx_disown_selection_internal)
14282 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14283 (lisp_data_to_selection_data): Use cons_to_unsigned.
14284 (x_fill_property_data): Use cons_to_signed.
14285 Report values out of range.
14286
d1f3d2af
PE
14287 Check for buffer and string overflow more precisely.
14288 * buffer.h (BUF_BYTES_MAX): New macro.
14289 * lisp.h (STRING_BYTES_MAX): New macro.
14290 * alloc.c (Fmake_string):
14291 * character.c (string_escape_byte8):
14292 * coding.c (coding_alloc_by_realloc):
14293 * doprnt.c (doprnt):
14294 * editfns.c (Fformat):
14295 * eval.c (verror):
14296 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14297 since they may not be the same number.
14298 * editfns.c (Finsert_char):
14299 * fileio.c (Finsert_file_contents):
14300 Likewise for BUF_BYTES_MAX.
14301
dd52fcea
PE
14302 * image.c: Use ptrdiff_t, not int, for sizes.
14303 (slurp_file): Switch from int to ptrdiff_t.
14304 All uses changed.
14305 (slurp_file): Check that file size fits in both size_t (for
14306 malloc) and ptrdiff_t (for sanity and safety).
14307
7f9bbdbb
PE
14308 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14309 if b->modtime has its maximal value.
14310
dfe18f82
PE
14311 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14312
84acfcf0
PE
14313 Don't assume time_t can fit into int.
14314 * buffer.h (struct buffer.modtime): Now time_t, not int.
14315 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14316 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14317
ccd9a01a
PE
14318 Minor fixes for signed vs unsigned integers.
14319 * character.h (MAYBE_UNIFY_CHAR):
14320 * charset.c (maybe_unify_char):
14321 * keyboard.c (read_char, reorder_modifiers):
14322 XINT -> XFASTINT, since the integer must be nonnegative.
14323 * ftfont.c (ftfont_spec_pattern):
14324 * keymap.c (access_keymap, silly_event_symbol_error):
14325 XUINT -> XFASTINT, since the integer must be nonnegative.
14326 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14327 since it makes no difference and we prefer signed.
14328 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14329 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14330 nonnegative.
14331
d6d100dd
SM
143322011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14333
14334 * window.h (Fwindow_frame): Declare.
14335
2b6148e4
PE
143362011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14337
14338 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14339 (SPARE_MEMORY): Always define.
14340 (LARGE_REQUEST): Remove.
14341 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14342
f230ecc9
MR
143432011-06-06 Martin Rudalics <rudalics@gmx.at>
14344
727e958e
MR
14345 * lisp.h: Move EXFUNS for Fframe_root_window,
14346 Fframe_first_window and Fset_frame_selected_window to window.h.
14347
14348 * window.h: Move EXFUNS for Fframe_root_window,
14349 Fframe_first_window and Fset_frame_selected_window here from
14350 lisp.h.
14351
14352 * frame.c (Fwindow_frame, Fframe_first_window)
14353 (Fframe_root_window, Fframe_selected_window)
14354 (Fset_frame_selected_window): Move to window.c.
14355 (Factive_minibuffer_window): Move to minibuf.c.
14356 (Fother_visible_frames_p): New function.
14357
14358 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14359
f230ecc9
MR
14360 * window.c (decode_window, decode_any_window): Move up in code.
14361 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14362 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
14363 (Fwindow_buffer): Move up and rewrite doc-string.
14364 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14365 (Fwindow_prev): New functions.
727e958e
MR
14366 (Fwindow_frame): Move here from frame.c. Accept any window as
14367 argument.
14368 (Fframe_root_window, Fframe_first_window)
14369 (Fframe_selected_window): Move here from frame.c. Accept frame
14370 or arbitrary window as argument. Update doc-strings.
14371 (Fminibuffer_window): Move up in code.
14372 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
14373 (Fset_frame_selected_window): Move here from frame.c.
14374 Marginal rewrite.
727e958e
MR
14375 (Fselected_window, select_window, Fselect_window): Move up in
14376 code. Minor doc-string fixes.
f230ecc9 14377
4d09bcf6
PE
143782011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14379
14380 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14381 Do not assume that spare memory exists; that assumption is valid
14382 only if SYSTEM_MALLOC.
14383 (LARGE_REQUEST): New macro, so that the issue of large requests
14384 is separated from the issue of spare memory.
14385
810928a2
AS
143862011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14387
172418ad
AS
14388 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14389 format. (Bug#8806)
14390
43f862f7
AS
14391 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14392
810928a2
AS
14393 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14394 before statements.
14395
a059fe24
JD
143962011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14397
14398 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14399
14400 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14401
14402 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14403 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14404
989bf368
JB
144052011-06-05 Juanma Barranquero <lekktu@gmail.com>
14406
14407 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14408
4b80f674
CY
144092011-06-04 Chong Yidong <cyd@stupidchicken.com>
14410
14411 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14412 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
14413 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14414 New error handlers.
4b80f674
CY
14415 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14416 Obey Vx_select_enable_clipboard_manager. Catch errors in
14417 x_clipboard_manager_save (Bug#8779).
14418 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 14419 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 14420
99a33b77 144212011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
14422
14423 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14424
99a33b77 144252011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
14426
14427 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14428 in the current matrix if keep_current_p is non-zero.
14429
8264569d
EZ
144302011-06-04 Eli Zaretskii <eliz@gnu.org>
14431
14432 * bidi.c (bidi_level_of_next_char): Fix last change.
14433
57f97249
EZ
144342011-06-03 Eli Zaretskii <eliz@gnu.org>
14435
fec2107c 14436 Support bidi reordering of text covered by display properties.
57f97249 14437
fec2107c
EZ
14438 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14439 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14440 (bidi_cache_search, bidi_cache_iterator_state)
14441 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
14442 (bidi_level_of_next_char, bidi_move_to_visually_next):
14443 Support character positions inside a run of characters covered by a
fec2107c
EZ
14444 display string.
14445 (bidi_paragraph_init, bidi_resolve_explicit_1)
14446 (bidi_level_of_next_char): Call bidi_fetch_char and
14447 bidi_fetch_char_advance instead of FETCH_CHAR and
14448 FETCH_CHAR_ADVANCE.
14449 (bidi_init_it): Initialize new members.
14450 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14451 definitions.
14452 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14453 instead of using explicit *_CHAR codes.
d6d100dd
SM
14454 (bidi_resolve_explicit, bidi_resolve_weak):
14455 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
14456 bidirectional text is supported only in multibyte buffers.
14457 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14458 it to initialize the frame_window_p member of struct bidi_it.
14459 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14460 (bidi_resolve_explicit, bidi_resolve_weak)
14461 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14462 bidi_it->nchars is non-positive.
14463 (bidi_level_of_next_char): Don't try to lookup the cache for the
14464 next/previous character if nothing is cached there yet, or if we
14465 were just reseat()'ed to a new position.
c40e2fb2 14466
0e14fe90
EZ
14467 * xdisp.c (set_cursor_from_row): Set start and stop points
14468 according to the row's direction when priming the loop that looks
14469 for the glyph on which to display cursor.
14470 (single_display_spec_intangible_p): Function deleted.
14471 (display_prop_intangible_p): Reimplement to call
14472 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
14473 Accept 3 additional arguments needed by handle_display_spec.
14474 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
14475 values: lists, `(when COND...)' forms, etc.
14476 (single_display_spec_string_p): Support property values that are
14477 lists with the argument STRING its top-level element.
14478 (display_prop_string_p): Fix the condition for processing a
14479 property that is a list to be consistent with handle_display_spec.
fec2107c 14480 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
14481 last portion of handle_display_prop.
14482 (compute_display_string_pos): Accept additional argument
14483 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14484 value of a `display' property is a "replacing spec".
14485 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14486 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14487 the display property, but just return a value indicating whether
14488 the display property will replace the characters it covers.
14489 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14490 frame_window_p members of struct bidi_it.
d6d100dd
SM
14491 (compute_display_string_pos, compute_display_string_end):
14492 New functions.
fec2107c
EZ
14493 (push_it): Accept second argument POSITION, where pop_it should
14494 jump to continue iteration.
14495 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 14496
fec2107c
EZ
14497 * keyboard.c (adjust_point_for_property): Adjust the call to
14498 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
14499
14500 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
14501 (bidi_init_it): Update prototypes.
14502 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
14503 (compute_display_string_pos, compute_display_string_end):
14504 Declare prototypes.
fec2107c
EZ
14505 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14506 EMACS_INT.
fc6f18ce 14507
40087514 145082011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 14509
57f53182
PE
14510 Malloc failure behavior now depends on size of allocation.
14511 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14512 * lisp.h: Change signatures accordingly.
14513 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14514 All callers changed. (Bug#8762)
14515
14516 * gnutls.c: Use Emacs's memory allocators.
14517 Without this change, the gnutls library would invoke malloc etc.
14518 directly, which causes problems on non-SYNC_INPUT hosts, and which
14519 runs afoul of improving memory_full behavior. (Bug#8761)
14520 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14521 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14522 xfree instead of the default malloc, realloc, free.
14523 (Fgnutls_boot): No need to check for memory allocation failure,
14524 since xmalloc does that for us.
14525
ac32cd99 14526 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
14527 * category.c (hash_get_category_set):
14528 * ccl.c (ccl_driver):
14529 * charset.c (Fdefine_charset_internal):
14530 * charset.h (struct charset.hash_index):
14531 * composite.c (get_composition_id, gstring_lookup_cache)
14532 (composition_gstring_put_cache):
14533 * composite.h (struct composition.hash_index):
14534 * dispextern.h (struct image.hash):
14535 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14536 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14537 (hashfn_equal, hashfn_user_defined, make_hash_table)
14538 (maybe_resize_hash_table, hash_lookup, hash_put)
14539 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14540 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14541 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14542 * image.c (make_image, search_image_cache, lookup_image)
14543 (xpm_put_color_table_h):
14544 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 14545 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 14546 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 14547 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
14548 * alloc.c (allocate_vectorlike):
14549 Check for overflow in vector size calculations.
14550 * ccl.c (ccl_driver):
14551 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
14552 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14553 need to be updated by these changes.
40087514
PE
14554 * fns.c (make_hash_table, maybe_resize_hash_table):
14555 Check for integer overflow with large hash tables.
0de4bb68
PE
14556 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14557 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14558 (SXHASH_REDUCE): New macro.
14559 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14560 Use it instead of discarding useful hash info with large hash values.
14561 (sxhash_float): New function.
14562 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14563 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
14564 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14565 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
14566 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14567 Adjust signatures to match updated version of code.
14568 (consing_since_gc): Now EMACS_INT, since a single hash table can
14569 use more than INT_MAX bytes.
14570
698d32e2
DN
145712011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14572
14573 Make it possible to build with GCC-4.6+ -O2 -flto.
14574
14575 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14576
fd6fa53f
SM
145772011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14578
14579 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14580 Call minibuffer-inactive-mode.
14581
864db017
JB
145822011-05-31 Juanma Barranquero <lekktu@gmail.com>
14583
14584 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14585 Update dependencies.
14586
2ad0baf4
DN
145872011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14588
14589 * data.c (init_data): Remove code for UTS, this system is not
14590 supported anymore.
14591
4fcc2638
DN
145922011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14593
14594 Don't force ./temacs to start in terminal mode.
14595
14596 * frame.c (make_initial_frame): Initialize faces in all cases, not
14597 only when CANNOT_DUMP is defined.
14598 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14599
c56e0fd5
DN
146002011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14601
14602 * dispnew.c (add_window_display_history): Use const for the string
14603 pointer. Remove declaration, not needed.
14604
333d54da 146052011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 14606
55d4c1b2 14607 Use 'inline', not 'INLINE'.
333d54da 14608 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
14609 * alloc.c, fontset.c (INLINE): Remove.
14610 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14611 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14612 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14613 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14614 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14615
738db178
DN
146162011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14617
14618 Make it possible to run ./temacs.
14619
14620 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14621 syms_of_callproc does the same thing. Remove test for
14622 "initialized", do it in the caller.
14623 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14624
620c53a6
SM
146252011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14626
14627 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14628 (read_minibuf): Use get_minibuffer.
14629 (syms_of_minibuf): Use DEFSYM.
14630 (Qmetadata): New var.
14631 * data.c (Qbuffer): Don't make it static.
14632 (syms_of_data): Use DEFSYM.
14633
e003a292
PE
146342011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14635
14636 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14637 (CCL_CODE_MIN): New macro.
14638
ed008a6d
PE
146392011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14640
3687c2ef
PE
14641 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14642
ed008a6d
PE
14643 * eval.c (Qdebug): Now static.
14644 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14645 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14646 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14647
d66c4c7c
CY
146482011-05-29 Chong Yidong <cyd@stupidchicken.com>
14649
14650 * image.c: Various fixes to ImageMagick code comments.
14651 (Fimagemagick_types): Doc fix.
14652
5fbc2025
PE
146532011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14654
0196f88a
PE
14655 Minor fixes prompted by GCC 4.6.0 warnings.
14656
14657 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14658
5fbc2025
PE
14659 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14660 (x_clipboard_manager_save_all): Move extern decl to ...
14661 * xterm.h: ... here, so that it can be checked for consistency.
14662
1dd3c2d9
CY
146632011-05-29 Chong Yidong <cyd@stupidchicken.com>
14664
14665 * xselect.c (x_clipboard_manager_save_frame)
14666 (x_clipboard_manager_save_all): New functions.
14667 (Fx_clipboard_manager_save): Lisp function deleted.
14668
14669 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14670 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14671
14672 * xterm.h: Update prototype.
14673
5ba6571d
WX
146742011-05-28 William Xu <william.xwl@gmail.com>
14675
14676 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14677 exiting (Bug#8239).
14678
3eaff834
JM
146792011-05-28 Jim Meyering <meyering@redhat.com>
14680
e1900994 14681 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
14682 * fns.c (to_uchar): Define.
14683 (crypto_hash_function): Use it to convert some newly-signed
14684 variables to unsigned, to avoid sign-extension bugs. For example,
14685 without this change, (md5 "truc") would evaluate to
14686 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14687 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 14688 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 14689
0f6990a7
PE
146902011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14691
14692 Integer overflow fixes.
c8a9ca5a 14693
08686060
PE
14694 * dbusbind.c: Serial number integer overflow fixes.
14695 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
14696 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14697 to hold a serial number that is too large for a fixnum.
14698 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14699 Check for serial numbers out of range. Decode any serial number
59568bf0 14700 that was so large that it became a float. (Bug#8722)
08686060 14701
2d1fc3c7
PE
14702 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14703 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14704 Use XFASTINT rather than XUINT when numbers are nonnegative.
14705 (xd_append_arg, Fdbus_method_return_internal):
14706 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14707 arguments, check that Lisp number is nonnegative, rather than
59568bf0 14708 silently wrapping negative numbers around. (Bug#8722)
30217ff0 14709 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 14710 (Bug#8722)
2d1fc3c7 14711
c8a9ca5a
PE
14712 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14713
519e1d69
PE
14714 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14715
6df6ae42 14716 ccl: Add integer overflow checks.
30569699
PE
14717 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14718 (IN_INT_RANGE): New macros.
14719 (ccl_driver): Use them to check for integer overflow when
14720 decoding a CCL program. Many of the new checks are whether XINT (x)
14721 fits in int; it doesn't always, on 64-bit hosts. The new version
14722 doesn't catch all possible integer overflows, but it's an
847044ea 14723 improvement. (Bug#8719)
30569699 14724
c11285dc
PE
14725 * alloc.c (make_event_array): Use XINT, not XUINT.
14726 There's no need for unsigned here.
14727
fdccd48e
PE
14728 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14729 This follows up to the 2011-05-06 change that substituted uintptr_t
14730 for EMACS_INT. This case wasn't caught back then.
14731
37910ab2
PE
14732 Rework Fformat to avoid integer overflow issues.
14733 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14734 now (part of C89). Include <verify.h>.
14735 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14736 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14737 (Fformat): Avoid the prepass trying to compute sizes; it was only
14738 approximate and thus did not catch overflow reliably. Instead, walk
14739 through the format just once, formatting and computing sizes as we go,
14740 checking for integer overflow at every step, and allocating a larger
14741 buffer as needed. Keep track separately whether the format is
14742 multibyte. Keep only the most-recently calculated precision, rather
14743 than them all. Record whether each argument has been converted to
14744 string. Use EMACS_INT, not int, for byte and char and arg counts.
14745 Support field widths and precisions larger than INT_MAX. Avoid
14746 sprintf's undefined behavior with conversion specifications such as %#d
14747 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14748 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14749 formatting out-of-range floating point numbers with int
9173deec 14750 formats. (Bug#8668)
37910ab2 14751
2e6578fb
PE
14752 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14753
0ae6bdee
PE
14754 * data.c: Avoid integer truncation in expressions involving floats.
14755 * data.c: Include <intprops.h>.
14756 (arith_driver): When there's an integer overflow in an expression
14757 involving floating point, convert the integers to floating point
14758 so that the resulting value does not suffer from catastrophic
14759 integer truncation. For example, on a 64-bit host (* 4
14760 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14761 Do not rely on undefined behavior after integer overflow.
14762
de883a70
PE
14763 merge count_size_as_multibyte, parse_str_to_multibyte
14764 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 14765 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
14766 Check for integer overflow.
14767 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14768 since it's now a duplicate of the other. This is more of
14769 a character than a buffer op, so better that it's in character.c.
14770 * fns.c, print.c: Adjust to above changes.
14771
2ff916cb
PE
147722011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14773
14774 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14775
f1b54466
PE
147762011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14777
fb1ac845
PE
14778 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14779 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14780 (x_clipboard_manager_save): Now static.
14781 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14782
f1b54466
PE
14783 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14784 (crypto_hash_function): Now static.
14785 Fix pointer signedness problems. Avoid unnecessary initializations.
14786
a9f737ee
CY
147872011-05-27 Chong Yidong <cyd@stupidchicken.com>
14788
14789 * termhooks.h (Vselection_alist): Make it terminal-local.
14790
14791 * terminal.c (create_terminal): Initialize it.
14792
14793 * xselect.c: Support for clipboard managers.
14794 (Vselection_alist): Move to termhooks.h as terminal-local var.
14795 (LOCAL_SELECTION): New macro.
14796 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14797 (symbol_to_x_atom): Remove gratuitous arg.
14798 (x_handle_selection_request, lisp_data_to_selection_data)
14799 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
14800 (x_own_selection, x_get_local_selection, x_convert_selection):
14801 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
14802 (some_frame_on_display): Delete unused function.
14803 (Fx_own_selection_internal, Fx_get_selection_internal)
14804 (Fx_disown_selection_internal, Fx_selection_owner_p)
14805 (Fx_selection_exists_p): New optional frame arg.
14806 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14807 (x_handle_selection_clear): Don't treat other terminals with the
14808 same keyboard specially. Use the terminal-local Vselection_alist.
14809 (x_clear_frame_selections): Use Frun_hook_with_args.
14810
14811 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14812
14813 * xterm.h: Add support for those atoms.
14814
e067f0c1
CY
148152011-05-26 Chong Yidong <cyd@stupidchicken.com>
14816
14817 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14818 (converted_selections, conversion_fail_tag): New global variables.
14819 (x_selection_request_lisp_error): Free the above.
14820 (x_get_local_selection): Remove unnecessary code.
14821 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
14822 of converted selections stored in converted_selections.
14823 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
14824 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14825 (x_convert_selection): New function.
14826 (x_handle_selection_event): Simplify.
14827 (x_get_foreign_selection): Don't ignore incoming requests while
14828 waiting for an answer; this will fail when we implement
14829 SAVE_TARGETS, and seems unnecessary anyway.
14830 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14831 (Vx_sent_selection_functions): Doc fix.
14832
0f4aebc0
LL
148332011-05-26 Leo Liu <sdl.web@gmail.com>
14834
14835 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14836
e61124cd
YM
148372011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14838
14839 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14840
14841 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14842 for fringe update if it has periodic bitmap.
ac389d0c 14843 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
14844 and fringe_bitmap_periodic_p.
14845
14846 * fringe.c (get_fringe_bitmap_data): New function.
14847 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14848 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14849 row. Mark glyph row for fringe update if periodicity changed.
14850
14851 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14852 for fringe update unless it has periodic bitmap.
14853
f16d9837
KH
148542011-05-25 Kenichi Handa <handa@m17n.org>
14855
14856 * xdisp.c (get_next_display_element): Set correct it->face_id for
14857 a static composition.
14858
e1b90ef6
LL
148592011-05-24 Leo Liu <sdl.web@gmail.com>
14860
14861 * deps.mk (fns.o):
14862 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14863
14864 * fns.c (crypto_hash_function, Fsha1): New function.
14865 (Fmd5): Use crypto_hash_function.
14866 (syms_of_fns): Add Ssha1.
14867
7400048f
PE
148682011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14869
14870 * gnutls.c: Remove unused macros.
14871 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14872 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14873 Remove macros that are defined and never used.
14874 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14875
abb71cf4
CY
148762011-05-22 Chong Yidong <cyd@stupidchicken.com>
14877
14878 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14879 (Fx_get_selection_internal): Minor cleanup.
14880 (Fx_own_selection_internal): Rename arguments for consistency with
14881 select.el.
14882
6307db39
PE
148832011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14884
14885 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14886
f3d4e0a4
CY
148872011-05-22 Chong Yidong <cyd@stupidchicken.com>
14888
14889 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14890
4d8ade89
YM
148912011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14892
14893 * dispnew.c (scrolling_window): Don't exclude the case that the
14894 last enabled row in the desired matrix touches the bottom boundary.
14895
32078c8d
GM
148962011-05-21 Glenn Morris <rgm@gnu.org>
14897
14898 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
14899 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14900 and add some more files.
32078c8d 14901
7285dc67
EZ
149022011-05-20 Eli Zaretskii <eliz@gnu.org>
14903
14904 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14905 report_file_error introduced by the change from 2011-05-07.
14906
89d1bd22
PE
149072011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14908
14909 * systime.h (Time): Define only if emacs is defined.
14910 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14911 where the include path doesn't have X11/X.h by default. See
14912 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14913
cd394be1 149142011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
14915
14916 * composite.c (find_automatic_composition): Fix previous change.
14917
b9704ad9
GM
149182011-05-20 Glenn Morris <rgm@gnu.org>
14919
14920 * lisp.mk: New file, split from Makefile.in.
14921 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14922 (shortlisp): Remove.
14923 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14924
4a720484
GM
149252011-05-19 Glenn Morris <rgm@gnu.org>
14926
14927 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14928 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14929 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14930 (lisp): Set the order to that of loadup.el.
14931 (shortlisp): Make it a copy of $lisp.
14932 (SOME_MACHINE_LISP): Remove.
14933 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14934 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14935
a28d4396
KH
149362011-05-18 Kenichi Handa <handa@m17n.org>
14937
14938 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14939 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14940 (find_automatic_composition): Mostly rewrite for efficiency.
14941
a2b1fa8e
JB
149422011-05-18 Juanma Barranquero <lekktu@gmail.com>
14943
14944 * makefile.w32-in: Update dependencies.
14945
8e1f5610
CS
149462011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14947
14948 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 14949 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 14950
7025ee00 149512011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 14952
cdfa6eab
PE
14953 Fix some integer overflow issues, such as string length overflow.
14954
06d6db33
PE
14955 * insdel.c (count_size_as_multibyte): Check for string overflow.
14956
2b4560a8
PE
14957 * character.c (lisp_string_width): Check for string overflow.
14958 Use EMACS_INT, not int, for string indexes and lengths; in
14959 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14960 the resulting string length overflows an EMACS_INT; instead,
14961 report a string overflow if no precision given. When checking for
14962 precision exhaustion, use a check that cannot possibly have
14963 integer overflow. (Bug#8675)
14964 * character.h (lisp_string_width): Adjust to new signature.
14965
cb93f9be
PE
14966 * alloc.c (string_overflow): New function.
14967 (Fmake_string): Use it. This doesn't change behavior, but saves
14968 a few bytes and will simplify future changes.
14969 * character.c (string_escape_byte8): Likewise.
14970 * lisp.h (string_overflow): New decl.
14971
1a1f3366
PE
14972 Fixups, following up to the user-interface timestamp change.
14973 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14974 for UI timestamps, instead of unsigned long.
9fbd6841
PE
14975 * msdos.c (mouse_get_pos): Likewise.
14976 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
14977 * w32gui.h (Time): Define by including "systime.h" rather than by
14978 declaring it ourselves. (Bug#8664)
14979
d4e3e4d3
PE
14980 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14981 * image.c (clear_image_cache): Likewise.
14982
f6a24d19
PE
14983 * term.c (term_mouse_position): Don't assume time_t wraparound.
14984
08dc5ae6
PE
14985 Be more systematic about user-interface timestamps.
14986 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
14987 and sometimes 'EMACS_UINT', to represent these timestamps.
14988 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
14989 This makes the code easier to follow, and makes it easier to catch
14990 integer overflow bugs such as Bug#8664.
14991 * frame.c (Fmouse_position, Fmouse_pixel_position):
14992 Use Time, not unsigned long, for user-interface timestamps.
14993 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14994 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14995 * keyboard.h (last_event_timestamp): Likewise.
14996 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14997 * menu.h (xmenu_show): Likewise.
14998 * term.c (term_mouse_position): Likewise.
14999 * termhooks.h (struct input_event.timestamp): Likewise.
15000 (struct terminal.mouse_position_hook): Likewise.
15001 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15002 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15003 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15004 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15005 what it was before.
15006 * menu.h, termhooks.h: Include "systime.h", for Time.
15007
8e55734a
PE
15008 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15009 Don't assume that the difference between two unsigned long values
15010 can fit into an integer. At this point, we know button_down_time
15011 <= event->timestamp, so the difference must be nonnegative, so
15012 there's no need to cast the result if double-click-time is
15013 nonnegative, as it should be; check that it's nonnegative, just in
15014 case. This bug is triggered when events are more than 2**31 ms
86db42d2 15015 apart (about 25 days). (Bug#8664)
8e55734a 15016
841f1b75 15017 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 15018 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 15019
3e26f69c
PE
15020 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15021 that always fit in int. Use a sentinel instead of a counter, to
15022 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
15023 * frame.h (struct frame): Use int for menu_bar_items_used
15024 instead of EMACS_INT, since it always fits in int.
3e26f69c 15025
5cc152c0
PE
15026 * menu.c (grow_menu_items): Check for int overflow.
15027
d89eb65e
PE
15028 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15029
5235bd3e
PE
15030 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15031 Before, the code was not consistent. These values cannot exceed
15032 2**31 - 1 so there's no need to make them unsigned.
15033 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15034 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15035 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15036 as modifiers.
15037 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15038
bc827e23
PE
15039 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15040 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15041 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15042 presumably because the widths might not match.
15043
78eb494e
PE
15044 * window.c (size_window): Avoid needless test at loop start.
15045
04f2d78b
CB
150462011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15047
15048 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15049
d2fc7e3d 150502011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
15051
15052 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15053
d2fc7e3d 150542011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
15055
15056 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15057 `width' to `bar_area_x' and `bar_area_width', respectively.
15058 (x_scroll_run): Take account of fringe background extension.
15059
04f2d78b
CB
15060 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15061 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
15062 `bar_area_width', respectively.
15063 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15064 background extension.
15065
79b70037
GM
150662011-05-10 Jim Meyering <meyering@redhat.com>
15067
15068 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15069
2f142cc5
JB
150702011-05-10 Juanma Barranquero <lekktu@gmail.com>
15071
15072 * image.c (Finit_image_library): Return t for built-in image types,
15073 like pbm and xbm. (Bug#8640)
15074
57679c86
AS
150752011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15076
15077 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15078
888c9e86
EZ
150792011-05-07 Eli Zaretskii <eliz@gnu.org>
15080
b0512a1d
EZ
15081 * w32console.c (Fset_screen_color): Doc fix.
15082 (Fget_screen_color): New function.
15083 (syms_of_ntterm): Defsubr it.
15084
7285dc67
EZ
15085 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15086 unlink the temporary file if Fcall_process didn't create it in the
15087 first place.
15088 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15089 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
15090 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15091 cue to call_process_cleanup not to close that handle.
15092
4d3fcc8e
BK
150932011-05-07 Ben Key <bkey76@gmail.com>
15094
15095 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15096 one of two shell specific rules, either bootstrap-temacs-CMD or
15097 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15098 to the previous implementation of the bootstrap-temacs rule.
15099 The bootstrap-temacs-CMD rule is similar to the previous
15100 implementation of the bootstrap-temacs rule except that it
15101 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15102 variable.
15103
15104 These changes, along with some changes to nt/configure.bat,
15105 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15106 earlier fix to add support for --cflags and --ldflags options
15107 that include quotes so that it works whether make uses cmd or
15108 sh as the shell.
15109
b4289b64
MA
151102011-05-06 Michael Albinus <michael.albinus@gmx.de>
15111
15112 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15113 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15114 is a constant.
15115 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15116 a string. Handle both cases.
15117 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15118 (Fdbus_register_method): Use Qinvalid_function.
15119
af4c0e28
JB
151202011-05-06 Juanma Barranquero <lekktu@gmail.com>
15121
15122 * makefile.w32-in: Update dependencies.
15123 (LISP_H): Add inttypes.h and stdin.h.
15124 (PROCESS_H): Add unistd.h.
15125
c51453d9
EZ
151262011-05-06 Eli Zaretskii <eliz@gnu.org>
15127
15128 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15129 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15130
8ff0ac3c 151312011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 15132
4c4b566b
PE
15133 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15134
aab2b9b5
PE
15135 * term.c (vfatal): Remove stray call to va_end.
15136 It's not needed and the C Standard doesn't allow it here anyway.
15137
c378da0b
PE
15138 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15139 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15140
288b08c7
PE
15141 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15142 bytes.
15143
e3601888
PE
15144 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15145
db6c0e74
PE
15146 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15147
dd5963ea
PE
15148 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15149
88c9450f
PE
15150 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15151
2f9442b8
PE
15152 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15153
c032b5f8
PE
15154 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15155 * charset.c (Fdefine_charset_internal): Don't initialize
15156 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 15157 32-bit int (Bug#8600).
a108c10b
PE
15158
15159 * lread.c (read_integer): Be more consistent with string-to-number.
15160 Use string_to_number to do the actual conversion; this avoids
15161 rounding errors and fixes some other screwups. Without this fix,
15162 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15163 (digit_to_number): Move earlier, for benefit of read_integer.
15164 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 15165 not a digit in any supported base. (Bug#8602)
a108c10b 15166
ad5f9eea
PE
15167 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15168
aec1708a
PE
15169 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15170 to match comment at start of function. This also removes a
15171 GCC warning about overflow in a 32+64-bit port.
15172
47be4ab5
PE
15173 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15174
371cac43
PE
15175 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15176 Reported by Stefan Monnier in
15177 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
15178 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15179 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 15180
d01a7826
PE
15181 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15182 (EMACS_UINTPTR): Likewise, with uintptr_t.
15183
7fd47d5c
PE
15184 * lisp.h: Prefer 64-bit EMACS_INT if available.
15185 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15186 on 32-bit hosts that have 64-bit int, so that they can access
15187 large files.
122b0c86
PE
15188 However, temporarily disable this change unless the temporary
15189 symbol WIDE_EMACS_INT is defined.
7fd47d5c 15190
8727937b
PE
15191 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15192
8ac068ac
PE
15193 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15194 This removes an assumption that EMACS_INT and long are the same
15195 width as pointers. The assumption is true for Emacs porting targets
15196 now, but we want to make other targets possible.
15197 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15198 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15199 In the rest of the code, change types of integers that hold casted
15200 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15201 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15202 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15203 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15204 No need to cast type when ORing.
15205 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15206 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15207 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15208 assume EMACS_INT is the same width as char *.
15209 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15210 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15211 Remove no-longer-needed casts.
15212 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15213 (xg_tool_bar_help_callback, xg_make_tool_item):
15214 Use EMACS_INTPTR to hold an integer
15215 that will be cast to void *; this can avoid a GCC warning
15216 if EMACS_INT is not the same width as void *.
15217 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15218 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15219 (current_message_1, set_message_1):
15220 Use a local to convert to proper width without a cast.
15221 * xmenu.c (dialog_selection_callback): Likewise.
15222
ede49d71
PE
15223 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15224 Also, don't assume VALBITS / RAND_BITS is less than 5,
15225 and don't rely on undefined behavior when shifting a 1 left into
15226 the sign bit.
15227 * lisp.h (get_random): Change signature to match.
15228
2f30ecd0
PE
15229 * lread.c (hash_string): Use size_t, not int, for hash computation.
15230 Normally we prefer signed values; but hashing is special, because
15231 it's better to use unsigned division on hash table sizes so that
15232 the remainder is nonnegative. Also, size_t is the natural width
15233 for hashing into memory. The previous code used 'int', which doesn't
15234 retain enough info to hash well into very large tables.
15235 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15236
2a866e7b
PE
15237 * dbusbind.c: Don't possibly lose pointer info when converting.
15238 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15239 Use XPNTR rather than XHASH, so that the high-order bits of
15240 the pointer aren't lost when converting through void *.
15241
51639eac
PE
15242 * eval.c (Fautoload): Don't double-shift a pointer.
15243
92394119
PE
15244 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15245
dbdb9a7c
JB
152462011-05-06 Juanma Barranquero <lekktu@gmail.com>
15247
15248 * gnutls.c (DEF_GNUTLS_FN):
15249 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15250
db7a0b4f
AS
152512011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15252
15253 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15254 marker. (Bug#8610)
15255
cd394be1 152562011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
15257
15258 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15259 New version that can reserve upto 2GB of heap space.
15260
f7ff1b0f 152612011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
15262
15263 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15264
639c109b
TZ
152652011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15266
15267 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15268 `gnutls_certificate_set_x509_key_file'.
15269
d2127135
JB
152702011-05-05 Juanma Barranquero <lekktu@gmail.com>
15271
15272 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15273 Update dependencies.
15274
e968f4f3
JB
152752011-05-04 Juanma Barranquero <lekktu@gmail.com>
15276
15277 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15278 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15279 Remove unused parameter `fildes'.
15280 * process.c (read_process_output, send_process): Don't pass it.
15281
84d358f0
JB
152822011-05-04 Juanma Barranquero <lekktu@gmail.com>
15283
15284 Fix previous change: the library cache is defined in w32.c.
15285 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15286 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15287
0898ca10
JB
152882011-05-04 Juanma Barranquero <lekktu@gmail.com>
15289
15290 Implement dynamic loading of GnuTLS on Windows.
15291
15292 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15293 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15294 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15295 Declare.
15296
15297 * gnutls.c (Qgnutls_dll): Define.
15298 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15299 (gnutls_*): Declare function pointers.
15300 (init_gnutls_functions): New function to initialize function pointers.
15301 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15302 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15303 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15304 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15305 (emacs_gnutls_write, emacs_gnutls_read)
15306 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15307 (Fgnutls_available_p): New function.
15308 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15309 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15310 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15311
15312 * image.c: Include w32.h.
15313 (Vimage_type_cache): Delete.
15314 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15315 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15316 (w32_delayed_load): Move to w32.c.
15317
15318 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15319
15320 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15321 (w32_delayed_load): Move from image.c. When loading a library, record
15322 its filename in the :loaded-from property of the library id.
15323 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15324 Initialize and staticpro them.
15325 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15326
15327 * process.c: Include lisp.h before w32.h, not after.
15328 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15329 instead of gnutls_record_check_pending.
15330
15331 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15332
ff4de4aa
TZ
153332011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15334
15335 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15336 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15337 as passed in.
15338
abe95abb
JD
153392011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15340
15341 * xterm.c (x_set_frame_alpha): Do not set property on anything
15342 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15343
e16e55d4
JB
153442011-05-02 Juanma Barranquero <lekktu@gmail.com>
15345
15346 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15347
bafcf6a5
JB
153482011-05-02 Juanma Barranquero <lekktu@gmail.com>
15349
15350 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15351 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15352 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15353 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15354 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15355 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15356 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15357 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15358 (Qgnutls_bootprop_callbacks_verify): Make static.
15359
e7a6747f
AS
153602011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15361
19ed11ba
AS
15362 * callproc.c: Indentation fixup.
15363
e7a6747f 15364 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
15365 (wait_for_termination, interruptible_wait_for_termination):
15366 Move after wait_for_termination_1.
e7a6747f 15367
1ef14cb4
LMI
153682011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15369
15370 * sysdep.c (interruptible_wait_for_termination): New function
15371 which is like wait_for_termination, but allows keyboard
15372 interruptions.
15373
15374 * callproc.c (Fcall_process): Add (:file "file") as an option for
15375 the STDOUT buffer.
15376 (Fcall_process_region): Ditto.
15377
330d880c
EZ
153782011-04-30 Eli Zaretskii <eliz@gnu.org>
15379
8db90b73
EZ
15380 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15381 rather than `XVECTOR (FOO)->size'.
15382
330d880c
EZ
15383 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15384 inttypes.h, as a gnulib replacement is used if it not available in
15385 system headers.
15386
15cbd324
EZ
153872011-04-21 Eli Zaretskii <eliz@gnu.org>
15388
15389 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15390 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15391 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15392
15393 * coding.c (coding_alloc_by_realloc): Error out if destination
15394 will grow beyond MOST_POSITIVE_FIXNUM.
15395 (decode_coding_emacs_mule): Abort if there isn't enough place in
15396 charbuf for the composition carryover bytes. Reserve an extra
15397 space for up to 2 characters produced in a loop.
15398 (decode_coding_iso_2022): Abort if there isn't enough place in
15399 charbuf for the composition carryover bytes.
15400
154012011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 15402
ae940cca
EZ
15403 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15404 aborting when %lld or %lll format is passed.
15405 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15406 %llo or %llx format is passed. (Bug#8545)
15407
03ab8921
EZ
15408 * window.c (window_scroll_line_based): Use a marker instead of
15409 simple variables to record original value of point. (Bug#7952)
15410
afda1437
EZ
15411 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15412 produced by %s or %c overflows available buffer space. (Bug#8545)
15413
f76dee0c
PE
154142011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15415
15416 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 15417 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 15418
fdc5744d
JB
154192011-04-28 Juanma Barranquero <lekktu@gmail.com>
15420
15421 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15422
638f053a
JB
154232011-04-28 Juanma Barranquero <lekktu@gmail.com>
15424
15425 * keyboard.c (Qdelayed_warnings_hook): Define.
15426 (command_loop_1): Run `delayed-warnings-hook'
15427 if Vdelayed_warnings_list is non-nil.
15428 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15429 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15430
d178f871
EZ
154312011-04-28 Eli Zaretskii <eliz@gnu.org>
15432
15433 * doprnt.c (doprnt): Don't return value smaller than the buffer
15434 size if the message was truncated. (Bug#8545).
15435
b124fd93
JB
154362011-04-28 Juanma Barranquero <lekktu@gmail.com>
15437
15438 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15439 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15440
e810457d
PE
154412011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15442
15443 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15444
ea51cceb
JB
154452011-04-27 Juanma Barranquero <lekktu@gmail.com>
15446
15447 * makefile.w32-in: Update dependencies.
15448
94dcfacf
EZ
154492011-04-27 Eli Zaretskii <eliz@gnu.org>
15450
15451 Improve `doprnt' and its usage. (Bug#8545)
15452 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15453 `format_end'. Remove support for %l as a conversion specifier.
15454 Don't use xrealloc. Improve diagnostics when the %l size modifier
15455 is used. Update the commentary.
15456
15457 * eval.c (verror): Simplify calculation of size_t.
15458
15459 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15460 messages.
15461
f61f41d7
PE
154622011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15463
15464 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15465 change.
15466
96fb4434
PE
154672011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15468
15469 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15470 This makes this file independent of the recent pseudovector change.
15471
671875da 154722011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 15473
69e9b5a3
PE
15474 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15475
b5f869a7 15476 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 15477 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 15478 Remove unused local.
c8926152 15479 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 15480
841a1577 15481 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
15482 GCC 4.6.0 optimizes based on type-based alias analysis.
15483 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
15484 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15485 != &v->size, and therefore "v->size = 1; b->size = 2; return
15486 v->size;" must therefore return 1. This assumption is incorrect
15487 for Emacs, since it type-puns struct Lisp_Vector * with many other
15488 types. To fix this problem, this patch adds a new type struct
f904488f 15489 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
15490 and pseudovectors, and helps optimizing compilers not get fooled
15491 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15492 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
15493 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15494 the size member.
eab3844f
PE
15495 (XSETPVECTYPE): Rewrite in terms of new macro.
15496 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15497 This is a bit clearer, and further avoids the possibility of
15498 undesirable aliasing.
15499 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 15500 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
15501 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15502 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
15503 (ASIZE): Now uses header.size rather than size.
15504 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
15505 to avoid the hassle of writing XVECTOR (foo)->header.size.
15506 (struct vectorlike_header): New type.
eab3844f
PE
15507 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15508 object, to help avoid aliasing.
15509 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15510 (SUBRP): Likewise, since Lisp_Subr is a special case.
15511 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15512 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15513 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 15514 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
15515 changed to be "header.size" and "header.next".
15516 * buffer.h (struct buffer): Likewise.
15517 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15518 * frame.h (struct frame): Likewise.
15519 * process.h (struct Lisp_Process): Likewise.
15520 * termhooks.h (struct terminal): Likewise.
15521 * window.c (struct save_window_data, struct saved_window): Likewise.
15522 * window.h (struct window): Likewise.
15523 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15524 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15525 * buffer.c (init_buffer_once): Likewise.
15526 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15527 special case.
15528 * process.c (Fformat_network_address): Use local var for size,
15529 for brevity.
15530
0df1eac5
PE
15531 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15532
847ab9d1 15533 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
15534 * data.c (atof): Remove decl; no longer used or needed.
15535 (digit_to_number): Move to lread.c.
15536 (Fstring_to_number): Use new string_to_number function, to be
15537 consistent with how the Lisp reader treats infinities and NaNs.
15538 Do not assume that floating-point numbers represent EMACS_INT
15539 without losing information; this is not true on most 64-bit hosts.
15540 Avoid double-rounding errors, by insisting on integers when
15541 parsing non-base-10 numbers, as the documentation specifies.
15542 * lisp.h (string_to_number): New decl, replacing ...
15543 (isfloat_string): Remove.
bc0a5c13 15544 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 15545 (read1): Do not accept +. and -. as integers; this
452f4150
PE
15546 appears to have been a coding error. Similarly, do not accept
15547 strings like +-1e0 as floating point numbers. Do not report
15548 overflow for integer overflows unless the base is not 10 which
15549 means we have no simple and reliable way to continue.
15550 Break out the floating-point parsing into a new
15551 function string_to_number, so that Fstring_to_number parses
15552 floating point numbers consistently with the Lisp reader.
04f2d78b 15553 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
15554 (E_CHAR, EXP_INT): Remove, replacing with ...
15555 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15556 (string_to_number): New function, replacing isfloat_string.
15557 This function checks for valid syntax and produces the resulting
15558 Lisp float number too. Rework it so that string-to-number
bc0a5c13 15559 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
15560 so that overflow for non-base-10 numbers is reported only when
15561 there's no portable and simple way to convert to floating point.
452f4150 15562
67769ffc
PE
15563 * textprop.c (set_text_properties_1): Rewrite for clarity,
15564 and to avoid GCC warning about integer overflow.
15565
c20db43f
PE
15566 * intervals.h (struct interval): Use EMACS_INT for members
15567 where EMACS_UINT might cause problems. See
15568 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15569 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15570 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15571 All uses changed.
37aa2f85
PE
15572 (offset_intervals): Tell GCC not to worry about length overflow
15573 when negating a negative length.
c20db43f 15574
2538aa2f
PE
15575 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15576 (overrun_check_free): Likewise.
15577
f2d3008d
PE
15578 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15579 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15580 word size.
15581
ec8df744
PE
15582 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15583 (gnutls_make_error): Rename local to avoid shadowing.
15584 (gnutls_emacs_global_deinit): ifdef out; not used.
15585 (Fgnutls_boot): Use const for pointer to readonly storage.
15586 Comment out unused local. Fix pointer signedness problems.
15587
640ee02d
PE
15588 * lread.c (openp): Don't stuff size_t into an 'int'.
15589 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15590 about possible signed overflow.
15591
6048fb2a
PE
15592 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15593 (GDK_KEY_g): Don't define if already defined.
15594 (xg_prepare_tooltip): Avoid pointer signedness problem.
15595 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15596
fa3c87e1
PE
15597 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15598 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15599
2172544b
PE
15600 * xfns.c (Fx_window_property): Simplify a bit,
15601 to make a bit faster and to avoid GCC 4.6.0 warning.
15602 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15603
9b821a21
PE
15604 * fns.c (internal_equal): Don't assume size_t fits in int.
15605
3c616cfa
PE
15606 * alloc.c (compact_small_strings): Tighten assertion a little.
15607
c2982e87
PE
15608 Replace pEd with more-general pI, and fix some printf arg casts.
15609 * lisp.h (pI): New macro, generalizing old pEd macro to other
15610 conversion specifiers. For example, use "...%"pI"d..." rather
15611 than "...%"pEd"...".
15612 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 15613 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
15614 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15615 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15616 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15617 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15618 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15619 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15620 64-bit hosts.
15621 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15622 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15623 * print.c (safe_debug_print, print_object): Likewise.
15624 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15625 to int.
6f04d126
PE
15626 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15627 avoiding the 0 flag, which is not portable.
c2982e87
PE
15628 * process.c (Fmake_network_process): Use pI to avoid cast.
15629 * region-cache.c (pp_cache): Likewise.
15630 * xdisp.c (decode_mode_spec): Likewise.
15631 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15632 behavior on 64-bit hosts with printf arg.
6f04d126 15633 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
15634 (x_stop_queuing_selection_requests): Likewise.
15635 (x_get_window_property): Don't truncate byte count to an 'int'
15636 when tracing.
0b432f21 15637
5e073ec7
PE
15638 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15639 here, since it parses constructs like leading '-' and spaces,
15640 which are not wanted; and it overflows with large numbers.
15641 Instead, simply match F[0-9]+, which is what is wanted anyway.
15642
36372bf9
PE
15643 * alloc.c: Remove unportable assumptions about struct layout.
15644 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15645 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15646 (allocate_vectorlike, make_pure_vector): Use the new macros,
15647 plus offsetof, to remove unportable assumptions about struct layout.
15648 These assumptions hold on all porting targets that I know of, but
15649 they are not guaranteed, they're easy to remove, and removing them
15650 makes further changes easier.
15651
0b432f21
PE
15652 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15653 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
15654 (string_overrun_cookie): Now const. Use initializers that
15655 don't formally overflow signed char, to avoid warnings.
000098c1
PE
15656 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15657 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
15658 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15659 multiple of sizeof (EMACS_INT); it need not be, if
15660 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 15661 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 15662
895009e1
JB
156632011-04-26 Juanma Barranquero <lekktu@gmail.com>
15664
15665 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15666
6a7a1b0b
TZ
156672011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15668
15669 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 15670 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
15671 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15672
841a1577 156732011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
15674
15675 * lisp.h (Qdebug): List symbol.
895009e1 15676 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
15677 * keyboard.c (debug-on-event): New variable.
15678 (handle_user_signal): Break into debugger when debug-on-event
15679 matches the current signal symbol.
15680
f2d3ba6f
DN
156812011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15682
15683 * alloc.c (check_sblock, check_string_bytes)
15684 (check_string_free_list): Convert to standard C.
15685
42ce4c63
TZ
156862011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15687
15688 * w32.c (emacs_gnutls_push): Fix typo.
15689
825cd63c
EZ
156902011-04-25 Eli Zaretskii <eliz@gnu.org>
15691
fb11d64d
EZ
15692 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15693 "cast to pointer from integer of different size".
15694
825cd63c
EZ
15695 Improve doprnt and its use in verror. (Bug#8545)
15696 * doprnt.c (doprnt): Document the set of format control sequences
15697 supported by the function. Use SAFE_ALLOCA instead of always
15698 using `alloca'.
15699
15700 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15701 is one byte too soon. Don't use xrealloc; instead xfree and
15702 xmalloc anew.
15703
e061a11b
TZ
157042011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15705
15706 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15707 callbacks stage.
15708
15709 * gnutls.c: Renamed global_initialized to
15710 gnutls_global_initialized. Added internals for the
15711 :verify-hostname-error, :verify-error, and :verify-flags
15712 parameters of `gnutls-boot' and documented those parameters in the
15713 docstring. Start callback support.
9173deec
JB
15714 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15715 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15716 on error. Return error code.
e061a11b
TZ
15717 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15718 (emacs_gnutls_read): Likewise.
15719 (Fgnutls_boot): Return handshake error code.
15720 (emacs_gnutls_handle_error): New function.
15721 (wsaerror_to_errno): Likewise.
15722
15723 * w32.h (emacs_gnutls_pull): Add prototype.
15724 (emacs_gnutls_push): Likewise.
15725
15726 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15727 (emacs_gnutls_push): Likewise.
15728
157292011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15730
15731 * process.c (wait_reading_process_output): Check if GnuTLS
15732 buffered some data internally if no FDs are set for TLS
15733 connections.
15734
15735 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15736 (LIBS): Link to USER_LIBS.
15737 ($(BLD)/gnutls.$(0)): New target.
15738
fa6996bc
EZ
157392011-04-24 Eli Zaretskii <eliz@gnu.org>
15740
eb35682e
EZ
15741 * xdisp.c (handle_single_display_spec): Rename the
15742 display_replaced_before_p argument into display_replaced_p, to
15743 make it consistent with the commentary. Fix typos in the
15744 commentary.
15745
e2ad650c
EZ
15746 * textprop.c (syms_of_textprop): Remove dead code.
15747 (copy_text_properties): Delete obsolete commentary about an
15748 interface that was deleted long ago. Fix typos in the description
15749 of arguments.
15750
1b2de274
EZ
15751 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15752 to changes in oldXMenu/XMenu.h from 2011-04-16.
15753 <menu_help_message, prev_menu_help_message>: Constify.
15754 (IT_menu_make_room): menu->help_text is now `const char **';
15755 adjust.
15756
15757 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15758 to changes in oldXMenu/XMenu.h from 2011-04-16.
15759 (struct XMenu): Declare `help_text' `const char **'.
15760
15761 * xfaces.c <Qunspecified>: Make extern again.
15762
15763 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 15764 required by POSIX.
1b2de274 15765
762b15be
EZ
15766 * doc.c (get_doc_string): Improve the format passed to `error'.
15767
15768 * doprnt.c (doprnt): Improve commentary.
15769
15770 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15771
15772 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15773 them with etags.
15774
f1052e5d
EZ
15775 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15776 changes in globals.h immediately force recompilation.
762b15be
EZ
15777 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15778 $(CURDIR)/s/ms-w32.h.
15779 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 15780
fa6996bc
EZ
15781 * character.c (Fchar_direction): Function deleted.
15782 (syms_of_character): Don't defsubr it.
15783 <char-direction-table>: Deleted.
15784
e6c3da20
EZ
157852011-04-23 Eli Zaretskii <eliz@gnu.org>
15786
15787 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15788 * doprnt.c: Include limits.h.
15789 (SIZE_MAX): New macro.
04f2d78b
CB
15790 (doprnt): Return a size_t value. 2nd arg is now size_t.
15791 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
15792 Improve overflow protection. Support `l' modifier for integer
15793 conversions. Support %l conversion. Don't assume an EMACS_INT
15794 argument for integer conversions and for %c.
15795
15796 * lisp.h (doprnt): Restore prototype.
15797
15798 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15799 $(SRC)/character.h.
15800
15801 * Makefile.in (base_obj): Add back doprnt.o.
15802
15803 * deps.mk (doprnt.o): Add back prerequisites.
15804 (callint.o): Depend on character.h.
15805
15806 * eval.c (internal_lisp_condition_case): Include the handler
15807 representation in the error message.
15808 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15809 when breaking from the loop.
15810
15811 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15812
15813 * callint.c (Fcall_interactively): When displaying error message
15814 about invalid control letter, pass the character's codepoint, not
15815 a pointer to its multibyte form. Improve display of the character
15816 in octal and display also its hex code.
15817
15818 * character.c (char_string): Use %x to display the (unsigned)
15819 codepoint of an invalid character, to avoid displaying a bogus
15820 negative value.
15821
15822 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15823 `error', not SYMBOL_NAME itself.
15824
15825 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15826 character arguments to `error'.
15827
15828 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15829 to `error' in error message about FINAL_CHAR argument. Make sure
15830 FINAL_CHAR is a character, and use %c when it is passed as
15831 argument to `error'.
15832
4ffd0d6b 158332011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
15834
15835 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15836
15837 * w32.c: Include <time.h>.
15838 (sys_localtime): New function.
15839
4ffd0d6b 158402011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
15841
15842 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15843
4ffd0d6b 15844 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 15845
4ffd0d6b 158462011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 15847
4ffd0d6b
GM
15848 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15849 zombies (Bug#8467).
aac0c6e3 15850
04c56954
EZ
158512011-04-19 Eli Zaretskii <eliz@gnu.org>
15852
15853 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15854 gl_state.e_property when gl_state.object is Qt.
15855
15856 * insdel.c (make_gap_larger): Remove limitation of buffer size
15857 to <= INT_MAX.
15858
16a43933
CY
158592011-04-18 Chong Yidong <cyd@stupidchicken.com>
15860
15861 * xdisp.c (lookup_glyphless_char_display)
15862 (produce_glyphless_glyph): Handle cons cell entry in
15863 glyphless-char-display.
15864 (Vglyphless_char_display): Document it.
15865
15866 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15867 glyphless-char-display.
15868
4581706e
CY
158692011-04-17 Chong Yidong <cyd@stupidchicken.com>
15870
15871 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15872
15873 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15874
15875 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15876 definition for no-X builds.
15877
4887c6e2 158782011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 15879
fd35b6f9
PE
15880 Static checks with GCC 4.6.0 and non-default toolkits.
15881
5c1ccb01
PE
15882 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15883
006c5daa
PE
15884 * process.c (keyboard_bit_set): Define only if SIGIO.
15885 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15886 (send_process): Repair possible setjmp clobbering.
15887
efc736d3
PE
15888 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15889
4e2fe2e6
PE
15890 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15891
f97334a2
PE
15892 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15893
4e75f29d
PE
15894 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15895 Define only if needed.
15896
90efadd1
PE
15897 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15898 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 15899 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 15900
3c647824
PE
15901 * dispextern.h (struct redisplay_interface): Rename param
15902 to avoid shadowing.
e264f262 15903 * termhooks.h (struct terminal): Likewise.
761383f4 15904 * xterm.c (xembed_send_message): Likewise.
3c647824 15905
b58c5c4a
PE
15906 * insdel.c (make_gap_smaller): Define only if
15907 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15908
cad59032
PE
15909 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15910 it.
15911
c339dc2e
PE
15912 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15913 so that we aren't warned about unused symbols.
15914
91a3e27b
PE
15915 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15916
399c71d3 15917 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 15918
8ffc96f5
PE
15919 * xfns.c (x_real_positions): Mark locals as initialized.
15920
eef9bc79
PE
15921 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15922
098db9dd
PE
15923 * xterm.c: Fix problems found by static analysis with other toolkits.
15924 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
15925 (x_dispatch_event): Declare static if USE_GTK, and
15926 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 15927 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 15928 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
15929 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15930 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 15931
eb18f6cc
PE
15932 * xmenu.c (menu_help_callback): Pointer type fixes.
15933 Use const pointers when pointing at readonly data. Avoid pointer
15934 signedness clashes.
15935 (FALSE): Remove unused macro.
15936 (update_frame_menubar): Remove unused decl.
15937
1fe72bf8
PE
15938 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15939
60d9e1db
PE
15940 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15941 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15942 (single_menu_item): Rename local to avoid shadowing.
15943
39261c26
PE
15944 * keyboard.c (make_lispy_event): Remove unused local var.
15945
018c5e19
PE
15946 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15947 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15948
63d2b86e
PE
15949 * bitmaps: Change bitmaps from unsigned char back to the X11
15950 compatible char. Avoid the old compiler warnings about
15951 out-of-range initializers by using, for example, '\xab' rather
15952 than 0xab.
15953
aefd87e1
PE
15954 * xgselect.c (xgselect_initialize): Check vs interface
15955 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15956
bf501fb9
PE
15957 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15958
e9829fdf
PE
15959 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15960 to read-only memory.
15961
1086c095
PE
15962 * fns.c (vector): Remove; this old hack is no longer needed.
15963
2baccd04 15964 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 15965 Remove unused var.
dde42981 15966 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 15967
72391843 15968 * xrdb.c (x_load_resources): Omit unused local.
3565b346 15969
436c16df 15970 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 15971 (x_window): Rename locals to avoid shadowing.
dc5ddd85 15972 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 15973
92bb796d 15974 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 15975 (x_term_init): Remove local to avoid shadowing.
92bb796d 15976
764430a3 15977 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
15978
15979 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15980 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15981
d1dfb56c
EZ
159822011-04-16 Eli Zaretskii <eliz@gnu.org>
15983
c4354cb4
EZ
15984 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15985
d1dfb56c
EZ
15986 Fix regex.c, syntax.c and friends for buffers > 2GB.
15987 * syntax.h (struct gl_state_s): Declare character position members
15988 EMACS_INT.
15989
15990 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15991
04f2d78b
CB
15992 * textprop.c (verify_interval_modification, interval_of):
15993 Declare arguments EMACS_INT.
d1dfb56c
EZ
15994
15995 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15996 EMACS_INT.
15997
15998 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15999
16000 * indent.c (Fvertical_motion): Local variable it_start is now
16001 EMACS_INT.
16002
16003 * regex.c (re_match, re_match_2, re_match_2_internal)
16004 (bcmp_translate, regcomp, regexec, print_double_string)
16005 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16006 (re_compile_pattern, re_exec): Declare arguments and local
16007 variables `size_t' and `ssize_t' and return values `regoff_t', as
16008 appropriate.
16009 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16010 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16011 <compile_stack_type>: `size' and `avail' are now `size_t'.
16012
16013 * regex.h <regoff_t>: Use ssize_t, not int.
16014 (re_search, re_search_2, re_match, re_match_2): Arguments that
16015 specify buffer/string position and length are now ssize_t and
16016 size_t. Return type is regoff_t.
16017
613052cd
BK
160182011-04-16 Ben Key <bkey76@gmail.com>
16019
16020 * nsfont.m: Fixed bugs in ns_get_family and
16021 ns_descriptor_to_entity that were caused by using free to
16022 deallocate memory blocks that were allocated by xmalloc (via
16023 xstrdup). This caused Emacs to crash when compiled with
16024 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16025 --enable-checking=xmallocoverrun). xfree is now used to
16026 deallocate these memory blocks.
16027
4170f62f 160282011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 16029
71b41406
PE
16030 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16031
9587a89d
PE
16032 emacs_write: Accept and return EMACS_INT for sizes.
16033 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16034 et seq.
16035 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16036 Accept and return EMACS_INT.
16037 (emacs_gnutls_write): Return the number of bytes written on
16038 partial writes.
16039 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
16040 (emacs_read, emacs_write): Remove check for negative size, as the
16041 Emacs source code has been audited now.
9587a89d
PE
16042 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16043 (emacs_read, emacs_write): Use it.
273a5f82
PE
16044 * process.c (send_process): Adjust to the new signatures of
16045 emacs_write and emacs_gnutls_write. Do not attempt to store
16046 a byte offset into an 'int'; it might overflow.
9587a89d 16047 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 16048
3e047f51
PE
16049 * sound.c: Don't assume sizes fit in 'int'.
16050 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 16051 Return EMACS_INT, not int.
3e047f51 16052 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
16053 Accept EMACS_INT, not int.
16054 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
16055 record read return values.
16056
cc39a9db
BK
160572011-04-15 Ben Key <bkey76@gmail.com>
16058
c9d0ec6d
JB
16059 * keyboard.c (Qundefined): Don't declare static since it is used
16060 in nsfns.m.
16061 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16062 static since they are used in nsfont.m.
cc39a9db 16063
6c60eb9f
SM
160642011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16065
16066 * process.c (Qprocessp): Don't declare static.
16067 * lisp.h (Qprocessp): Declare again.
16068
7990b61a
JB
160692011-04-15 Juanma Barranquero <lekktu@gmail.com>
16070
16071 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16072
5d4cb038
PE
160732011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16074
8bd7b830 16075 Improve C-level modularity by making more things 'static'.
cd64ea1d 16076
e3b27b31
PE
16077 Don't publish debugger-only interfaces to other modules.
16078 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16079 (verify_bytepos, count_markers): Move decls to the only modules
16080 that need them.
16081 * region-cache.h (pp_cache): Likewise.
16082 * window.h (check_all_windows): Likewise.
16083 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16084
5d4cb038
PE
16085 * sysdep.c (croak): Now static, if
16086 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16087 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
16088
16089 * alloc.c (refill_memory_reserve): Now static if
16090 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16091 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 16092
e87b6180
PE
16093 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16094 Define only if USE_LUCID.
16095
ac64929e
PE
16096 * xrdb.c (x_customization_string, x_rm_string): Now static.
16097
6f37259d
PE
16098 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16099 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16100
1683e3ab
PE
16101 * xdisp.c (draw_row_with_mouse_face): Now static.
16102 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16103
de9c2632
PE
16104 * window.h (check_all_windows): Mark externally visible.
16105
2b96acb7
PE
16106 * window.c (window_deletion_count): Now static.
16107
16108 * undo.c: Make symbols static if they're not exported.
16109 (last_undo_buffer, last_boundary_position, pending_boundary):
16110 Now static.
16111
50436f33
PE
16112 * textprop.c (interval_insert_behind_hooks): Now static.
16113 (interval_insert_in_front_hooks): Likewise.
16114
64520e5c
PE
16115 * term.c: Make symbols static if they're not exported.
16116 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16117 (max_frame_lines, tty_set_terminal_modes):
16118 (tty_reset_terminal_modes, tty_turn_off_highlight):
16119 (get_tty_terminal): Now static.
16120 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16121 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 16122 HAVE_WINDOW_SYSTEM.
64520e5c
PE
16123 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16124 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16125
1fa53021
PE
16126 * sysdep.c: Make symbols static if they're not exported.
16127 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16128 Now static.
16129 (sigprocmask_set, full_mask): Remove; unused.
16130 (wait_debugging): Mark as visible.
16131 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16132 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16133
d4b43b22
PE
16134 * syntax.c (syntax_temp): Define only if !__GNUC__.
16135
b7c513d0
PE
16136 * sound.c (current_sound_device, current_sound): Now static.
16137
989b29ad
PE
16138 * search.c (searchbufs, searchbuf_head): Now static.
16139
13a55a78
PE
16140 * scroll.c (scroll_cost): Remove; unused.
16141 * dispextern.h (scroll_cost): Remove decl.
16142
de68a1fc
PE
16143 * region-cache.h (pp_cache): Mark as externally visible.
16144
40ccffa6
PE
16145 * process.c: Make symbols static if they're not exported.
16146 (process_tick, update_tick, create_process, chan_process):
16147 (Vprocess_alist, proc_buffered_char, datagram_access):
16148 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16149 (deactivate_process): Mark defn as static, as well as decl.
16150 * lisp.h (create_process): Remove decl.
16151 * process.h (chan_process, Vprocess_alist): Remove decls.
16152
ad64fc97
PE
16153 * print.c: Make symbols static if they're not exported.
16154 (print_depth, new_backquote_output, being_printed, print_buffer):
16155 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16156 (print_interval, print_number_index, initial_stderr_stream):
16157 Now static.
16158 * lisp.h (Fprinc): Remove decl.
16159 (debug_output_compilation_hack): Mark as externally visible.
16160
adddb265
PE
16161 * sysdep.c (croak): Move decl from here to syssignal.h.
16162 * syssignal.h (croak): Put it here, so the API can be checked when
16163 'croak' is called from dissociate_if_controlling_tty.
16164
1717ede2
PE
16165 * minibuf.c: Make symbols static if they're not exported.
16166 (minibuf_save_list, choose_minibuf_frame): Now static.
16167 * lisp.h (choose_minibuf_frame): Remove decl.
16168
fa5fb2bc
PE
16169 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16170
1e3890d1
PE
16171 * lread.c: Make symbols static if they're not exported.
16172 (read_objects, initial_obarray, oblookup_last_bucket_number):
16173 Now static.
16174 (make_symbol): Remove; unused.
16175 * lisp.h (initial_obarray, make_symbol): Remove decls.
16176
8a1414fa
PE
16177 * keyboard.c: Make symbols static if they're not exported.
16178 (single_kboard, recent_keys_index, total_keys, recent_keys):
16179 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16180 (this_single_command_key_start, echoing, last_auto_save):
16181 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16182 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16183 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16184 (Vlispy_mouse_stem, double_click_count):
16185 Now static.
16186 (force_auto_save_soon): Define only if SIGDANGER.
16187 (ignore_mouse_drag_p): Now static if
16188 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16189 (print_help): Remove; unused.
16190 (stop_character, last_timer_event): Mark as externally visible.
16191 * keyboard.h (ignore_mouse_drag_p): Declare only if
16192 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16193 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16194 * lisp.h (echoing): Remove decl.
16195 (force_auto_save_soon): Declare only if SIGDANGER.
16196 * xdisp.c (redisplay_window): Simplify code, to make it more
16197 obvious that ignore_mouse_drag_p is not accessed if !defined
16198 USE_GTK && !defined HAVE_NS.
16199
93ea6e8f
PE
16200 * intervals.c: Make symbols static if they're not exported.
16201 (merge_properties_sticky, merge_interval_right, delete_interval):
16202 Now static.
16203 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16204
77382fcc
PE
16205 * insdel.c: Make symbols static if they're not exported.
16206 However, leave prepare_to_modify_buffer alone. It's never
16207 called from outside this function, but that appears to be a bug.
16208 (combine_after_change_list, combine_after_change_buffer):
4889fc82 16209 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
16210 (adjust_after_replace_noundo): Remove; unused.
16211 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 16212 (signal_before_change): Remove decls.
77382fcc 16213
9306c32e
PE
16214 * indent.c (val_compute_motion, val_vmotion): Now static.
16215
cd44d2eb
PE
16216 * image.c: Make symbols static if they're not exported.
16217 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16218 if USE_GTK.
16219 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16220 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16221
ad9a7a06
PE
16222 * fringe.c (standard_bitmaps): Now static.
16223 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16224
81626931
PE
16225 * frame.c: Make symbols static if they're not exported.
16226 (x_report_frame_params, make_terminal_frame): Now static.
16227 (get_frame_param): Now static, unless HAVE_NS.
16228 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16229 (x_get_resource_string): Remove; not used.
16230 * frame.h (make_terminal_frame, x_report_frame_params):
16231 (x_get_resource_string); Remove decls.
16232 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16233 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16234
239f9db9
PE
16235 * font.c, fontset.c: Make symbols static if they're not exported.
16236 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16237 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16238 * font.c (font_close_object): Now static.
16239 * font.h (font_close_object): Remove.
16240 * fontset.c (FONTSET_OBJLIST): Remove.
16241 (free_realized_fontset) #if-0 the body, which does nothing.
16242 (face_suitable_for_char_p): #if-0, as it's never called.
16243 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
16244 * xfaces.c (face_at_string_position):
16245 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
16246 since 0 is always ASCII.
16247
dfcf3579
PE
16248 * fns.c (weak_hash_tables): Now static.
16249
5045092b
PE
16250 * fileio.c: Make symbols static if they're not exported.
16251 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16252 (Vwrite_region_annotation_buffers): Now static.
16253
57a96f5c
PE
16254 * eval.c: Make symbols static if they're not exported.
16255 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16256 * lisp.h (backtrace_list): Remove decl.
16257
35f08c38
PE
16258 * emacs.c: Make symbols static if they're not exported.
16259 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16260 (fatal_error_code, fatal_error_signal_hook, standard_args):
16261 Now static.
16262 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16263 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16264 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16265 * lisp.h (fatal_error_signal_hook): Remove decl.
16266 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16267
f44bd759
PE
16268 * editfns.c: Move a (normally-unused) function to its only use.
16269 * editfns.c, lisp.h (get_operating_system_release): Remove.
16270 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16271 worth the hassle of breaking this out.
16272
b532497d
PE
16273 * xterm.c: Make symbols static if they're not exported.
16274 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16275 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16276 (x_destroy_window, x_delete_display):
16277 Now static.
16278 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16279 (x_mouse_leave): Remove; unused.
16280 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16281 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16282 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16283 Remove decls.
16284 (x_mouse_leave): Declare only if WINDOWSNT.
16285 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16286 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16287 USE_X_TOOLKIT.
16288
1675728f
PE
16289 * ftxfont.c: Make symbols static if they're not exported.
16290 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16291 HAVE_FREETYPE.
16292 * font.h (ftxfont_driver): Likewise.
16293
e4cebfca
PE
16294 * xfns.c: Make symbols static if they're not exported.
16295 (x_last_font_name, x_display_info_for_name):
16296 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16297 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16298 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16299 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16300 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16301 (last_show_tip_args): Now static.
16302 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16303 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16304 (x_screen_planes): Remove; unused.
16305 * dispextern.h (x_screen_planes): Remove decl.
16306
5bf46f05
PE
16307 * dispnew.c: Make symbols static if they're not exported.
16308 * dispextern.h (redraw_garbaged_frames, scrolling):
16309 (increment_row_positions): Remove.
16310 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16311 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16312 Now static.
16313 (redraw_garbaged_frames): Remove; unused.
16314
435f4c28
PE
16315 * xfaces.c: Make symbols static if they're not exported.
16316 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16317 Remove decls.
16318 * xterm.h (defined_color): Remove decls.
16319 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16320 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16321 (menu_face_changed_default, defined_color, free_realized_face):
16322 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16323 (ascii_face_of_lisp_face): Remove; unused.
16324
8524aef3
PE
16325 * xdisp.c: Make symbols static if they're not exported.
16326 * dispextern.h (scratch_glyph_row, window_box_edges):
16327 (glyph_to_pixel_coords, set_cursor_from_row):
16328 (get_next_display_element, set_iterator_to_next):
16329 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16330 (show_mouse_face): Remove decls
16331 * frame.h (message_buf_print): Likewise.
16332 * lisp.h (pop_message, set_message, check_point_in_composition):
16333 Likewise.
16334 * xterm.h (set_vertical_scroll_bar): Likewise.
16335 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16336 (message_buf_print, scratch_glyph_row, displayed_buffer):
16337 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16338 (get_next_display_element, show_mouse_face, window_box_edges):
16339 (frame_to_window_pixel_xy, check_point_in_composition):
16340 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16341 (glyph_to_pixel_coords): Remove; unused.
16342
16390cd2
PE
16343 * dired.c (file_name_completion): Now static.
16344
16345 * dbusbind.c (xd_in_read_queued_messages): Now static.
16346
a25f4dfa
PE
16347 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16348 * data.c (circular_list_error): Remove.
16349
14a9c8df
PE
16350 * commands.h (last_point_position, last_point_position_buffer):
16351 (last_point_position_window): Remove decls.
16352 * keyboard.c: Make these variables static.
16353
04f2d78b
CB
16354 * coding.h (coding, code_convert_region, encode_coding_gap):
16355 Remove decls.
74ab6df5
PE
16356 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16357 (iso_code_class, detect_coding, code_convert_region): Now static.
16358 (encode_coding_gap): Remove; unused.
16359
38dfbee1
PE
16360 * chartab.c (chartab_chars, chartab_bits): Now static.
16361
a2cb4e63
PE
16362 * charset.h (charset_iso_8859_1): Remove decl.
16363 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16364 Now static.
16365
127198fd
PE
16366 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16367 * ccl.c (Vccl_program_table): Now static.
16368 (check_ccl_update): Remove; unused.
16369
d85b608f
PE
16370 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16371 * category.h: ... from here.
16372 * category.c (check_category_table, set_category_set): Now static.
16373
31cd66f3
PE
16374 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16375 * lisp.h: Remove these decls.
16376
c358e587
PE
16377 * buffer.c (buffer_count): Remove unused var.
16378
e78aecca
PE
16379 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16380 so that it's not optimized away.
16381 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16382 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16383 exported only to the debugger.
16384
e192d7d3 16385 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 16386 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 16387
92470028
PE
16388 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16389 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16390 was inaccessible from Lisp.
16391 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16392 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16393
244ed907
PE
16394 alloc.c: Import and export fewer symbols, and remove unused items.
16395 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16396 is defined.
16397 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16398 it's not optimized away by whole-program optimization.
16399 (message_enable_multibyte, free_misc): Remove.
16400 (catchlist, handlerlist, mark_backtrace):
16401 Declare only if BYTE_MARK_STACK.
16402 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16403 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16404 (message_enable_multibyte): Remove decl.
16405 (free_misc, interval_free_list, float_block, float_block_index):
16406 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16407 (cons_free_list, last_marked_index):
16408 Now static.
16409 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16410 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16411 (mark_backtrace): Define only if BYTE_MARK_STACK.
16412 * xdisp.c (message_enable_multibyte): Now static.
16413
61c2b50e 16414 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
16415 This makes it easier for human readers (and static analyzers)
16416 to see whether these variables are used from other modules.
16417 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16418 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16419 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16420 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16421 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16422 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16423 * xmenu.c, xselect.c:
16424 Declare Q* vars static if they are not used in other modules.
16425 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16426 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16427 Remove decls of unexported vars.
16428 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16429
95c82688
PE
16430 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16431
16a97296
PE
16432 Make Emacs functions such as Fatom 'static' by default.
16433 This makes it easier for human readers (and static analyzers)
16434 to see whether these functions can be called from other modules.
16435 DEFUN now defines a static function. To make the function external
16436 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
16437 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16438 (Finit_image_library):
16a97296
PE
16439 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16440 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16441 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16442 Remove decls, since these functions are now static.
16443 (Funintern, Fget_internal_run_time): New decls, since these functions
16444 were already external.
95c82688 16445
16a97296
PE
16446 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16447 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16448 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16449 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16450 * keyboard.c, keymap.c, lread.c:
16451 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16452 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16453 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16454 Mark functions with DEFUE instead of DEFUN,
16455 if they are used in other modules.
16456 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16457 decls for now-static functions.
16458 * buffer.h (Fdelete_overlay): Remove decl.
16459 * callproc.c (Fgetenv_internal): Mark as internal.
16460 * composite.c (Fremove_list_of_text_properties): Remove decl.
16461 (Fcomposition_get_gstring): New forward static decl.
16462 * composite.h (Fcomposite_get_gstring): Remove decl.
16463 * dired.c (Ffile_attributes): New forward static decl.
16464 * doc.c (Fdocumntation_property): New forward static decl.
16465 * eval.c (Ffetch_bytecode): New forward static decl.
16466 (Funintern): Remove extern decl; now in .h file where it belongs.
16467 * fileio.c (Fmake_symbolic_link): New forward static decl.
16468 * image.c (Finit_image_library): New forward static decl.
16469 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16470 * intervals.h (Fprevious_property_change):
16471 (Fremove_list_of_text_properties): Remove decls.
16472 * keyboard.c (Fthis_command_keys): Remove decl.
16473 (Fcommand_execute): New forward static decl.
16474 * keymap.c (Flookup_key): New forward static decl.
16475 (Fcopy_keymap): Now static.
16476 * keymap.h (Flookup_key): Remove decl.
16477 * process.c (Fget_process): New forward static decl.
16478 (Fprocess_datagram_address): Mark as internal.
16479 * syntax.c (Fsyntax_table_p): New forward static decl.
16480 (skip_chars): Remove duplicate decl.
16481 * textprop.c (Fprevious_property_change): New forward static decl.
16482 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16483 Now internal.
16484 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16485 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16486
785bbd42
PE
16487 * editfns.c (Fformat): Remove unreachable code.
16488
8b913b57
AS
164892011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16490
16491 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16492 change. (Bug#8496)
16493
a6744a35
EZ
164942011-04-13 Eli Zaretskii <eliz@gnu.org>
16495
16496 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16497 when at ZV. (Bug#8487)
16498
e7974947
AS
164992011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16500
baad03f0
AS
16501 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16502 (Bug#8437)
16503 * keyboard.c (parse_tool_bar_item): Likewise.
16504 * sound.c (sound_cleanup, alsa_close): Likewise.
16505 * termcap.c (tgetent): Likewise.
16506 * xfns.c (x_default_font_parameter): Likewise.
16507 * xsettings.c (read_and_apply_settings): Likewise.
16508
e7974947
AS
16509 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16510 (overrun_check_free): Protoize.
16511
28272684
PE
165122011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16513
16514 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16515 since callers should never pass a negative size.
16516 Change the signature to match that of plain 'read' and 'write'; see
16517 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16518 * lisp.h: Update prototypes of emacs_write and emacs_read.
16519
11997c76
EZ
165202011-04-11 Eli Zaretskii <eliz@gnu.org>
16521
16522 * xdisp.c (redisplay_window): Don't try to determine the character
16523 position of the scroll margin if the window start point w->startp
e896f03c 16524 is outside the buffer's accessible region. (Bug#8468)
11997c76 16525
8a2cbd72
EZ
165262011-04-10 Eli Zaretskii <eliz@gnu.org>
16527
16528 Fix write-region and its subroutines for buffers > 2GB.
16529 * fileio.c (a_write, e_write): Modify declaration of arguments and
16530 local variables to support buffers larger than 2GB.
16531 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16532
16533 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16534 argument, local variables, and return value.
16535
16536 * lisp.h: Update prototypes of emacs_write and emacs_read.
16537
16538 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16539
4073e537 165402011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 16541
1ebfdcb6
PE
16542 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16543
b2ded58d
PE
16544 Fix more problems found by GCC 4.6.0's static checks.
16545
7d66342c
PE
16546 * xdisp.c (vmessage): Use a better test for character truncation.
16547
bbf47d44
PE
16548 * charset.c (load_charset_map): <, not <=, for optimization,
16549 and to avoid potential problems with integer overflow.
9248994d 16550 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 16551 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 16552 * editfns.c (Fformat): Likewise.
1e69125e 16553 * syntax.c (skip_chars): Likewise.
3befa583 16554
e3019616
PE
16555 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16556 This also lets GCC 4.6.0 generate slightly better loop code.
16557
becfa255
PE
16558 * callint.c (Fcall_interactively): <, not <=, for optimization.
16559 (Fcall_interactively): Count the number of arguments produced,
16560 not the number of arguments given. This is simpler and lets GCC
16561 4.6.0 generate slightly better code.
16562
dae0cd48
PE
16563 * ftfont.c: Distingish more carefully between FcChar8 and char.
16564 The previous code passed unsigned char * to a functions like
16565 strlen and xstrcasecmp that expect char *, which does not
16566 conform to the C standard.
16567 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16568 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16569 char * when the C standard requires it.
16570
76032d70
PE
16571 * keyboard.c (read_char): Remove unused var.
16572
eb3f1cc8
PE
16573 * eval.c: Port to Windows vsnprintf (Bug#8435).
16574 Include <limits.h>.
16575 (SIZE_MAX): Define if the headers do not.
16576 (verror): Do not give up if vsnprintf returns a negative count.
16577 Instead, grow the buffer. This ports to Windows vsnprintf, which
16578 does not conform to C99. Problem reported by Eli Zaretskii.
16579 Also, simplify the allocation scheme, by avoiding the need for
16580 calling realloc, and removing the ALLOCATED variable.
16581
70476b54
PE
16582 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16583
12020a9e
PE
16584 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16585 But keep the doprint source code for now, as we might revamp it
16586 and use it again (Bug#8435).
ea6c7ae6
PE
16587 * lisp.h (doprnt): Remove.
16588 * Makefile.in (base_obj): Remove doprnt.o.
16589 * deps.mk (doprnt.o): Remove.
16590
5fdb398c
PE
16591 error: Print 32- and 64-bit integers portably (Bug#8435).
16592 Without this change, on typical 64-bit hosts error ("...%d...", N)
16593 was used to print both 32- and 64-bit integers N, which relied on
16594 undefined behavior.
61bdb816 16595 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
16596 * lisp.h (error, verror): Mark as printf-like functions.
16597 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16598 Report overflow in size calculations when allocating printf buffer.
16599 Do not truncate output string at its first null byte.
16600 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16601 Truncate the output at a character boundary, since vsnprintf does not
16602 do that.
16603 * charset.c (check_iso_charset_parameter): Convert internal
16604 character to string before calling 'error', since %c now has the
16605 printf meaning.
16606 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16607 overflow when computing char to be passed to 'error'. Do not
16608 pass Lisp_Object to 'error'; pass the integer instead.
16609 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16610 formatted with plain %d.
16611
b189fa66
PE
16612 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16613
bff87ef0
PE
16614 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16615
7e2cac20
PE
16616 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16617
ce4d90b5
PE
16618 * xterm.c (x_catch_errors): Remove duplicate declaration.
16619
266c9547
PE
16620 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16621
79c49ad2
PE
16622 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16623
368f4090
JM
166242011-04-10 Jim Meyering <meyering@redhat.com>
16625
16626 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16627 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16628 return ssize_t not "int", and use size_t as the buffer length.
16629 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16630 * gnutls.h: Update declarations.
16631 * process.c (read_process_output): Use ssize_t, to match.
16632 (send_process): Likewise.
16633
a32d4040
CY
166342011-04-09 Chong Yidong <cyd@stupidchicken.com>
16635
16636 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16637
8546720e 166382011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 16639
04f2d78b
CB
16640 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16641 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 16642
8546720e
GM
16643 * xterm.c (handle_one_xevent):
16644 * xmenu.c (create_and_show_popup_menu):
16645 * xselect.c (x_decline_selection_request)
16646 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 16647
0a2f5c1a 166482011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
16649
16650 Fix some uses of `int' instead of EMACS_INT.
16651 * search.c (string_match_1, fast_string_match)
16652 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16653 (scan_buffer, find_next_newline_no_quit)
16654 (find_before_next_newline, search_command, Freplace_match)
16655 (Fmatch_data): Make some `int' variables be EMACS_INT.
16656
16657 * xdisp.c (display_count_lines): 3rd argument and return value now
16658 EMACS_INT. All callers changed.
16659 (pint2hrstr): Last argument is now EMACS_INT.
16660
16661 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16662 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16663 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16664 (decode_coding_utf_16, decode_coding_emacs_mule)
16665 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16666 (decode_coding_ccl, decode_coding_charset)
16667 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16668 (decode_coding_iso_2022, decode_coding_emacs_mule)
16669 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16670 <char_offset, last_offset>: Declare EMACS_INT.
16671 (encode_coding_utf_8, encode_coding_utf_16)
16672 (encode_coding_emacs_mule, encode_invocation_designation)
16673 (encode_designation_at_bol, encode_coding_iso_2022)
16674 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16675 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16676 Declare EMACS_INT.
16677 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16678 (encode_invocation_designation): Last argument P_NCHARS is now
16679 EMACS_INT.
16680 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16681 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16682
16683 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16684 All users changed.
16685
16686 * ccl.c (Fccl_execute_on_string): Declare some variables
16687 EMACS_INT.
16688
8546720e 166892011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
16690
16691 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16692
4e19a977
CS
166932011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16694
16695 * process.c (Fformat_network_address): Doc fix.
16696
87302331
R
166972011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16698
ee7683eb 16699 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 16700
cbb59342
CY
167012011-04-08 Chong Yidong <cyd@stupidchicken.com>
16702
16703 * keyboard.c (read_char): Call Lisp function help-form-show,
16704 instead of using internal_with_output_to_temp_buffer.
16705 (Qhelp_form_show): New var.
e0d38eeb 16706 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
16707
16708 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16709
16710 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16711
e67a13ab
CY
167122011-04-06 Chong Yidong <cyd@stupidchicken.com>
16713
04f2d78b
CB
16714 * process.c (Flist_processes): Remove to Lisp.
16715 (list_processes_1): Delete.
e67a13ab 16716
973f782d
EZ
167172011-04-06 Eli Zaretskii <eliz@gnu.org>
16718
7c106b1e
EZ
16719 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16720
973f782d
EZ
16721 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16722
41cf7d1a 167232011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 16724
ca23cc88
PE
16725 Fix more problems found by GCC 4.6.0's static checks.
16726
f390e2d5
PE
16727 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16728
42eea0d0
PE
16729 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16730
b69769da 16731 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 16732
f9541e84
PE
16733 * xdisp.c (vmessage): Mark as a printf-like function.
16734
13841b55
PE
16735 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16736
c136c10f
PE
16737 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16738
5e2d4a30
PE
16739 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16740 printf-like functions.
16741 (tiff_load): Add casts to remove these marks before passing them
16742 to system-supplied API.
16743
583f48b9
PE
16744 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16745
b25d760e
PE
16746 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16747 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
16748 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16749 directly, rather than having caller test rule sign. This avoids
16750 some unnecessary tests.
16751 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16752 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16753 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 16754
bc7b6697 16755 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 16756 (xfont_open): Avoid unnecessary tests.
bc7b6697 16757
27ccc379
PE
16758 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16759
dcd5c89a
PE
16760 * composite.h, composite.c (composition_gstring_put_cache):
16761 Use EMACS_INT, not int, for length.
16762
b13a45c6
PE
16763 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16764 breaking out part of COMPOSITION_DECODE_RULE.
16765 (COMPOSITION_DECODE_RULE): Use it.
16766 * composite.c (get_composition_id): Remove unused local vars,
16767 by using the new macro.
16768
1e792e4d
PE
16769 * textprop.c (set_text_properties_1): Change while to do-while,
16770 since the condition is always true at first.
16771
dc6c6455 16772 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
16773 (interval_deletion_adjustment): Return unsigned value.
16774 All uses changed.
dc6c6455 16775
aba7731a
PE
16776 * process.c (list_processes_1, create_pty, read_process_output):
16777 (exec_sentinel): Remove vars that were set but not used.
afd4052b 16778 (create_pty): Remove unnecessary "volatile"s.
bc57d757 16779 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 16780 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 16781 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 16782
fdfc4bf3
PE
16783 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16784
fca8fe46 16785 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 16786 (update_syntax_table): Use unsigned instead of int.
fca8fe46 16787
06a0259a 16788 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 16789 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 16790 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 16791
e7b9e80f
PE
16792 * print.c (print_error_message): Avoid int overflow.
16793
56201685
PE
16794 * font.c (font_list_entities): Redo for clarity,
16795 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16796
78834453 16797 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 16798 (font_score): Avoid potential overflow in diff calculation.
78834453 16799
0bc0b309 16800 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 16801 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 16802
e610eaca
PE
16803 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16804
b895abce
PE
16805 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16806 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16807 can always succeed if overflow has undefined behavior.
16808
1f1d9321 16809 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 16810 (wordify): Omit three unnecessary tests.
1f1d9321 16811
c59478bc
PE
16812 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16813 All callers changed. This avoids the need for an unused var.
16814
79b73827
PE
16815 * casefiddle.c (casify_region): Remove var that is set but not used.
16816
a4db5dfe
PE
16817 * dired.c (file_name_completion): Remove var that is set but not used.
16818
43aae36e
PE
16819 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16820
2a47c44d 16821 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 16822 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 16823
a37c69bf
PE
16824 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16825 Check for integer overflow on size calculations.
16826
328ab8e7
PE
16827 * buffer.c (Fprevious_overlay_change): Remove var that is set
16828 but not used.
16829
e5a2a5cb
PE
16830 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16831 Remove vars that are set but not used.
8d84a6eb 16832 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 16833 (timer_check_2): Mark vars as initialized.
e5a2a5cb 16834
a60e5f68
PE
16835 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16836
f661cb61 16837 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 16838 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 16839
f0397f5a
PE
16840 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16841 that are set but not used.
16842
8664db06 16843 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 16844 if XCreateBitmapFromData fails (Bug#8410).
8664db06 16845
6abdaa4a
PE
16846 * xselect.c (x_get_local_selection, x_handle_property_notify):
16847 Remove vars that are set but not used.
16848
0ce7538d 16849 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 16850 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 16851
9ae848fc
PE
16852 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16853 Remove var that is set but not used.
0b918413
PE
16854 (scroll_bar_windows_size): Now size_t, not int.
16855 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16856 Check for overflow.
9ae848fc 16857
a5a62657
PE
16858 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16859 (map_tty_color) [!defined MSDOS]: Likewise.
16860
5c5cdd39
PE
16861 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16862
66ebf983
PE
16863 * coding.c: Remove vars that are set but not used.
16864 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16865 All callers changed.
16866 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16867 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16868 (decode_coding_charset): Remove vars that are set but not used.
16869
1be4d761
PE
16870 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16871 that is set but not used.
16872
47553fa8
PE
16873 * print.c (print_object): Remove var that is set but not used.
16874
1f7196bf 16875 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
16876 The gnulib version avoids calling malloc in the usual case,
16877 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16878 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16879 * filelock.c (current_lock_owner): Likewise.
16880 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16881 * sysdep.c: Include allocator.h, careadlinkat.h.
16882 (emacs_no_realloc_allocator): New static constant.
16883 (emacs_readlink): New function.
fdb61804
PE
16884 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16885 ../lib/careadlinkat.h.
d1fdcab7 16886
f84c17c7
SM
168872011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16888
16889 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16890 first non-nil return value).
16891
ef3862ad
JD
168922011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16893
16894 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16895 if not defined (Bug#8403).
16896
376a7006
JB
168972011-04-02 Juanma Barranquero <lekktu@gmail.com>
16898
16899 * xdisp.c (display_count_lines): Remove parameter `start',
16900 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16901 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16902 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16903 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16904 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16905 and thereabouts. All callers changed.
16906 (get_per_char_metric): Remove parameter `f', unused since
16907 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16908
6ca3801d
JM
169092011-04-02 Jim Meyering <meyering@redhat.com>
16910
16911 do not dereference NULL upon failed strdup
16912 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16913 (ns_get_family): Likewise.
16914
d8e2b5ba
JB
169152011-04-02 Juanma Barranquero <lekktu@gmail.com>
16916
16917 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16918
8c74fcbd
JD
169192011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16920
16921 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16922 later (Bug#8403).
16923
7200d79c
SM
169242011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16925
03408648 16926 Add lexical binding.
7200d79c 16927
03408648
SM
16928 * window.c (Ftemp_output_buffer_show): New fun.
16929 (Fsave_window_excursion):
16930 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16931
16932 * lread.c (lisp_file_lexically_bound_p): New function.
16933 (Fload): Bind Qlexical_binding.
16934 (readevalloop): Remove `evalfun' arg.
16935 Bind Qinternal_interpreter_environment.
16936 (Feval_buffer): Bind Qlexical_binding.
16937 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16938 Mark as dynamic.
16939 (syms_of_lread): Declare `lexical-binding'.
16940
16941 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16942
16943 * keyboard.c (eval_dyn): New fun.
16944 (menu_item_eval_property): Use it.
ca105506
SM
16945
16946 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 16947
03408648
SM
16948 * fns.c (concat, mapcar1): Accept byte-code-functions.
16949
16950 * eval.c (Fsetq): Handle lexical vars.
16951 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16952 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16953 (FletX, Flet): Obey lexical binding.
16954 (Fcommandp): Handle closures.
16955 (Feval): New `lexical' arg.
16956 (eval_sub): New function extracted from Feval. Use it almost
16957 everywhere where Feval was used. Look up vars in lexical env.
16958 Handle closures.
16959 (Ffunctionp): Move from subr.el.
16960 (Ffuncall): Handle closures.
16961 (apply_lambda): Remove `eval_flags'.
16962 (funcall_lambda): Handle closures and new byte-code-functions.
16963 (Fspecial_variable_p): New function.
16964 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16965 but without exporting it to Lisp.
23aba0ea 16966
23aba0ea 16967 * doc.c (Fdocumentation, store_function_docstring):
03408648 16968 * data.c (Finteractive_form): Handle closures.
23aba0ea 16969
03408648
SM
16970 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16971 interactive spec.
ba83908c 16972
04f2d78b
CB
16973 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16974 New byte-codes.
03408648
SM
16975 (exec_byte_code): New function extracted from Fbyte_code to handle new
16976 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 16977
03408648 16978 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 16979
03408648 16980 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 16981
e2abce01
JB
169822011-03-31 Juanma Barranquero <lekktu@gmail.com>
16983
16984 * xdisp.c (redisplay_internal): Fix prototype.
16985
63696a73 169862011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 16987
63696a73 16988 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
16989 (try_scrolling): Use it when setting scroll_limit.
16990 Limit scrolling to 100 screen lines.
63696a73
EZ
16991 (redisplay_window): Even when falling back on "recentering",
16992 position point in the window according to scroll-conservatively,
16993 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16994
16995 (try_scrolling): When point is above the window, allow searching
16996 as far as scroll_max, or one screenful, to compute vertical
16997 distance from PT to the scroll margin position. This prevents
16998 try_scrolling from unnecessarily failing when
16999 scroll-conservatively is set to a value slightly larger than the
17000 window height. Clean up the case of PT below the margin at bottom
17001 of window: scroll_max can no longer be INT_MAX. When aggressive
17002 scrolling is in use, don't let point enter the opposite scroll
17003 margin as result of the scroll.
17004 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
17005 threshold of 100 lines for never-recentering scrolling.
17006
e4cc2dfc
JB
170072011-03-31 Juanma Barranquero <lekktu@gmail.com>
17008
17009 * dispextern.h (move_it_by_lines):
17010 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17011 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17012 (message_log_check_duplicate): Remove parameters `prev_bol' and
17013 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17014 (redisplay_internal): Remove parameter `preserve_echo_area',
17015 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17016
17017 * indent.c (Fvertical_motion):
17018 * window.c (window_scroll_pixel_based, Frecenter):
17019 Don't pass `need_y_p' to `move_it_by_lines'.
17020
1c470562
SM
170212011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17022
44f230aa
SM
17023 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17024 steal a few bits to be more compact.
17025 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17026 Remove unneeded casts.
17027
1c470562
SM
17028 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17029
888adce9
ZK
170302011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17031
17032 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17033 binding" message (bug#7967).
17034
f838ed7b
PE
170352011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17036
77861b95
PE
17037 Fix more problems found by GCC 4.6.0's static checks.
17038
de6dbc14
PE
17039 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17040 Remove unused local var.
17041
f838ed7b
PE
17042 * editfns.c (Fmessage_box): Remove unused local var.
17043
792c7b2b
PE
17044 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17045 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17046 Omit unused local vars.
c499e557 17047 * window.c (shrink_windows): Omit unused local var.
b01a1c29 17048 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
17049 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17050 Omit unused local var.
17051
ba0165e1
PE
17052 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17053 Don't assume string length fits in int.
32ad8845 17054 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 17055 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 17056
3c59b4c9
PE
17057 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17058 instead of alloca (Bug#8344).
17059
a3eed478 17060 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 17061 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 17062
eb4d412d
PE
17063 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17064
1658b401
PE
17065 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17066 concerns.
17067
17068 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17069
17070 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 17071
9a2c6e05
PE
17072 * keyboard.c (syms_of_keyboard): Use the same style as later
17073 in this function when indexing through an array. This also
17074 works around GCC bug 48267.
17075
03d0a109
PE
17076 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17077
44f730c8
PE
17078 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17079
fe75f926
PE
17080 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17081 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17082
ffa8c828
PE
17083 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17084 This avoids undefined behavior on integer overflow, and is a bit
17085 more convenient anyway since it is compared to a size_t variable.
17086
c5101a77
PE
17087 Variadic C functions now count arguments with size_t, not int.
17088 This avoids an unnecessary limitation on 64-bit machines, which
17089 caused (substring ...) to crash on large vectors (Bug#8344).
17090 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17091 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 17092 All variadic functions and their callers changed accordingly.
c5101a77
PE
17093 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17094 * data.c (arith_driver, float_arith_driver): Likewise.
17095 * editfns.c (general_insert_function): Likewise.
17096 * eval.c (struct backtrace.nargs, interactive_p)
17097 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17098 (funcall_lambda, mark_backtrace): Likewise.
17099 * fns.c (concat): Likewise.
17100 * frame.c (x_set_frame_parameters): Likewise.
17101 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17102 0 if not found, not -1. All callers changed.
17103
dd3f25f7
PE
17104 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17105 (stack_copy_size): Now size_t, not int.
17106 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17107
461c2ab9
JB
171082011-03-28 Juanma Barranquero <lekktu@gmail.com>
17109
17110 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17111 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17112 All callers changed.
17113
17114 * lisp.h (multibyte_char_to_unibyte):
17115 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17116 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17117 * character.h (CHAR_TO_BYTE8):
17118 * cmds.c (internal_self_insert):
17119 * editfns.c (general_insert_function):
17120 * keymap.c (push_key_description):
17121 * search.c (Freplace_match):
17122 * xdisp.c (message_dolog, set_message_1): All callers changed.
17123
f6d62986
SM
171242011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17125
17126 * keyboard.c (safe_run_hook_funcall): New function.
17127 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17128 don't set the hook to nil, but remove the offending function instead.
17129 (Qcommand_hook_internal): Remove, unused.
17130 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17131 Vcommand_hook_internal.
17132
17133 * eval.c (enum run_hooks_condition): Remove.
17134 (funcall_nil, funcall_not): New functions.
17135 (run_hook_with_args): Call each function through a `funcall' argument.
17136 Remove `cond' argument, now redundant.
17137 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17138 (Frun_hook_with_args_until_failure): Adjust accordingly.
17139 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17140
1db5b1ad
JB
171412011-03-28 Juanma Barranquero <lekktu@gmail.com>
17142
17143 * dispextern.h (string_buffer_position): Remove declaration.
17144
17145 * print.c (strout): Remove parameter `multibyte', unused since
17146 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17147
17148 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17149 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17150 All callers changed.
17151
17152 * w32.c (_wsa_errlist): Use braces for struct initializers.
17153
17154 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17155 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17156 All callers changed.
17157 (string_buffer_position): Likewise. Also, make static (it's never
17158 used outside xdisp.c).
17159 (cursor_row_p): Remove parameter `w', unused since
17160 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17161 (decode_mode_spec): Remove parameter `precision', introduced during
17162 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17163 All callers changed.
17164
5ffb62aa
JD
171652011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17166
17167 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17168
461c2ab9 171692011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
17170
17171 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17172 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17173 (ns_update_auto_hide_menu_bar): New functions.
17174 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17175 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17176 ns_constrain_all_frames.
17177 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17178 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17179
5c380ffb
JD
171802011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17181
17182 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17183
9af30bdf
GM
171842011-03-27 Glenn Morris <rgm@gnu.org>
17185
17186 * syssignal.h: Replace RETSIGTYPE with void.
17187 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17188 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17189 Replace SIGTYPE with void everywhere.
17190 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17191 * s/template.h (SIGTYPE): Remove commented out definition.
17192
e2abce01
JB
171932011-03-26 Eli Zaretskii <eliz@gnu.org>
17194
17195 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17196 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17197
f868cd8a
JB
171982011-03-26 Juanma Barranquero <lekktu@gmail.com>
17199
59eb0929
JB
17200 * w32.c (read_unc_volume): Use parameter `henum', instead of
17201 global variable `wget_enum_handle'.
17202
17203 * keymap.c (describe_vector): Remove parameters `indices' and
17204 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17205 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17206
f868cd8a
JB
17207 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17208
17209 * keyboard.c (timer_check): Remove parameter `do_it_now',
17210 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17211 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17212 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17213
17214 * keyboard.c (read_char):
17215 * w32menu.c (w32_menu_display_help):
17216 * xmenu.c (show_help_event, menu_help_callback):
17217 Adjust calls to `show_help_echo'.
17218
17219 * gtkutil.c (xg_maybe_add_timer):
17220 * keyboard.c (readable_events):
17221 * process.c (wait_reading_process_output):
17222 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17223
17224 * insdel.c (adjust_markers_gap_motion):
17225 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17226 (gap_left, gap_right): Don't call it.
17227
2ecf6fdb
CY
172282011-03-25 Chong Yidong <cyd@stupidchicken.com>
17229
17230 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17231 incurred during fontification.
17232
6b1f9ba4
JB
172332011-03-25 Juanma Barranquero <lekktu@gmail.com>
17234
17235 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17236 (DEFVAR_PER_BUFFER): Don't pass it.
17237
17238 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17239 (scrolling_window): Don't pass it.
17240
0f4a96b5
JB
172412011-03-25 Juanma Barranquero <lekktu@gmail.com>
17242
17243 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17244
17245 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17246 and `suffix'.
17247 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17248 of variables specific to SELinux and computation of `encoded_absname'.
17249
17250 * image.c (XPutPixel): Remove unused variable `height'.
17251
17252 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17253
17254 * unexw32.c (get_section_info): Remove unused variable `section'.
17255
17256 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17257 (system_process_attributes): Remove unused variable `sess'.
17258 (sys_read): Remove unused variable `err'.
17259
17260 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17261 (w32_wnd_proc): Remove unused variable `isdead'.
17262 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17263 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17264 (x_create_tip_frame): Remove unused variable `tem'.
17265
17266 * w32inevt.c (w32_console_read_socket):
17267 Remove unused variable `no_events'.
17268
17269 * w32term.c (x_draw_composite_glyph_string_foreground):
17270 Remove unused variable `width'.
17271
1149507c
JB
172722011-03-24 Juanma Barranquero <lekktu@gmail.com>
17273
17274 * w32term.c (x_set_glyph_string_clipping):
17275 Don't pass uninitialized region to CombineRgn.
17276
9c88f339
JB
172772011-03-23 Juanma Barranquero <lekktu@gmail.com>
17278
17279 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17280 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17281 (Fx_close_connection): Remove unused variable `i'.
17282
17283 * w32font.c (w32font_draw): Return number of glyphs.
17284 (w32font_open_internal): Remove unused variable `i'.
17285 (w32font_driver): Add missing initializer.
17286
17287 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17288 (fill_in_menu): Remove unused variable `items_added'.
17289
17290 * w32term.c (last_mouse_press_frame): Remove static global variable.
17291 (w32_clip_to_row): Remove unused variable `f'.
17292 (x_delete_terminal): Remove unused variable `i'.
17293
17294 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17295 (NOTHING): Remove unused static global variable.
17296 (uniscribe_check_otf): Remove unused variable `table'.
17297 (uniscribe_font_driver): Add missing initializers.
17298
dee091a3
JD
172992011-03-23 Julien Danjou <julien@danjou.info>
17300
17301 * term.c (Fsuspend_tty, Fresume_tty):
17302 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17303 * window.c (temp_output_buffer_show):
17304 * insdel.c (signal_before_change):
17305 * frame.c (Fhandle_switch_frame):
17306 * fileio.c (Fdo_auto_save):
17307 * emacs.c (Fkill_emacs):
17308 * editfns.c (save_excursion_restore):
17309 * cmds.c (internal_self_insert):
17310 * callint.c (Fcall_interactively):
17311 * buffer.c (Fkill_all_local_variables):
17312 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17313 Use Frun_hooks.
0f4a96b5 17314 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 17315 unconditionally since it does the check itself.
dee091a3 17316
2c520ab5 173172011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 17318
c9c49752
PE
17319 Fix more problems found by GCC 4.5.2's static checks.
17320
8abc3f12
PE
17321 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17322 the first time through the loop, since we know p0 < p1 then.
17323 This also avoids a gcc -Wstrict-overflow warning.
17324
a2d26660
PE
17325 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17326 leading to a memory leak, possible in functions like
17327 load_charset_map_from_file that can allocate an unbounded number
b12ef411 17328 of objects (Bug#8318).
a2d26660 17329
916c72e9
PE
17330 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17331 that could (at least in theory) be that large.
17332
19ab8a18
PE
17333 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17334 This is less likely to overflow, and avoids undefined behavior if
17335 overflow does occur. All callers changed. Use strtoul to scan
17336 for the unsigned long integer.
b7cbbd6f
PE
17337 (pint2hrstr): Simplify and tune code slightly.
17338 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 17339
f0641eff
PE
17340 * scroll.c (do_scrolling): Work around GCC bug 48228.
17341 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17342
7f650bb9
PE
17343 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17344 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
17345 (validate_x_resource_name): Simplify count usage.
17346 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 17347
37dd57d1
PE
17348 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17349 fail (Bug#8306).
81e56e61 17350
699979fc 17351 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 17352
401bf9b4
PE
17353 * process.c (Fmake_network_process): Use socklen_t, not int,
17354 where POSIX says socklen_t is required in portable programs.
17355 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 17356 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
17357 (Fmake_network_process, server_accept_connection):
17358 (wait_reading_process_output, read_process_output):
17359 Likewise.
17360
b93aacde
PE
17361 * process.c: Rename or move locals to avoid shadowing.
17362 (list_processes_1, Fmake_network_process):
17363 (read_process_output_error_handler, exec_sentinel_error_handler):
17364 Rename or move locals.
4dc343ee 17365 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 17366 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 17367 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 17368 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 17369 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 17370
af8a867c 17371 Make tparam.h and terminfo.c consistent.
44f230aa
SM
17372 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17373 Include tparam.h instead, since it declares them.
af8a867c
PE
17374 * cm.h (PC): Remove extern decl; tparam.h now does this.
17375 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17376 * terminfo.c: Include tparam.h, to check interfaces.
17377 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17378 (tparam): Adjust signature to match interface in tparam.h;
17379 this removes some undefined behavior. Check that outstring and len
17380 are zero, which they always are with Emacs.
17381 * tparam.h (PC, BC, UP): New extern decls.
17382
0248044d 17383 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 17384 (xftfont_open): Rename locals to avoid shadowing.
0248044d 17385
8ff096c1 17386 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
17387 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17388 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 17389 (ftfont_list): Remove unused local.
49eaafba
PE
17390 (get_adstyle_property, ftfont_pattern_entity):
17391 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17392 Rename locals to avoid shadowing.
8ff096c1 17393
e2be39f6
PE
17394 * xfont.c (xfont_list_family): Mark var as initialized.
17395
c9735e30
PE
17396 * xml.c (make_dom): Now static.
17397
8f5201ae
PE
17398 * composite.c (composition_compute_stop_pos): Rename local to
17399 avoid shadowing.
b246f932
PE
17400 (composition_reseat_it): Remove unused locals.
17401 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 17402 (composition_update_it): Mark var as initialized.
11b61122
PE
17403 (find_automatic_composition): Mark vars as initialized,
17404 with a FIXME (Bug#8290).
8f5201ae 17405
760fbc2c
PE
17406 character.h: Rename locals to avoid shadowing.
17407 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17408 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17409 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17410 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17411 to avoid shadowing.
17412
ff08eb85
PE
17413 * textprop.c (property_change_between_p): Remove; unused.
17414
fc7bf025
PE
17415 * intervals.c (interval_start_pos): Now static.
17416
235d7abc
PE
17417 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17418
44f230aa
SM
17419 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17420 Rename locals to avoid shadowing.
3e7d6594 17421
50060332
PE
17422 * sound.c (wav_play, au_play, Fplay_sound_internal):
17423 Fix pointer signedness.
d01f234b 17424 (alsa_choose_format): Remove unused local var.
c83b8872
PE
17425 (wav_play): Initialize a variable to 0, to prevent undefined
17426 behavior (Bug#8278).
50060332 17427
c4fc4e30
PE
17428 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17429
918436ed
PE
17430 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17431
c939f91b
PE
17432 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17433 clobbering (Bug#8298).
b9c7f648
PE
17434 * sysdep.c (sys_subshell): Likewise.
17435 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 17436
6bd8c144
PE
17437 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17438 This should get cleaned up, so that child_setup has the
17439 same signature on all platforms.
17440
7710357c 17441 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 17442 (relocate_fd): Rename locals to avoid shadowing.
7710357c 17443
c59da222
CY
174442011-03-22 Chong Yidong <cyd@stupidchicken.com>
17445
17446 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17447 not to be necessary, and produces flickering.
17448
66b87493
GM
174492011-03-20 Glenn Morris <rgm@gnu.org>
17450
17451 * config.in: Remove file.
17452
45b6f6d5
JB
174532011-03-20 Juanma Barranquero <lekktu@gmail.com>
17454
17455 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17456 are now in src/globals.h.
17457 (syms_of_minibuf): Remove spurious & from previous change.
17458
cd394be1 174592011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
17460
17461 * minibuf.c (completing-read-function): New variable.
17462 (completing-read-default): Rename from completing-read.
17463 (completing-read): Call completing-read-function.
17464
b14e3e21
CY
174652011-03-19 Juanma Barranquero <lekktu@gmail.com>
17466
17467 * xfaces.c (Fx_load_color_file):
17468 Read color file from absolute filename (bug#8250).
17469
f2b726e6
JB
174702011-03-19 Juanma Barranquero <lekktu@gmail.com>
17471
17472 * makefile.w32-in: Update dependencies.
17473
09f6ff02
EZ
174742011-03-17 Eli Zaretskii <eliz@gnu.org>
17475
17476 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17477
29a6015a
PE
174782011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17479
a3a6c54e
PE
17480 Fix more problems found by GCC 4.5.2's static checks.
17481
b766f867
PE
17482 * process.c (make_serial_process_unwind, send_process_trap):
17483 (sigchld_handler): Now static.
17484
be02381c
PE
17485 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17486 That way, the code declares only the vars that it needs.
17487 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17488 * s/cygwin.h (PTY_ITERATION): Likewise.
17489 * s/darwin.h (PTY_ITERATION): Likewise.
17490 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17491
57048744
PE
17492 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17493 * process.c (allocate_pty): Don't declare stb unless it's needed.
17494
7914961c 17495 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
17496 (CONSTANTLIM): Remove; unused.
17497 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17498 Define only if needed.
7914961c 17499
b3967b18
PE
17500 * unexelf.c (unexec): Name an expression,
17501 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
17502 Use a different way to cause a compilation error if anyone uses
17503 n rather than nn, a way that does not involve shadowing.
73366a00 17504 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 17505
29a6015a
PE
17506 * deps.mk (unexalpha.o): Remove; unused.
17507
43cfc33e 17508 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 17509 * unexec.h: New file.
ce701a33
PE
17510 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17511 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17512 Depend on unexec.h.
17513 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17514 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17515 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 17516 Change as necessary to match prototype in unexec.h.
ce701a33 17517
01f44d5a
PE
17518 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17519 shadowing.
4f63c6bb 17520 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 17521
a6670b0b
PE
17522 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17523 Rename locals to avoid shadowing.
17524
cef2010d 17525 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 17526 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 17527
d4d7173a
PE
17528 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17529
f08b802a
PE
17530 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17531 warning when compiling print.c.
17532
3ddb0639
PE
17533 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17534 instead of using an uninitialized var.
5ad03b97 17535 (font_sort_entities): Mark var as initialized.
3ddb0639 17536
170a2692
PE
17537 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17538
e663c700
PE
17539 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17540 pointers to constants.
89bc529a 17541 (font_parse_fcname): Remove unused vars.
7b81e2d0 17542 (font_delete_unmatched): Now static.
ea838e10 17543 (font_get_spec): Remove; unused.
13a547c6
PE
17544 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17545 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17546 Rename or move locals to avoid shadowing.
e663c700 17547
2a80c887 17548 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 17549 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 17550
1384fa33 17551 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 17552 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 17553
8b2c52e9
PE
17554 * alloc.c (mark_backtrace): Move decl from here ...
17555 * lisp.h: ... to here, so that it can be checked.
17556
475545b5 17557 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 17558 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
17559 (lisp_indirect_variable): Name an expression,
17560 to avoid gcc -Wbad-function-cast warning.
1faed8ae 17561 (Fdefvar): Rename locals to avoid shadowing.
475545b5 17562
b1349114 17563 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 17564 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 17565 Use const pointer when appropriate.
b1349114 17566
a2928364
PE
17567 * lisp.h (get_system_name, get_operating_system_release):
17568 Move decls here, to check interfaces.
17569 * process.c (get_operating_system_release): Move decl to lisp.h.
17570 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
17571 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17572 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17573 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
17574 (Fformat_time_string, Fencode_time, Finsert_char):
17575 (Ftranslate_region_internal, Fformat):
17576 Rename or remove local vars to avoid shadowing.
9710023e 17577 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 17578
a415e694
PE
17579 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17580 avoid shadowing.
17581
8ef4622d
PE
17582 * lisp.h (eassert): Check that the argument compiles, even if
17583 ENABLE_CHECKING is not defined.
17584
946f9a5b
PE
17585 * data.c (Findirect_variable): Name an expression, to avoid
17586 gcc -Wbad-function-cast warning.
112396d6 17587 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 17588 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
17589 (Fmake_variable_buffer_local, Fmake_local_variable):
17590 Mark variables as initialized.
52746918 17591 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 17592
e5aab7e7 17593 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
17594 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17595 Rename locals to avoid shadowing.
dff45157
PE
17596 (mark_stack): Move local variables into the #ifdef region where
17597 they're used.
7bc26fdb
PE
17598 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17599 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17600 needed otherwise.
17601 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17602 (GC_STRING_CHARS): Remove; not used.
d40d4be1 17603 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 17604
e5aab7e7
PE
17605 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17606 avoids undefined behavior in theory.
17607
4da60324
PE
17608 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17609
88043301
PE
17610 Use functions, not macros, for up- and down-casing (Bug#8254).
17611 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17612 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17613 to use the following functions instead of these macros.
17614 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17615 EMACS_INT, since callers assume the returned value fits in int.
17616 (upcase1): Likewise, for UPCASE_TABLE.
17617 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 17618 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 17619 the race-condition problem in the old DOWNCASE.
88043301 17620
19ed5445
PE
17621 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17622 Rename locals to avoid shadowing.
17623 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
17624 (regex_compile, re_search_2, re_match_2_internal):
17625 Remove unused local vars.
952db0d7
PE
17626 (FREE_VAR): Rewrite so as not to use empty "else",
17627 which gcc can warn about.
da053e48 17628 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
17629 (RETALLOC_IF): Define only if needed.
17630 (WORDCHAR_P): Likewise. This one is never needed, but is used
17631 only in a comment talking about a compiler bug, so put inside
17632 the #if 0 of that comment.
17633 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17634 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17635 Remove; unused.
19ed5445 17636
1f3561e4 17637 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
17638 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17639 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 17640
ded6f8f7
PE
17641 * search.c (simple_search): Remove unused var.
17642
dbd37a95
PE
17643 * dired.c (compile_pattern): Move decl from here ...
17644 * lisp.h: ... to here, so that it can be checked.
17645 (struct re_registers): New forward decl.
17646
7e47afad
PE
17647 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17648
85f24f61
PE
17649 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17650 All uses changed.
17651 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17652 Rename locals to avoid shadowing.
5671df8f 17653 (Fvertical_motion): Mark locals as initialized.
85f24f61 17654
181aa2be 17655 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 17656 (casify_region): Mark local as initialized.
181aa2be 17657
930d429c
PE
17658 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17659
7082eac6
PE
17660 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17661 New macros, so that the caller can use some names other than
17662 gcpro1, gcpro2, etc.
17663 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17664 of the new macros.
17665 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17666 argument, for consistency with GCPRO2_VAR, etc: it is now the
17667 prefix of the variable, not the variable itself. All uses
17668 changed.
38b2c076
PE
17669 * dired.c (directory_files_internal, file_name_completion):
17670 Rename locals to avoid shadowing.
17671
15206ed9
PE
17672 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17673 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17674 dired.c's scmp function, had undefined behavior.
17675 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17676 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17677 * buffer.h: ... to here, because these macros use current_buffer,
17678 and the new implementation with inline functions needs to have
17679 current_buffer in scope now, rather than later when the macros
17680 are used.
17681 (downcase, upcase1): New static inline functions.
17682 (DOWNCASE, UPCASE1): Reimplement using these functions.
17683 This avoids undefined behavior in expressions like
17684 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17685 from race conditions in accessing the global variables
17686 case_temp1 and case_temp2.
17687 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17688 * lisp.h (case_temp1, case_temp2): Remove their decls.
17689 * character.h (ASCII_CHAR_P): Move from here ...
17690 * lisp.h: ... to here, so that the inline functions mentioned
17691 above can use them.
17692
4a6bea26
PE
17693 * dired.c (directory_files_internal_unwind): Now static.
17694
f14b7e14
PE
17695 * fileio.c (file_name_as_directory, directory_file_name):
17696 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17697 Now static.
2893f146
PE
17698 (file_name_as_directory): Use const pointers when appropriate.
17699 (Fexpand_file_name): Likewise. In particular, newdir might
17700 point at constant storage, so make it a const pointer.
fd4ead52 17701 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
17702 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17703 signedness issues.
f839df0c
PE
17704 (Fset_file_times, Finsert_file_contents, auto_save_error):
17705 Rename locals to avoid shadowing.
f14b7e14 17706
5716756e 17707 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
17708 (Ftry_completion, Fall_completions): Rename or remove locals
17709 to avoid shadowing.
5716756e 17710
b4c3046a
PE
17711 * marker.c (bytepos_to_charpos): Remove; unused.
17712
b45db522
PE
17713 * lisp.h (verify_bytepos, count_markers): New decls,
17714 so that gcc does not warn that these functions aren't declared.
17715
85876d07
PE
17716 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17717 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 17718 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 17719 (copy_text): Remove unused local var.
85876d07 17720
03d78a21 17721 * filelock.c (within_one_second): Now static.
b3dd38ab 17722 (lock_file_1): Rename local to avoid shadowing.
03d78a21 17723
5df8f01b
PE
17724 * buffer.c (fix_overlays_before): Mark locals as initialized.
17725 (fix_start_end_in_overlays): Likewise. This function should be
17726 simplified by using pointers-to-pointers, but that's a different
17727 matter.
b1d876f1 17728 (switch_to_buffer_1): Now static.
8f54f30a
PE
17729 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17730 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 17731
a70072c9 17732 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 17733 Fix pointer signedness issue.
edced198
PE
17734 (sys_subshell): Mark local as volatile if checking for lint,
17735 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 17736 (MAXPATHLEN): Define only if needed.
a70072c9 17737
a0977c44
PE
17738 * process.c (serial_open, serial_configure): Move decls from here ...
17739 * systty.h: ... to here, so that they can be checked.
17740
a884fdcc
PE
17741 * fns.c (get_random, seed_random): Move extern decls from here ...
17742 * lisp.h: ... to here, so that they can be checked.
17743
604efe86 17744 * sysdep.c (reset_io): Now static.
b8950c94 17745 (wait_for_termination_signal): Remove; unused.
604efe86 17746
38fc62d9
PE
17747 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17748 (copy_keymap_item, append_key, push_text_char_description):
17749 Now static.
1004a21a 17750 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 17751 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
17752 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17753 (describe_map_tree):
17754 Rename locals to avoid shadowing.
38fc62d9 17755
2f2650da
PE
17756 * keyboard.c: Declare functions static if they are not used elsewhere.
17757 (echo_char, echo_dash, cmd_error, top_level_2):
17758 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
17759 (read_char, kbd_buffer_get_event, make_lispy_position):
17760 (make_lispy_event, make_lispy_movement, apply_modifiers):
17761 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17762 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17763 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 17764 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 17765 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 17766
a053e86c 17767 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
17768 (mark_kboards): Move decl here ...
17769 * alloc.c (mark_kboards): ... from here.
a053e86c 17770
4752793e
PE
17771 * lisp.h (force_auto_save_soon): New decl.
17772
74f10ca7 17773 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
17774 (DEFINE_DUMMY_FUNCTION): New macro.
17775 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17776 Use it.
c03cd23f
PE
17777 (main): Add casts to avoid warnings
17778 if GCC considers string literals to be constants.
74f10ca7 17779
022e70d4
PE
17780 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17781
59d6fe83
PE
17782 * dbusbind.c: Pointer signedness fixes.
17783 (xd_signature, xd_append_arg, xd_initialize):
17784 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17785 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17786 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17787 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17788
78320123
PE
17789 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17790 if GCC considers string literals to be constants.
49cebcca 17791 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 17792
35ac2a97
SM
177932011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17794
fb103ca9
SM
17795 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17796 (print_preprocess, print_object): New macro to fix last change.
17797
35ac2a97
SM
17798 * print.c (print_preprocess): Don't forget font objects.
17799
62973b41
JB
178002011-03-16 Juanma Barranquero <lekktu@gmail.com>
17801
17802 * emacs.c (USAGE3): Doc fixes.
17803
0e48bb22
AS
178042011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17805
17806 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17807 structure.
17808
7684e57b
JB
178092011-03-14 Juanma Barranquero <lekktu@gmail.com>
17810
17811 * lisp.h (VWindow_system, Qfile_name_history):
17812 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17813 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17814 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17815
17816 * w32select.c: Don't #include "keyboard.h".
c96bbc66 17817 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
17818
17819 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17820 * w32console.c (detect_input_pending, read_input_pending)
17821 (encode_terminal_code):
17822 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17823 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17824 (w32_system_caret_y, Qfile_name_history):
17825 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17826 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17827 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17828 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17829 * w32proc.c (Qlocal, report_file_error):
17830 * w32term.c (Vwindow_system, updating_frame):
17831 * w32uniscribe.c (initialized, uniscribe_font_driver):
17832 Remove unneeded extern declarations.
17833
2aa46d6c
CY
178342011-03-14 Chong Yidong <cyd@stupidchicken.com>
17835
c96bbc66 17836 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 17837
cffc6f3b
CY
178382011-03-13 Chong Yidong <cyd@stupidchicken.com>
17839
17840 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17841 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17842 These macros can no longer be used for assignment.
17843
44f230aa
SM
17844 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17845 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
17846 (record_buffer_markers, fetch_buffer_markers): New functions for
17847 recording and fetching special buffer markers.
17848 (set_buffer_internal_1, set_buffer_temp): Use them.
17849
17850 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17851
17852 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17853
17854 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17855 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17856
17857 * xdisp.c (hscroll_window_tree):
17858 (reconsider_clip_changes): Use PT instead of BUF_PT.
17859
d251f04b
EZ
178602011-03-13 Eli Zaretskii <eliz@gnu.org>
17861
17862 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17863 $(EMACS_ROOT)/lib/intprops.h.
17864
f0c77cd1
PE
178652011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17866
3eca4629
PE
17867 Fix more problems found by GCC 4.5.2's static checks.
17868
7c86ee98
PE
17869 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17870 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
17871 (xg_free_frame_widgets): Make it clear that a local variable is
17872 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
17873 (gdk_window_get_screen): Make it clear that this macro is needed
17874 only if USE_GTK_TOOLTIP.
1e5524e7
PE
17875 (int_gtk_range_get_value): New function, which avoids a diagnostic
17876 from gcc -Wbad-function-cast.
17877 (xg_set_toolkit_scroll_bar_thumb): Use it.
17878 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17879 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
17880 (get_utf8_string, xg_get_file_with_chooser):
17881 Rename locals to avoid shadowing.
17882 (create_dialog): Move locals to avoid shadowing.
7c86ee98 17883
41729b81
PE
17884 * xgselect.c (xg_select): Remove unused var.
17885
f0c77cd1
PE
17886 * image.c (four_corners_best): Mark locals as initialized.
17887 (gif_load): Initialize transparent_p to zero (Bug#8238).
17888 Mark another local as initialized.
ec6cf4c6 17889 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 17890
ce0ad53d 17891 * image.c (clear_image_cache): Now static.
d5d5a617 17892 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 17893 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
17894 (x_edge_detection): Remove unnecessary cast that
17895 gcc -Wbad-function-cast diagnoses.
2037898d 17896 (gif_load): Fix pointer signedness.
6ae141d6
PE
17897 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17898 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 17899
33383987 179002011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 17901
d32df629
PE
17902 Improve quality of tests for time stamp overflow.
17903 For example, without this patch (encode-time 0 0 0 1 1
17904 1152921504606846976) returns the obviously-bogus value (-948597
17905 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17906 reports time overflow. See
17907 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
17908 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17909 * editfns.c: Include limits.h and intprops.h.
17910 (TIME_T_MIN, TIME_T_MAX): New macros.
17911 (time_overflow): Move earlier, to before first use.
17912 (hi_time, lo_time): New functions, for an accurate test for
17913 out-of-range times.
17914 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17915 (Fget_internal_run_time): Don't assume time_t fits in int.
17916 (make_time): Use list2 instead of Fcons twice.
17917 (Fdecode_time): More accurate test for out-of-range times.
17918 (check_tm_member): New function.
17919 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
17920 (lisp_time_argument): Don't rely on undefined left-shift and
17921 right-shift behavior when checking for time stamp overflow.
8be6f318 17922
fe31d94c
PE
17923 * editfns.c (time_overflow): New function, refactoring common code.
17924 (Fformat_time_string, Fdecode_time, Fencode_time):
17925 (Fcurrent_time_string): Use it.
17926
8be6f318
PE
17927 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17928 * dired.c (make_time): Move to ...
17929 * editfns.c (make_time): ... here.
17930 * systime.h: Note the move.
17931
09d9db2c 179322011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 17933
126bc0dc
YM
17934 * fringe.c (update_window_fringes): Remove unused variables.
17935
c47cbdfd
YM
17936 * unexmacosx.c (copy_data_segment): Also copy __got section.
17937 (Bug#8223)
17938
7ac80be9
EZ
179392011-03-12 Eli Zaretskii <eliz@gnu.org>
17940
c96bbc66 17941 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
17942 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17943 Constify `char *' arguments and their references according to
17944 prototypes in tparam.h.
17945
ecb0f94d 17946 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 17947
7ac80be9
EZ
17948 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17949 Adapt all references accordingly.
17950
17951 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17952
ef1fd07e
TT
179532011-03-11 Tom Tromey <tromey@redhat.com>
17954
17955 * buffer.c (syms_of_buffer): Remove obsolete comment.
17956
7ef4b50c
EZ
179572011-03-11 Eli Zaretskii <eliz@gnu.org>
17958
17959 * termhooks.h (encode_terminal_code): Declare prototype.
17960
17961 * msdos.c (encode_terminal_code): Don't declare prototype.
17962
17963 * term.c (encode_terminal_code): Now external again, used by
17964 w32console.c and msdos.c.
17965
44f230aa
SM
17966 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17967 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 17968
4b1ec863 179692011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 17970
1714f52b 17971 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 17972
4b1ec863
PE
17973 * fringe.c (update_window_fringes): Mark locals as initialized
17974 (Bug#8227).
17975 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 17976
524c7aa6
PE
17977 * alloc.c (mark_fringe_data): Move decl from here ...
17978 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17979 to check its interface.
17980 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17981
a5c0af81 17982 * fontset.c (free_realized_fontset): Now static.
7519b8cd 17983 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 17984 (fontset_font): Mark local as initialized.
a9a06e0b 17985 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 17986
b4716021
PE
17987 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17988
811e9bac 17989 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 17990 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
17991 (x_own_selection, Fx_disown_selection_internal): Rename locals
17992 to avoid shadowing.
17993 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 17994
7e3ab302
PE
17995 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17996 so that the caller can use some name other than gcpro1.
17997 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
17998 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17999 (Fx_backspace_delete_keys_p):
18000 Use them to avoid shadowing, and rename vars to avoid shadowing.
18001 (x_decode_color, x_set_name, x_window): Now static.
6b437900 18002 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 18003 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
18004 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18005 Remove unused locals.
7e3ab302
PE
18006 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18007 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18008 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18009 macros.
f78faa98 18010
e2b13473
PE
18011 * xterm.h (x_mouse_leave): New decl.
18012
77f23912
PE
18013 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18014 Remove unused functions.
cdf4ba58
PE
18015 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18016 (x_calc_absolute_position): Now static.
7411c686 18017 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 18018 Don't declare local "event" unless it's used.
ed7bf3a5
PE
18019 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18020 unless they are used.
38d0b34a
PE
18021 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18022 (x_fatal_error_signal): Remove; not used.
a6067996
PE
18023 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18024 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18025 (x_error_catcher, x_connection_closed, x_error_handler):
18026 (x_error_quitter, xembed_send_message, x_iconify_frame):
18027 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 18028 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 18029 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 18030
44f230aa
SM
18031 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18032 Rename or move locals to avoid shadowing.
6b463e58 18033 (tty_defined_color, merge_face_heights): Now static.
5967d051 18034 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
18035 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18036 does not deduce is never used uninitialized.
73719eba
PE
18037 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18038 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 18039
426994c3 18040 * terminal.c (store_terminal_param): Now static.
5489860b 18041
032f1620 18042 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 18043 (set_frame_menubar): Remove unused local.
d4323972 18044 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
18045 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18046 since they might point to immutable storage.
281585b0
PE
18047 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18048 since it's unused otherwise.
032f1620 18049
367c19e5 18050 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 18051 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
18052 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18053 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 18054 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
18055 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18056 does not deduce are never used uninitialized.
70739cbe 18057
07b48fa9
PE
18058 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18059
8868a238 18060 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
18061 * window.c (window_loop, size_window):
18062 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 18063
7e5cf297 18064 * window.c (display_buffer): Now static.
d6550a9f
PE
18065 (size_window): Mark variables that gcc -Wuninitialized
18066 does not deduce are never used uninitialized.
a586633d
PE
18067 * window.h (check_all_windows): New decl, to forestall
18068 gcc -Wmissing-prototypes diagnostic.
5b555da1 18069 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 18070
f6095868
PE
18071 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18072 shadowing.
18073 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
18074 Include <limits.h>.
18075 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18076 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
18077 (load_charset_map): Mark variables that gcc -Wuninitialized
18078 does not deduce are never used uninitialized.
53df7c11 18079 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 18080
f38b440c
PE
18081 * coding.c (coding_set_source, coding_set_destination):
18082 Use "else { /* comment */ }" rather than "else /* comment */;"
18083 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
18084 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18085 a block, when the outer 'i' will do.
18086 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18087 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18088 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18089 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18090 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18091 Rename locals to avoid shadowing.
18092 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
18093 * coding.c (emacs_mule_char, encode_invocation_designation):
18094 Now static, since they're not used elsewhere.
413bb2db 18095 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 18096 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
18097 (decode_coding_emacs_mule): Mark variables that gcc
18098 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
18099 (detect_coding_iso_2022): Initialize a local variable that might
18100 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 18101 this initialization is needed. (Bug#8211)
5f58e762
PE
18102 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18103 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18104 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18105 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18106 Remove unused macros.
f38b440c 18107
232b38b9 18108 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 18109 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 18110 * character.c (string_count_byte8): Likewise.
232b38b9 18111
fb90da1b
PE
18112 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18113 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18114
fb93dbc2
PE
18115 * chartab.c (copy_sub_char_table): Now static, since it's not used
18116 elsewhere.
5c156ace
PE
18117 (sub_char_table_ref_and_range, char_table_ref_and_range):
18118 Rename locals to avoid shadowing.
bbcd0949 18119 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 18120
7d3b3862 18121 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 18122 (BIDI_BOB): Remove unused macro.
7d3b3862 18123
6be7d3da
PE
18124 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18125 deduce are never used uninitialized.
c2ed9c8b 18126 * term.c (encode_terminal_code): Likewise.
6be7d3da 18127
75f8807f 18128 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 18129
50938595
PE
18130 * tparam.h: New file.
18131 * term.c, tparam.h: Include it.
18132 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18133 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18134 Move these decls to tparam.h, and make them agree with what
18135 is actually in tparam.c. The previous trick of using incompatible
18136 decls in different modules does not conform to the C standard.
18137 All callers of tparam changed to use tparam's actual API.
18138 * tparam.c (tparam1, tparam, tgoto):
18139 Use const pointers where appropriate.
18140
fbceeba2
PE
18141 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18142 * cm.h (struct cm): Likewise.
18143 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18144 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18145 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18146 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18147 (turn_on_face, init_tty): Likewise.
18148 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 18149
7f3f1250
PE
18150 * term.c (term_mouse_position): Rename local to avoid shadowing.
18151
e6ca6543
PE
18152 * alloc.c (mark_ttys): Move decl from here ...
18153 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18154
c40f8d15
AS
181552011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18156
18157 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18158
cfe0661d
JB
181592011-03-09 Juanma Barranquero <lekktu@gmail.com>
18160
18161 * search.c (compile_pattern_1): Remove argument regp, unused since
18162 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18163 (compile_pattern): Don't pass it.
18164
0afb4571
J
181652011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18166
18167 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18168 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18169 for ! HAVE_GTK3.
18170 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18171
18172 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18173
18174 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18175 gdk_window_get_screen, gdk_window_get_geometry,
18176 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18177 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18178 (xg_get_pixbuf_from_pixmap): New function.
18179 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18180 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18181 Call xg_get_pixbuf_from_pixmap instead of
18182 gdk_pixbuf_get_from_drawable.
18183 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18184 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18185 (xg_check_special_colors): Use GtkStyleContext and its functions
18186 for HAVE_GTK3.
18187 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18188 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18189 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
18190 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18191 Call gtk_widget_get_preferred_size.
0afb4571
J
18192 (xg_frame_resized): gdk_window_get_geometry only takes 5
18193 parameters.
44f230aa
SM
18194 (xg_win_to_widget, xg_event_is_for_menubar):
18195 Call gdk_x11_window_lookup_for_display.
0afb4571
J
18196 (xg_set_widget_bg): New function.
18197 (delete_cb): New function.
895009e1 18198 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 18199 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
18200 (xg_set_background_color): Call xg_set_widget_bg.
18201 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18202 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18203 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18204 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18205 if ! HAVE_GTK3.
18206 (update_frame_tool_bar): Call gtk_widget_hide.
18207 (xg_initialize): Use GDK_KEY_g.
18208
18209 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18210 if ! HAVE_GTK3
18211 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18212
18213 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18214 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18215 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18216
1c2cc4ef
JB
182172011-03-08 Juanma Barranquero <lekktu@gmail.com>
18218
18219 * w32xfns.c (select_palette): Check success of RealizePalette against
18220 GDI_ERROR, not zero.
18221
33383987 18222See ChangeLog.11 for earlier changes.
aac0c6e3
MR
18223
18224;; Local Variables:
18225;; coding: utf-8
aac0c6e3
MR
18226;; End:
18227
2f097256 18228 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
18229
18230 This file is part of GNU Emacs.
18231
18232 GNU Emacs is free software: you can redistribute it and/or modify
18233 it under the terms of the GNU General Public License as published by
18234 the Free Software Foundation, either version 3 of the License, or
18235 (at your option) any later version.
18236
18237 GNU Emacs is distributed in the hope that it will be useful,
18238 but WITHOUT ANY WARRANTY; without even the implied warranty of
18239 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18240 GNU General Public License for more details.
18241
18242 You should have received a copy of the GNU General Public License
18243 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.