Support x64 build on MS-Windows with MSVC.
[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.
7
8 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
9 defining an XRectangle structure.
10
11 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
12 arithmetics for compatibility with x64.
13
14 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
15 compatibility with x64.
16
17 * w32heap.h: Adjust prototypes and declarations.
18
19 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
20 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
21 DWORD, long, and unsigned long, for compatibility with x64.
22 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
23 (sbrk): Argument is now of type ptrdiff_t.
24
25 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
26 less than 0x0500.
27 (w32_msg_pump): Use WPARAM type for 'result'.
28
29 * w32.c (init_environment, get_emacs_configuration): Support AMD64
30 architecture.
31 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
32 compatibility with x64.
33
34 * vm-limit.c (lim_data): Now size_t.
35 (check_memory_limits): Adjust prototypes of real_morecore and
36 __morecore to receive argument of type ptrdiff_t. Use size_t for
37 five_percent and data_size.
38
39 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
40 variables, for compatibility with x64.
41 (rva_to_section, offset_to_section, relocate_offset)
42 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
43 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
44 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
45 for compatibility with x64.
46
47 * sysdep.c (STDERR_FILENO): Define if not already defined.
48
49 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
50 (__morecore): Argument type is now ptrdiff_t.
51 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
52 (relinquish): Use ptrdiff_t type for 'excess'.
53 (r_alloc_sbrk): Argument type is now ptrdiff_t.
54
55 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
56 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
57 instead of a literal number.
58
59 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
60 (min): Define only if not already defined.
61
62 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
63 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
64 hosts.
65
66 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
67 'bitmaps' is a pointer.
68
69 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
70
71 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
72
e7a2937b
PE
732012-09-30 Paul Eggert <eggert@cs.ucla.edu>
74
75 file-attributes has a new optional arg FOLLOW-SYMLINKS.
76 * dired.c (directory_files_internal, Ffile_attributes):
77 New arg follow_symlinks. All uses changed.
78
b43d62ae
SM
792012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
80
81 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
82
c06c382a
EZ
832012-09-30 Eli Zaretskii <eliz@gnu.org>
84
85 Support atimers and CPU profiler via profile.c on MS-Windows.
86 * w32proc.c (sig_mask, crit_sig): New static variables.
87 (sys_signal): Support SIGALRM and SIGPROF.
88 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 89 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
90 sigfillset, and sigprocmask are no longer no-ops.
91 (sigismember): New function.
92 (struct itimer_data): New definition.
93 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
94 (crit_prof): New static variables.
95 (MAX_SINGLE_SLEEP): New definition.
96 (timer_loop, stop_timer_thread, term_timers, init_timers)
97 (start_timer_thread, getitimer, setitimer): New functions.
98 (alarm): No longer a no-op, calls setitimer.
99
100 * w32.c (term_ntproc): Call term_timers.
101 (init_ntproc): Make sure all signals are unblocked at startup, to
102 erase any traces of dumping. Call init_timers.
103
104 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
105 Windows-specific code to display the hourglass mouse pointer is no
106 longer used.
107 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
108 to hourglass timer expiration.
109 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
110 Remove, no longer used.
b43d62ae
SM
111 (w32_note_current_window, show_hourglass, hide_hourglass):
112 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
113 window systems.
114 (syms_of_w32fns): Don't initialize hourglass_timer.
115
116 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
117 WINDOWSNT as well.
118 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
119
120 * w32.h (init_timers, term_timers): Add prototypes.
121
95402d5f
KH
1222012-09-30 Kenichi Handa <handa@gnu.org>
123
124 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
125 to the buffer relocation which may be caused by ccl_driver.
126
dd946752
JD
1272012-09-30 Jan Djärv <jan.h.d@swipnet.se>
128
d7e642cc
JD
129 * xfns.c (Fx_file_dialog): Update comment.
130
131 * w32fns.c (Fx_file_dialog): Update comment.
132
133 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
134 Initialize panel name field if OSX >= 10.6.
135
136 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
137
dd946752
JD
138 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
139
140 * nsterm.m (NEW_STYLE_FS): New define.
141 (ns_fullscreen_hook, windowWillEnterFullScreen)
142 (windowDidEnterFullScreen, windowWillExitFullScreen)
143 (windowDidExitFullScreen, toggleFullScreen, handleFS)
144 (setFSValue): New functions.
145 (EmacsFSWindow): New implementation.
146 (canBecomeKeyWindow): New function for EmacsFSWindow.
147 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
148 (dealloc): Release nonfs_window if in fullscreen.
149 (updateFrameSize:): Call windowDidMove to update top/left.
150 (windowWillResize:toSize:): Check if frame is still maximized.
151 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
152 next_maximized, maximized_width, maximized_height and nonfs_window.
153 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
154 tbar_height.
155 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
156 fullscreen. Set maximized_width/height. Act on next_maximized.
157
158 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
159 (EmacsView): Add variables for fullscreen.
160 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
161 (EmacsFSWindow): New interface for fullscreen.
162
427730eb
JB
1632012-09-30 Juanma Barranquero <lekktu@gmail.com>
164
165 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
166
48de8b12
CY
1672012-09-30 Chong Yidong <cyd@gnu.org>
168
169 * fns.c (Frandom): Doc fix.
170
5938d519
MR
1712012-09-30 Martin Rudalics <rudalics@gmx.at>
172
173 * window.c (Vwindow_combination_limit): New default value.
174 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
175
cb5b0266
PE
1762012-09-30 Paul Eggert <eggert@cs.ucla.edu>
177
178 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
179 Suggested by Eli Zaretskii in
180 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
181
84f72efd
EZ
1822012-09-30 Eli Zaretskii <eliz@gnu.org>
183
184 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
185 HAVE_TIMER_SETTIME is defined.
186
9d4dcdc9
PE
1872012-09-30 Paul Eggert <eggert@cs.ucla.edu>
188
d89460ed
PE
189 Profiler improvements: more-accurate timers, overflow checks.
190 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
191 signal.h, setjmp.h. Include systime.h instead.
192 (saturated_add): New function.
193 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
194 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
195 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
196 New static vars.
84f72efd 197 (enum profiler_cpu_running): New enum.
d89460ed
PE
198 (profiler_cpu_running): Now of that enum type, not bool.
199 All uses changed to store the new value.
200 (handle_profiler_signal): Rename from sigprof_handler_1,
201 for consistency with other handlers. Do not check whether
202 cpu_log is a hash-table if garbage collecting, since it
203 doesn't matter in that case.
204 (deliver_profiler_signal): Rename from sigprof_handler,
205 for consistency with other handlers.
206 (setup_cpu_timer): New function, with much of what used to be in
207 Fprofiler_cpu_start. Check for out-of-range argument.
208 Prefer timer_settime if available, and prefer
209 thread cputime clocks, then process cputime clocks, then
210 monotonic clocks, to the old realtime clock. Use make_timeval
211 to round more-correctly when falling back to setitimer.
212 (Fprofiler_cpu_start): Use it.
213 (Fprofiler_cpu_stop): Prefer timer_settime if available.
214 Don't assume that passing NULL as the 2nd argument of setitimer
215 is the same as passing a pointer to all-zero storage.
216 Ignore SIGPROF afterwards.
217 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
218 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
219 non-fatal signal handlers. Ignore SIGPROF on startup.
220 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
221 in profiler.c, since sysdep.c now uses it.
222
9d4dcdc9
PE
223 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
224 Suggested by Eli Zaretskii in
225 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
226
8e5691a0
JB
2272012-09-29 Juanma Barranquero <lekktu@gmail.com>
228
229 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
230
e7c1b6ef
SM
2312012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
232
233 * lisp.h (struct backtrace): Remove indirection for `function' field.
234 * xdisp.c (redisplay_internal):
235 * profiler.c (record_backtrace, sigprof_handler_1):
236 * alloc.c (Fgarbage_collect):
237 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
238 (Fbacktrace_frame): Adjust accordingly.
239
e61d39cd 2402012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
241
242 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
243 (Frun_hook_with_args_until_failure): Doc fixes.
244
404043ea
EZ
2452012-09-28 Eli Zaretskii <eliz@gnu.org>
246
247 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
248 Qautomatic_redisplay and change the symbol name. All users changed.
249
704d3f45
TM
2502012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
251
252 * profiler.c (sigprof_handler): Fix race condition.
253
757140ff
GM
2542012-09-28 Glenn Morris <rgm@gnu.org>
255
256 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
257
a615a3ae
PE
2582012-09-27 Paul Eggert <eggert@cs.ucla.edu>
259
260 Check more robustly for timer_settime.
89d17fd0
PE
261 * Makefile.in (LIB_TIMER_TIME): New macro.
262 (LIBES): Add it.
a615a3ae
PE
263 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
264 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
265 call timer_settime.
266
3670daf7
TM
2672012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
268
269 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
270
6a586b7f
JB
2712012-09-26 Juanma Barranquero <lekktu@gmail.com>
272
273 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
274
41c8bfcf
PE
2752012-09-26 Paul Eggert <eggert@cs.ucla.edu>
276
277 * character.h (MAYBE_UNIFY_CHAR): Remove.
278 * charset.c, charset.h (maybe_unify_char): Now static.
279 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
280 Since this stuff is now private to charset.c, there's no need for
281 a public macro and no need to inline by hand.
282
3a880af4
SM
2832012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
284 Stefan Monnier <monnier@iro.umontreal.ca>
285 Juanma Barranquero <lekktu@gmail.com>
611b7507 286
3a880af4
SM
287 * profiler.c: New file.
288 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
289 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
290 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
291 * emacs.c (main): Call syms_of_profiler.
292 * alloc.c (Qautomatic_gc): New constant.
293 (MALLOC_PROBE): New macro.
294 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
295 (total_bytes_of_live_objects): New function.
296 (Fgarbage_collect): Use it. Record itself in backtrace_list.
297 Call malloc_probe for the memory profiler.
298 (syms_of_alloc): Define Qautomatic_gc.
299 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
300 race condition.
301 (struct backtrace): Move definition...
302 * lisp.h (struct backtrace): ..here.
303 (Qautomatic_gc, profiler_memory_running): Declare vars.
304 (malloc_probe, syms_of_profiler): Declare functions.
305 * xdisp.c (Qautomatic_redisplay): New constant.
306 (redisplay_internal): Record itself in backtrace_list.
307 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 308
5938d519 3092012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
3102012-09-25 Juanma Barranquero <lekktu@gmail.com>
311
312 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
313
e26fd2e4
PE
3142012-09-25 Paul Eggert <eggert@cs.ucla.edu>
315
316 Prefer POSIX timers if available.
317 They avoid a race if the timer is too close to the current time.
318 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
319 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 320 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 321
eedec3ee
EZ
3222012-09-25 Eli Zaretskii <eliz@gnu.org>
323
324 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
325 CHAR_STRING_ADVANCE.
326 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
327 STRING_CHAR_ADVANCE.
328
aa15c6bb
JB
3292012-09-25 Juanma Barranquero <lekktu@gmail.com>
330
331 Move Vlibrary_cache to emacs.c and reset before dumping.
332
333 * lisp.h (reset_image_types): Declare.
334 [WINDOWSNT] (Vlibrary_cache): Declare.
335
336 * image.c (reset_image_types): New function.
337
338 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
339 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
340 (Fdump_emacs): Reset Vlibrary_cache and image_types.
341
342 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
343 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
344
345 * w32.h (Vlibrary_cache): Do not declare.
346
54d629be
EZ
3472012-09-25 Eli Zaretskii <eliz@gnu.org>
348
16b22fef
EZ
349 * w32proc.c (sys_signal): Handle all signals defined by the
350 MS-Windows runtime, not just SIGCHLD. Actually install the signal
351 handlers for signals supported by Windows. Don't override
352 term_ntproc as the handler for SIGABRT.
353 (sigaction): Rewrite to call sys_signal instead of duplicating its
354 code.
355 (sys_kill): Improve commentary.
356
357 * w32.c (term_ntproc): Accept (and ignore) one argument, for
358 consistency with a signature of a signal handler. All callers
359 changed.
360 (init_ntproc): Accept an argument DUMPING. If dumping, don't
361 install term_ntproc as a signal handler for SIGABRT, as that
362 should be done by the dumped Emacs.
363
364 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
365
366 * w32select.c (term_w32select): Protect against repeated
367 invocation by setting clipboard_owner to NULL after calling
368 DestroyWindow.
369
370 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
371 and term_ntproc to their modified signatures.
372
54d629be
EZ
373 * character.c (char_string, string_char): Remove calls to
374 MAYBE_UNIFY_CHAR. See the discussion starting at
375 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
376 for the details.
377
59f7af81
CY
3782012-09-25 Chong Yidong <cyd@gnu.org>
379
380 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
381
22e8cf4a
SM
3822012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
383
384 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
385 when encountering an unknown bytecode.
386
578098f3
PE
3872012-09-24 Paul Eggert <eggert@cs.ucla.edu>
388
389 image.c, indent.c: Use bool for booleans.
390 * dispextern.h (struct image_type): Members valid_p, load, init
391 now return bool, not int. All uses changed.
392 * image.c: Omit unnecessary static decls.
393 (x_create_bitmap_mask, x_build_heuristic_mask):
394 Return void, not int, since callers don't care about the return value.
395 (x_create_bitmap_mask, define_image_type, valid_image_p)
396 (struct image_keyword, parse_image_spec, image_spec_value)
397 (check_image_size, image_background)
398 (image_background_transparent, x_clear_image_1)
399 (postprocess_image, lookup_image, x_check_image_size)
400 (x_create_x_image_and_pixmap, xbm_image_p)
401 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
402 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
403 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
404 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
405 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
406 (png_image_p, init_png_functions, png_load_body, png_load)
407 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
408 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
409 (init_gif_functions, gif_load, imagemagick_image_p)
410 (imagemagick_load_image, imagemagick_load, svg_image_p)
411 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
412 (gs_load):
413 * nsimage.m (ns_load_image):
414 * nsterm.m (ns_defined_color):
415 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
416 * xfns.c (x_defined_color):
417 * xterm.c (x_alloc_lighter_color_for_widget)
418 (x_alloc_nearest_color_1, x_alloc_nearest_color)
419 (x_alloc_lighter_color):
420 * indent.c (disptab_matches_widthtab, current_column)
421 (scan_for_column, string_display_width, indented_beyond_p)
422 (compute_motion, vmotion, Fvertical_motion):
423 Use bool for booleans.
424
a5f2b6ec
CY
4252012-09-24 Chong Yidong <cyd@gnu.org>
426
427 * chartab.c (Fset_char_table_default): Obsolete function removed.
428
18e27ea8
PE
4292012-09-23 Paul Eggert <eggert@cs.ucla.edu>
430
afea8a8a
PE
431 Move pid_t related decls out of lisp.h.
432 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
433 (interruptible_wait_for_termination):
434 Move these decls from lisp.h to syswait.h, since they use pid_t.
435 Needed on FreeBSD; see Herbert J. Skuhra in
436 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
437 * callproc.c: Include syswait.h.
438
18e27ea8
PE
439 gnutls.c, gtkutil.c: Use bool for boolean.
440 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
441 (emacs_gnutls_handle_error):
442 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
443 (xg_hide_tooltip, xg_create_frame_widgets)
444 (create_dialog, xg_uses_old_file_dialog)
445 (xg_get_file_with_chooser, xg_get_file_with_selection)
446 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
447 (xg_item_label_same_p, xg_update_menubar)
448 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
449 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
450 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
451 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
452 (update_frame_tool_bar, free_frame_tool_bar):
453 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
454 * nsmenu.m (ns_update_menubar):
455 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
456 * xfns.c (Fx_show_tip) [USE_GTK]:
457 Use bool for boolean.
458 * gtkutil.c (xg_update_frame_menubar):
459 * xmenu.c (update_frame_menubar):
460 Return void, not int, since caller ignores return value.
461 * gtkutil.c (xg_change_toolbar_position):
462 Return void, not 1.
463
af0e9f75
JB
4642012-09-23 Juanma Barranquero <lekktu@gmail.com>
465
466 * makefile.w32-in (BLOCKINPUT_H): Remove.
467 (SYSSIGNAL_H): New macro.
468 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
469 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
470 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
471 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
472 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
473 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
474 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
475 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
476 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
477 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
478 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
479 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
480 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
481 ($(BLD)/w32xfns.$(O)): Update dependencies.
482
5101529e
EZ
4832012-09-23 Eli Zaretskii <eliz@gnu.org>
484
485 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
486 fatal_error_backtrace.
487
488 * w32proc.c (sys_kill): Undo last change: don't do anything when
489 invoked to deliver SIGABRT to our own process. This is now
490 handled by emacs_raise.
491
2c3ee0ad
JB
4922012-09-23 Juanma Barranquero <lekktu@gmail.com>
493
494 * w32term.c (w32_read_socket): Remove leftover reference to
495 interrupt_input_pending.
496
62a1d661
PE
4972012-09-23 Paul Eggert <eggert@cs.ucla.edu>
498
499 Do not use SA_NODEFER.
500 Problem reported by Dani Moncayo in
501 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
502 * alloc.c (die):
503 * sysdep.c (emacs_abort): Do not reset signal handler.
504 * emacs.c (terminate_due_to_signal): Reset signal handler here.
505 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
506 wanted even on POSIXish hosts, and it doesn't work on Windows.
507
a0942b9a
JD
5082012-09-23 Jan Djärv <jan.h.d@swipnet.se>
509
510 * xterm.c (x_term_init): Call fixup_locale before and after calling
511 gtk_init (Bug#12392).
512
d07ff9db
CY
5132012-09-23 Chong Yidong <cyd@gnu.org>
514
515 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
516 Vdynamic_library_alist.
517
518 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
519 (Fgnutls_available_p): Caller changed.
520
521 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
522 (Flibxml_parse_xml_region): Likewise.
523
524 * dispextern.h (struct image_type): Remove arg from init function.
525
526 * image.c (Finit_image_library, lookup_image_type)
527 (define_image_type): Remove now-unneeded second arg.
528 (init_xpm_functions, init_png_functions, init_jpeg_functions)
529 (init_tiff_functions, init_gif_functions, init_svg_functions):
530 Arglist and w32_delayed_load calling convention changed.
531 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 532 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 533
4d7e6e51
PE
5342012-09-23 Paul Eggert <eggert@cs.ucla.edu>
535
536 Simplify and avoid signal-handling races (Bug#12471).
537 * alloc.c (die):
538 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
539 Avoid recursive loop if there's a fatal error in the function itself.
540 * atimer.c (pending_atimers):
541 * blockinput.h: Don't include "atimer.h"; no longer needed.
542 (interrupt_input_pending): Remove. All uses removed.
543 pending_signals now counts both atimers and ordinary interrupts.
544 This is less racy than having three separate pending-signal flags.
545 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
546 (input_blocked_p):
547 Rename from their upper-case counterparts BLOCK_INPUT,
548 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
549 INPUT_BLOCKED_P, and turn into functions. All uses changed.
550 This makes it easier to access volatile variables more accurately.
551 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
552 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
553 that's more reliable if the code is buggy and sets
554 interrupt_input_blocked to a negative value. All uses changed.
555 * atimer.c (deliver_alarm_signal):
556 Remove. No need to deliver this to the parent; any thread can
557 handle this signal now. All uses replaced by underlying handler.
558 * atimer.c (turn_on_atimers):
559 * dispnew.c (handle_window_change_signal):
560 * emacs.c (handle_danger_signal):
561 * keyboard.c (kbd_buffer_get_event):
562 Don't reestablish signal handler; not needed with sigaction.
563 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
564 (UNBLOCK_INPUT_TO):
565 Rework to avoid unnecessary accesses to volatile variables.
566 (UNBLOCK_INPUT_TO): Now a function.
567 (totally_unblock_input, unblock_input): New decls.
568 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
569 (init_data): Remove. Necessary stuff now done in init_signal.
570 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
571 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
572 (fatal_error_code): Remove; no longer needed.
573 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
574 it doesn't always backtrace. All uses changed. No need to reset
575 signal to default, since sigaction and/or die does that for us now.
576 Use emacs_raise (FOO), not kill (getpid (), FOO).
577 (main): Check more-accurately whether we're dumping.
578 Move fatal-error setup to sysdep.c
579 * floatfns.c: Do not include "syssignal.h"; no longer needed.
580 * gtkutil.c (xg_get_file_name, xg_get_font):
581 Remove no-longer-needed signal-mask manipulation.
582 * keyboard.c, process.c (POLL_FOR_INPUT):
583 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
584 * keyboard.c (read_avail_input): Remove.
585 All uses replaced by gobble_input.
586 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
587 (kbd_buffer_store_event_hold, gobble_input):
588 (record_asynch_buffer_change) [USABLE_SIGIO]:
589 (store_user_signal_events):
590 No need to mess with signal mask.
591 (gobble_input): If blocking input and there are terminals, simply
592 set pending_signals to 1 and return. All hooks changed to not
593 worry about whether input is blocked.
594 (process_pending_signals): Clear pending_signals before processing
595 them, in case a signal comes in while we're processing.
596 By convention callers now test pending_signals before calling us.
597 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
598 New functions, to support changes to blockinput.h.
599 (handle_input_available_signal): Now extern.
600 (reinvoke_input_signal): Remove. All uses replaced by
601 handle_async_input.
602 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
603 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
604 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
605 Clear sigmask reliably, even if Fsignal returns, which it can.
606 Omit unnecessary accesses to volatile var.
607 (quit_throw_to_read_char): No need to restore sigmask.
608 * keyboard.c (gobble_input, handle_user_signal):
609 * process.c (wait_reading_process_output):
610 Call signal-handling code rather than killing ourselves.
611 * lisp.h: Include <float.h>, for...
612 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
613 (pending_signals): Now volatile.
614 (syms_of_data): Now const if IEEE floating point.
615 (handle_input_available_signal) [USABLE_SIGIO]:
616 (terminate_due_to_signal, record_child_status_change): New decls.
617 * process.c (create_process): Avoid disaster if memory is exhausted
618 while we're processing a vfork, by tightening the critical section
619 around the vfork.
620 (send_process_frame, process_sent_to, handle_pipe_signal)
621 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
622 ignores SIGPIPE.
623 (send_process): No need for setjmp/longjmp any more, since the
624 SIGPIPE stuff is now gone. Instead, report an error if errno
625 is EPIPE.
626 (record_child_status_change): Now extern. PID and W are now args.
627 Return void, not bool. All callers changed.
628 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
629 Remove. All uses removed. This bug should be fixed now in a
630 different way.
631 (wait_for_termination_1): Use waitpid rather than sigsuspend,
632 and record the child status change directly. This avoids the
633 need to futz with the signal mask.
634 (process_fatal_action): Move here from emacs.c.
635 (emacs_sigaction_flags): New function, containing
636 much of what used to be in emacs_sigaction_init.
637 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
638 caught by emacs, to make races less likely.
639 (deliver_process_signal): Rename from handle_on_main_thread.
640 All uses changed.
641 (BACKTRACE_LIMIT_MAX): Now at top level.
642 (thread_backtrace_buffer, threadback_backtrace_pointers):
643 New static vars.
644 (deliver_thread_signal, deliver_fatal_thread_signal):
645 New functions, for more-accurate delivery of thread-specific signals.
646 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
647 (deliver_arith_signal): Handle in this thread, not
648 in the main thread, since it's triggered by this thread.
649 (maybe_fatal_sig): New function.
650 (init_signals): New arg DUMPING so that we can be more accurate
651 about whether we're dumping. Caller changed.
652 Treat thread-specific signals differently from process-general signals.
653 Block all signals while handling fatal error; that's safer.
654 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
655 on IEEE hosts.
656 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
657 Ignore SIGPIPE unless batch.
658 (emacs_backtrace): Output backtrace for the appropriate thread,
659 which is not necessarily the main thread.
660 * syssignal.h: Include <stdbool.h>.
661 (emacs_raise): New macro.
662 * xterm.c (x_connection_signal): Remove; no longer needed
663 now that we use sigaction.
664 (x_connection_closed): No need to mess with sigmask now.
665 (x_initialize): No need to reset SIGPIPE handler here, since
666 init_signals does this for us now.
667
8f4635e9
JD
6682012-09-23 Jan Djärv <jan.h.d@swipnet.se>
669
670 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 671 background rect may be larger (Bug#12245).
8f4635e9 672
3296976d
CY
6732012-09-23 Chong Yidong <cyd@gnu.org>
674
675 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
676
d41e491e
PE
6772012-09-22 Paul Eggert <eggert@cs.ucla.edu>
678
679 * .gdbinit: Just stop at fatal_error_backtrace.
680 See Stefan Monnier's request in
681 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
682 Remove no-longer-used query of system type.
683
c88b867f
CY
6842012-09-22 Chong Yidong <cyd@gnu.org>
685
686 * search.c (Freplace_match): Doc fix (Bug#12325).
687
688 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
689
690 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
691 (Fline_end_position): Doc fix.
692
693 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
694
bb4d86b4
CY
6952012-09-22 Chong Yidong <cyd@gnu.org>
696
697 * dispextern.h (struct image_type): Add new slot, storing a type
698 initialization function.
699
700 * image.c (define_image_type): Call the image initializer function
701 if it is defined. Arguments and return value changed.
702 (valid_image_p, make_image): Callers changed.
703 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
704 (gif_type, imagemagick_type, svg_type, gs_type):
705 Add initialization functions.
bb4d86b4
CY
706 (Finit_image_library): Call lookup_image_type.
707 (CHECK_LIB_AVAILABLE): Macro deleted.
708 (lookup_image_type): Call define_image_type here, rather than via
709 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
710 (syms_of_image): Move define_image_type calls for xbm_type and
711 pbm_type to lookup_image_type.
712
df9685f3
EZ
7132012-09-22 Eli Zaretskii <eliz@gnu.org>
714
715 * keyboard.c (timer_check_2): Move calculation of 'timers' and
716 'idle_timers' from here ...
717 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
718 lists, to avoid infloops when the timer does something stupid,
719 like reinvoke itself with the same or smaller time-out.
720 (Bug#12447)
721
8e17c9ba
MR
7222012-09-22 Martin Rudalics <rudalics@gmx.at>
723
724 * window.c (Fsplit_window_internal): Handle only Qt value of
725 Vwindow_combination_limit separately.
726 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
727 (Vwindow_combination_limit): New default value.
728 Rewrite doc-string.
8e17c9ba 729
589bd69b
EZ
7302012-09-22 Eli Zaretskii <eliz@gnu.org>
731
732 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
733 the new overlay string. (Bug#10159)
734
01108e3f
PE
7352012-09-22 Paul Eggert <eggert@cs.ucla.edu>
736
737 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
738 or that fprintf is async-signal-safe. POSIX doesn't require
739 either assumption.
740
82f8cd94
CY
7412012-09-22 Chong Yidong <cyd@gnu.org>
742
743 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
744 (Bug#8207).
745
3cccbd87
KH
7462012-09-22 Kenichi Handa <handa@gnu.org>
747
748 * composite.c (composition_reseat_it): Handle the case that a
749 grapheme cluster is not covered by a single font (Bug#12352).
750
09c01941
CY
7512012-09-21 Chong Yidong <cyd@gnu.org>
752
753 * image.c (define_image_type): Avoid adding duplicate types to
754 image_types (Bug#12463). Suggested by Jörg Walter.
755
acfa068f 7562012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
757
758 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
759 (print_load_command_name): Add case LC_DATA_IN_CODE.
760 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
761
acfa068f 7622012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
763
764 * eval.c (Frun_hook_with_args_until_success)
765 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
766
acfa068f 7672012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
768
769 * fileio.c (Ffile_selinux_context): Only call freecon when
770 lgetfilecon succeeded.
771 (Fset_file_selinux_context): Likewise. (Bug#12444)
772
acfa068f 7732012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
774
775 * xdisp.c (try_window_reusing_current_matrix): Under bidi
776 reordering, locate the cursor by calling set_cursor_from_row; if
777 that fails, clear the desired glyph matrix before returning a
778 failure indication to the caller. Fixes leaving garbled display
779 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
780 (compute_stop_pos_backwards): Fix a typo that caused crashes while
781 scrolling through multibyte text.
aa36e4d2 782
e99f70c8
SM
7832012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
784
785 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
786 calling mark_vectorlike since that's the one that marks the window.
787 (mark_discard_killed_buffers): Mark the final cdr.
788 * window.h (struct window): Move prev/next_buffers to the
789 non-standard fields.
790 * window.c (make_window): Initialize prev/next_buffers manually.
791
f75beb47
PE
7922012-09-20 Paul Eggert <eggert@cs.ucla.edu>
793
794 Omit unused arg EXPECTED from socket hooks.
795 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
796 * nsterm.m (ns_term_init):
797 * termhooks.h (struct terminal.read_socket_hook):
798 * w32inevt.c (w32_console_read_socket):
799 * w32term.c (w32_read_socket):
800 * xterm.c (XTread_socket):
801 Omit unused arg EXPECTED. All callers changed.
802 (store_user_signal_events): Return void, not int, since callers no
803 longer care about the return value. All uses changed.
804
b019b76a
JB
8052012-09-20 Juanma Barranquero <lekktu@gmail.com>
806
807 * w32gui.h (XParseGeometry): Do not declare.
808
05642592
PE
8092012-09-19 Paul Eggert <eggert@cs.ucla.edu>
810
e4bce92a
PE
811 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
812 Ignore 'expected'. See Eli Zaretskii in
813 <http://bugs.gnu.org/12471#8> (last line).
814
05642592
PE
815 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
816 (XParseGeometry): Now static. Substitute extremal values for
817 values that are out of range.
818
e543ae91
JD
8192012-09-19 Jan Djärv <jan.h.d@swipnet.se>
820
821 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
822
823 * nsfns.m (XParseGeometry): Remove.
824 (Fx_create_frame): Call x_set_offset to correctly interpret
825 top_pos in geometry.
826
3a880af4 827 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
828 (Fx_parse_geometry): If there is a space in string, call
829 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
830
45ba16c7
EZ
8312012-09-17 Eli Zaretskii <eliz@gnu.org>
832
c8b9f1bc
EZ
833 * search.c (scan_buffer): Use character positions in calls to
834 region_cache_forward and region_cache_backward, not byte
835 positions. (Bug#12196)
836
b4c932a2
EZ
837 * w32term.c (w32_read_socket): Set pending_signals to 1, like
838 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
839
45ba16c7
EZ
840 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
841 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
842 emacs_blocked_malloc, now deleted.
843
eeceac93
PE
8442012-09-17 Paul Eggert <eggert@cs.ucla.edu>
845
846 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
847 The workaround was for improving performance on Solaris 2.4, but
848 is getting in the way now. Emacs will still work if someone is
849 still running Solaris 2.4 in a museum somewhere; Sun dropped
850 support for Solaris 2.4 in 2003.
851 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
852 * process.c (create_process) [HAVE_WORKING_VFORK]:
853 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
854 since Emacs no longer uses vfork on that platform.
855
78f83752
GM
8562012-09-17 Glenn Morris <rgm@gnu.org>
857
858 * emacs.c: Use COPYRIGHT.
859
634b8cac
PE
8602012-09-16 Paul Eggert <eggert@cs.ucla.edu>
861
0caaedb1
PE
862 Remove configure's --without-sync-input option (Bug#12450).
863 When auditing signal-handling in preparation for cleaning it up,
864 I found that SYNC_INPUT has race conditions and would be a real
865 pain to fix. Since it's an undocumented and deprecated
866 configure-time option, now seems like a good time to remove it.
867 Also see <http://bugs.gnu.org/11080#16>.
868 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
869 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
870 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
871 (malloc_hysteresis):
872 (check_depth) [XMALLOC_OVERRUN_CHECK]:
873 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
874 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
875 (dont_register_blocks, bytes_used_when_reconsidered)
876 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
877 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
878 [!SYSTEM_MALLOC && !SYNC_INPUT]:
879 Remove. All uses removed.
880 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
881 implementation, one that depends on whether the new macro
882 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
883 is defined.
884 * atimer.c (run_timers, handle_alarm_signal):
885 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
886 (handle_async_input, process_pending_signals)
887 (handle_input_available_signal, init_keyboard):
888 * nsterm.m (ns_read_socket):
889 * process.c (wait_reading_process_output):
890 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
891 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
892 (emacs_write):
893 * xterm.c (XTread_socket):
894 Assume SYNC_INPUT.
895 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
896 * eval.c (handling_signal): Remove. All uses removed.
897 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
898 All uses replaced with the SYNC_INPUT version.
899 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
900 Remove decls.
901 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
902 Now static.
903
634b8cac
PE
904 * font.c (Ffont_shape_gstring): Remove unused local.
905
83da1b55
GM
9062012-09-16 Glenn Morris <rgm@gnu.org>
907
518650a5
GM
908 * Makefile.in (clean): No longer run nextstep's clean.
909
83da1b55
GM
910 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
911 (ns_frag): Remove.
912 (ns-app): Move here from ns.mk, and simplify.
913 (clean): Simplify nextstep entry.
914 * ns.mk: Remove file.
915
85a43e2e
KH
9162012-09-17 Kenichi Handa <handa@gnu.org>
917
918 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
919 not covert the last few charactes.
920
ba13e616 9212012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
922
923 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
924 here, but just check the validity of glyphs in the glyph-string.
925
a8c729af
MR
9262012-09-16 Martin Rudalics <rudalics@gmx.at>
927
3a880af4
SM
928 * window.c (Fwindow_parameter, Fset_window_parameter):
929 Accept any window as argument (Bug#12452).
a8c729af 930
c077c059
JD
9312012-09-16 Jan Djärv <jan.h.d@swipnet.se>
932
933 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
934 to ns_term_init to avoid memory leak.
935
936 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
937 explicit retain/release.
938 (ns_term_init): Only allow one display. Initialize outerpool and
939 ns_*_types.
940
39a57ad0
PE
9412012-09-15 Paul Eggert <eggert@cs.ucla.edu>
942
943 Port _setjmp fix to POSIXish hosts as well as Microsoft.
944 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
945 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
946 the Microsoft problem in a different way, by altering ../nt/config.nt.
947
7105c8cb
EZ
9482012-09-15 Eli Zaretskii <eliz@gnu.org>
949
950 * w32xfns.c:
951 * w32uniscribe.c:
952 * w32term.c:
953 * w32select.c:
954 * w32reg.c:
955 * w32proc.c:
956 * w32menu.c:
957 * w32inevt.c:
958 * w32heap.c:
959 * w32font.c:
960 * w32fns.c:
961 * w32console.c:
962 * w32.c:
963 * w16select.c: Remove inclusion of setjmp.h, as it is now included
964 by lisp.h. This completes removal of setjmp.h inclusion
965 erroneously announced in the previous commit. (Bug#12446)
966
967 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
968 more accurate.
969
970 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
971 not defined as a macro. The latter happens on MS-Windows.
972 (Bug#12446)
973
0328b6de
PE
9742012-09-15 Paul Eggert <eggert@cs.ucla.edu>
975
976 Port better to POSIX hosts lacking _setjmp (Bug#12446).
977 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 978 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
979 only reason for the instance was because "lisp.h" was included.
980 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
981 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
982 and _longjmp with the new symbols. Emacs already uses _setjmp if
983 available, so this change affects only POSIXish hosts that have
984 sigsetjmp but not _setjmp, such as some versions of Solaris and
985 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
986 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
987 (png_load_body) [HAVE_PNG]:
988 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
989 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
990 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
991 since PNG requires jmp_buf. This is the only exception to the
992 general rule that we now use sys_setjmp and sys_longjmp.
993 This exception is OK since this code does not change the signal
994 mask or longjmp out of a signal handler.
995
2af03429
PE
9962012-09-14 Paul Eggert <eggert@cs.ucla.edu>
997
998 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
999 Include "syssignal.h", for 'main_thread'.
1000
2f294edf
DA
10012012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1002
1003 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
1004 * insdel.c (replace_range, replace_range_2):
1005 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
1006 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1007 Remove redundant check before calling offset_intervals.
1008
6b533e9c
MR
10092012-09-14 Martin Rudalics <rudalics@gmx.at>
1010
1011 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1012 current buffer (Bug#12387).
1013
2a7931e3
JB
10142012-09-14 Juanma Barranquero <lekktu@gmail.com>
1015
1016 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
1017
c18e885b
PE
10182012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1019
1020 Use a more backwards-compatible timer format (Bug#12430).
1021 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
1022 vector element, not from the 4th, since PSECS is now at the end.
1023 (Fcurrent_idle_time): Doc fix.
1024
d59a1afb
DA
10252012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
1026
1027 Function to mark objects and remove killed buffers at once.
1028 * alloc.c (discard_killed_buffers): Rename to ...
1029 (mark_discard_killed buffers) ... new name. Add marking
1030 of remaining objects. Fix comment. Adjust users.
1031 (mark_object): Do not touch frame buffer lists here.
1032 * frame.c (delete_frame): Reset frame buffer lists here.
1033
5f0cb45a
PE
10342012-09-13 Paul Eggert <eggert@cs.ucla.edu>
1035
8ea47e3a
PE
1036 Better workaround for GNOME bug when --enable-gcc-warnings.
1037 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
1038 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
1039 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
1040
4a4bbad2
PE
1041 Simplify SIGIO usage (Bug#12408).
1042 The code that dealt with SIGIO was crufty and confusing, e.g., it
1043 played tricks like "#undef SIGIO" but these tricks were not used
1044 consistently. Simplify mostly by not #undeffing standard symbols,
1045 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
1046 or not as we please) rather than "defined SIGIO" (standard symbol
1047 that we probably shouldn't #undef).
1048 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
1049 Modules that need it can include it.
1050 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
1051 * dispextern.h (ignore_sigio): New decl.
1052 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
1053 unconditionally, since it's now a no-op if !USABLE_SIGIO.
1054 * emacs.c (shut_down_emacs):
1055 * keyboard.c (kbd_buffer_store_event_hold):
1056 Use ignore_sigio rather than invoking 'signal' directly.
1057 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
1058 for FIONREAD.
1059 (FIONREAD, SIGIO): Do not #undef.
1060 (tty_read_avail_input): Use #error rather than a syntax error.
1061 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
1062 for I_PIPE, used by SETUP_SLAVE_PTY.
1063 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
1064 * sysdep.c (croak): Remove; no longer needed. This bit of
1065 temporary code, with Fred N. Fish's comment that it's temporary,
1066 has been in Emacs since at least 1992!
1067 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
1068 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
1069 * syssignal.h (croak): Remove decl.
1070 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
1071 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
1072 now that we're termios-only.
1073 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
1074 * term.c (dissociate_if_controlling_tty): Use #error rather than
1075 a run-time error.
1076
5f0cb45a
PE
1077 Work around GCC and GNOME bugs when --enable-gcc-warnings.
1078 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
1079 to work around GNOME bug 683906.
1080 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
1081 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
1082 This works around GCC bug 54561.
1083
40bce90b
PE
10842012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1085
1086 More fixes for 'volatile' and setjmp/longjmp.
1087 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
1088 * image.c (struct png_load_context) [HAVE_PNG]: New type.
1089 (png_load_body) [HAVE_PNG]:
1090 (jpeg_load_body) [HAVE_JPEG]:
1091 New function, with most of the old parent function's body.
1092 (png_load) [HAVE_PNG]:
1093 (jpeg_load) [HAVE_JPEG]:
1094 Invoke the new function, to avoid longjmp munging our locals.
1095 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
1096 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
1097 longjmp is passed 2, as the C standard doesn't guarantee this.
1098 Instead, store the failure code into mgr->failure_code.
1099
bfeae2cf
SM
11002012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1101
1102 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
1103 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
1104 (syms_of_keyboard): Remove support for unread-command-char.
1105
8099e36b
EZ
11062012-09-12 Eli Zaretskii <eliz@gnu.org>
1107
1108 * w32proc.c (sys_kill): If PID is our process ID and the signal is
1109 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
1110 violation. (Bug#12426)
1111
92547ff9
PE
11122012-09-12 Paul Eggert <eggert@cs.ucla.edu>
1113
1114 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
1115
45b82ad0
SM
11162012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1117
1118 * eval.c: Add `inhibit-debugger'.
1119 (Qinhibit_debugger): New symbol.
1120 (call_debugger): Bind it instead of Qdebug_on_error.
1121 (maybe_call_debugger): Test Vinhibit_debugger.
1122 (syms_of_eval): Define inhibit-debugger.
1123 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
1124 (syms_of_xdisp): Remove inhibit-debug-on-message.
1125
5779a1dc
PE
11262012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1127
50f2e553
PE
1128 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
1129 If a nonvolatile local variable is written before a _longjmp to
1130 the frame containing the variable, and is read after the _longjmp,
1131 the value read is indeterminate. Some local variables of type
1132 'struct handler' and 'struct catchtag' are used in this way, so
1133 mark each of their slots as volatile if the slot can be set before
1134 _longjmp and read afterwards.
1135 * lisp.h (struct handler): var and chosen_clause are now volatile.
1136 (struct catchtag): val, next, and pdlcount are now volatile.
1137
ae1d87e2
PE
1138 * bidi.c (bidi_push_it, bidi_pop_it):
1139 * fns.c (copy_hash_table):
1140 * image.c (define_image_type):
1141 * keyboard.c (kbd_buffer_store_event_hold):
1142 * process.c (Fprocess_send_eof):
1143 * xfaces.c (x_create_gc) [HAVE_NS]:
1144 * xgselect.c (xg_select):
1145 Prefer assignment to memcpy when either will do.
1146
5779a1dc
PE
1147 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
1148 Use pointer-to-a-pointer to simplify and avoid a NILP check each
1149 time an item is removed. No need to mark this function 'inline';
1150 the compiler knows better than we do.
1151
c4c9756b
JD
11522012-09-11 Jan Djärv <jan.h.d@swipnet.se>
1153
1154 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
1155 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
1156 to change_frame_size (Bug#12388).
1157 (windowDidResize:): Pass YES to updateFrameSize.
1158
1159 * nsterm.h: Add delay parameter to updateFrameSize.
1160
d73e321c
DA
11612012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1162
1163 Discard killed buffers from deleted window and frame objects.
1164 This reduces an amount of references to killed buffers and
1165 helps GC to reclaim them faster.
1166 * alloc.c (discard_killed_buffers): New function.
1167 (mark_object): Use it for deleted windows and frames.
1168 (mark_object): If symbol's value is set up for a killed buffer
1169 or deleted frame, restore it's global binding.
1170 * data.c (swap_in_global_binding): Add GC notice.
1171 (swap_in_symval_forwarding): Use convenient set_blv_where.
1172 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
1173 * window.h: ... to here.
1174
e578f381
DA
11752012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
1176
1177 Convenient macro to check whether the buffer is live.
1178 * buffer.h (BUFFER_LIVE_P): New macro.
1179 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
1180 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
1181
3057e615
YM
11822012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1183
1184 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
1185 composition cases (Bug#12364).
1186
1187 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
1188 overhang of succeeding glyphs overlapping box cursor.
1189
1190 * w32term.c (x_draw_glyph_string): Likewise.
1191
6fda35f2
PE
11922012-09-11 Paul Eggert <eggert@cs.ucla.edu>
1193
c990426a
PE
1194 Simplify, document, and port floating-point (Bug#12381).
1195 The porting part of this patch fixes bugs on non-IEEE platforms
1196 with frexp, ldexp, logb.
1197 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
1198 Now static.
1199 * floatfns.c: Simplify discussion of functions that Emacs doesn't
1200 support, by removing commented-out code and briefly listing the
1201 C89 functions excluded. The commented-out stuff was confusing
1202 maintenance, e.g., we thought we needed cbrt but it was commented out.
1203 (logb): Remove decl; no longer needed.
1204 (isfinite): New macro, if not already supplied.
1205 (isnan): Don't replace any existing macro.
1206 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
1207 are present on all C89 platforms.
1208 (Ffrexp): Do not special-case zero, as frexp does the right thing
1209 for that case.
1210 (Flogb): Do not use logb, as it doesn't have the desired meaning
1211 on hosts that use non-base-2 floating point. Instead, stick with
1212 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
1213 frexp, to avoid getting an unspecified result.
1214
6fda35f2
PE
1215 * xdisp.c (Qinhibit_debug_on_message): Now static.
1216
16130a58
JD
12172012-09-10 Jan Djärv <jan.h.d@swipnet.se>
1218
1219 * nsterm.m (ns_update_begin): Set clip path to whole view by using
1220 NSBezierPath (Bug#12131).
1221
d105a573
CY
12222012-09-10 Chong Yidong <cyd@gnu.org>
1223
1224 * fns.c (Fdelq, Fdelete): Doc fix.
1225
ff55dfe8
PE
12262012-09-10 Paul Eggert <eggert@cs.ucla.edu>
1227
1228 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
1229 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
1230
e7032e7c
SM
12312012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
1232
1233 * lisp.h (make_lisp_ptr): New macro to replace XSET.
1234 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
1235 Use it.
1236
e9957956
EZ
12372012-09-09 Eli Zaretskii <eliz@gnu.org>
1238
aba05ce9
EZ
1239 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
1240 left fringe if the window has a left margin. This avoids leaving
1241 traces of the cursor because its leftmost pixel is not drawn over.
1242
e9957956
EZ
1243 * dispnew.c (update_window_line): When the left margin area of a
1244 screen line is updated, set the redraw_fringe_bitmaps_p flag of
1245 that screen line. (Bug#12277)
1246
f6196b87
PE
12472012-09-09 Paul Eggert <eggert@cs.ucla.edu>
1248
1249 Assume C89 or later for math functions (Bug#12381).
1250 This simplifies the code, and makes it a bit smaller and faster,
1251 and (most important) makes it easier to clean up signal handling
1252 since we can stop worring about floating-point exceptions in
1253 library code. That was a problem before C89, but the problem
1254 went away many years ago on all practical Emacs targets.
1255 * data.c, image.c, lread.c, print.c:
1256 Don't include <math.h>; no longer needed.
1257 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
1258 might be autoconfigured, as that never happens.
1259 * data.c (fmod):
1260 * doprnt.c (DBL_MAX_10_EXP):
1261 * print.c (DBL_DIG):
1262 Remove. C89 or later always defines these.
1263 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
1264 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
1265 (arith_error, domain_error, domain_error2):
1266 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
1267 no longer needed -- we simply return what C returns. All uses removed.
1268 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
1269 the wrapped code.
1270 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
1271 Remove. All uses expanded, as these macros are no longer used
1272 more than once and are now more trouble than they're worth.
1273 (Ftan): Use tan, not sin / cos.
1274 (Flogb): Assume C89 frexp.
1275 (fmod_float): Assume C89 fmod.
1276 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
1277 (init_floatfns): Remove. All uses removed.
1278
9d7f1863
JD
12792012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1280
1281 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
1282 compositeToPoint for OSX < 10.6 (Bug#12390).
1283
eabf0404
PE
12842012-09-08 Paul Eggert <eggert@cs.ucla.edu>
1285
1286 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
1287 This produces more-accurate results.
1288
0b3b1d23
JD
12892012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1290
1291 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
1292 changes (Bug#12088).
1293
6dcef6ec
CY
12942012-09-08 Chong Yidong <cyd@gnu.org>
1295
1296 * syntax.c (Fstring_to_syntax): Doc fix.
1297
aa7d57c5
JD
12982012-09-08 Jan Djärv <jan.h.d@swipnet.se>
1299
1300 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
1301 in the internal border.
1302 (x_set_window_size): Remove static variables and their usage.
1303 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
1304 (ns_after_update_window_line, ns_draw_fringe_bitmap):
1305 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
1306 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
1307 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
1308 (ns_fix_rect_ibw): Remove.
1309 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
1310 (ns_dumpglyphs_box_or_relief): Ditto.
1311 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
1312 adjustment.
1313 (ns_dumpglyphs_image): Ditto.
fc0c31f8 1314 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
1315 border adjustment.
1316 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
1317 their usage. Add fringe_extended_p and its use as in other terms.
1318 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
1319 scroll bar was removed.
1320 (updateFrameSize): New function.
1321 (windowDidResize): Move code to updateFrameSize and call it.
1322
1323 * nsterm.h (EmacsView): Add updateFrameSize.
1324
1a5432bc
CY
13252012-09-07 Chong Yidong <cyd@gnu.org>
1326
b4f5313e
CY
1327 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
1328
1a5432bc
CY
1329 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
1330
1a4f1e9b
PE
13312012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1332
1333 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
1334 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
1335 Problem introduced when merging patches. Noted by Eli Zaretskii in
1336 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
1337 * floatfns.c: Comment fix.
1338 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
1339 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
1340 and anyway the declaration is harmless even if SIGDANGER is not defined.
1341 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
1342 defined BROKEN_FIONREAD). systty.h formerly did this, but other
1343 source files not surprisingly expected syssignal.h to define, or
1344 not define, SIGIO, and it's cleaner to do it that way, for consistency.
1345 Include <sys/ioctl.h>, for FIONREAD.
1346 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
1347 This eliminates a problem whereby other files mysteriously had
1348 to include "syssignal.h" before including "systty.h" if they
1349 wanted to use "#ifdef SIGIO".
1350
bc8000ff
EZ
13512012-09-07 Eli Zaretskii <eliz@gnu.org>
1352
3e6d6928
EZ
1353 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
1354
1355 * w32.c (sigemptyset): Empty the set.
1356 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
1357
bc8000ff
EZ
1358 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
1359
b4fa72f2
DA
13602012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
1361
1362 * alloc.c (mark_buffer): Revert unsafe marking optimization.
1363 (mark_object): Likewise for frame objects.
1364
30730c93
PE
13652012-09-07 Paul Eggert <eggert@cs.ucla.edu>
1366
1367 * syssignal.h (handle_on_main_thread): Always declare,
1368 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
1369 This ports to platforms without HAVE_PTHREAD.
1370
2fe28299
PE
13712012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1372
1373 Signal-handler cleanup (Bug#12327).
1374 Emacs's signal handlers were written in the old 4.2BSD style with
1375 sigblock and sigmask and so forth, and this led to some
1376 inefficiencies and confusion. Rewrite these to use
1377 pthread_sigmask etc. without copying signal sets around. Also,
1378 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
1379 'signal', and instead use functions that do not attempt to take
1380 over the system name space. This patch causes Emacs's text
1381 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
1382 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
1383 Do not include <signal.h> or "syssignal.h", as these
1384 modules do not use signals.
1385 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
1386 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
1387 Do not include <signal.h>, as "syssignal.h" does that for us now.
1388 * atimer.c (sigmask_atimers): New function.
1389 (block_atimers, unblock_atimers): New functions,
1390 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
1391 All uses replaced.
1392 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
1393 no longer needed here.
1394 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 1395 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
1396 * sysdep.c (struct save_signal): New member 'action', replacing
1397 old member 'handler'.
1398 (save_signal_handlers, restore_signal_handlers):
1399 Use sigaction instead of 'signal' to save and restore.
1400 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
1401 New function. All users of 'signal' modified to use set_sighandler
1402 if they're writeonly, and to use sys_signal if they're read+write.
1403 (emacs_sigaction_init, forwarded_signal): New functions.
1404 (sys_signal): Remove. All uses replaced by calls to sigaction
1405 and emacs_sigaction_init, or by direct calls to 'signal'.
1406 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
1407 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
1408 all uses replaced by pthread_sigmask etc. calls.
1409 * syssignal.h: Include <signal.h>.
1410 (emacs_sigaction_init, forwarded_signal): New decls.
1411 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
1412 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
1413 (sigmask, sys_sigmask): Remove; no longer needed.
1414 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
1415 (sigblock, sigunblock, sigfree):
1416 (sigsetmask) [!defined sigsetmask]:
1417 Remove. All uses replaced by pthread_sigmask.
1418 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
1419 no longer need to be replaced, and its typical old uses
1420 are now done via emacs_sigaction_init and sigaction.
1421 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
1422 (sys_sigdel): Remove; unused.
1423 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
1424
0216c128
EZ
14252012-09-06 Eli Zaretskii <eliz@gnu.org>
1426
1427 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
1428 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
1429
c752cfa9
DA
14302012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1431
1432 Explicitly mark buffer_defaults and buffer_local_symbols.
1433 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
1434 mark_local_symbols here.
1435 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
1436 since special buffers aren't marked here any more.
1437 (allocate_buffer): Chain new buffer with all_buffers here...
1438 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
1439 not here.
1440 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
1441 (syms_of_buffer): Remove staticpro of the above.
1442 (init_buffer_once): Set names for buffer_defaults and
1443 buffer_local_symbols.
1444
a864ef14
PE
14452012-09-06 Paul Eggert <eggert@cs.ucla.edu>
1446
1447 Use bool for booleans in font-related modules.
1448 * font.c (font_intern_prop, font_style_to_value)
1449 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
1450 (generate_otf_features, font_check_otf_features, font_check_otf)
1451 (font_match_p, font_list_entities, font_at):
1452 * fontset.c (fontset_id_valid_p, reorder_font_vector
1453 (fontset_find_font, Fset_fontset_font)
1454 (face_suitable_for_char_p) [0]:
1455 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
1456 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
1457 (m17n_flt_initialized, ftfont_shape_by_flt):
1458 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
1459 * nsfont.m (nsfont_draw):
1460 * w32font.c (w32font_draw):
1461 * w32term.c (x_draw_glyphless_glyph_string_foreground):
1462 Use bool for booleans.
1463 * font.h: Adjust to above API changes.
1464 (struct font, struct font_driver, struct font_driver_list):
1465 Use bool for booleans.
1466 (struct font): Remove useless member encoding_type.
1467 All users removed.
1468 * fontset.c, xftfont.c: Omit unnecessary static decls.
1469
0699fc18
DA
14702012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
1471
1472 * alloc.c (mark_object): Revert window marking code
1473 since it's unsafe for the Fset_window_configuration.
1474
20ef56db
PE
14752012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1476
2fe28299 1477 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
1478 Be more systematic about preserving errno whenever a signal
1479 handler returns, even if it's not in the main thread. Do this by
1480 renaming signal handlers to distinguish between signal delivery
1481 and signal handling. All uses changed.
1482 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
1483 * data.c (deliver_arith_signal): Rename from arith_error.
1484 * dispnew.c (deliver_window_change_signal): Rename from
1485 window_change_signal.
1486 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
1487 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
1488 * keyboard.c (deliver_input_available_signal): Rename from
1489 input_available_signal.
1490 (deliver_user_signal): Rename from handle_user_signal.
1491 (deliver_interrupt_signal): Rename from interrupt_signal.
1492 * process.c (deliver_pipe_signal): Rename from send_process_trap.
1493 (deliver_child_signal): Rename from sigchld_handler.
1494 * atimer.c (handle_alarm_signal):
1495 * data.c (handle_arith_signal):
1496 * dispnew.c (handle_window_change_signal):
1497 * emacs.c (handle_fatal_signal, handle_danger_signal):
1498 * keyboard.c (handle_input_available_signal):
1499 * keyboard.c (handle_user_signal, handle_interrupt_signal):
1500 * process.c (handle_pipe_signal, handle_child_signal):
1501 New functions, with the actual signal-handling code taken from the
1502 original respective signal handlers, sans the sporadic attempts to
1503 preserve errno, since that's now done by handle_on_main_thread.
1504 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
1505 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
1506 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1507 Move to sysdep.c.
1508 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1509 Move initialization of main_thread to sysdep.c's init_signals.
1510 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
1511 our usage, and simplifies the mainline code.
1512 (record_child_status_change): New static function, as a helper
1513 for handle_child_signal, and with most of the old child handler's
1514 contents.
1515 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
1516 (handle_child_signal): Use the above.
1517 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1518 Moved here from emacs.c.
1519 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
1520 code moved here from emacs.c's main function.
1521 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
1522 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
1523 This lets callers save and restore errno properly.
20ef56db 1524
e3ccf108
DA
15252012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1526
1527 Remove redundant or unused things here and there.
1528 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
1529 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
1530 * editfns.c (Fcompare_buffer_substrings): Likewise.
1531 * frame.h (struct terminal, struct font_driver_list):
1532 Remove redundant declarations.
1533 * window.h (Qleft, Qright): Likewise.
1534
697e1e39
DA
15352012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1536
1537 Do not mark objects from deleted buffers, windows and frames.
1538 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
1539 (mark_object): Likewise for windows and frames.
1540
c1ca42ca
DA
15412012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
1542
1543 * alloc.c (valid_lisp_object_p): Treat killed buffers,
1544 buffer_defaults and buffer_local_symbols as valid objects.
1545 Return special value to denote them.
1546
014d93be
PE
15472012-09-05 Paul Eggert <eggert@cs.ucla.edu>
1548
f75d7a91
PE
1549 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
1550 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
1551 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
1552 (file_name_absolute_p, Fsubstitute_in_file_name):
1553 (check_executable, check_writable, Ffile_accessible_directory_p)
1554 (Fset_file_selinux_context, Fdefault_file_modes)
1555 (Finsert_file_contents, choose_write_coding_system)
1556 (Fwrite_region, build_annotations, a_write, e_write)
1557 (Fdo_auto_save):
1558 * filelock.c (boot_time_initialized, get_boot_time)
1559 (get_boot_time_1, lock_file_1, within_one_second):
1560 * floatfns.c (in_float):
1561 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
1562 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
1563 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
1564 * lisp.h (struct Lisp_Hash_Table.cmpfn):
1565 * window.c (compare_window_configurations):
1566 Use bool for booleans.
1567 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
1568 (Fdefault_file_modes): Now mode_t, not int, for modes.
1569 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
1570 (internal_delete_file): Now returns void, not a (boolean) int,
1571 since nobody was looking at the return value.
1572 * lisp.h, window.h: Adjust to above API changes.
1573
014d93be
PE
1574 * xdisp.c (set_message): Simplify and reindent last change.
1575
776f29e1
JB
15762012-09-05 Juanma Barranquero <lekktu@gmail.com>
1577
1578 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
1579
7f7e0167
LI
15802012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
1581
1582 * eval.c (call_debugger): Make the function non-static so that we
1583 can call it from set_message.
1584
1585 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
1586 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
1587
cf29dd84
PE
15882012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1589
1590 Give more-useful info on a fatal error (Bug#12328).
1591 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
1592 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
1593 of doing the work ourselves.
1594 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
1595 do most of the work.
1596 (fatal_error_backtrace): New function, taken from the guts
1597 of the old fatal_error_signal, but with a new option to output
1598 a backtrace.
1599 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
1600 info about the signal than just its number.
1601 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
1602 * sysdep.c: Include <execinfo.h>
1603 (emacs_backtrace): New function, taken partly from the previous
1604 code of the 'die' function.
1605 (emacs_abort): Call fatal_error_backtrace rather than abort.
1606
972debf2
SM
16072012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
1608
1609 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
1610 eager (load-time) macro-expansion.
1611 * lisp.mk (lisp): Add macroexp.
1612
1088b922
PE
16132012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1614
1615 Simplify redefinition of 'abort' (Bug#12316).
1616 Do not try to redefine the 'abort' function. Instead, redo
1617 the code so that it calls 'emacs_abort' rather than 'abort'.
1618 This removes the need for the NO_ABORT configure-time macro
1619 and makes it easier to change the abort code to do a backtrace.
1620 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
1621 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
1622 Remove; sysdep.c's emacs_abort now takes its place.
1623 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
1624 'abort' changed to use 'emacs_abort'.
1625 * msdos.c (dos_abort) [defined abort]: Remove; not used.
1626 (abort) [!defined abort]: Rename to ...
1627 (emacs_abort): ... new name.
1628 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
1629 the place of the old 'abort' in emacs.c.
1630 * w32.c, w32fns.c (abort): Do not #undef.
1631 * w32.c (emacs_abort): Rename from w32_abort.
1632
30934d33
EZ
16332012-09-04 Eli Zaretskii <eliz@gnu.org>
1634
1635 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
1636 offsets[j].dv, since the y axis of the screen coordinates points
1637 down, while the y axis of the font definition coordinates points
1638 up. This fixes display of Arabic diacritics such as KASRA and
1639 KASRATAN. (Bug#11860)
1640
af26b72c
PE
16412012-09-04 Paul Eggert <eggert@cs.ucla.edu>
1642
1643 Be more systematic about _setjmp vs setjmp.
1644 * alloc.c (test_setjmp, mark_stack):
1645 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
1646 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
1647 (png_load, my_error_exit, jpeg_load):
1648 * process.c (send_process_trap, send_process):
1649 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
1650 The underscored versions are up to 30x faster on some hosts.
1651 Formerly, the code used setjmp+longjmp sometimes and
1652 _setjmp+_longjmp at other times, with no particular reason to
1653 prefer setjmp+longjmp.
1654
26d4541d
PE
16552012-09-03 Paul Eggert <eggert@cs.ucla.edu>
1656
d42f4f0f 1657 Fix minor problem found by static checking.
26d4541d 1658 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 1659
c5e28e39
MR
16602012-09-03 Martin Rudalics <rudalics@gmx.at>
1661
1662 * buffer.c (Fdelete_all_overlays): New function.
1663
3eab3ca9
CY
16642012-09-03 Chong Yidong <cyd@gnu.org>
1665
1666 * gtkutil.c: Add extern decl for Qxft.
1667
c04889f8
PE
16682012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1669
1882aa38
PE
1670 * emacs.c, eval.c: Use bool for boolean.
1671 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
1672 (malloc_using_checking) [DOUG_LEA_MALLOC]:
1673 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
1674 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
1675 (main, decode_env_path, Fdaemon_initialized):
1676 * eval.c (call_debugger, Finteractive_p, interactive_p):
1677 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
1678 (maybe_call_debugger, Fbacktrace):
1679 * process.c (read_process_output, exec_sentinel):
1680 Use bool for booleans.
1681 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
1682 All callers changed.
1683 * eval.c (interactive_p): Omit always-true boolean argument
1684 EXCLUDE_SUBRS_P. All callers changed.
1685 * dispextern.h, lisp.h: Reflect above API changes.
1686 * firstfile.c (dummy): Use the address of 'main', whose signature
1687 won't change, instead of the address of 'initialize', whose
1688 signature just changed from int to bool.
1689 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
1690 * msdos.c (fatal_error_in_progress): ... from here.
1691 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
1692 of incrementing it.
1693 (redisplay_internal, unwind_redisplay): Simply clear
1694 REDISPLAYING_P when unwinding, instead of saving its previous,
1695 always-false value and then restoring it.
1696
a411ac43
PE
1697 Clean up some extern decls.
1698 Mostly, this hoists extern decls out of .c files and into .h files.
1699 That way, we're more likely to catch errors if the interfaces change.
1700 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
1701 declare xg_mark_data.
1702 * dispextern.h (x_frame_parm_handlers):
1703 * font.h (Qxft):
1704 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
1705 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
1706 (Qultra_bold, Qoblique, Qitalic):
1707 Move extern decl here from .c file.
1708 * alloc.c (xg_mark_data) [USE_GTK]:
1709 * doc.c (Qclosure):
1710 * eval.c (Qlexical_binding):
1711 * fns.c (time) [!HAVE_UNISTD_H]:
1712 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
1713 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
1714 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
1715 * lread.c (Qinternal_interpreter_environment):
1716 * minibuf.c (Qbuffer):
1717 * process.c (QCfamily, QCfilter):
1718 * widget.c (free_frame_faces):
1719 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
1720 * xfont.c (x_clear_errors):
1721 * xterm.c (x_frame_parm_handlers):
1722 Remove now-redundant extern decls.
1723 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
1724 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
1725 Now static.
1726 * xfaces.c: Remove unnecessary static decls.
1727 * xterm.c (updating_frame): Remove decl of nonexistent object.
1728
c04889f8
PE
1729 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1730 when building globals.h, as the objects that are not built on
1731 this host are not needed to compile C files on this host.
1732
8b339673
JD
17332012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1734
1735 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1736
1737 * frame.h: Add missing prototype for x_wm_set_size_hint.
1738
a08d4ba7
PE
17392012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1740
1741 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1742 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1743 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1744 (Fsubstitute_command_keys):
1745 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1746 (save_excursion_save, save_excursion_restore)
1747 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1748 (format_time_string, general_insert_function)
1749 (make_buffer_string, make_buffer_string_both)
1750 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1751 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1752 (copy_text, insert_1, insert_1_both, insert_from_string)
1753 (insert_from_string_before_markers, insert_from_string_1)
1754 (insert_from_buffer, insert_from_buffer_1, replace_range)
1755 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1756 (del_range_2, modify_region):
1757 * intervals.c (intervals_equal, balance_possible_root_interval)
1758 (adjust_intervals_for_insertion, merge_properties_sticky)
1759 (graft_intervals_into_buffer, lookup_char_property)
1760 (adjust_for_invis_intang, set_point_both)
1761 (get_property_and_range, compare_string_intervals)
1762 (set_intervals_multibyte_1, set_intervals_multibyte):
1763 * keyboard.c (decode_timer):
1764 Use bool for boolean.
1765 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1766 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1767
48c948de
CY
17682012-09-02 Chong Yidong <cyd@gnu.org>
1769
1770 * keymap.c (push_key_description): Print M-TAB as C-M-i
1771 (Bug#11758).
1772
6c49a40b
JB
17732012-09-02 Juanma Barranquero <lekktu@gmail.com>
1774
1775 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1776 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1777 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1778 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1779 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1780 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1781 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1782
4dfbd238
EZ
17832012-09-01 Eli Zaretskii <eliz@gnu.org>
1784
7e510e28
EZ
1785 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1786 more than one grapheme cluster passed to the shaper: compute the
1787 offset adjustment values separately for each cluster. (Bug#11860)
1788
4dfbd238
EZ
1789 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1790 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1791 about implicit conversions from integer to pointer.
1792
86571ae0
DC
17932012-09-01 Daniel Colascione <dancol@dancol.org>
1794
1795 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1796 system used too early.
1797
0e23ef9d
PE
17982012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1799
1800 Better seed support for (random).
1801 * emacs.c (main): Call init_random.
1802 * fns.c (Frandom): Set the seed from a string argument, if given.
1803 Remove long-obsolete Gentzel cruft.
1804 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1805 (init_random): New function.
1806
17a2cbbd
DC
18072012-09-01 Daniel Colascione <dancol@dancol.org>
1808
1809 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1810 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1811 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1812 x_wm_set_size_hint, x_query_colors, x_real_positions,
1813 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1814 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1815 all of which have been moved to common code.
1816
1817 * xfaces.c: Include TERM_HEADER instead of listing all possible
1818 window-system headers.
1819
1820 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1821 to match header.
1822
1823 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1824 directly accessing frame internals.
1825
f18cbb28 1826 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
1827 globals_of_w32font.
1828
1829 * process.c: Include TERM_HEADER instead of listing all possible
1830 window-system headers.
1831
3a880af4
SM
1832 * nsterm.h: Remove declarations now in frame.h.
1833 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
1834
1835 * menu.c: Include TERM_HEADER instead of listing all possible
1836 window-system headers.
1837
1838 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1839 window system.
1840
1841 * keyboard.c: Include TERM_HEADER instead of listing all possible
1842 window-system headers.
1843
1844 * image.c: Include TERM_HEADER instead of listing all possible
1845 window-system headers. Declare Vlibrary_cache when compiling for
1846 Windows.
1847
1848 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1849 window system declarations.
1850
1851 * frame.h: Move common functions here: set_frame_menubar,
1852 x_set_window_size, x_sync, x_get_focus_frame,
1853 x_set_mouse_position, x_set_mouse_pixel_position,
1854 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1855 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1856 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1857 x_activate_menubar, x_real_positions, x_bitmap_icon,
1858 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1859 and x_query_colors.
1860
1861 * frame.c: Include TERM_HEADER instead of listing all possible
1862 window-system headers.
1863
1864 * font.c: Include TERM_HEADER instead of listing all possible
1865 window-system headers.
1866
1867 * emacs.c: Include TERM_HEADER.
1868
f18cbb28
EZ
1869 * dispnew.c: Include TERM_HEADER instead of listing all possible
1870 window-system headers.
17a2cbbd 1871
f18cbb28 1872 * ccl.h: Include character.h.
17a2cbbd
DC
1873
1874 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1875 the current window system; include in list of objects to link into
1876 Emacs.
1877
c650a5de
DA
18782012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1879
1880 Remove mark_ttys function and fix tty_display_info initialization.
1881 * lisp.h (mark_ttys): Remove prototype.
1882 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1883 to mark_ttys because all possible values of 'top_frame' slot are
1884 the frames which are reachable from Vframe_list.
1885 * term.c (mark_ttys): Remove.
1886 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1887
4e0f6479
DA
18882012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1889
1890 Change struct frame bitfields from unsigned char to unsigned.
1891 * frame.h (struct frame): Change type of 'display_preempted',
1892 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1893 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1894 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1895 bitfields from unsigned char to unsigned.
1896
8b96a52c
DA
18972012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1898
1899 Remove unused member of struct x_output and struct w32_output.
1900 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1901 * w32term.h (struct w32_output): Likewise.
1902
b4444c8a
JD
19032012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1904
1905 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1906 does not become zero (Bug#12234).
1907
b98521db
PE
19082012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1909
1910 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1911 for GCC 4.7.1 x86-64.
1912
31d02438
GM
19132012-08-30 Glenn Morris <rgm@gnu.org>
1914
1915 * lread.c (init_lread): For out-of-tree builds, only add the
1916 source directory's site-lisp dir to the load-path if it exists,
1917 consistent with in-tree builds. (Bug#12302)
1918
7f8941d8
JD
19192012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1920
1921 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 1922 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
1923 (windowShouldClose:): Set window_closed.
1924 (dealloc): New member, free button_values.
fc0c31f8
JB
1925 (process_dialog:): Make member function. Remove window argument,
1926 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
1927 in button_values.
1928 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 1929 with tag. Remove return self, declare return value as void.
7f8941d8
JD
1930 (addString:row:): Remove return self, declare return value as void.
1931 (addSplit): Remove return self, declare return value as void.
1932 (clicked:): Remove return self, declare return value as void.
fc0c31f8 1933 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
1934 (initFromContents:isQuestion:): Adjust call to process_dialog.
1935 Code formatting change.
1936 (timeout_handler:): Set timer_fired to YES.
1937 (runDialogAt:): Set timer_fired to NO.
1938 Handle click on close button as quit.
1939
1940 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1941 Add window_closed and button_values. Add void as return value for
1942 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1943 Add process_dialog as new member.
1944
eada0861 19452012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 1946
eada0861
GM
1947 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1948 is not one of the heaps we manage. (Bug#12242)
1949
19502012-08-28 Glenn Morris <rgm@gnu.org>
1951
1952 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1953
457294dd
MR
19542012-08-28 Martin Rudalics <rudalics@gmx.at>
1955
1956 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
1957 auto-buffer-name window parameter. Install revision of reverted
1958 fix.
457294dd 1959
4f2daf31
DA
19602012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1961
1962 Do not allow to set major mode for a dead buffer.
1963 * buffer.c (Fset_buffer_major_mode): Signal an error
1964 if the buffer is dead.
1965 (Fother_buffer, other_buffer_safely): Remove redundant
1966 nested declaration.
1967
66322887
DA
19682012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1969
1970 Always use set_buffer_if_live to restore original buffer at unwind.
1971 * buffer.h (record_unwind_current_buffer): New function.
1972 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1973 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1974 * undo.c, window.c: Adjust users.
1975 * buffer.c (set_buffer_if_live): Fix comment.
1976
a3d794a1
DA
19772012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1978
1979 Fix usage of set_buffer_internal.
1980 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1981 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1982 * coding.c (decode_coding): Omit redundant test.
1983 * fileio.c (decide_coding_unwind): Likewise.
1984 * fns.c (secure_hash): Likewise.
1985 * insdel.c (modify_region): Likewise.
1986 * keyboard.c (command_loop_1): Likewise.
1987 * print.c (PRINTFINISH): Likewise.
1988 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1989
59ea14cd
PE
19902012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1991
1992 * dispnew.c: Use bool for boolean.
1993 (frame_garbaged, display_completed, delayed_size_change)
1994 (fonts_changed_p, add_window_display_history)
1995 (add_frame_display_history, verify_row_hash)
1996 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1997 (row_equal_p, realloc_glyph_pool)
1998 (allocate_matrices_for_frame_redisplay)
1999 (showing_window_margins_p)
2000 (adjust_frame_glyphs_for_frame_redisplay)
2001 (build_frame_matrix_from_leaf_window, make_current)
2002 (mirrored_line_dance, mirror_line_dance, update_frame)
2003 (update_window_tree, update_single_window)
2004 (check_current_matrix_flags, update_window, update_text_area)
2005 (update_window_line, set_window_update_flags, scrolling_window)
2006 (update_frame_1, scrolling, buffer_posn_from_coords)
2007 (do_pending_window_change, change_frame_size)
2008 (change_frame_size_1, sit_for):
2009 Use bool for boolean.
2010 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2011 and remove last int (actually boolean) argument, which was always 0.
2012 All callers changed.
2013 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2014 * dispextern.h (struct composition_it): Use bool for boolean.
2015 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2016 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
2017 * dired.c (file_name_completion):
2018 Use bool for boolean. (This was missed in an earlier change.)
2019
95072a94
MR
20202012-08-27 Martin Rudalics <rudalics@gmx.at>
2021
2022 * window.c (Fset_window_configuration): Revert first part of
2023 last change.
2024
0f19feff
JD
20252012-08-27 Jan Djärv <jan.h.d@swipnet.se>
2026
2027 * nsterm.h (NSPanel): New class variable dialog_return.
2028
3a880af4
SM
2029 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
2030 Initialize dialog_return.
0f19feff
JD
2031 (windowShouldClose:): Use stop instead of stopModalWithCode.
2032 (clicked:): Ditto, and also set dialog_return (Bug#12258).
2033 (timeout_handler:): Use stop instead of abortModal. Send a dummy
2034 event.
2035 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
2036 modal loop returns.
2037
f10fe38f
PE
20382012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2039
de1339b0
PE
2040 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
2041 * composite.c (find_composition, composition_gstring_p)
2042 (composition_reseat_it, find_automatic_composition):
2043 * data.c (let_shadows_buffer_binding_p)
2044 (let_shadows_global_binding_p, set_internal, make_blv)
2045 (Fmake_variable_buffer_local, Fmake_local_variable)
2046 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
2047 (cons_to_signed, arith_driver):
2048 * dbusbind.c (xd_in_read_queued_messages):
2049 * dired.c (directory_files_internal, file_name_completion):
2050 Use bool for booleans.
2051 * dired.c (file_name_completion):
2052 * process.h (fd_callback):
2053 Omit int (actually boolean) argument. It wasn't being used.
2054 All uses changed.
2055 * composite.h, lisp.h: Reflect above API changes.
2056
f10fe38f
PE
2057 * cmds.c, coding.c: Use bool for booleans.
2058 * cmds.c (move_point, Fself_insert_command):
2059 * coding.h (struct composition status, struct coding_system):
2060 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
2061 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
2062 (emacs_mule_char, decode_coding_emacs_mule)
2063 (encode_coding_emacs_mule, detect_coding_iso_2022)
2064 (decode_coding_iso_2022, encode_invocation_designation)
2065 (encode_designation_at_bol, encode_coding_iso_2022)
2066 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
2067 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
2068 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
2069 (encode_coding_raw_text, detect_coding_charset)
2070 (decode_coding_charset, encode_coding_charset, detect_eol)
2071 (detect_coding, get_translation_table, produce_chars)
2072 (consume_chars, reused_workbuf_in_use)
2073 (make_conversion_work_buffer, code_conversion_save)
2074 (decode_coding_object, encode_coding_object)
2075 (detect_coding_system, char_encodable_p)
2076 (Funencodable_char_position, code_convert_region)
2077 (code_convert_string, code_convert_string_norecord)
2078 (Fset_coding_system_priority):
2079 * fileio.c (Finsert_file_contents):
2080 Use bool for booleans.
2081 * coding.h, lisp.h: Reflect above API changes.
2082 * coding.c: Remove unnecessary static function decls.
2083 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
2084 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
2085 not a boolean 'int', since callers never look at the return value.
2086 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
2087 * coding.h (decoding_buffer_size, encoding_buffer_size)
2088 (emacs_mule_string_char): Remove unused extern decls.
2089 (struct iso_2022_spec, struct coding_system):
2090 Use 'unsigned int : 1' for boolean fields, since there's more than one.
2091 (struct emacs_mule_spec): Remove unused field 'full_support'.
2092 All initializations removed.
2093 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2094
5474c384
DA
20952012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2096
f10fe38f 2097 Fix spare memory change (Bug#12286).
5474c384
DA
2098 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
2099 (valid_lisp_object_p): Likewise.
2100
c4b6914d
MR
21012012-08-27 Martin Rudalics <rudalics@gmx.at>
2102
2103 * window.c (Fset_window_configuration): Record any window's old
2104 buffer if it's replaced (see Bug#8789). If the new current
2105 buffer doesn't appear in the selected window, go to its old
2106 point (Bug#12208).
2107
35aaa1ea
DA
21082012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
2109
2110 Special MEM_TYPE_SPARE to denote reserved memory.
2111 * alloc.c (enum mem_type): New memory type.
2112 (refill_memory_reserve): Use new type for spare memory.
2113 This prevents live_cons_p and live_string_p from incorrect
2114 detection of uninitialized objects from spare memory as live.
2115
6af64513
PE
21162012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2117
8b2e00a3
PE
2118 Spelling fixes.
2119 * Makefile.in (.PHONY): versioclean -> versionclean.
2120
b52d6985
PE
2121 Remove unused external symbols.
2122 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
2123 * window.c (Qwindow_valid_p, decode_valid_window):
2124 Now static, not extern.
2125 * data.c (Qinterval): Remove; unused.
2126 (syms_of_data): Do not define 'interval'.
2127 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
2128 * window.h (decode_valid_window):
2129 Remove decls.
2130
d5172d4f
PE
2131 * character.c, charset.c, chartab.c: Use bool for booleans.
2132 * character.c (lisp_string_width, string_count_byte8)
2133 (string_escape_byte8):
2134 * charset.c (charset_map_loaded, load_charset_map, read_hex):
2135 (load_charset_map_from_file, map_charset_chars)
2136 (Fdefine_charset_internal, define_charset_internal)
2137 (Fdeclare_equiv_charset, find_charsets_in_text)
2138 (Ffind_charset_region, char_charset, Fiso_charset):
2139 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
2140 (sub_char_table_set, sub_char_table_set_range)
2141 (char_table_set_range, optimize_sub_char_table)
2142 (map_sub_char_table):
2143 Use bool for boolean.
2144 * character.c (str_to_unibyte): Omit last boolean argument; it was
2145 always 0. All callers changed.
2146 * character.h, charset.h: Adjust to match previous changes.
2147 * character.h (char_printable_p): Remove decl of nonexistent function.
2148 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
2149 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
2150 are all boolean, so make them single-bit bitfields.
2151
6af64513
PE
2152 * lisp.h (ASET): Remove attempt to detect side effects.
2153 It was meant to be temporary and it often doesn't work,
2154 because when IDX has side effects the behavior of IDX==IDX
2155 is undefined. See Stefan Monnier in
2156 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
2157
e1f29348
BR
21582012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2159
2160 * lisp.h (functionp): New function (extracted from Ffunctionp).
2161 (FUNCTIONP): Use it.
2162 * eval.c (Ffunctionp): Use it.
2163
17c05d74
PE
21642012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2165
0f46bc75
PE
2166 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
2167 as that's faster and simpler than static storage. Don't bother
2168 with the g_main_context_query overhead if g_main_context_pending
2169 says no events are pending.
2170 (gfds, gfds_size): Remove these static vars.
2171 (xgselect_initialize): Remove; no longer needed.
2172 All uses and decls removed.
2173
ee4c0f69
PE
2174 * emacs.c (fatal_error_signal_hook): Remove.
2175 All uses removed. This leftover from old code was always 0.
2176
17c05d74
PE
2177 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
2178 * casefiddle.c (casify_object, casify_region):
2179 * casetab.c (set_case_table):
2180 * category.c, category.h (word_boundary_p):
2181 * category.h (CHAR_HAS_CATEGORY):
2182 Use bool for booleans, instead of int.
2183
391ceac5
EZ
21842012-08-25 Eli Zaretskii <eliz@gnu.org>
2185
2186 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
2187
2f221583
PE
21882012-08-25 Paul Eggert <eggert@cs.ucla.edu>
2189
f4a681b0
PE
2190 On assertion failure, print backtrace if available.
2191 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
2192 (die) [ENABLE_CHECKING]: Print a backtrace if available.
2193 * Makefile.in (LIB_EXECINFO): New macro.
2194 (LIBES): Use it.
2195
2f221583
PE
2196 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
2197 * bytecode.c (exec_byte_code):
2198 * callint.c (check_mark, Fcall_interactively):
2199 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
2200 (getenv_internal, sync_process_alive, call_process_exited):
2201 * lisp.h (USE_SAFE_ALLOCA):
2202 Use bool for booleans, instead of int.
2203 * lisp.h, process.h: Adjust prototypes to match above changes.
2204 * callint.c (Fcall_interactively): Don't assume the mark's
2205 offset fits in 'int'.
2206
37ef52bb
PE
22072012-08-24 Paul Eggert <eggert@cs.ucla.edu>
2208
2209 * buffer.c, buffer.h: Use bool for boolean.
2210 * buffer.c (reset_buffer_local_variables)
2211 (buffer_lisp_local_variables, Fset_buffer_modified_p)
2212 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
2213 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
2214 (overlay_touches_p, overlay_strings, Foverlay_put)
2215 (report_overlay_modification, call_overlay_mod_hooks):
2216 (mmap_enlarge, mmap_set_vars):
2217 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
2218 Use bool for booleans, instead of int.
2219 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
2220 since the 1-or-0 return value is always ignored anyway.
2221 (mmap_initialized_p):
2222 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
2223 * buffer.h, lisp.h: Adjust prototypes to match above changes.
2224
2cc21167
PE
22252012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2226
2227 * bidi.c: Use bool for boolean.
2228 This is a bit more readable, and makes the text segment of bidi.o
2229 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
2230 Presumably it's faster too.
2231 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
2232 Now bool.
2233 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2234 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
2235 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
2236 (bidi_explicit_dir_char, bidi_level_of_next_char)
2237 (bidi_find_other_level_edge, bidi_move_to_visually_next):
2238 Use bool for booleans, instead of int.
2239 * dispextern.h (bidi_init_it, bidi_paragraph_init)
2240 (bidi_unshelve_cache): Adjust decls to match code.
2241
7db4ddf4
MR
22422012-08-23 Martin Rudalics <rudalics@gmx.at>
2243
2244 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
2245 argument.
2246
b1bb8011
PE
22472012-08-23 Paul Eggert <eggert@cs.ucla.edu>
2248
2249 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
2250 * atimer.h: Include <stdbool.h>.
2251
ff687885
DN
22522012-08-22 Dan Nicolaescu <dann@gnu.org>
2253
2254 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
2255 compile time tests instead of run time tests on systems that do
2256 not use them.
2257 (FRAME_MAC_P): Remove leftover from deleted code.
2258 * frame.c (syms_of_frame): Remove leftover from deleted code.
2259
4ce7a138
JD
22602012-08-22 Jan Djärv <jan.h.d@swipnet.se>
2261
2262 * nsterm.m (insertText:): Don't clear modifiers if code is space.
2263
d733ec6d
PE
22642012-08-22 Paul Eggert <eggert@cs.ucla.edu>
2265
2266 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
2267 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 2268 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
2269 (fontset_add): Return void, for FONTSET_ADD.
2270
d0d2d26f
PE
22712012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2272
fce31d69
PE
2273 * alloc.c: Use bool for booleans.
2274 (gc_in_progress, abort_on_gc)
2275 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2276 (dont_register_blocks) [GC_MALLOC_CHECK]:
2277 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
2278 (check_string_bytes, make_specified_string, memory_full)
2279 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
2280 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
2281 (mark_stack, valid_pointer_p, make_pure_string)
2282 (Fgarbage_collect, survives_gc_p, gc_sweep):
2283 Use bool for booleans, instead of int.
2284 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
2285 Remove unused local.
2286 * alloc.c (PURE_POINTER_P):
2287 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
2288 * editfns.c (Fformat):
2289 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
2290 (Fdo_auto_save):
2291 * fns.c (sweep_weak_table):
2292 * lisp.h (suppress_checking, push_message, survives_gc_p)
2293 (make_pure_string, gc_in_progress, abort_on_gc):
2294 * lread.c (readchar, read1):
2295 * print.c (Fprin1_to_string):
2296 * xdisp.c (push_message):
2297 Use bool for booleans affected directly or indirectly by
2298 alloc.c's changes.
2299
d0d2d26f
PE
2300 Make recently-introduced setters macros.
2301 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
2302 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
2303 (set_fontset_default, set_fontset_fallback): Rename from their
2304 upper-case counterparts, and make them functions rather than macros.
2305 This is more consistent with the other recently-introduced setters.
2306 These don't need to be inline, since they're local.
2307
d18e2bb6
JD
23082012-08-21 Jan Djärv <jan.h.d@swipnet.se>
2309
2310 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
2311 the loop (Bug#12247).
2312
1b9d9d16
PE
23132012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2314
2315 * lisp.h (vcopy): Use memcpy rather than our own loop.
2316 This fixes a performance regression introduced by the recent
2317 addition of vcopy. This means 'vcopy' will need to be modified
2318 for a copying collector, but that's OK. Also, tighten the
2319 checking in the assertion.
2320
b2f09701
EZ
23212012-08-21 Eli Zaretskii <eliz@gnu.org>
2322
2323 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
2324 components for RTL text (Bug#11860). Adjust X-OFFSET of each
2325 non-base glyph for the width of the base character, according to
e1f29348
BR
2326 what x_draw_composite_glyph_string_foreground expects.
2327 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
2328 expectations, to produce correct width of the composed character.
2329 Reverse the sign of the DU offset produced by ScriptPlace.
2330
9b994fed
PE
23312012-08-21 Paul Eggert <eggert@cs.ucla.edu>
2332
2333 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
2334
086ca913
DA
23352012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2336
2337 Avoid direct writes to contents member of struct Lisp_Vector.
2338 * lisp.h (vcopy): New function to copy data into vector.
2339 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
2340 * fns.c (Ffillarray): Use ASET.
2341 * keyboard.c (timer_check_2): Use AREF and ASET.
2342 (append_tool_bar_item, Frecent_keys): Use vcopy.
2343 * lread.c (read_vector): Use ASET.
2344 * msdos.c (Frecent_doskeys): Use vcopy.
2345 * xface.c (Finternal_copy_lisp_face): Use vcopy.
2346 (Finternal_merge_in_global_face): Use ASET and vcopy.
2347 * xfont.c (xfont_list_pattern): Likewise.
2348
5481664a
MR
23492012-08-21 Martin Rudalics <rudalics@gmx.at>
2350
2351 * window.c (Fwindow_point): For the selected window always return
2352 the position of its buffer's point.
2353 (Fset_window_point): For the selected window always go in its
2354 buffer to the specified position.
2355
6d470bdd
DA
23562012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
2357
2358 Setter macros for fontsets.
2359 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
2360 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
2361 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
2362 Adjust users.
2363
24564fe1
GM
23642012-08-20 Glenn Morris <rgm@gnu.org>
2365
2366 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2367 Don't assume that `ln -f' works.
2368
0a05a035
EZ
23692012-08-20 Eli Zaretskii <eliz@gnu.org>
2370
2371 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
2372 and later about non-assignments with no effect. See discussion at
2373 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
2374 details.
2375
e46f2325
DA
23762012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2377
2378 Inline setter functions for Lisp_Objects slots of struct specbinding.
2379 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
2380 Adjust users.
2381
734fbd86
MR
23822012-08-20 Martin Rudalics <rudalics@gmx.at>
2383
2384 * window.c (select_window): Always make selected window's buffer
2385 current.
2386
f1a95992
DA
23872012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2388
2389 Use AREF and ASET for docstrings of category tables.
2390 * category.h (CATEGORY_DOCSTRING): Use AREF.
2391 (SET_CATEGORY_DOCSTRING): Use ASET.
2392 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
2393
e83064be
DA
23942012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2395
2396 Inline setter functions for hash table members.
2397 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
2398 (set_hash_hash, set_hash_index): Rename with _slot suffix.
2399 (set_hash_key_and_value, set_hash_index, set_hash_next)
2400 (set_hash_hash): New functions.
2401 * charset.c, fns.c: Adjust users.
2402
4ce60d2e
DA
24032012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
2404
2405 Inline getter and setter functions for per-buffer values.
2406 * buffer.h (per_buffer_default, set_per_buffer_default)
2407 (per_buffer_value, set_per_buffer_value): New functions.
2408 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
2409 * buffer.c, data.c: Adjust users.
2410
c06c9690
JB
24112012-08-20 Juanma Barranquero <lekktu@gmail.com>
2412
2413 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
2414
32bd4250
PE
24152012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2416
bad03192 2417 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
2418 as gnulib does this if the system doesn't.
2419 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
2420 Remove declaration. MS-Windows declares it on stdlib.h which is
2421 included by conf_post.h.
b69a6d22
PE
2422 * emacs.c (environ) [DOUG_LEA_MALLOC]:
2423 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
2424 * vm-limit.c: Include <unistd.h>, for 'environ'.
2425
22d7feb2
PE
2426 * unexaix.c, unexcoff.c: Include "mem-limits.h".
2427 (start_of_data): Remove decl; mem-limits.h provides it.
2428
32bd4250
PE
2429 * xdisp.c (handle_invisible_prop): Make it a bit faster
2430 and avoid a gcc -Wmaybe-uninitialized diagnostic.
2431
450809af
CY
24322012-08-19 Chong Yidong <cyd@gnu.org>
2433
2434 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
2435 ends (Bug#3874).
2436
9e677988
AS
24372012-08-19 Andreas Schwab <schwab@linux-m68k.org>
2438
6b1319ce
AS
2439 * .gdbinit: Use call instead of set when calling a function in the
2440 inferior.
2441
9e677988
AS
2442 * data.c (set_internal): Don't use set_blv_found.
2443 (Fkill_local_variable): Likewise.
2444
d7191076
AA
24452012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
2446
2447 * nsfont.m (ns_ascii_average_width): Ensure the string
2448 ascii_printable is initialized with a null-terminated character
2449 array. Otherwise, it can contain undesired extra characters.
2450
e757f1c6
PE
24512012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2452
2453 port new setting code to Sun C 5.8 2005/10/13
2454 * chartab.c, lisp.h (char_table_set, char_table_set_range):
2455 Return void, not Lisp_Object. Otherwise, the compiler
2456 complains about (A?B:C) where B is void and C is Lisp_Object
2457 when compiling CHAR_TABLE_SET, due to the recent change to
2458 the API of sub_char_table_set_contents.
2459
a999ce26
CY
24602012-08-18 Chong Yidong <cyd@gnu.org>
2461
2462 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
2463 for the string case (Bug#3874).
2464
3f22b86f
PE
24652012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2466
39eb03f1
PE
2467 * buffer.h (BSET): Remove (Bug#12215).
2468 Replace all uses with calls to new setter functions.
2469 (bset_bidi_paragraph_direction, bset_case_canon_table)
2470 (bset_case_eqv_table, bset_directory, bset_display_count)
2471 (bset_display_time, bset_downcase_table)
2472 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
2473 (bset_last_selected_window, bset_local_var_alist)
2474 (bset_mark_active, bset_point_before_scroll, bset_read_only)
2475 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
2476 (bset_width_table):
2477 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2478 (bset_auto_fill_function, bset_auto_save_file_format)
2479 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2480 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2481 (bset_cache_long_line_scans, bset_case_fold_search)
2482 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2483 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2484 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2485 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2486 (bset_header_line_format, bset_indicate_buffer_boundaries)
2487 (bset_indicate_empty_lines, bset_invisibility_spec)
2488 (bset_left_fringe_width, bset_major_mode, bset_mark)
2489 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2490 (bset_name, bset_overwrite_mode, bset_pt_marker)
2491 (bset_right_fringe_width, bset_save_length)
2492 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2493 (bset_scroll_up_aggressively, bset_selective_display)
2494 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2495 (bset_word_wrap, bset_zv_marker):
2496 * category.c (bset_category_table):
2497 * syntax.c (bset_syntax_table):
2498 New setter functions.
2499
6a09a33b
PE
2500 * process.h (PSET): Remove (Bug#12215).
2501 Replace all uses with calls to new setter functions.
2502 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2503 (PROCESS_INLINE): New macro.
2504 (pset_childp): New setter function.
2505 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
2506 * process.c (PROCESS_INLINE):
2507 Define to EXTERN_INLINE, so that the corresponding functions
2508 are compiled into code.
2509 (pset_buffer, pset_command, pset_decode_coding_system)
2510 (pset_decoding_buf, pset_encode_coding_system)
2511 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
2512 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
2513 (pset_type, pset_write_queue): New setter functions.
2514
e8c17b81
PE
2515 * window.h (WSET): Remove (Bug#12215).
2516 Replace all uses with calls to new setter functions.
2517 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2518 (WINDOW_INLINE): New macro.
2519 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
2520 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
2521 (wset_total_lines, wset_vertical_scroll_bar)
2522 (wset_window_end_pos, wset_window_end_valid)
2523 (wset_window_end_vpos): New setter functions.
2524 * window.c (WINDOW_INLINE):
2525 Define to EXTERN_INLINE, so that the corresponding functions
2526 are compiled into code.
2527 (wset_combination_limit, wset_dedicated, wset_display_table)
2528 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
2529 (wset_new_normal, wset_new_total, wset_next_buffers)
2530 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2531 (wset_prev_buffers, wset_right_fringe_width)
2532 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
2533 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
2534 (wset_window_parameters):
2535 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2536 (wset_column_number_displayed, wset_region_showing):
2537 New setter functions.
2538
3f22b86f
PE
2539 * termhooks.h (TSET): Remove (Bug#12215).
2540 Replace all uses with calls to new setter functions.
2541 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2542 (TERMHOOKS_INLINE): New macro.
2543 (tset_charset_list, tset_selection_alist): New setter functions.
2544 * terminal.c (TERMHOOKS_INLINE):
2545 Define to EXTERN_INLINE, so that the corresponding functions
2546 are compiled into code.
2547 (tset_param_alist): New setter function.
2548
742af32f
PE
25492012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2550
15dbb4d6
PE
2551 * keyboard.h (KSET): Remove (Bug#12215).
2552 Replace all uses with calls to new setter functions.
2553 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2554 (KEYBOARD_INLINE): New macro.
2555 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
2556 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
2557 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
2558 New setter functions.
2559 * keyboard.c (KEYBOARD_INLINE):
2560 Define to EXTERN_INLINE, so that the corresponding functions
2561 are compiled into code.
2562 (kset_echo_string, kset_kbd_queue)
2563 (kset_keyboard_translate_table, kset_last_prefix_arg)
2564 (kset_last_repeatable_command, kset_local_function_key_map)
2565 (kset_overriding_terminal_local_map, kset_real_last_command)
2566 (kset_system_key_syms): New setter functions.
2567
f00af5b1
PE
2568 * frame.h (FSET): Remove (Bug#12215).
2569 Replace all uses with calls to new setter functions.
2570 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2571 (FRAME_INLINE): New macro.
2572 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
2573 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
2574 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
2575 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
2576 (fset_param_alist, fset_root_window, fset_scroll_bars)
2577 (fset_selected_window, fset_title, fset_tool_bar_items)
2578 (fset_tool_bar_position, fset_tool_bar_window): New functions.
2579 * frame.c (FRAME_INLINE):
2580 Define to EXTERN_INLINE, so that the corresponding functions
2581 are compiled into code.
2582 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
2583
0c94c8d6
PE
2584 A few more naming-convention fixes for getters and setters.
2585 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
2586 and rename from buffer_overlays_set_before.
2587 (set_buffer_overlays_after): Move here from buffer.h, and rename
2588 from buffer_overlays_set_after.
2589 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
2590 All uses changed.
2591 (set_buffer_intervals): Rename from buffer_set_intervals.
2592 * intervals.c (set_interval_object): Move here from intervals.h,
2593 and rename from interval_set_object.
2594 (set_interval_left): Move here from intervals.h, and rename from
2595 interval_set_left.
2596 (set_interval_right): Move here from intervals.h, and rename from
2597 interval_set_right.
2598 (copy_interval_parent): Move here from intervals.h, and rename from
2599 interval_copy_parent.
2600 * intervals.h (set_interval_parent): Rename from interval_set_parent.
2601 (set_interval_plist): Rename from interval_set_plist.
2602 Return void, not Lisp_Object, since no caller uses the result.
2603 * lisp.h (string_intervals): Rename from string_get_intervals.
2604 (set_string_intervals): Rename from string_set_intervals.
2605
34dabdb7
PE
2606 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
2607 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 2608 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
2609 All uses changed. See the end of
2610 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
2611
742af32f
PE
2612 * lisp.h (CSET): Remove (Bug#12215).
2613 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
2614 (set_char_table_purpose): New functions,
2615 replacing CSET. All uses changed. For example, replace
2616 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 2617 "set_char_table_parent (char_table, parent);".
742af32f
PE
2618 The old version was confusing because it used the same name
2619 'parent' for two different things.
2620
a04e2c62
DA
26212012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2622
2623 Functions to get and set Lisp_Object fields of buffer-local variables.
2624 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
2625 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
2626 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
2627 * data.c, eval.c, frame.c: Adjust users.
2628
383dcbf9
CY
26292012-08-17 Chong Yidong <cyd@gnu.org>
2630
2631 * xfaces.c (merge_face_vectors): If the target font specfies a
2632 font spec, make the font's attributes take precedence over
2633 directly-specified attributes.
2634 (merge_face_ref): Recognize :font.
2635
44386687
DA
26362012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
2637
2638 Do not use memcpy for copying intervals.
2639 * intervals.c (reproduce_interval): New function.
2640 (reproduce_tree, reproduce_tree_obj): Use it.
2641 (reproduce_tree_obj): Remove prototype.
2642
927c7216
PE
26432012-08-17 Paul Eggert <eggert@cs.ucla.edu>
2644
2645 * lisp.h (duration_to_sec_usec): Remove unused decl.
2646
93044f7b
AA
26472012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
2648
2649 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
2650 to an allocated instance of NSString, not to the class itself.
2651
9851e4a5
JB
26522012-08-17 Juanma Barranquero <lekktu@gmail.com>
2653
2654 * makefile.w32-in (C_CTYPE_H): New macro.
2655 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
2656 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
2657 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2658
620f13b0
PE
26592012-08-16 Paul Eggert <eggert@cs.ucla.edu>
2660
2661 Use ASCII tests for character types.
2662 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
2663 * xfns.c, xterm.c:
2664 Don't include <ctype.h>; was not needed.
2665 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
2666 * sysdep.c, xfaces.c:
2667 Include <c-ctype.h> instead of <ctype.h>.
2668 * nsterm.m: Include <c-ctype.h>.
2669 * charset.c (read_hex):
2670 * doc.c (Fsnarf_documentation):
2671 * fileio.c (IS_DRIVE) [WINDOWSNT]:
2672 (DRIVE_LETTER) [DOS_NT]:
2673 (Ffile_name_directory, Fexpand_file_name)
2674 (Fsubstitute_in_file_name):
2675 * font.c (font_parse_xlfd, font_parse_fcname):
2676 * frame.c (x_set_font_backend):
2677 * gtkutil.c (xg_get_font):
2678 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
2679 * nsimage.m (hexchar):
2680 * nsterm.m (ns_xlfd_to_fontname):
2681 * sysdep.c (system_process_attributes):
2682 * xfaces.c (hash_string_case_insensitive):
2683 Use C-locale tests instead of locale-specific tests for character
2684 types, since we want the ASCII interpretation here, not the
2685 interpretation suitable for whatever happens to be the current locale.
2686
52162052
MR
26872012-08-16 Martin Rudalics <rudalics@gmx.at>
2688
2689 Consistently check windows for validity/liveness
2690 (Bug#11984, Bug#12025, Bug#12026).
2691 * lisp.h (CHECK_VALID_WINDOW): New macro.
2692 * window.c (decode_window): Rename to decode_live_window.
2693 (decode_valid_window, Fwindow_valid_p): New functions.
2694 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
2695 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
2696 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
2697 (Fwindow_prev_sibling, Fwindow_combination_limit)
2698 (Fset_window_combination_limit, Fwindow_use_time)
2699 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
2700 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
2701 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
2702 (Fwindow_hscroll, Fset_window_hscroll)
2703 (Fwindow_redisplay_end_trigger)
2704 (Fset_window_redisplay_end_trigger, Fwindow_edges)
2705 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
2706 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2707 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
2708 (Fwindow_end, Fset_window_point, Fset_window_start)
2709 (Fpos_visible_in_window_p, Fwindow_line_height)
2710 (Fwindow_dedicated_p, Fset_window_dedicated_p)
2711 (Fwindow_prev_buffers, Fset_window_prev_buffers)
2712 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
2713 (Fset_window_parameter, Fwindow_display_table)
2714 (Fset_window_display_table, Fdelete_other_windows_internal)
2715 (Fset_window_buffer, Fset_window_new_total)
2716 (Fset_window_new_normal, Fdelete_window_internal)
2717 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
2718 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
2719 (Fwindow_scroll_bars): Check whether argument window is a valid or
2720 live window. Update doc-strings.
2721 (syms_of_window): New symbol Qwindow_valid_p.
2722 * keyboard.c (Fposn_at_x_y): Check whether argument
2723 frame_or_window denotes a valid window.
2724
2751c80f
DA
27252012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2726
2727 Fix previous char table change.
2728 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2729 * chartab.c (optimize_sub_char_table): Likewise.
2730
032a42c8
CY
27312012-08-16 Chong Yidong <cyd@gnu.org>
2732
a2d19368
CY
2733 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2734
032a42c8
CY
2735 * xfont.c (xfont_open):
2736 * xftfont.c (xftfont_open): Set the font's max_width field.
2737
2738 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2739 min_width to space_width and average_width to the average over
2740 printable ASCII characters.
2741 (ns_char_width): Code cleanup.
2742 (ns_ascii_average_width): New utility function.
2743
2744 * font.h (struct font): Update comments.
2745
a098c930
DA
27462012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2747
032a42c8 2748 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
2749 * lisp.h (CSET): New macro.
2750 (char_table_set_extras, char_table_set_contents)
2751 (sub_char_table_set_contents): New function.
2752 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2753 * syntax.c: Adjust users.
2754
8be3a09c
SM
27552012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2756
2757 * eval.c (eval_sub): Bind lexical-binding.
2758 * lread.c (Qlexical_binding): Make non-static.
2759
ac4845a6
JD
27602012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2761
ddee6515
JD
2762 * nsmenu.m (popupSession): Remove.
2763 (pop_down_menu): Remove endModalSession.
2764 (timeout_handler:): New method.
2765 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2766 Call runModalForWindow. Check timer_fired when it returns.
2767 If not set, cancel timer and break out of loop.
2768 Otherwise loop again, with a new timeout.
2769
2770 * nsterm.m: Include fcntl.h if present.
2771 (fd_entry, t_readfds, inNsSelect): Remove.
2772 (select_writefds, select_valid, select_timeout, selfds)
2773 (select_mutex, apploopnr): Add.
2774 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2775 Otherwise call kbd_buffer_store_event.
2776 (ns_send_appdefined): Remove release of fd_entry.
2777 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2778 Increment and decrement apploopnr.
2779 (ns_select): If no file descriptors, just do a NSTimer.
2780 Otherwise copy read/write masks and start select thread (fd_handler).
2781 Start main loop and wait for application defined event.
2782 Inform select thread to stop selecting after main loop is exited.
2783 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 2784 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
2785 (fd_handler:): Loop forever, wait for info from the main thread
2786 to either start or stop selecting. When select returns, send
2787 and appdefined event.
2788 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2789 If not call kbd_buffer_store_event.
2790
2791 * nsterm.h (EmacsApp): fd_handler takes id argument.
2792 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2793
ac4845a6
JD
2794 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2795
eb424fe3
EZ
27962012-08-15 Eli Zaretskii <eliz@gnu.org>
2797
2798 * region-cache.c (move_cache_gap): Update gap_len using the actual
2799 growth of the boundaries array. Do not change cache_len.
2800 (Bug#12196)
2801
4e6a86c6
DA
28022012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2803
2804 Generalize and cleanup font subsystem checks.
2805 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
2806 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2807 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 2808
5bf192ca
DA
28092012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2810
2811 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2812
f2045622
CY
28132012-08-15 Chong Yidong <cyd@gnu.org>
2814
8be3a09c
SM
2815 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2816 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2817 extract the font descriptor instead of just the font name.
2818 In that case, return a font spec instead of a string.
f2045622
CY
2819 (x_last_font_name): Move to this file from xfns.c.
2820
2821 * xfns.c (Fx_select_font): The return value can also be a font
2822 spec. Move x_last_font_name management to gtkutil.c.
2823
2824 * xfaces.c: Make font weight and style symbols non-static.
2825
7f6feb56
SM
28262012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2827
2828 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2829 (bug#12117).
2830
fecbd8ff
SM
28312012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2832
2833 * alloc.c (Fgarbage_collect): Use plural form consistently.
2834
9b8d5165
EZ
28352012-08-14 Eli Zaretskii <eliz@gnu.org>
2836
2837 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2838 iteration through the command loop. Fixes a problem whereby mouse
2839 movements are ignored until the first mouse click.
2840
f5d9e83a
PE
28412012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2842
2843 Use bool, not int, for Lisp booleans.
2844 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2845 makes Emacs a bit smaller and presumably a bit faster.
2846 * lisp.h: Include <stdbool.h>.
2847 (struct Lisp_Boolfwd, defvar_bool):
2848 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2849 * regex.c [!emacs]: Include <stdbool.h>.
2850 (false, true): Remove; <stdbool.h> does this for us now.
2851
55802e4a
CY
28522012-08-14 Chong Yidong <cyd@gnu.org>
2853
4abcdac8
CY
2854 * character.c (Fcharacterp): Doc fix (Bug#12076).
2855
2856 * data.c (Findirect_variable): Doc fix (Bug#11040).
2857
55802e4a
CY
2858 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2859
2860 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 2861 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 2862
8e99d072
BR
28632012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2864
2865 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2866 (bug#12022).
2867
08908aca
MR
28682012-08-14 Martin Rudalics <rudalics@gmx.at>
2869
2870 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2871 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2872 * minibuf.c (choose_minibuf_frame, read_minibuf):
2873 * w32fns.c (x_create_tip_frame):
2874 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2875 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2876
56120d6f
PE
28772012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2878
2879 * intervals.c (offset_intervals): Remove obsolete comment.
2880
67b77c0b
AS
28812012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2882
2883 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2884
f48b82fd
GR
28852012-08-14 Gergely Risko <gergely@risko.hu>
2886
2887 * coding.c (decode_coding): Record buffer modification before
2888 disabling undo_list (Bug#11773).
2889
fd318b54
DA
28902012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2891
2892 Revert and cleanup some recent overlay changes.
2893 * buffer.h (enum overlay_type): Remove.
2894 (buffer_get_overlays, buffer_set_overlays): Likewise.
2895 (buffer_set_overlays_before, buffer_set_overlays_after):
2896 New function. Adjust users.
2897 (unchain_both): Add eassert.
2898
41a62dd9
DA
28992012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2900
2901 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2902
5884c324
PE
29032012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2904
2905 * gtkutil.c (xg_mark_data): Don't assume C99.
2906
ca06f160
JD
29072012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2908
2909 * gtkutil.c (xg_frame_tb_info): New struct.
2910 (TB_INFO_KEY): New define.
2911 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2912 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2913 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2914 if not present.
2915 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 2916 is up to date. Otherwise store new data.
ca06f160
JD
2917 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2918
7864a3f7
DA
29192012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2920
2921 Use KSET for write access to Lisp_Object members of struct kboard.
2922 * keyboard.h (KSET): New macro.
2923 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2924 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2925 * xterm.c: Adjust users.
2926
4c31be61
DA
29272012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2928
2929 Use BSET for write access to Lisp_Object members of struct buffer.
2930 * buffer.h (BSET): New macro.
2931 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2932 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2933 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2934 * window.c, xdisp.c, xfns.c: Adjust users.
2935
14ae4239
BT
29362012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2937
2938 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2939
32bcadb4
JD
29402012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2941
3d29b2ce 2942 * nsterm.m (not_in_argv): New function.
fc0c31f8 2943 (application:openFile, application:openTempFile:):
3d29b2ce
JD
2944 (application:openFileWithoutUI:, application:openFiles:): Open file
2945 if not_in_argv returns non-zero (bug#12171).
2946
32bcadb4 2947 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
2948 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2949 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
2950 (xg_get_font_name): Use those functions/macros here.
2951 Reported by Frans Oilinki <moilinki@gmail.com>.
2952
9ff9402d 29532012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
2954
2955 * unexmacosx.c (copy_data_segment): Copy initialized data in
2956 statically linked libraries from input file rather than memory.
2957
db74a5fc
YM
2958 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2959 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2960 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2961
25e65510
GM
29622012-08-10 Glenn Morris <rgm@gnu.org>
2963
2964 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2965 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2966
7961135c
DA
29672012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2968
2969 Fix last change to allow compilation with low optimization levels.
2970 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2971 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2972
42b3a444
DA
29732012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2974
2975 Use common inline syntax in intervals.h.
2976 * intervals.h (INTERVALS_INLINE): New macro.
2977 Change all users from LISP_INLINE.
2978
9fb0c957
DA
29792012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2980
2981 Define Qnone once for all platforms.
2982 * frame.c (Qnone): Define here.
2983 (syms_of_frame): DEFSYM it.
2984 * lisp.h (Qnone): New declaration.
2985 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2986 * xfns.c: Remove duplication. Adjust users.
2987
65e8ee52
DA
29882012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2989
2990 Remove unused macros from intervals.h.
2991 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2992 * intervals.c: Adjust comment.
2993
9b855fd6
EZ
29942012-08-10 Eli Zaretskii <eliz@gnu.org>
2995
2996 * w32fns.c <w32_unicode_gui>: New static variable.
2997 (globals_of_w32fns): Initialize it according to os_subtype.
2998 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2999 testing os_subtype.
3000
39cb9e56 30012012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
3002 Eli Zaretskii <eliz@gnu.org>
3003
3004 Fix bug #10299 with Unicode characters sent by customized
3005 keyboards created by MSKLC.
3006 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3007 (w32_init_class): Use it to initialize the Emacs class with either
3008 ANSI or Unicode API calls.
3009 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3010 later.
3011 (w32_wnd_proc): If the character code sent by WM_CHAR or
3012 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3013 original message. Call DefWindowProcW on NT and later.
3014
9374581a
GM
30152012-08-10 Glenn Morris <rgm@gnu.org>
3016
4b94e8cf
GM
3017 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
3018
9374581a
GM
3019 * lisp.h (DIRECTORY_SEP): Let configure set it.
3020
a2752828
DA
30212012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
3022
3023 Use TSET for write access to Lisp_Object slots of struct terminal.
3024 * termhooks.h (TSET): New macro.
3025 * coding.c, terminal.c, xselect.c: Adjust users.
3026
cc92c454
SM
30272012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
3028
3029 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
3030 the failing expression, include them in the error message.
3031 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
3032 * lisp.h (internal_condition_case_n): Update declaration.
3033
4cb3e6b3
DA
30342012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3035
3036 Inline functions to examine and change buffer overlays.
3037 * buffer.c (unchain_both): New function.
3038 * buffer.h (buffer_get_overlays, buffer_set_overlays):
3039 (buffer_has_overlays): New function.
3040 (enum overlay_type): New enum.
3041 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
3042 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
3043
8707c1e5
DA
30442012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3045
3046 Inline functions to examine and change buffer intervals.
3047 * alloc.c (mark_interval_tree): Remove.
3048 (MARK_INTERVAL_TREE): Simplify.
3049 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
3050 * intervals.c (buffer_balance_intervals): New function.
3051 (graft_intervals_into_buffer): Adjust indentation.
3052 (set_intervals_multibyte): Simplify.
3053 * buffer.h (BUF_INTERVALS): Remove.
3054 (buffer_get_intervals, buffer_set_intervals): New function.
3055 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
3056 * intervals.c, textprop.c: Adjust users.
3057
ad8c997f
DA
30582012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3059
3060 Inline functions to examine and change string intervals.
3061 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
3062 (string_get_intervals, string_set_intervals): New function.
3063 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3064 * lread.c, print.c, textprop.c: Adjust users.
3065
32ac3a6b
GM
30662012-08-08 Glenn Morris <rgm@gnu.org>
3067
3068 * lisp.mk (lisp): Remove language/persian.elc.
3069
77c7bcb1
DA
30702012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3071
3072 Cleanup intervals.
3073 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
3074 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
3075 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
3076 Adjust comment. Move under #if 0.
77c7bcb1
DA
3077 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
3078 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
3079
9c08a8d4
DA
30802012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
3081
3082 Check total length of intervals with eassert.
3083 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
3084 * intervals.c: Change all users to eassert.
3085
26d16b35
EZ
30862012-08-07 Eli Zaretskii <eliz@gnu.org>
3087
14ae4239
BT
3088 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
3089 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
3090 INTERNAL_FIELD in Lisp_Cons.
3091
c644523b
DA
30922012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3093
3094 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
3095 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
3096 name since all xname users are fixed long time ago. Do not
3097 use INTERNAL_FIELD.
3098 (set_symbol_name, set_symbol_function, set_symbol_plist):
3099 (set_symbol_next, set_overlay_plist): New function.
3100 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
3101 (struct Lisp_Overlay): Likewise.
3102 (CVAR, MVAR, SVAR): Remove.
3103 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
3104 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
3105 * xterm.c: Adjust users.
3106 * .gdbinit: Change to use name field of struct Lisp_Symbol
3107 where appropriate.
3108
6a3d20cc
DA
31092012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3110
3111 Basic functions to set Lisp_Object and pointer slots of intervals.
3112 * intervals.h (interval_set_parent, interval_set_object):
3113 (interval_set_left, interval_set_right, interval_set_plist):
3114 (interval_copy_parent): New function.
3115 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
3116 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
3117 Adjust indentation.
6a3d20cc
DA
3118 (INTERVAL_SIZE): Remove. Adjust users.
3119 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
3120
4d2b044c
DA
31212012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3122
3123 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
3124 * process.h (PGET): Remove.
3125 (struct Lisp_Process): Do not use INTERNAL_FIELD.
3126 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3127
d3d50620
DA
31282012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3129
3130 Drop WGET and revert read access to Lisp_Objects slots of struct window.
3131 * window.h (WGET): Remove.
3132 (struct window): Do not use INTERNAL_FIELD.
3133 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3134 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3135 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3136 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3137 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3138 Adjust users.
3139
d10a51dc
CY
31402012-08-07 Chong Yidong <cyd@gnu.org>
3141
3142 * window.c (Fwindow_edges, Fwindow_pixel_edges)
3143 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
3144 (Fdelete_window_internal): Signal an error if the window is not on
3145 a live frame (Bug#12025).
3146
e69b0960
DA
31472012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
3148
3149 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
3150 * frame.h (FGET): Remove.
3151 (struct frame): Do not use INTERNAL_FIELD.
3152 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3153 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3154 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3155 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3156
25a20a3a
JB
31572012-08-06 Juanma Barranquero <lekktu@gmail.com>
3158
3159 * w32.c: Silence compiler warnings.
3160 (map_w32_filename): Remove unused variable `is_fat'.
3161 (chase_symlinks): Add parentheses around expression.
3162
1c6f11f4
GM
31632012-08-06 Glenn Morris <rgm@gnu.org>
3164
1db4583a
GM
3165 * sysdep.c: Respect BROKEN_GETWD.
3166
1c6f11f4
GM
3167 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
3168 Let configure handle it.
3169 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
3170
2b90362b
DA
31712012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3172
3173 Use GCALIGNMENT where appropriate.
3174 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
3175 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
3176 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
3177
5f50daf2
EZ
31782012-08-06 Eli Zaretskii <eliz@gnu.org>
3179
14ae4239
BT
3180 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
3181 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 3182
cbcc7007
SM
31832012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
3184
3185 * buffer.h (struct buffer): Revert `indirections' to a simple int;
3186 that should be sufficient for everyone.
3187
4d365fa4
JD
31882012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3189
3190 * keyboard.c (timer_check_2): Add break so timer_check returns next
3191 timeout.
3192
dd86bd82
DA
31932012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3194
3195 Fix Windows build errors introduced after converting to WGET and WSET.
3196 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
3197 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3198
054e1668
JD
31992012-08-06 Jan Djärv <jan.h.d@swipnet.se>
3200
3201 * nsterm.m (ns_frame_rehighlight): Use FSET.
3202
3203 * nsmenu.m (ns_update_menubar): Use FSET.
3204
21238f11
DA
32052012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3206
3207 Separate read and write access to Lisp_Object slots of Lisp_Process.
3208 * process.h (PGET, PSET): New macros similar to AREF and ASET.
3209 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
3210
077288cf
DA
32112012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3212
3213 Separate read and write access to Lisp_Object slots of struct window.
3214 * window.h (WGET, WSET): New macros similar to AREF and ASET.
3215 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3216 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3217 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
3218 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
3219 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
3220 Adjust users.
3221
71688bd7
DA
32222012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3223
3224 Fix Windows build errors introduced after converting to FGET and FSET.
3225 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
3226 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
3227 (w32_judge_scroll_bars): Change to use FSET.
3228 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
3229
f99bac93
DA
32302012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3231
3232 Fix replacement typo.
3233 * window.c (replace_window): Set root_window instead of
3234 selected_window. This fixes a total window subsystem
3235 malfunction reported by Bastien Guerry <bzg@gnu.org>.
3236
8c2a0f2d
GM
32372012-08-06 Glenn Morris <rgm@gnu.org>
3238
3239 * lisp.mk (lisp): Add language/persian.elc.
3240
edd74c35
DA
32412012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
3242
3243 Separate read and write access to Lisp_Object slots of struct frame.
3244 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
3245 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
3246 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
3247 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
3248 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
3249
8671676c
AS
32502012-08-05 Andreas Schwab <schwab@linux-m68k.org>
3251
3252 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
3253
663e2b3f
DA
32542012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
3255
3256 Generalize common compile-time constants.
3257 * lisp.h (header_size, bool_header_size, word_size): Now here.
3258 (struct Lisp_Vector): Add comment.
3259 (struct Lisp_Bool_Vector): Move up to define handy constants.
3260 (VECSIZE, PSEUDOVECSIZE): Simplify.
3261 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
3262 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
3263 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
3264 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
3265 * xfont.c, xmenu.c: Use word_size where appropriate.
3266
d32e47af
LM
32672012-08-05 Lawrence Mitchell <wence@gmx.li>
3268
3269 * search.c (Freplace_match): Treat \? in the replacement text
3270 literally (Bug#8161).
3271
e5d9c0d1
CY
32722012-08-05 Chong Yidong <cyd@gnu.org>
3273
3274 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
3275 * frame.c (Vdelete_frame_functions):
3276 * emacs.c (Vkill_emacs_hook): Doc fix.
3277
8da0576b
EZ
32782012-08-04 Eli Zaretskii <eliz@gnu.org>
3279
3280 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
3281 --with-x-toolkit=no builds.
3282 Reported by Carsten Mattner <carstenmattner@gmail.com>.
3283
02676e5d
CY
32842012-08-04 Chong Yidong <cyd@gnu.org>
3285
3286 * syntax.c (Fmodify_syntax_entry): Doc fix.
3287
97147da9
EZ
32882012-08-04 Eli Zaretskii <eliz@gnu.org>
3289
76151e2c
EZ
3290 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
3291 * w32.c (init_environment): Change the default values of many
3292 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
3293 them into environment when they were not already defined.
3294 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 3295 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
3296 (check_windows_init_file): Now external, not static.
3297 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
3298 called when Vload_path is already set up.
3299
3300 * w32.h (check_windows_init_file): Add prototype.
3301
3302 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
3303 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
3304 compatibility with Posix platforms.
3305 (main): Move the call to check_windows_init_file to here from
3306 w32.c.
3307 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
3308 any, in the DEFALT argument into the root of the Emacs build or
3309 installation tree, as appropriate.
3310
3311 * callproc.c (init_callproc_1): Call decode_env_path instead of
3312 doing its equivalent by hand.
3313 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
3314 the code that sets Vexec_path run on MS-Windows.
3315
3316 * lread.c (init_lread): Add comments to #ifdef's.
3317
97147da9
EZ
3318 * msdos.c (dos_set_window_size, IT_update_begin)
3319 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
3320 instead of direct references.
3321
185ee146
PE
33222012-08-04 Paul Eggert <eggert@cs.ucla.edu>
3323
3324 Export DEFAULT_REHASH_* to GDB.
3325 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
3326 Now constants, not macros.
3327
8834c57a
PE
33282012-08-03 Paul Eggert <eggert@cs.ucla.edu>
3329
98c6f1e3
PE
3330 Remove unnecessary casts involving pointers.
3331 These casts are no longer needed now that we assume C89 or later,
3332 since they involve casting to or from void *.
3333 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
3334 (make_pure_float, make_pure_vector):
3335 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
3336 * macros.c (Fstart_kbd_macro):
3337 * menu.c (find_and_return_menu_selection):
3338 * minibuf.c (read_minibuf_noninteractive):
3339 * sysdep.c (closedir):
3340 * xdisp.c (x_produce_glyphs):
3341 * xfaces.c (compare_fonts_by_sort_order):
3342 * xfns.c (x_real_positions, select_visual):
3343 * xselect.c (x_stop_queuing_selection_requests)
3344 (x_get_window_property, x_get_window_property_as_lisp_data):
3345 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
3346 Remove unnecessary pointer casts.
3347 * alloc.c (record_xmalloc): New function.
3348 * lisp.h (record_xmalloc): New decl.
3349 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
3350 more like a function. This is because the pointer cast is not
3351 needed. All uses changed.
3352 * print.c (print_string, print_error_message): Avoid length recalc.
3353
8834c57a
PE
3354 Improve fix for macroexp crash with debugging (Bug#12118).
3355 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
3356 ARRAY_MARK_FLAG when checking subscripts, because ASET is
3357 not supposed to be invoked from the garbage collector.
3358 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
3359 (gc_aset): New function, which is like ASET but can be
3360 used in the garbage collector.
3361 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3362 (set_hash_index): Use it instead of ASET.
3363
6dad7178
EZ
33642012-08-03 Eli Zaretskii <eliz@gnu.org>
3365
3366 Support symlinks on latest versions of MS-Windows.
3367 * w32.c: Include winioctl.h and aclapi.h.
3368 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
3369 (revert_to_self): Forward declarations of static functions.
3370 <static BOOL g_b_init_get_security_info>:
3371 <g_b_init_create_symbolic_link>: New static flags.
3372 (globals_of_w32): Initialize them to zero.
3373 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
3374 (map_w32_filename): Improve commentary. Simplify switch.
3375 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
3376 headers (most versions of MinGW w32api don't).
3377 (get_security_info, create_symbolic_link)
3378 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
3379 New functions.
3380 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
3381 in the argument file name.
3382 (sys_access): Call unc_volume_file_attributes only if
3383 GetFileAttributes fails with network-related error codes.
3384 (sys_rename): Diagnose renaming of a symlink when the user doesn't
3385 have the required privileges.
14ae4239 3386 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
3387 get_file_security_desc.
3388 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
3389 with addition of handling of symlinks and support for 'lstat'.
3390 If possible, get file's attributes and security information by
6dad7178
EZ
3391 handle, not by name. Produce S_IFLNK bit for symlinks, when
3392 called from 'lstat'.
3393 (stat, lstat): New functions, call 'stat_worker'.
3394 (symlink, readlink, careadlinkat): Rewritten to create and resolve
3395 symlinks when the underlying filesystem supports them.
3396
f162bcc3
PE
33972012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3398
79ea6c20
PE
3399 Fix macroexp crash on Windows with debugging (Bug#12118).
3400 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
3401 checking subscripts; problem introduced with the recent
3402 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
3403 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
3404 since it's used in non-static inline functions now.
3405
c0ce93fd
PE
3406 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
3407 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 3408
f162bcc3
PE
3409 Use C99-style 'extern inline' if available.
3410 * buffer.h (BUFFER_INLINE):
3411 * category.h (CATEGORY_INLINE):
3412 * character.h (CHARACTER_INLINE):
3413 * charset.h (CHARSET_INLINE):
3414 * composite.h (COMPOSITE_INLINE):
3415 * dispextern.h (DISPEXTERN_INLINE):
3416 * lisp.h (LISP_INLINE):
3417 * systime.h (SYSTIME_INLINE):
3418 New macro, replacing 'static inline' in this header.
3419 * buffer.h, category.h, character.h, charset.h, composite.h:
3420 * dispextern.h, lisp.h, systime.h:
3421 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3422 * alloc.c (LISP_INLINE):
3423 * buffer.c (BUFFER_INLINE):
3424 * category.c (CATEGORY_INLINE):
3425 * character.c (CHARACTER_INLINE):
3426 * charset.c (CHARSET_INLINE):
3427 * composite.c (COMPOSITE_INLINE):
3428 * dispnew.c (DISPEXTERN_INLINE):
3429 * sysdep.c (SYSTIME_INLINE):
3430 Define to EXTERN_INLINE, so that the corresponding functions
3431 are compiled into code.
3432 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
3433 (INLINE_HEADER_END): New macros.
3434 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
3435 since it's used in non-static inline functions now.
a8333d03 3436 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 3437
837b365b
GM
34382012-08-02 Glenn Morris <rgm@gnu.org>
3439
d66b744d
GM
3440 * s/: Remove empty directory.
3441
837b365b
GM
3442 * s/ms-w32.h: Move to ../nt/inc.
3443 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
3444 Update for new ms-w32.h location.
3445
13294f95
PE
34462012-08-02 Paul Eggert <eggert@cs.ucla.edu>
3447
3448 Port to Solaris 8.
3449 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
3450
90df0db3
GM
34512012-08-02 Glenn Morris <rgm@gnu.org>
3452
3453 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
3454 hard-coding the path separator.
3455
4939150c
PE
34562012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3457
3458 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
3459 This how ASET and AREF are supposed to work, and makes
3460 it easier to think about future improvements. See
3461 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
3462 * charset.h (set_charset_attr): New function.
3463 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
3464 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
3465 (aref_addr): New function. All uses of &AREF(...) changed.
3466 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
3467 (set_hash_index): New functions. All lvalue-style uses of
3468 HASH_KEY etc. changed.
3469 * keyboard.c (set_prop): New function. All lvalue-style uses
3470 of PROP changed.
3471
947b2afd
AA
34722012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
3473
3474 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
3475 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
3476 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
3477 * nsfns.m (ns_set_name_as_filename): Likewise.
3478 * nsmenu.m (ns_update_menubar): Likewise.
3479 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
3480
4f5d0325
EZ
34812012-08-01 Eli Zaretskii <eliz@gnu.org>
3482
2008beae
EZ
3483 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
3484 Adapt to latest changes in field names of the corresponding Lisp
288479f6 3485 objects.
2008beae 3486
4f5d0325
EZ
3487 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
3488
fe3cc771
GM
34892012-08-01 Glenn Morris <rgm@gnu.org>
3490
3491 * s/msdos.h: Remove file.
3492 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
3493 * Makefile.in (S_FILE): Remove.
3494 (config_h): Remove S_FILE.
3495
c90acc54
JB
34962012-08-01 Juanma Barranquero <lekktu@gmail.com>
3497
3498 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
3499 Remove; moved to nt/config.nt.
3500
d8a05828
DA
35012012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3502
3503 Use INTERNAL_FIELD for conses and overlays.
3504 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
3505 Remove obsolete comment.
3506 (MVAR): New macro.
3507 (struct Lisp_Overlay): Use INTERNAL_FIELD.
3508 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
3509
8271d590
DA
35102012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3511
3512 Use INTERNAL_FIELD for symbols.
3513 * lisp.h (SVAR): New macro. Adjust users.
3514 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
3515 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
3516
3193acd2
DA
35172012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3518
3519 Use INTERNAL_FIELD for processes.
3520 * process.h (PVAR): New macro. Adjust style.
3521 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
3522 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
3523
3a45383a
DA
35242012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
3525
3526 Use INTERNAL_FIELD for windows.
3527 * window.h (WVAR): New macro.
3528 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
3529 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
3530 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
3531 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
3532 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
3533 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3534
c1dbc63c
PE
35352012-08-01 Paul Eggert <eggert@cs.ucla.edu>
3536
3537 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
3538
5c0c0e8a
GM
35392012-08-01 Glenn Morris <rgm@gnu.org>
3540
3541 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
3542 Move to configure.ac.
3543
552a99b4
JB
35442012-08-01 Juanma Barranquero <lekktu@gmail.com>
3545
3546 * makefile.w32-in (CONFIG_H): Update dependencies.
3547 (CONF_POST_H): New macro.
3548
3549 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
3550
8d8e2dfe
GM
35512012-07-31 Glenn Morris <rgm@gnu.org>
3552
bc96620a
GM
3553 * Makefile.in (S_FILE): No longer set by configure.
3554
476b1b2d
GM
3555 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
3556 is available.
3557 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
3558
b2c7a106
GM
3559 * process.h (NULL_DEVICE):
3560 * emacs.c (SEPCHAR):
3561 * editfns.c (USER_FULL_NAME): Let configure set them.
3562
d53d062a
GM
3563 * s/README, s/template.h: Remove files.
3564
4515017f
GM
3565 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
3566
8d8e2dfe
GM
3567 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
3568 Move to configure.ac.
3569
5b20b3cc
EZ
35702012-07-31 Eli Zaretskii <eliz@gnu.org>
3571
1e0afd9a
EZ
3572 * .gdbinit (xframe): Adapt to introduction of FVAR and the
3573 resulting renaming of 'struct frame' members.
3574
5b20b3cc
EZ
3575 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
3576
3577 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
3578 after introduction of FVAR.
3579
f1310128
JD
35802012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3581
79e721e0
JD
3582 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
3583
3584 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
3585 instead of compositeToPoint.
3586 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
3587
8d7c7eed 3588 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 3589
e34f7f79
DA
35902012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3591
3592 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
3593 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 3594 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
3595 (BVAR): Change to use INTERNAL_FIELD.
3596 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
3597 (KVAR): Change to use INTERNAL_FIELD.
3598 * frame.h (FVAR): New macro.
3599 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
3600 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
3601 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
3602 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
3603 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
3604
c09bfb2f
DA
36052012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
3606
3607 Miscellaneous fixes for non-default X toolkits.
3608 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
3609 * xterm.c (x_frame_of_widget): Remove redundant prototype.
3610 Move under #ifdef USE_LUCID.
3611 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
3612 definition and usage to avoid warnings.
3613
14c114ae
JD
36142012-07-31 Jan Djärv <jan.h.d@swipnet.se>
3615
3616 * nsterm.m (openFiles): Fix previous checkin.
3617
3bd21e82
PE
36182012-07-31 Paul Eggert <eggert@cs.ucla.edu>
3619
3620 * indent.c (compute_motion): Remove unused local.
3621
c1529ded
GM
36222012-07-31 Glenn Morris <rgm@gnu.org>
3623
400d5621
GM
3624 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
3625
268e2432
GM
3626 * conf_post.h [USG5_4]:
3627 Move remaining contents of s/usg5-4-common.h here.
3628 * s/usg5-4-common.h: Remove file.
3629
7552f3ee
GM
3630 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
3631 * s/irix6-5.h: Remove file.
3632
6a381852
GM
3633 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
3634 * s/darwin.h: Remove file.
3635
c1529ded
GM
3636 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
3637 * s/hpux10-20.h: Remove file, which is now empty.
3638
b429a4ee
GM
36392012-07-30 Glenn Morris <rgm@gnu.org>
3640
3641 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
3642 * Makefile.in (config_h): Add conf_post.h.
3643 * makefile.w32-in (CONFIG_H): Add conf_post.h.
3644
adff3182
JD
36452012-07-30 Jan Djärv <jan.h.d@swipnet.se>
3646
3647 * nsterm.m (ns_do_open_file): New variable.
b9031d69 3648 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
3649 (openFile, openTempFile, openFileWithoutUI, openFiles):
3650 Open files only if ns_do_open_file.
adff3182 3651
c32af1e4
PE
36522012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3653
7393bcbb
PE
3654 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
3655 This no-op macro hasn't been needed for many years.
3656 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
3657
c32af1e4
PE
3658 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
3659 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
3660 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
3661 gdb_make_enums_visible.
3662 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
3663 (DIRECTORY_SEP): Now a constant, not a macro.
3664
302fc036
EZ
36652012-07-30 Eli Zaretskii <eliz@gnu.org>
3666
3667 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
3668 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
3669
3670 * w32term.c <w32_keyboard_codepage>: Renamed from
3671 keyboard_codepage and now external. All users changed.
3672
3673 * w32term.h: Add declaration of w32_keyboard_codepage.
3674
3675 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
3676 the codepage to translate keys to Unicode. If this argument is
3677 -1, use the value returned by GetConsoleCP. All callers changed.
3678
88fb40b4
PE
36792012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3680
0aee6912
PE
3681 Update .PHONY listings in makefiles.
3682 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
3683 bootstrap-clean, distclean, maintainer-clean, versioclean,
3684 extraclean, frc.
3685
88fb40b4
PE
3686 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
3687 This is a bit clearer. Fix some commentary typos.
3688
0a763bd1
GM
36892012-07-30 Glenn Morris <rgm@gnu.org>
3690
32bac6d6
GM
3691 * s/netbsd.h: Let configure include signal.h if needed.
3692 Remove file, which is now empty.
3693
b65e7c46
GM
3694 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
3695 Let configure set them.
3696 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
3697 No more need to undefine.
0a763bd1 3698
169304bd
AS
36992012-07-30 Andreas Schwab <schwab@linux-m68k.org>
3700
3701 * keymap.c (Fkey_description): Don't remove 0x80 bit from
3702 non-single-byte char when adding meta modifier. (Bug#12090)
3703
6cd7a139
DA
37042012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3705
3706 Convert safe_call to use variable number of arguments.
3707 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
3708 (safe_call2): Fix comment.
3709 * lisp.h (safe_call): Adjust prototype.
3710 * coding.c (encode_coding_object): Change to use safe_call2.
3711 * xfaces.c (merge_face_heights): Change to use safe_call1.
3712
d34d6ffc
GM
37132012-07-30 Glenn Morris <rgm@gnu.org>
3714
7b8a48e4 3715 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 3716 does that unconditionally. Remove file, which is now empty.
7b8a48e4 3717
d34d6ffc
GM
3718 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
3719 Remove empty files.
3720
03a660a6
PE
37212012-07-30 Paul Eggert <eggert@cs.ucla.edu>
3722
3723 Export to GDB most of lisp.h's remaining object-like macros.
3724 * lisp.h (min, max): Move earlier, because they're used earlier now.
3725 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
3726 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
3727 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
3728 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3729 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3730 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3731 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3732 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3733 Now constants, for GDB. They need not be macros.
3734 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3735 Now constants, for GDB, as well as macros, for static initializers.
3736 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3737 Move to after the definition of struct Lisp_Char_Table,
3738 since the former now needs that type defined.
3739 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3740 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3741 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3742 New enums, for gdb_make_enums_visible.
3743 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 3744 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
3745 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3746 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3747 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3748 enum maxargs, enum MAX_ALLOCA.
3749 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3750 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3751 no longer needed, now that they are done in lisp.h.
3752
e499d0ee
DA
37532012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3754
3755 Cleanup string bytes checking.
3756 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3757 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3758 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3759 (check_sblock, compact_small_strings): Simplify.
3760
d5040d2d
PE
37612012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3762
3763 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3764 These macros are confusing and no longer need to be defined, as
3765 the enum values now suffice. All uses replaced with definiens.
3766 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3767
7f259ae6
JB
37682012-07-29 Juanma Barranquero <lekktu@gmail.com>
3769
3770 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3771 ($(BLD)/w32console.$(O)): Update dependencies.
3772
7e63e0c3
DA
37732012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3774
3775 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3776 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3777 time. Adjust users.
3778 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3779
ffd817eb
JD
37802012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3781
3782 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3783 setting sitelisp (Bug#12010).
3784
417a7a0e
EZ
37852012-07-29 Eli Zaretskii <eliz@gnu.org>
3786
14ae4239 3787 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
3788
3789 * w32heap.c (cache_system_info):
3790 * w32.c (sys_rename):
3791 * w32proc.c (find_child_console, sys_kill): All users changed.
3792
387d4d92
PE
37932012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3794
3795 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3796
55a6cca6
EZ
37972012-07-29 Eli Zaretskii <eliz@gnu.org>
3798
3799 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3800
dbcf001c
DA
38012012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3802
3803 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
3804 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3805 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 3806
e2688e4a
DA
38072012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3808
3809 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3810 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3811 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3812 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3813 (replace_range, replace_range_2, del_range_2): Change to eassert.
3814 * marker.c (byte_char_debug_check): Adjust style.
3815
b46a6a83
PE
38162012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3817
3818 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3819 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3820 long-ago-commented-out code that talks about "WIN32".
3821 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3822 All uses changed.
3823
e32a5799
PE
38242012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3825
3826 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3827 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3828 Simplify by using alignof.
3829 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3830 * lisp.h: Include <stdalign.h>.
3831 (GCALIGNMENT): New macro and constant.
3832 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3833 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3834 (stdalign): New macro, if not already defined.
3835
df81cd29
EZ
38362012-07-28 Eli Zaretskii <eliz@gnu.org>
3837
01bd1b0d
EZ
3838 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3839 * w32inevt.c: Include w32inevt.h.
3840 (w32_read_console_input): New inline function, calls either
3841 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3842 w32_console_unicode_input.
3843 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3844 (w32_kbd_patch_key, key_event): Use the codepage returned by
3845 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3846 (key_event): use uChar.UnicodeChar only if
3847 w32_console_unicode_input is non-zero.
3848
3849 * w32console.c: Include w32heap.h.
3850 <w32_console_unicode_input>: New global variable.
3851 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3852 family of Windows, zero otherwise.
3853
3854 * w32inevt.h: Declare w32_console_unicode_input.
3855
df81cd29
EZ
3856 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3857 --without-x. (Bug#11742)
3858
c20fdd9e
PE
38592012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3860
3861 Adjust GDB to reflect pvec_type changes (Bug#12036).
3862 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
3863 2012-07-04 changes to pseudovector representation.
3864 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 3865
32770973 38662012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
3867
3868 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3869 bus address.
3870 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3871
3438fe21
EZ
38722012-07-27 Eli Zaretskii <eliz@gnu.org>
3873
bcfbc9de
EZ
3874 * alloc.c (listn): Fix the order the arguments are consed onto the
3875 list.
3876
3438fe21
EZ
3877 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3878 enumeration constants, as PURE and HEAP are too general, and clash
3879 with other headers and sources, such as gmalloc.c and the
3880 MS-Windows system headers. All users changed.
3881
eeaea515
DA
38822012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3883
3884 Revert last save_excursion_save and save_excursion_restore changes.
3885 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3886 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3887
073c88c2
DA
38882012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3889
3890 Fix recently-introduced typos in Windows port.
3891 Reported by Martin Rudalics <rudalics@gmx.at>.
3892 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 3893 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 3894
4706125e
PE
38952012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3896
3897 Improve GDB symbol export (Bug#12036).
3898 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3899 arms of an 'if', not using conditional expressions; otherwise GDB
3900 complains about the types in the unevaluated arm when the argument
3901 is an integer literal.
3902 (xgetint): Simplify expression.
3903 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3904 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3905 Zaretskii in <http://bugs.gnu.org/12036#13>.
3906 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3907 needed now that we have gdb_make_enums_visible.
3908 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3909 (enum enum_USE_LSB_TAG):
3910 New enum types, packaging up enums that need to be exported to GDB.
3911
694b6c97
DA
39122012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3913
3914 Utility function to make a list from specified amount of objects.
3915 * lisp.h (enum constype): New datatype.
3916 (listn): New prototype.
3917 * alloc.c (listn): New function.
3918 (Fmemory_use_count, syms_of_alloc): Use it.
3919 * buffer.c (syms_of_buffer): Likewise.
3920 * callint.c (syms_of_callint): Likewise.
3921 * charset.c (define_charset_internal): Likewise.
3922 * coding.c (syms_of_coding): Likewise.
3923 * keymap.c (syms_of_keymap): Likewise.
3924 * search.c (syms_of_search): Likewise.
3925 * syntax.c (syms_of_syntax): Likewise.
3926 * w32.c (init_environment): Likewise.
3927 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3928 * xdisp.c (syms_of_xdisp): Likewise.
3929 * xfns.c (syms_of_xfns): Likewise.
3930
6195f384
DA
39312012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3932
3933 Fast save_excursion_save and save_excursion_restore.
3934 * lisp.h (struct Lisp_Excursion): New data type.
3935 (PVEC_EXCURSION): New pseudovector type.
3936 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3937 to deal with it. Adjust comments.
3938 (init_marker, attach_marker): New prototype.
3939 (unchain_marker): Adjust prototype.
3940 * marker.c (attach_marker): Change to global.
3941 (init_marker): New function.
3942 * alloc.c (Fmake_marker, build_marker): Use it.
3943 (build_marker): More easserts.
3944 (mark_object): Handle struct Lisp_Excursion.
3945 * editfns.c (save_excursion_save, save_excursion_restore):
3946 Reimplement to use struct Lisp_Excursion. Add comments.
3947
5eceb8fb
PE
39482012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3949
3950 Fix export of symbols to GDB (Bug#12036).
3951 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3952 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3953 emacs.c, as this is a more-suitable home. Had this been done earlier
3954 the fix for 12036 would have avoided some of the problems noted in
3955 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3956 would have been more obvious.
562157c8
PE
3957 * emacs.c: Do not include <verify.h>; no longer needed.
3958 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
3959 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3960 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3961 Remove; now done in lisp.h.
3962 * lisp.h (PUBLISH_TO_GDB): New macro.
3963 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3964 (DATA_SEG_BITS): Use it.
3965 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3966 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3967 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3968 not be usable in #if. This simplifies things.
3969
d6749401
JB
39702012-07-26 Juanma Barranquero <lekktu@gmail.com>
3971
3972 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3973
1781b9e9
PE
39742012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3975
d89518db 3976 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
3977 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3978 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3979 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3980 Adjust to changes in lisp.h and emacs.c, by using
3981 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3982 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3983 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3984 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3985 instead of gdb_valbits.
3986 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3987 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3988 instead of gdb_array_mark_flag.
3989 (xboolvector): Get size from $->size, not $->header.size.
3990 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3991 (xreload, hook-run, hookpost-run): Remove.
3992 * emacs.c: Include <verify.h>.
3993 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3994 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3995 Remove.
3996 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3997 (gdb_USE_LSB_TAG): New enum constants.
3998 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3999 Also define these as enum constants, so they're visible to GDB.
4000 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4001 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4002 as constants, so they're visible to GDB.
4003 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4004 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4005 Now enum constants, not macros, so they're visible to GDB.
4006 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4007 more convenient now. All uses changed.
4008 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4009 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4010
3628596a
DA
40112012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4012
4013 Explicitly free restriction data that are not needed anymore.
4014 * editfns.c (save_restriction_restore): Free restriction data.
4015
7abaf5cc
SM
40162012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
4017
4018 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
4019 add argument, tune behavior, and adjust all callers.
4020
71f88e00
PE
40212012-07-25 Paul Eggert <eggert@cs.ucla.edu>
4022
4023 Use typedef for EMACS_INT, EMACS_UINT.
4024 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
4025 than macros. This simplifies debugging in the usual case, since
4026 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
4027 and it allows expressions involving EMACS_INT casts.
4028 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
4029
57ec3034
JD
40302012-07-25 Jan Djärv <jan.h.d@swipnet.se>
4031
4032 * nsterm.m (ns_read_socket): Return early if there is a modal
4033 window (Bug#12043).
4034
8137e7b3
MR
40352012-07-25 Martin Rudalics <rudalics@gmx.at>
4036
4037 * frame.c (Fredirect_frame_focus): In doc-string don't mention
4038 that FOCUS-FRAME can be omitted.
4039
04e9897c
DA
40402012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
4041
4042 Adjust buffer text indirection counters at the end of Fkill_buffer.
4043 * buffer.c (Fkill_buffer): Adjust indirection counters when the
4044 buffer is definitely dead. This should really fix an issue reported
4045 by Christoph Scholtes again. (Bug#12007).
4046 (init_buffer_once): Initialize indirection counters of
4047 buffer_defaults and buffer_local_symbols (for sanity and safety).
4048
8a0484e1
EZ
40492012-07-24 Eli Zaretskii <eliz@gnu.org>
4050
4051 * xdisp.c (init_iterator): Don't compute dimensions of truncation
4052 and continuation glyphs on tooltip frames, leave them at zero.
4053 Avoids continued lines in tooltips. (Bug#11832)
4054
fa691a83
DA
40552012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
4056
4057 Simplify copy_overlay.
04e9897c 4058 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
4059 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
4060
436bc8e0
EZ
40612012-07-23 Eli Zaretskii <eliz@gnu.org>
4062
4063 * print.c (print_object): Don't crash when a frame's name is nil
4064 or invalid. (Bug#12025)
4065
4066 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
4067 it signals an error when a tooltip frame is being created.
4068
d7a7fda3
DA
40692012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
4070
4071 Cleanup miscellaneous objects allocation and initialization.
4072 * alloc.c (allocate_misc): Change to static. Add argument to
4073 specify the subtype. Adjust comment and users.
4074 (build_overlay): New function.
4075 * buffer.c (copy_overlays, Fmake_overlay): Use it.
4076 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
4077 (allocate_misc): Remove prototype.
4078 (build_overlay): Add prototype.
4079
40802012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
4081
4082 Swap buffer text indirection counters in Fbuffer_swap_text.
4083 * buffer.c (Fbuffer_swap_text): Swap indirections too.
4084 This avoids crash reported by Christoph Scholtes at
4085 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
4086
9d7fa573
JD
40872012-07-22 Jan Djärv <jan.h.d@swipnet.se>
4088
4089 * nsmenu.m (Popdown_data): New struct.
4090 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
4091 free Popdown_data.
4092 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
4093 (initWithContentRect): Make imgView and contentView non-static
4094 and autorelease them. Also autorelease img and matrix (Bug#12005).
4095 (dealloc): Remove (Bug#12005).
4096
0dd6d66d
DA
40972012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4098
4099 Adjust consing_since_gc when objects are explicitly freed.
4100 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
4101 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
4102 (free_cons, free_misc): Subtract object size from consing_since_gc.
4103
d36d71df
DA
41042012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
4105
4106 Simplify and cleanup markers positioning code.
4107 * marker.c (attach_marker): More useful eassert.
4108 (live_buffer, set_marker_internal): New function.
4109 (Fset_marker, set_marker_restricted): Use set_marker_internal.
4110 (set_marker_both, set_marker_restricted_both): Use live_buffer.
4111
fb9ea40f
PE
41122012-07-22 Paul Eggert <eggert@cs.ucla.edu>
4113
4114 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
4115 as it's limited by the amount of memory, not by INT_MAX.
4116
2d5c5f7d
EZ
41172012-07-21 Eli Zaretskii <eliz@gnu.org>
4118
07fb592e
EZ
4119 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
4120 in special-event-map. See the discussion at
4121 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
4122 for the reasons.
4123
37a9eac8 4124 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
4125 info.dwItemData. Fixes crashes on 64-bit Windows.
4126 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 4127
c4328746
JD
41282012-07-21 Jan Djärv <jan.h.d@swipnet.se>
4129
fc0c31f8 4130 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 4131 (conversationIdentifier): Return value is NSInteger.
784051c4 4132 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 4133
6e5d1c12
CY
41342012-07-21 Chong Yidong <cyd@gnu.org>
4135
4136 * window.c (decode_any_window): Signal an error if the window is
4137 on a dead frame (Bug#11984).
4138
9928463d
DA
41392012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4140
4141 Add indirection counting to speed up Fkill_buffer.
4142 * buffer.h (struct buffer): New member.
4143 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
4144 (Fmake_indirect_buffer): Set indirection counter to -1, increment
4145 base buffer indirection counter.
4146 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
4147 (Fkill_buffer): Adjust indirection counters as needed, don't walk
4148 through buffer list if indirection counter is 0.
4149
f8643a6b
DA
41502012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4151
4152 Extend the value returned by Fgarbage_collect with heap statistics.
4153 * alloc.c (Qheap): New symbol.
4154 (syms_of_alloc): DEFSYM it.
4155 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
4156 (Fmemory_free): Remove.
4157 (syms_of_alloc): Don't defsubr it.
4158 * buffer.c (Fcompact_buffer): Remove.
4159 (syms_of_buffer): Don't defsubr it.
4160
dac616ff
DA
41612012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4162
4163 Make maybe_gc inline.
4164 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
4165 * lisp.h (consing_since_gc, gc_relative_threshold)
4166 (memory_full_cons_threshold): Revert declaration.
4167 (maybe_gc): Remove prototype, define as inline.
4168 * alloc.c: Remove old commented-out code.
4169 (consing_since_gc, gc_relative_threshold)
4170 (memory_full_cons_threshold): Revert to global.
4171 (maybe_gc): Remove.
4172
d7ea76b4
DA
41732012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4174
4175 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
4176 * lisp.h (build_unibyte_string): New function.
4177 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
4178 * sysdep.c, w32fns.c, xfns.c: Use it.
4179 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
4180 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
4181 Adjust users accordingly.
4182 * font.h (font_open_by_name): Adjust prototype.
4183
765e61e3
DA
41842012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
4185
4186 Cleanup calls to Fgarbage_collect.
4187 * lisp.h (maybe_gc): New prototype.
4188 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4189 Remove declarations.
4190 * alloc.c (maybe_gc): New function.
4191 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
4192 Make them static.
4193 * bytecode.c (MAYBE_GC): Use maybe_gc.
4194 * eval.c (eval_sub, Ffuncall): Likewise.
4195 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
4196 to avoid dependency from auto-save feature.
4197
52b852c7
PE
41982012-07-19 Paul Eggert <eggert@cs.ucla.edu>
4199
4200 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
4201 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
4202 'for_each_per_buffer_object_at'.
4203 All uses changed. It's better to use upper-case for macros that
4204 cannot be implemented as functions, to give the reader a clue
4205 that they're special.
4206
5db81e33
SM
42072012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
4208
4209 * alloc.c (Fgarbage_collect): Tweak docstring.
4210
5b835e1d
DA
42112012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4212
4213 Tweak the value returned from Fgarbage_collect again.
4214 * alloc.c (Fgarbage_collect): New return value, as confirmed in
4215 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
4216 Adjust documentation.
4217 (total_vector_bytes): Rename to total_vector_slots, adjust
4218 accounting.
4219 (total_free_vector_bytes): Rename to total_free_vector_slots,
4220 adjust accounting.
4221 (Qstring_bytes, Qvector_slots): New symbols.
4222 (syms_of_alloc): DEFSYM them.
4223
9cd47b72
DA
42242012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4225
4226 Buffer compaction primitive which may be used from Lisp.
4227 * buffer.c (compact_buffer, Fcompact_buffer): New function.
4228 (syms_of_buffer): Register Fcompact_buffer.
4229 * alloc.c (Fgarbage_collect): Use compact_buffer.
4230 * buffer.h (compact_buffer): New prototype.
4231 (struct buffer_text): New member.
4232
d17337e5
DA
42332012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
4234
4235 New macro to iterate over all buffers, miscellaneous cleanups.
4236 * lisp.h (all_buffers): Remove declaration.
4237 * buffer.h (all_buffers): Add declaration, with comment.
4238 (for_each_buffer): New macro.
4239 * alloc.c (Fgarbage_collect, mark_object): Use it.
4240 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
4241 (init_buffer): Likewise.
4242 * data.c (Fset_default): Likewise.
4243 * coding.c (code_conversion_restore): Remove redundant check
4244 for dead buffer.
4245 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
4246
60cfd278
AS
42472012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4248
4249 Fix bug that created negative-length intervals.
4250 * intervals.c (merge_interval_right, merge_interval_left):
4251 Do not zero out this interval if it is absorbed by its children,
4252 as this interval's total length doesn't change in that case. See
4253 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
4254
d06714cb
PE
42552012-07-18 Paul Eggert <eggert@cs.ucla.edu>
4256
83713154
PE
4257 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
4258 when invoking (make-bool-vector N t) and N is a positive
4259 multiple of 8 -- the last 8 bits were mistakenly cleared.
4260
d06714cb
PE
4261 Remove some struct layout assumptions in bool vectors.
4262 * alloc.c (bool_header_size): New constant.
4263 (header_size, word_size): Move earlier, as they're now used earlier.
4264 Use 'word_size' in a few more places, where it's appropriate.
4265 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
4266 padding before the data member of a bool vector.
4267 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
4268 than doing the check by hand with an abort ().
4269
464d5a5e
SM
42702012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4271
5fbc0409
SM
4272 * eval.c (Fdefvar): Don't check constants since we only set the var if
4273 it's not yet defined anyway (bug#11904).
4274
464d5a5e
SM
4275 * lisp.h (last_undo_boundary): Declare new var.
4276 * keyboard.c (command_loop_1): Set it.
4277 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
4278 were auto-added by the command loop (bug#11774).
4279
8dc2e44a
AS
42802012-07-18 Andreas Schwab <schwab@linux-m68k.org>
4281
4282 * w32font.c (Qsymbol): Remove local definition.
4283 (syms_of_w32font): Don't DEFSYM it.
4284
169925ec
DA
42852012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4286
4287 Fix sweep_vectors to handle large bool vectors correctly.
4288 * alloc.c (sweep_vectors): Account total_vector_bytes for
4289 bool vectors larger than VBLOCK_BYTES_MAX.
4290
5fbfb018
CY
42912012-07-18 Chong Yidong <cyd@gnu.org>
4292
4293 * frame.c (x_set_frame_parameters): Revert bogus change introduced
4294 in 2012-05-25 commit by Paul Eggert (Bug#11738).
4295
3ab6e069
DA
42962012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
4297
4298 Return more descriptive data from Fgarbage_collect.
4299 Suggested by Stefan Monnier in
4300 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
4301 * alloc.c (bounded_number): New function.
4302 (total_buffers, total_vectors): New variable.
4303 (total_string_size): Rename to total_string_bytes, adjust users.
4304 (total_vector_size): Rename to total_vector_bytes, adjust users.
4305 (sweep_vectors): Account total_vectors and total_vector_bytes.
4306 (Fgarbage_collect): New return value. Adjust documentation.
4307 (gc_sweep): Account total_buffers.
4308 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
4309 (VECTOR_SIZE): Remove.
4310 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
4311 (Qinterval, Qmisc): New symbols.
4312 (syms_of_data): Initialize them.
4313 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
4314 (Qcons, Qbuffer): New declarations.
4315
6d02fe5b
PE
43162012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4317
4318 * alloc.c (Fmemory_free): Account for memory-free's own storage.
4319 Round up, not down. Improve doc.
4320
b7ffe040
DA
43212012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4322
4323 Restore old code in allocate_string_data to avoid Faset breakage.
4324 Reported by Julien Danjou <julien@danjou.info> in
4325 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
4326 * alloc.c (allocate_string_data): Restore old code with minor
4327 adjustments, fix comment to explain this subtle issue.
4328
4dc7c8d5
SM
43292012-07-17 Eli Zaretskii <eliz@gnu.org>
4330
4331 Remove FILE_SYSTEM_CASE.
4332 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
4333
4334 * fileio.c (FILE_SYSTEM_CASE): Don't define.
4335 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
4336 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
4337 call-process-region passes it through expand-file-name.
4338
4339 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
4340
43412012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4342
4343 Fix crash when creating indirect buffer (Bug#11917)
4344 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
4345 Don't handle unbound variables specially if non-zero.
4346 (Fbuffer_local_variables): Pass zero.
4347 (clone_per_buffer_values): Pass non-zero.
4348
43492012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4350
4351 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
4352 to make the loop interruptible.
4353
43542012-07-17 Andreas Schwab <schwab@linux-m68k.org>
4355
4356 * gnutls.c (emacs_gnutls_handshake): Only retry if
4357 GNUTLS_E_INTERRUPTED.
4358
cce7fefc
DA
43592012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4360
4361 Cleanup and convert miscellaneous checks to eassert.
4362 * alloc.c (mark_interval): Fix comment, partially rephrase
4363 old comment from intervals.h (see below).
4364 * intervals.c (find_interval, adjust_intervals_for_insertion)
4365 (delete_interval, adjust_intervals_for_deletion)
4366 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
4367 Convert to eassert.
4368 (adjust_intervals_for_insertion, make_new_interval):
4369 Remove obsolete and unused code.
4370 * intervals.h (struct interval): Remove obsolete comment.
4371 * textprotp.c (erase_properties): Remove unused code.
4372 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
4373 (Fremove_list_of_text_properties): Convert to eassert.
4374
9ea10cc3
CY
43752012-07-17 Chong Yidong <cyd@gnu.org>
4376
4377 * editfns.c (Finsert_char): Doc fix.
4378
3900d5de
DA
43792012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4380
4381 Fix previous change to make Fmemory_free always accurate.
4382 * alloc.c (make_interval): Update total_free_intervals.
4383 (make_float): Likewise for total_free_floats.
4384 (free_cons, Fcons): Likewise for total_free_conses.
4385 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
4386 Likewise for total_free_vector_bytes.
4387 (Fmake_symbol): Likewise for total_free_symbols.
4388 (bytes_free): Remove.
4389
7098646f
DA
43902012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4391
4392 Simple free memory accounting feature.
4393 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
4394 (sweep_vectors): Accumulate size of free vectors.
4395 (Fgarbage_collect): Setup bytes_free.
4396 (Fmemory_free): New function.
4397 (syms_of_alloc): Register it.
4398
22657b40
DA
43992012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
4400
4401 Cleanup overlays checking.
4402 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
4403 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
4404 eassert and OVERLAYP.
4405 (sort_overlays): Change to use OVERLAYP.
4406
ddfc8813
RK
44072012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
4408
4409 * editfns.c (Finsert_char): Make it interactive, and make the
4410 second arg optional. Copy interactive spec and docstring from
4411 ucs-insert.
4412
7c26cf3c
PE
44132012-07-17 Paul Eggert <eggert@cs.ucla.edu>
4414
4415 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
4416 Unlike the other wrapped functions, fabs has an unspecified
4417 effect on errno.
4418
5d127af9
JD
44192012-07-16 Jan Djärv <jan.h.d@swipnet.se>
4420
4421 * nsterm.m (keyDown): Interpret flags without left/right bits
4422 as the left key (Bug#11670).
4423
6a0dd1d7
DA
44242012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4425
4426 Remove empty and useless init functions.
4427 * lisp.h (init_character_once, init_fns, init_image)
4428 (init_filelock, init_sound): Remove prototype.
4429 * character.c (init_character_once): Remove.
4430 * filelock.c (init_filelock): Likewise.
4431 * fns.c (init_fns): Likewise.
4432 * image.c (init_image): Likewise.
4433 * sound.c (init_sound): Likewise.
4434 * emacs.c (main): Adjust accordingly.
4435
7a6136fd
DA
44362012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
4437
4438 * gtkutil.h: Tiny cleanups.
4439 (use_old_gtk_file_dialog): Remove useless declaration.
4440 (xg_uses_old_file_dialog): Add suggested const attribute.
4441
ce811ad9
EZ
44422012-07-15 Eli Zaretskii <eliz@gnu.org>
4443
4444 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
4445 (bidi_paragraph_init): Use it to limit search forward for a strong
4446 directional character in abnormally large paragraphs full of
4447 neutral or weak characters. (Bug#11943)
4448
c9adfeaa
SF
44492012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
4450
4451 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4452 the toolbar (Bug#9451).
4453 (xg_make_tool_item): Give the widget event box a transparent
4454 background.
4455
fff62aa9
DA
44562012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4457
4458 Cleanup basic allocation variables and functions.
4459 * alloc.c (ignore_warnings, init_intervals, init_float)
4460 (init_cons, init_symbol, init_marker): Remove.
4461 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
4462 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
4463 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
4464 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
4465 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
4466 (staticidx, init_alloc_once, init_strings, free_ablock):
4467 Remove redundant initialization.
4468 * fns.c (init_weak_hash_tables): Remove.
4469 * lisp.h (init_weak_hash_tables): Remove prototype.
4470
9730daca
DA
44712012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
4472
4473 Use zero_vector where appropriate.
4474 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
4475 accordingly.
4476 * lisp.h (zero_vector): New declaration.
4477 * font.c (null_vector): Remove.
4478 (syms_of_font): Remove initialization and staticpro.
4479 (font_list_entities, font_find_for_lface): Change to use zero_vector.
4480 * keymap.c (Faccessible_keymaps): Likewise.
4481
2e2d2a13
LL
44822012-07-15 Leo Liu <sdl.web@gmail.com>
4483
4484 * fringe.c: Fix typo in comments.
4485
cd276f6e
LL
44862012-07-14 Leo Liu <sdl.web@gmail.com>
4487
4488 * fringe.c: Add a new bitmap exclamation-mark.
4489
5a1131d9
EZ
44902012-07-14 Eli Zaretskii <eliz@gnu.org>
4491
4492 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
4493
4494 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
4495 (HAVE_MENUS): Don't define, defined by editing config.in with
4496 msdos/sed2v2.inp.
4497 (GMALLOC_INHIBIT_VALLOC): Don't define.
4498 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
4499
22e983b7
JB
45002012-07-14 Juanma Barranquero <lekktu@gmail.com>
4501
4502 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
4503
5b3f250f
GM
45042012-07-14 Glenn Morris <rgm@gnu.org>
4505
4506 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
4507 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
4508 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
4509
33d63ff4
GM
45102012-07-13 Glenn Morris <rgm@gnu.org>
4511
5b633342
GM
4512 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4513
33d63ff4
GM
4514 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4515 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
4516
b55b9f85
JD
45172012-07-13 Jan Djärv <jan.h.d@swipnet.se>
4518
0dc8cf50
JD
4519 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
4520 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
4521 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
4522 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
4523 where appropriate.
4524 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
4525 as boolean expression.
4526 (x_set_window_size): Remove unused variable toolbar.
4527 (ns_get_color_default, ns_mod_to_lisp): Remove.
4528 (ns_mouse_position): Remove unused variables xchar and ychar.
4529 (ns_compute_glyph_string_overhangs): Remove unused variable face.
4530 (ns_set_vertical_scroll_bar): Remove unused variable count.
4531 (ns_delete_terminal): Remove unused variable i.
4532 (ns_term_init): Remove unused variables r, g and b.
4533 (mouseDown): Remove unused variable window.
4534 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
4535 (initFrameFromEmacs): Remove unused variable vbextra.
4536 (mouseEntered): Remove unused variables p and dpyinfo.
4537 (mouseExited): Remove unused variables p and r.
4538 (ns_define_frame_cursor, ns_clear_frame_area)
4539 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
4540 (menuDown): Assign [sender tag] to variable and cast the variable.
4541
4542 * nsterm.h (menuDown): Add id as type to argument sender.
4543 (ns_display_info_for_name): Add Lisp_Object argument.
4544 (ns_term_init): Add Lisp_Object argument.
4545 (ns_map_event_to_object): Add void argument.
4546 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
4547 prototype with arguments and only declare if __OBJC__.
4548 (nxatoms_of_nsselect): Add void argument.
4549 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
4550 (ns_alloc_autorelease_pool): Add void argument.
4551 (ns_release_autorelease_pool): Add void* argument.
4552 (ns_get_defaults_value): Add const char* argument.
4553
4554 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
4555 (initFromContents): Use SSDATA where appropriate.
4556 (ns_update_menubar): Add braces to ambigous if-else.
4557 (initWithTitle): Put () around assignment in if statement.
4558 (ns_menu_show): Remove unused variables window and keymap.
4559 (update_frame_tool_bar): Remove unused variable selected_p.
4560 (initWithContentRect): Remove unused variable this_cmd_name.
4561
4562 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
4563 appropriate.
4564 (setXBMColor): Remove unused variable len.
4565 (setPixmapData): Put () around assignment in loop statement.
4566
4567 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
4568 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
4569 where appropriate.
4570 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
4571 around assignment in loop statement.
4572 (nsfont_open): Remove unused variable i.
4573 (nsfont_open): Remove unused variable len.
4574 (nsfont_draw): Remove unused variable cs.
4575
4576 * nsfns.m (x_set_icon_name, ns_set_name_internal)
4577 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
4578 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
4579 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
4580 (Fns_font_name, Fns_perform_service)
4581 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
4582 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
4583 (ns_set_name): Remove unused variable view.
4584 (x_set_menu_bar_lines): Remove unused variable olines.
4585 (x_set_tool_bar_lines): Remove unused variable root_window.
4586 (Fns_list_colors): Put () around assignment in while statement.
4587 (Fns_perform_service): Remove unused variable len.
4588 (Fns_display_usable_bounds): Remove unused variable top.
4589 (syms_of_nsfns): Remove unused variable i.
4590
b55b9f85
JD
4591 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
4592 memcpy (Bug#11907).
4593
ed9265fc 45942012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
4595
4596 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
4597 and free it with DestroyExceptionInfo (Bug#11558).
4598
ef099b57
JB
45992012-07-13 Juanma Barranquero <lekktu@gmail.com>
4600
4601 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
4602 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
4603 Set here, not in nt/config.nt.
4604
ea814a5d
EZ
46052012-07-13 Eli Zaretskii <eliz@gnu.org>
4606
4607 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
4608 cursor overflow into the last glyph on display line when the right
4609 fringe is off. (Bug#11832)
4610
1a952767
PE
46112012-07-13 Paul Eggert <eggert@cs.ucla.edu>
4612
4613 * xdisp.c (produce_special_glyphs): Now static.
4614 * dispextern.h (produce_special_glyphs): Remove decl.
4615
983188fd
GM
46162012-07-13 Glenn Morris <rgm@gnu.org>
4617
8d7c7eed 4618 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
4619 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
4620
983188fd
GM
4621 * s/usg5-4-common.h (USG, USG5):
4622 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
4623 * s/sol2-6.h (SOLARIS2):
4624 * s/irix6-5.h (IRIX6_5):
4625 * s/hpux10-20.h (USG, USG5, HPUX):
4626 * s/gnu-linux.h (USG, GNU_LINUX):
4627 * s/freebsd.h (BSD_SYSTEM):
4628 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
4629 * s/cygwin.h (CYGWIN):
4630 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
4631 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
4632
d1e68667 46332012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
4634
4635 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 4636
6de0e799
GM
46372012-07-13 Glenn Morris <rgm@gnu.org>
4638
739ae010
GM
4639 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
4640
dbee5793
GM
4641 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
4642
6de0e799
GM
4643 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
4644 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
4645
b82da769
GM
46462012-07-12 Glenn Morris <rgm@gnu.org>
4647
4fae5a7a 4648 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
4649
4650 * process.c (init_process_emacs): Rename from init_process.
4651 The old name is also the name of a Mach system call.
4652 * lisp.h, emacs.c: Update for this name change.
4653 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
4654 longer needed.
4655
5a979817
EZ
46562012-07-12 Eli Zaretskii <eliz@gnu.org>
4657
4658 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
4659 memmove call that removes glyphs covered by the left truncation
4660 glyph. Improve commentary.
4661 (display_line): Fix display of continuation glyphs on GUI frames
4662 when the right fringe is turned off and variable-size fonts are
4663 used in the window. Move the code that appends a stretch glyph to
4664 produce_special_glyphs, so that it could be used for truncation
4665 and continuation glyphs alike.
4666 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
4667 glyph of a suitably computed width, to align the special glyphs at
4668 the window margin. Code moved from display_line. (Bug#11832)
4669
3e91a053
GM
46702012-07-12 Glenn Morris <rgm@gnu.org>
4671
ba9e4b84
GM
4672 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
4673
4674 * s/gnu-linux.h, s/hpux10-20.h:
4675 Do not unconditionally define HAVE_XRMSETDATABASE.
4676
3e91a053
GM
4677 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
4678
b300b1f4
PE
46792012-07-12 Paul Eggert <eggert@cs.ucla.edu>
4680
4681 Fix typos that broke OS X build.
4682 Reported by Randal L. Schwartz in
4683 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
4684 * nsterm.m (ns_timeout): Add missing local decl.
4685 (ns_get_color): snprintf -> sprintf, to fix typo.
4686
6e777848
GM
46872012-07-12 Glenn Morris <rgm@gnu.org>
4688
3f922c37
GM
4689 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
4690 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
4691 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
4692 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
4693
0ab7b23a
GM
4694 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
4695 Move PTY_OPEN to configure.
4696
6e777848
GM
4697 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4698 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
4699 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
4700
4a7edc24
DA
47012012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
4702
4703 Use empty_unibyte_string where applicable.
4704 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
4705 * lread.c (read1): Likewise.
4706 * xsettings.c (syms_of_xsettings): Likewise.
4707
308aab79
GM
47082012-07-12 Glenn Morris <rgm@gnu.org>
4709
42bd1719
GM
4710 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
4711 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
4712 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
4713 * s/hpux10-20.h (RUN_TIME_REMAP):
4714 * s/bsd-common.h (TABDLY): Move to configure.
4715
4716 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
4717
4718 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
4719
ea0bbd17 4720 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 4721 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
4722
4723 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 4724
308aab79
GM
4725 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
4726 * s/template.h: Move NARROWPROTO to configure.
4727
ee1cf5cf
GM
47282012-07-11 Glenn Morris <rgm@gnu.org>
4729
30fe9bf4
GM
4730 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4731 unused since 2011-01-17 change to systty.h.
4732
ee1cf5cf
GM
4733 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4734 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4735 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4736
63e47e07
PE
47372012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4738
4739 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4740
c43fb4c3
GM
47412012-07-11 Glenn Morris <rgm@gnu.org>
4742
4743 * s/darwin.h, s/gnu-linux.h, s/template.h:
4744 Move INTERRUPT_INPUT to configure.
4745
e8df9267
DA
47462012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4747
4748 Minor adjustments to interning code.
4749 * lisp.h (intern, intern_c_string): Redefine as static inline
4750 wrappers for intern_1 and intern_c_string_1, respectively.
4751 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
4752 * lread.c (intern_1, intern_c_string_1, oblookup):
4753 Simplify Vobarray checking.
e8df9267
DA
4754 * font.c (font_intern_prop): Likewise. Adjust comment.
4755 * w32font.c (intern_font_name): Likewise.
4756
34348bd4
AS
47572012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4758
d96a1e0c
AS
4759 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4760
34348bd4
AS
4761 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4762 of Fcar/Fcdr if possible.
4763 * font.c (check_otf_features): Likewise.
4764 * fontset.c (Fnew_fontset): Likewise.
4765 * gnutls.c (Fgnutls_boot): Likewise.
4766 * minibuf.c (read_minibuf): Likewise.
4767 * msdos.c (IT_set_frame_parameters): Likewise.
4768 * xmenu.c (Fx_popup_dialog): Likewise.
4769 * w32menu.c (Fx_popup_dialog): Likewise.
4770
c8add24e
GM
47712012-07-11 Glenn Morris <rgm@gnu.org>
4772
4b575b3c
GM
4773 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4774 since nothing has defined it on these platforms.
4775
09f4e3b0
GM
4776 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4777 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4778
172bedef
GM
4779 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4780 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4781 Move CLASH_DETECTION to configure.
4782
249685df
GM
4783 * s/gnu.h: Remove file, which is now empty.
4784
c8add24e
GM
4785 * s/gnu.h, s/gnu-linux.h:
4786 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4787
b41253a3
JW
47882012-07-11 John Wiegley <johnw@newartisans.com>
4789
4790 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4791 function attribute, so we only use it if it exists in the
4792 compiler.
4793
d923b542
DA
47942012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4795
4796 Avoid call to strlen in fast_c_string_match_ignore_case.
4797 * search.c (fast_c_string_match_ignore_case): Change to use
4798 length argument. Adjust users accordingly.
4799 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4800
5ebbef1d
PE
48012012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4802
bb352260
PE
4803 Assume mkdir, rmdir.
4804 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4805 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4806
57054ddd
PE
4807 Assume rename.
4808 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4809
b747d3f7
PE
4810 Assume perror.
4811 * s/hpux10-20.h (HAVE_PERROR): Remove.
4812 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4813 Remove dummy definition, as this problem was obsolete long ago.
4814
5ebbef1d
PE
4815 Assume strerror.
4816 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4817
984e7f30
DA
48182012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4819
4820 Avoid calls to strlen in font processing functions.
4821 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
4822 (font_open_by_name): Change to use length argument.
4823 Adjust users accordingly.
d923b542
DA
4824 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4825 Adjust prototypes.
4826 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4827 Change to return ptrdiff_t.
984e7f30
DA
4828 (xfont_list_pattern, xfont_match): Use length returned by
4829 xfont_decode_coding_xlfd.
4830 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4831
20e94fdd
GM
48322012-07-11 Glenn Morris <rgm@gnu.org>
4833
9d596af3
GM
4834 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4835 Move DONT_REOPEN_PTY to configure.
4836
20e94fdd
GM
4837 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4838 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4839
e99a530f
PE
48402012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4841
22ffb973
PE
4842 Remove "#define unix" that is no longer needed (Bug#11905).
4843 * s/aix4-2.h (unix): Remove; no longer needed.
4844
e9a9ae03
PE
4845 EMACS_TIME simplification (Bug#11875).
4846 This replaces macros (which typically do not work in GDB)
4847 with functions, typedefs and enums, making the code easier to debug.
4848 The functional style also makes code easier to read and maintain.
4849 * systime.h: Include <sys/time.h> on all hosts, not just if
4850 WINDOWSNT, since 'struct timeval' is needed in general.
4851 (EMACS_TIME): Now a typedef, not a macro.
4852 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4853 not macros.
4854 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4855 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4856 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4857 (EMACS_TIME_LE): Now functions, not macros.
4858 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4859 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4860 which are not functions. All uses rewritten to use:
4861 (make_emacs_time): New function.
4862 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4863 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4864 not functions. All uses rewritten to use the following, respectively:
4865 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4866 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 4867 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
4868 * fileio.c (Fcopy_file):
4869 * xterm.c (XTflash): Get the current time closer to when it's used.
4870 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4871
ffacb126
PE
4872 * bytecode.c (targets): Suppress -Woverride-init warnings.
4873
e99a530f
PE
4874 Simplify by avoiding confusing use of strncpy etc.
4875 * doc.c (Fsnarf_documentation):
4876 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4877 * frame.c (Fmake_terminal_frame):
4878 * gtkutil.c (get_utf8_string):
4879 * lread.c (openp):
4880 * nsmenu.m (ns_update_menubar):
4881 * regex.c (regerror):
4882 Prefer memcpy to strncpy and strncat when either will do.
4883 * fileio.c (Fsubstitute_in_file_name):
4884 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4885 (menu_separator_name_p):
4886 * nsmenu.m (ns_update_menubar):
4887 Prefer memcmp to strncmp when either will do.
4888 * nsterm.m: Include <ftoastr.h>.
4889 (ns_get_color):
4890 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4891 Prefer snprintf to strncpy.
4892 * nsterm.m (ns_term_init):
4893 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4894 * nsterm.m (ns_term_init):
4895 Avoid the need for strncpy, by using build_string or
4896 make_unibyte_string directly. Use dtoastr, not snprintf.
4897 * process.c (Fmake_network_process): Diagnose service names that
4898 are too long, rather than silently truncating them or creating
4899 non-null-terminated names.
4900 (Fnetwork_interface_info): Likewise, for interface names.
4901 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4902 Prefer sprintf to strncat.
4903 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4904 Prefer vsnprintf to vsprintf + strncpy.
4905
c59592b3
GM
49062012-07-10 Glenn Morris <rgm@gnu.org>
4907
4908 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4909 Clarify fallback case.
4910
7d7bbefd
DA
49112012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4912
4913 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4914 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4915 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 4916 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
4917 where argument type is known to be a Lisp_Cons.
4918
3a4c8000
TT
49192012-07-10 Tom Tromey <tromey@redhat.com>
4920
4921 * bytecode.c (BYTE_CODE_THREADED): New macro.
4922 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4923 (enum byte_code_op): New type.
4924 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4925 (exec_byte_code): Use them. Use token threading when applicable.
4926
2a0213a6
DA
49272012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4928
4929 Optimize pure C strings initialization.
4930 * lisp.h (make_pure_string): Fix prototype.
4931 (build_pure_c_string): New function, defined as static inline. This
4932 provides a better opportunity to optimize away calls to strlen when
4933 the function is called with compile-time constant argument.
4934 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4935 argument, adjust users accordingly. Use build_pure_c_string where
4936 appropriate.
4937 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4938 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4939 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4940
cb1caeaf
DA
49412012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4942
4943 Avoid calls to strlen in miscellaneous functions.
4944 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4945 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4946 * lread.c (openp): Likewise.
4947
c293e30c
DA
49482012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4949
4950 Avoid calls to strlen in path processing functions.
4951 * fileio.c (file_name_as_directory): Add comment. Change to add
4952 srclen argument and return the length of result. Adjust users
4953 accordingly.
4954 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
4955 swap 1st and 2nd arguments to obey the common convention.
4956 Adjust users accordingly.
c293e30c
DA
4957 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4958
9e059e3f
GM
49592012-07-10 Glenn Morris <rgm@gnu.org>
4960
d02eb359
GM
4961 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4962 Move PENDING_OUTPUT_COUNT definition to configure.
4963
882cf227
GM
4964 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4965 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4966 * s/gnu.h (DATA_START): Move definitions to configure.
4967
af6e839f
GM
4968 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4969 We include usg5-4-common.h, which defines them both.
4970
40289a12
GM
4971 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4972 O_RDONLY already includes it).
4973
9e059e3f
GM
4974 Stop ns builds setting the EMACSLOADPATH environment variable.
4975 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4976 Now it does not set EMACSLOADPATH, just returns the load-path string.
4977 * nsterm.h: Update accordingly.
4978 * lread.c [HAVE_NS]: Include nsterm.h.
4979 (init_lread) [HAVE_NS]: Use ns_load_path.
4980 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4981
7c4e8ec0
GM
49822012-07-09 Glenn Morris <rgm@gnu.org>
4983
d4f600ff
GM
4984 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4985 since the included bsd-common.h does so.
4986
cbb31951
GM
4987 Stop ns builds setting the EMACSPATH environment variable.
4988 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4989 (ns_init_paths): Do not set EMACSPATH.
4990 * nsterm.h (ns_exec_path): Add it.
4991 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4992 Use ns_exec_path.
4993
7c4e8ec0
GM
4994 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4995
26bccfae
PE
49962012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4997
a0bee46f
PE
4998 * process.c (wait_reading_process_output): 'waitchannels' was unset
4999 when read_kbd || !NILP (wait_for_cell); fix this.
5000
5994c183
PE
5001 Add GCC-style 'const' attribute to functions that can use it.
5002 * character.h (char_resolve_modifier_mask):
5003 * keyboard.h (make_ctrl_char):
5004 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5005 (init_character_once, next_almost_prime, init_fns, init_image)
5006 (flush_pending_output, init_sound):
5007 * mem-limits.h (start_of_data):
5008 * menu.h (finish_menu_items):
5009 Add ATTRIBUTE_CONST.
5010 * emacs.c (DEFINE_DUMMY_FUNCTION):
5011 Declare the dummy function with ATTRIBUTE_CONST.
5012 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5013 Add decls with ATTRIBUTE_CONST.
5014
26bccfae
PE
5015 Minor improvements to make_formatted_string.
5016 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
5017 where int is good enough, as vsprintf returns an int.
5018 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
5019
a8290ec3
DA
50202012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5021
5022 Use make_formatted_string to avoid double length calculation.
5023 * lisp.h (make_formatted_string): New prototype.
5024 * alloc.c (make_formatted_string): New function.
5025 * buffer.c (Fgenerate_new_buffer_name): Use it.
5026 * dbus.c (syms_of_dbusbind): Likewise.
5027 * editfns.c (Fcurrent_time_zone): Likewise.
5028 * filelock.c (get_boot_time): Likewise.
5029 * frame.c (make_terminal_frame, set_term_frame_name)
5030 (x_report_frame_params): Likewise.
5031 * image.c (gs_load): Likewise.
5032 * minibuf.c (get_minibuffer): Likewise.
5033 * msdos.c (dos_set_window_size): Likewise.
5034 * process.c (make_process): Likewise.
5035 * xdisp.c (ensure_echo_area_buffers): Likewise.
5036 * xsettings.c (apply_xft_settings): Likewise.
5037
d01ba2f1
GM
50382012-07-09 Glenn Morris <rgm@gnu.org>
5039
5040 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
5041 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
5042 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
5043 * nsterm.h (ns_etc_directory): Add it.
5044 * callproc.c [HAVE_NS]: Include nsterm.h.
5045 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
5046
f1f924b6
DA
50472012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
5048
5049 Move marker debugging code under MARKER_DEBUG.
5050 * marker.c (MARKER_DEBUG): Move marker debugging code under
5051 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
5052 for bootstrap with --enable-checking (~3x slowdown reported
5053 by Juanma Barranquero <lekktu@gmail.com>).
5054 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
5055
ab531b66
PE
50562012-07-08 Paul Eggert <eggert@cs.ucla.edu>
5057
5058 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
5059 See <http://bugs.gnu.org/11825#29>.
5060
c4b3bc8a
EZ
50612012-07-08 Eli Zaretskii <eliz@gnu.org>
5062
5063 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
5064 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
5065 (display_line): Add commentary about displaying truncation glyphs
5066 on GUI frames.
5067 (produce_special_glyphs): Move here from term.c.
5068
5069 * term.c (produce_special_glyphs): Move to xdisp.c.
5070
5071 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
5072 section.
c4b3bc8a 5073
b676b881
AS
50742012-07-07 Andreas Schwab <schwab@linux-m68k.org>
5075
f17c5273
AS
5076 * xdisp.c (display_line): Avoid warning about implicit declaration
5077 of FRAME_FONT.
5078
298819b9
AS
5079 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
5080
b676b881
AS
5081 * lisp.h: Remove empty conditional.
5082
6045c4fd
PE
50832012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5084
b3350bf9
PE
5085 * lread.c (load_path_check): Now static.
5086
6045c4fd
PE
5087 Fix some minor --with-ns problems found by static checking.
5088 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
5089 (x_set_font) [!HAVE_X_WINDOWS]:
5090 * image.c (xpm_load_image) [HAVE_NS]:
5091 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
5092 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
5093 Remove unused local.
5094 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
5095 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
5096 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
5097 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
5098 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
5099 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
5100 Fix pointer signedness problem.
5101 * xfaces.c (FRAME_X_FONT_TABLE):
5102 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
5103
929e7845
GM
51042012-07-07 Glenn Morris <rgm@gnu.org>
5105
5106 * lread.c (load_path_check): New function, split from init_lread.
5107 (init_lread): Reorganize. Motivation:
5108 If EMACSLOADPATH is set, check/warn about that rather than the
5109 defaults, which we are not going to use. Hence we can remove
5110 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
5111 Don't warn if site-lisp directories are missing.
5112 If not installed, start from a blank load-path, since
5113 PATH_LOADSEARCH refers to the eventual installation directories.
5114
58dd0aa4
EZ
51152012-07-07 Eli Zaretskii <eliz@gnu.org>
5116
5117 Support truncation and continuation glyphs on GUI frames, when
5118 fringes are disabled. (Bug#11832)
5119 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
5120 continuation glyphs even if on GUI frames.
5121 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
5122 or both, are absent.
5123 (start_display, move_it_in_display_line_to): Handle the case of a
5124 GUI frame without a fringe to display continuation or truncation
5125 glyphs.
5126 (insert_left_trunc_glyphs): Support GUI frames: make sure
5127 truncation glyphs overwrite enough glyphs from the current line to
5128 have sufficient space in pixels.
5129 (display_line): Support truncation and continuation glyphs on GUI
5130 frames. If some spare pixels are left on the line after inserting
5131 the truncation glyphs, fill that space with a stretch glyph of a
5132 suitably computed width.
5133
5134 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
5135 produce_glyphs, to support GUI sessions.
5136
31571fd7
PE
51372012-07-07 Paul Eggert <eggert@cs.ucla.edu>
5138
5a16b9bc
PE
5139 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
5140
f3047c75
PE
5141 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
5142
31571fd7
PE
5143 Do not require float-time's arg to fit in time_t (Bug#11825).
5144 This works better on hosts where time_t is unsigned, and where
5145 float-time is applied to the (negative) difference between two times.
5146 * editfns.c (decode_time_components): Last arg is now double *,
5147 not int *, and means to store all the result as a double, without
5148 worrying about whether the seconds part fits in time_t.
5149 All callers changed.
5150 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
5151 All callers changed.
5152 (Ffloat_time): Do not fail merely because the specified time falls
5153 outside of time_t range.
5154
4516fbef
GM
51552012-07-07 Glenn Morris <rgm@gnu.org>
5156
5157 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
5158 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
5159 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
5160
07adc2c6
JB
51612012-07-07 Juanma Barranquero <lekktu@gmail.com>
5162
5163 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
5164 Update dependencies.
5165
5166 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
5167
fd573f31
PE
51682012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5169
fee5959d
PE
5170 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
5171 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
5172 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
5173 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
5174 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
5175 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
5176
fd573f31
PE
5177 * xfont.c (compare_font_names): Redo to omit the need for casts.
5178
ddadbc0e
AS
51792012-07-06 Andreas Schwab <schwab@linux-m68k.org>
5180
fca8d6b6
AS
5181 * xfns.c (Fx_change_window_property): Doc fix.
5182 * w32fns.c (Fx_change_window_property): Doc fix.
5183
ddadbc0e
AS
5184 * w32fns.c (Fx_window_property): Accept the same arguments as the
5185 X Windows version. Doc fix.
5186 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
5187
ed9265fc 51882012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
5189 Eli Zaretskii <eliz@gnu.org>
5190
5191 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
5192 Windows-specific code from nt/config.nt moved here.
5193 Obsolete settings removed.
5194
216ee680
PE
51952012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5196
5197 * process.c: Avoid unnecessary calls to gettime.
5198 (wait_reading_process_output): Don't get the time of day
5199 when gobbling data immediately and not waiting, as there's no need
5200 for it in that case. This removes a FIXME.
5201
bdd091e4
JD
52022012-07-06 Jan Djärv <jan.h.d@swipnet.se>
5203
5204 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
5205 is defined (Bug#11768).
5206
9d44f8ce
DA
52072012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5208
5209 Fix marker debugging code.
5210 * marker.c (byte_char_debug_check): Do not perform the check
5211 if buffer is not multibyte.
090bd7cb
JB
5212 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5213 Call byte_char_debug_check with correct arguments.
9d44f8ce 5214
90fc4786
DA
52152012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5216
5217 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
5218 * marker.c (byte_char_debug_check, count_markers):
5219 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
5220 (byte_debug_flag): Remove.
5221 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
5222 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
5223
7b7ae965
DA
52242012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5225
4e57b342
DA
5226 Avoid code repetition in marker-related functions.
5227 * marker.c (attach_marker): New function.
5228 (Fset_marker, set_marker_restricted, set_marker_both)
5229 (set_marker_restricted_both): Use it.
5230 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
5231 Consistently rename charno to charpos.
5232 (marker_position): Add eassert.
5233 (marker_byte_position): Convert to eassert.
5234
52352012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5236
5237 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 5238 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 5239 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 5240
657924ff
DA
52412012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5242
5243 Introduce fast path for the widely used marker operation.
5244 * alloc.c (build_marker): New function.
5245 * lisp.h (build_marker): New prototype.
5246 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
5247 * composite.c (autocmp_chars): Likewise.
5248 * editfns.c (buildmark): Remove.
5249 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
5250 (save_restriction_save): Use build_marker.
5251 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
5252 * window.c (save_window_save): Likewise.
5253
041a49a6
DA
52542012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
5255
5256 Do not use Fdelete_overlay in delete_all_overlays
5257 to avoid redundant calls to unchain_overlay.
5258 * buffer.c (drop_overlay): New function.
5259 (delete_all_overlays, Fdelete_overlay): Use it.
5260 * minibuf.c (get_minibuffer): Fix comment.
5261
7dca65a4
PE
52622012-07-06 Paul Eggert <eggert@cs.ucla.edu>
5263
5264 Port to OpenBSD 5.1 amd64.
5265 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
5266 This is needed for OpenBSD, and should be harmless on all BSD systems.
5267 Also, include <sys/sysctl.h>, as it should be available on all
5268 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
5269 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
5270 use p_pid member, not kp_proc.pid.
5271
8eb876e2
GM
52722012-07-06 Glenn Morris <rgm@gnu.org>
5273
5274 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
5275
38182d90
PE
52762012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5277
5278 More xmalloc and related cleanup.
5279 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
5280 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
5281 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
5282 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
5283 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
5284 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
5285 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
5286 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
5287 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
5288 * xterm.c:
5289 Omit needless casts involving void * pointers and allocation.
5290 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
5291 as the former is more robust if P's type is changed.
5292 Prefer xzalloc to xmalloc + memset 0.
5293 Simplify malloc-or-realloc to realloc.
5294 Don't worry about xmalloc returning a null pointer.
5295 Prefer xstrdup to xmalloc + strcpy.
5296 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
5297 growing it.
5298 * keyboard.c (apply_modifiers_uncached): Prefer local array to
5299 alloca of a constant.
5300
6dd5a677
EZ
53012012-07-05 Eli Zaretskii <eliz@gnu.org>
5302
5303 * xdisp.c (display_line): Fix horizontal pixel coordinates when
5304 hscroll is larger than the line width. Fixes long and futile
5305 looping inside extend_face_to_end_of_line (on a TTY) producing
5306 glyphs that are not needed and thrown away.
5307
6b312f0f
DA
53082012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5309
5310 * marker.c (set_marker_restricted_both): Simplify by using
5311 clip_to_bounds.
5312
f520ef9b
PE
53132012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5314
5315 * editfns.c (region_limit): Simplify by using clip_to_bounds.
5316
383b7c95
JD
53172012-07-05 Jan Djärv <jan.h.d@swipnet.se>
5318
5319 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
5320 not defined (Bug#11768).
5321 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
5322 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
5323 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
5324 followed by gtk_box_set_homogeneous (Bug#11768).
5325 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
5326 (update_theme_scrollbar_width, xg_create_scroll_bar):
5327 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
5328 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
5329 (is_box_type): New function (Bug#11768).
5330 (xg_tool_item_stale_p): Call is_box_type.
5293d758 5331 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
5332 with default display (Bug#11768).
5333
d6e7bf45
EZ
53342012-07-05 Eli Zaretskii <eliz@gnu.org>
5335
5336 * xdisp.c (window_hscroll_limited): New function.
5337 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
5338 coordinates when window's hscroll is set to insanely large
5339 values. (Bug#11857)
5340
431391ec
JB
53412012-07-05 Juanma Barranquero <lekktu@gmail.com>
5342
5343 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
5344 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
5345
23f86fce
DA
53462012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
5347
5348 Cleanup xmalloc.
5349 * lisp.h (xzalloc): New prototype. Omit needless casts.
5350 * alloc.c (xzalloc): New function. Omit needless casts.
5351 * charset.c: Omit needless casts. Convert all calls to
5352 xmalloc with following memset to xzalloc.
5353 * dispnew.c: Likewise.
5354 * fringe.c: Likewise.
5355 * image.c: Likewise.
5356 * sound.c: Likewise.
5357 * term.c: Likewise.
5358 * w32fns.c: Likewise.
5359 * w32font.c: Likewise.
5360 * w32term.c: Likewise.
5361 * xfaces.c: Likewise.
5362 * xfns.c: Likewise.
5363 * xterm.c: Likewise.
5364 * atimer.c: Omit needless casts.
5365 * buffer.c: Likewise.
5366 * callproc.c: Likewise.
5367 * ccl.c: Likewise.
5368 * coding.c: Likewise.
5369 * composite.c: Likewise.
5370 * doc.c: Likewise.
5371 * doprnt.c: Likewise.
5372 * editfns.c: Likewise.
5373 * emacs.c: Likewise.
5374 * eval.c: Likewise.
5375 * filelock.c: Likewise.
5376 * fns.c: Likewise.
5377 * gtkutil.c: Likewise.
5378 * keyboard.c: Likewise.
5379 * lisp.h: Likewise.
5380 * lread.c: Likewise.
5381 * minibuf.c: Likewise.
5382 * msdos.c: Likewise.
5383 * print.c: Likewise.
5384 * process.c: Likewise.
5385 * region-cache.c: Likewise.
5386 * search.c: Likewise.
5387 * sysdep.c: Likewise.
5388 * termcap.c: Likewise.
5389 * terminal.c: Likewise.
5390 * tparam.c: Likewise.
5391 * w16select.c: Likewise.
5392 * w32.c: Likewise.
5393 * w32reg.c: Likewise.
5394 * w32select.c: Likewise.
5395 * w32uniscribe.c: Likewise.
5396 * widget.c: Likewise.
5397 * xdisp.c: Likewise.
5398 * xmenu.c: Likewise.
5399 * xrdb.c: Likewise.
5400 * xselect.c: Likewise.
5401
0497dc44
PE
54022012-07-05 Paul Eggert <eggert@cs.ucla.edu>
5403
5404 * fileio.c (time_error_value): Check the right error number.
5405 Problem reported by Troels Nielsen in
5406 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
5407
356e7178
PE
54082012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5409
4e71fd89
PE
5410 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
5411 This should be fixed in a better way; see Eli Zaretskii in
5412 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
5413 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
5414
f0941253
PE
5415 * fileio.c (time_error_value): Rename from special_mtime.
5416 The old name's problems were noted by Eli Zaretskii in
5417 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
5418
065c9eb4
PE
5419 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
5420 This variable's comment says Emacs needs at least one GDB-visible
5421 symbol of type enum pvec_type, to work around GDB problems.
5422 The symbol's value doesn't matter.
5423
356e7178
PE
5424 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
5425 that causes compilation to fail on pre-C99 compilers.
5426
ed9265fc 54272012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
5428
5429 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
5430 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
5431
3884d954
DA
54322012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5433
d209e2fb 5434 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
5435 headers for buffer_defaults and buffer_local_symbols.
5436 Reported by Juanma Barranquero <lekktu@gmail.com>.
5437
ee28be33
SM
54382012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5439
5440 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
5441 * lisp.h (enum pvec_type): Use fewer bits.
5442 (PSEUDOVECTOR_SIZE_BITS): New constant.
5443 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
5444 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
5445 change in pvec_type.
5446 (PSEUDOVECTOR_TYPEP): New macro.
5447 (TYPED_PSEUDOVECTORP): Use it.
5448 * fns.c (internal_equal): Adapt code to extract pvectype.
5449 * emacs.c (gdb_pvec_type): Update type.
5450 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
5451 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
5452 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
5453 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
5454 (sweep_vectors): Use it. Use local var `total_bytes' instead of
5455 abusing vector->header.next.nbytes.
5456 (live_vector_p): Use PVEC_TYPE.
5457 (mark_object): Adapt code to extract pvectype. Use switch.
5458
c7f2cd7f
PE
54592012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5460
5461 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
5462 Tighten new eassert a bit.
5463
8ce70ed2
DA
54642012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5465
5466 Fix compilation with --enable-gcc-warnings and -O1
5467 optimization level.
5468 * doprnt.c (doprnt): Change type of tem to int, initialize
5469 to avoid compiler warning. Add eassert.
5470 * search.c (simple_search): Initialize match_byte to avoid
5471 compiler warning. Add eassert.
5472
dea7f1e5
PE
54732012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5474
24a212eb
PE
5475 Avoid weird behavior with large horizontal scrolls.
5476 Without this change, for example, large hscroll values would
5477 mess up Emacs's display on Fedora 15 x86, presumably due to
5478 overflows in int calculations in the display code.
5479 Also, if buffers had long lines, Emacs would freeze.
5480 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
5481 (set_window_hscroll): New function, containing the old guts of
5482 Fset_window_hscroll. Return the clipped value.
5483 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
5484 This avoids the need to check against PTRDIFF_MAX.
5485
dea7f1e5
PE
5486 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
5487
76046526
DA
54882012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
5489
5490 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
5491
39adff0d
PE
54922012-07-04 Paul Eggert <eggert@cs.ucla.edu>
5493
63807d47
PE
5494 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
5495 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
5496 since GCC 4.4.6 issues a bogus warning for them.
5497
39adff0d
PE
5498 Fix bugs in file timestamp newness comparisons.
5499 * fileio.c (Ffile_newer_than_file_p):
5500 * lread.c (Fload): Use full timestamp resolution of files,
5501 not just the 1-second resolution, so that files that are only
5502 slightly newer still count as newer.
5503 * fileio.c (Ffile_newer_than_file_p): Don't assume file
5504 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
5505
dbeed9a6
PE
55062012-07-03 Paul Eggert <eggert@cs.ucla.edu>
5507
5508 * fileio.c: Improve handling of file time marker. (Bug#11852)
5509 (special_mtime): New function.
5510 (Finsert_file_contents, Fverify_visited_file_modtime):
5511 Use it to set special mtime values consistently.
5512
636334d6
AS
55132012-07-03 Andreas Schwab <schwab@linux-m68k.org>
5514
5515 * fileio.c (Finsert_file_contents): Properly handle st_mtime
5516 marker for non-existing file. (Bug#11852)
5517
e2017fe2
GM
55182012-07-03 Glenn Morris <rgm@gnu.org>
5519
5520 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
5521 and did not make it into globals.h).
5522
404dbd37
TT
55232012-07-03 Tom Tromey <tromey@redhat.com>
5524
5525 * window.c (Fset_window_margins, Fset_window_fringes)
5526 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
5527 * textprop.c (Fprevious_property_change): No longer static.
5528 * syntax.c (Fsyntax_table_p): No longer static.
5529 * process.c (Fget_process, Fprocess_datagram_address): No longer
5530 static.
5531 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
5532 * keyboard.c (Fcommand_execute): No longer static.
5533 Remove EXFUN.
5534 * insdel.c (Fcombine_after_change_execute): No longer static.
5535 * image.c (Finit_image_library): No longer static.
5536 * fileio.c (Fmake_symbolic_link): No longer static.
5537 * eval.c (Ffetch_bytecode): No longer static.
5538 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
5539 * doc.c (Fdocumentation_property, Fsnarf_documentation):
5540 No longer static.
404dbd37
TT
5541 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
5542 static.
5543 * dired.c (Ffile_attributes): No longer static.
5544 * composite.c (Fcomposition_get_gstring): No longer static.
5545 * callproc.c (Fgetenv_internal): No longer static.
5546
5547 * ccl.h: Remove EXFUNs.
5548 * buffer.h: Remove EXFUNs.
5549 * dispextern.h: Remove EXFUNs.
5550 * intervals.h: Remove EXFUNs.
5551 * fontset.h: Remove EXFUN.
5552 * font.h: Remove EXFUNs.
5553 * dosfns.c (system_process_attributes): Remove EXFUN.
5554 * keymap.h: Remove EXFUNs.
5555 * lisp.h: Remove EXFUNs.
5556 * w32term.h: Remove EXFUNs.
5557 * window.h: Remove EXFUNs.
5558 * xsettings.h: Remove EXFUN.
5559 * xterm.h: Remove EXFUN.
5560
8e4fd1e1
GM
55612012-07-03 Glenn Morris <rgm@gnu.org>
5562
5563 * lisp.h (Frandom): Make it visible to C.
5564 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
5565 buffer for invisible buffers. (Bug#1229)
5566
ca95b3eb
DA
55672012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5568
5569 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
5570 values which aren't power of 2.
14ae4239
BT
5571 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
5572 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
5573 accordingly.
5574
7555c33f
SM
55752012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
5576
5577 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
5578
5579 * alloc.c (mark_object): Revert part of last patch to use `switch'.
5580
d12e8f5a
DA
55812012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5582
5583 * alloc.c (allocate_vector_block): Remove redundant
5584 calls to mallopt if DOUG_LEA_MALLOC is defined.
5585 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
5586 avoid calls to mallopt if zero_vector is returned.
5587
296094c3
DA
55882012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5589
5590 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
5591 is enabled, avoid dereferencing NULL current_sblock if
5592 running undumped.
5593
36429c89
DA
55942012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
5595
5596 Cleanup basic buffer management.
5597 * buffer.h (struct buffer): Change layout to use generic vector
5598 marking code. Fix some comments. Change type of 'clip_changed'
5599 to bitfield. Remove unused #ifndef old.
5600 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
5601 (GET_OVERLAYS_AT): Fix indentation.
5602 (for_each_per_buffer_object_at): New macro.
5603 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
5604 (Fbuffer_local_variables): Use it.
5605 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
5606 * alloc.c (allocate_buffer): Adjust to match new layout of
5607 struct buffer. Fix comment.
5608 (mark_overlay): New function.
5609 (mark_buffer): Use it. Use mark_vectorlike to mark normal
5610 Lisp area of struct buffer.
5611 (mark_object): Use it. Adjust marking of misc objects
5612 and related comments.
5613
3b3e4cac
PE
56142012-07-02 Paul Eggert <eggert@cs.ucla.edu>
5615
5616 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
5617 wrapper that is not needed because the wrapped code is a no-op (zero
5618 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
5619 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
5620
cf5c0175
DA
56212012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
5622
5623 * alloc.c (mark_buffer): Simplify. Remove prototype.
5624 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 5625 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
5626 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
5627 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 5628
ca26824c
GM
56292012-06-30 Glenn Morris <rgm@gnu.org>
5630
2e4c5312
GM
5631 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
5632
ca26824c
GM
5633 * epaths.in (PATH_SITELOADSEARCH): New.
5634 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
5635 This is rather than relying on --enable-locallisppath elements
5636 having "site-lisp" in their names. (Bug#10208#25, 11658)
5637
0d23c240
EZ
56382012-06-30 Eli Zaretskii <eliz@gnu.org>
5639
c9240d7a
EZ
5640 * w32proc.c (sys_select): Accept and ignore one more argument.
5641
5642 * w32.c (emacs_gnutls_pull): Call select with one more argument.
5643
0d23c240 5644 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 5645 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
5646
5647 * sysdep.c: Don't include dos.h and dosfns.h.
5648
5649 * process.c (sys_select):
5650 * msdos.c (sys_select): Accept one more argument and ignore it.
5651
5652 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
5653 adapt data types and code to that.
5654
5655 * dosfns.c:
5656 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
5657 which clashes with the gnulib function of the same name.
5658
af5a5a98
AS
56592012-06-30 Andreas Schwab <schwab@linux-m68k.org>
5660
c5e4379c
AS
5661 * font.c (font_style_to_value, font_style_symbolic)
5662 (font_prop_validate_style): Add type checks for values in
5663 font_style_table.
5664
af5a5a98
AS
5665 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
5666 argument.
5667 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
5668 uses.
5669
8d38f461
EZ
56702012-06-29 Eli Zaretskii <eliz@gnu.org>
5671
2e5a6631
EZ
5672 * xdisp.c (try_window_id): Undo last change.
5673
8d38f461
EZ
5674 * w32.c (getwd): Adjust commentary about startup_dir.
5675 (init_environment): Always call sys_access, even in non-MSVC
5676 builds. Don't chdir to the directory of the Emacs executable.
5677 This undoes code from 1997 which was justified by the need to
5678 "avoid conflicts when removing and renaming directories". But its
5679 downside was that every relative file name was being interpreted
5680 relative to the directory of the Emacs executable, which can never
5681 be TRT. In particular, it broke sys_access when called with
5682 relative file names.
5683 (sys_access): Map GetLastError to errno.
5684
2af3565e
DA
56852012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5686
5687 * window.h (struct window): Change type of 'fringes_outside_margins'
5688 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 5689 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
5690 Adjust comment.
5691 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
5692 to ptrdiff_t.
5693
c8d3a25c 56942012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 5695
c8d3a25c
GM
5696 * gnutls.c (emacs_gnutls_handshake):
5697 Add QUIT to make the loop interruptible.
57570cd3 5698
c8d3a25c 56992012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 5700
c8d3a25c
GM
5701 * charset.c (init_charset): Make lack of etc/charsets fatal.
5702
3e984ee8
DA
57032012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5704
5705 * editfns.c (region_limit): Fix type mismatch.
5706
ef884f23
DA
57072012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
5708
5709 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
5710 undefined. Convert from xassert to eassert.
5711 * nsmenu.m: Convert from xassert to eassert.
5712 * nsterm.m: Likewise.
5713
7d7e0027
SM
57142012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
5715
5716 * editfns.c (region_limit): Clip to narrowing (bug#11770).
5717
aa754e6a
PE
57182012-06-28 Paul Eggert <eggert@cs.ucla.edu>
5719
5720 Avoid integer overflow on scroll-left and scroll-right.
5721 * window.c (HSCROLL_MAX): New macro.
5722 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
5723 overflow when requested scroll falls outside ptrdiff_t range.
5724
80b00b08
DA
57252012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5726
5727 * window.h (struct window): Change type of 'hscroll',
5728 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5729 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5730 Adjust users accordingly.
5731 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5732 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5733 from EMACS_INT to ptrdiff_t.
5734 (make_window): Omit redundant initialization.
5735
62b2bcf6
JB
57362012-06-28 Juanma Barranquero <lekktu@gmail.com>
5737
5738 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5739
45942c7d
DA
57402012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5741
5742 * window.h (struct window): Change type of 'use_time' and
5743 'sequence_number' from Lisp_Object to int.
5744 * frame.c (make_frame): Adjust users accordingly.
5745 * print.c (print_object): Likewise.
5746 * window.c (select_window, Fwindow_use_time, make_parent_window)
5747 (make_window): Likewise.
5748
e509cfa6
DA
57492012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5750
5751 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5752 enabled with --enable-checking=[all,glyphs] configure option.
5753 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5754 adjust comments accordingly.
5755 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5756 undefined, adjust comments accordingly.
5757 * image.c: Likewise.
5758 * scroll.c: Likewise.
5759 * w32fns.c: Likewise.
5760 * w32term.c: Likewise.
5761 * xdisp.c: Likewise.
5762 * xfaces.c: Likewise.
5763 * xfns.c: Likewise.
5764 * xterm.c: Likewise.
5765
a54e2c05
DA
57662012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5767
5768 Generalize run-time debugging checks.
5769 * dispextern.h (XASSERTS): Remove.
5770 * fontset.c (xassert): Remove.
5771 Convert from xassert to eassert.
5772 * alloc.c: Convert from xassert to eassert.
5773 * bidi.c: Likewise.
5774 * dispnew.c: Likewise.
5775 * fns.c: Likewise.
5776 * fringe.c: Likewise.
5777 * ftfont.c: Likewise.
5778 * gtkutil.c: Likewise.
5779 * image.c: Likewise.
5780 * keyboard.c: Likewise.
5781 * menu.c: Likewise.
5782 * process.c: Likewise.
5783 * scroll.c: Likewise.
5784 * sound.c: Likewise.
5785 * term.c: Likewise.
5786 * w32console.c: Likewise.
5787 * w32fns.c: Likewise.
5788 * w32term.c: Likewise.
5789 * window.c: Likewise.
5790 * xdisp.c: Likewise.
5791 * xfaces.c: Likewise.
5792 * xfns.c: Likewise.
5793 * xselect.c: Likewise.
5794 * xterm.c: Likewise.
5795
1ec4b7b2
SM
57962012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5797
5798 * fns.c (maybe_resize_hash_table): Output message when growing the
5799 purify-hashtable.
5800
2014308a
DA
58012012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5802
5803 * alloc.c (allocate_string_data): Remove dead code.
5804 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5805 avoid GCC warning about unused macro.
5806
246155eb
DA
58072012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5808
5809 * alloc.c (allocate_string): Omit intervals initialization.
5810 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5811 as in make_pure_string and make_pure_c_string.
5812
43184b7b
DA
58132012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5814
d209e2fb 5815 * alloc.c (allocate_string): Fix last change.
43184b7b 5816
3fe6dd74
DA
58172012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5818
d209e2fb 5819 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
5820 to memset, add explicit initialization where appropriate.
5821
1ba6038a
GM
58222012-06-27 Glenn Morris <rgm@gnu.org>
5823
5824 * lisp.mk (lisp): Remove paths.elc.
5825
c89926a5
CY
58262012-06-27 Chong Yidong <cyd@gnu.org>
5827
5828 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5829
ed6b3510
JW
58302012-06-26 John Wiegley <johnw@newartisans.com>
5831
1ec4b7b2 5832 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
5833 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5834
ed6b3510
JW
5835 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5836 when building with Clang.
5837
8edd4a2b
SM
58382012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5839
5840 * eval.c (Fapply): Allow calling it with a single argument.
5841
f6f62d1b
EZ
58422012-06-26 Eli Zaretskii <eliz@gnu.org>
5843
5844 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5845 _stricmp and _strnicmp.
5846 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5847
62efea5e
DA
58482012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5849
5850 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5851 allocated window.
5852 (allocate_process): Likewise for new process.
8edd4a2b 5853 (allocate_terminal): Change to use offsetof.
62efea5e
DA
5854 (allocate_frame): Likewise.
5855 * frame.c (make_frame): Omit redundant initialization.
5856 * window.c (make_parent_window): Use memset.
5857 (make_window): Omit redundant initialization.
5858 * process.c (make_process): Omit redundant initialization.
5859 * terminal.c (create_terminal): Likewise.
5860
42997f4d
DA
58612012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5862
5863 * term.c (delete_tty): Remove redundant call to memset.
5864
1130ecfc
DA
58652012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5866
5867 * alloc.c: Remove build_string.
5868 * lisp.h: Define build_string as static inline. This provides
5869 a better opportunity to optimize away calls to strlen when the
5870 function is called with compile-time constant argument.
5871 * image.c (imagemagick_error): Convert to build_string.
5872 * w32proc.c (sys_spawnve): Likewise.
5873 * xterm.c (x_term_init): Likewise.
5874
cf38a720
PE
58752012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5876
99027bdd
PE
5877 Use sprintf return value instead of invoking strlen on result.
5878 In the old days this wasn't portable, since some sprintf
5879 implementations returned char *. But they died out years ago and
5880 Emacs already assumes sprintf returns int.
5881 Similarly for float_to_string.
5882 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5883 * ccl.c (ccl_driver):
5884 * character.c (string_escape_byte8):
5885 * data.c (Fnumber_to_string):
5886 * doprnt.c (doprnt):
5887 * print.c (print_object):
5888 * xdisp.c (message_dolog):
5889 * xfns.c (syms_of_xfns):
5890 Use sprintf or float_to_string result to avoid need to call strlen.
5891 * data.c (Fnumber_to_string):
5892 Use make_unibyte_string, since the string must be ASCII.
5893 * lisp.h, print.c (float_to_string): Now returns int length.
5894 * term.c (produce_glyphless_glyph):
5895 Use sprintf result rather than recomputing it.
5896
cf38a720
PE
5897 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5898 * Makefile.in (ALL_CFLAGS):
5899 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5900 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5901
3511c784
DA
59022012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5903
0a08eb21 5904 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
5905 strcasecmp if available.
5906 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5907
fb7da12e
AS
59082012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5909
5910 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5911 Avoid comma operator.
5912 * menu.c (push_submenu_start, push_submenu_end)
5913 (push_left_right_boundary, push_menu_pane): Likewise.
5914 * msdos.c (dos_rawgetc): Likewise.
5915
afa2ffd8
DA
59162012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5917
5918 * xfns.c (xic_create_fontsetname): Remove redundant calls
5919 to memset.
5920
b3b4476b
PE
59212012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5922
4495ff38
PE
5923 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5924 sprintf already null-terminates its output.
5925
b3b4476b
PE
5926 * xfns.c (x_window): Remove redundant cast.
5927
b00876c9
DA
59282012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5929
5930 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5931 `const char *' to `char *' to avoid compiler warning.
5932
d188e26b
PE
59332012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5934
885d1d74
PE
5935 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5936 instead of truncating it to 63 (admittedly a generous limit).
5937
d188e26b
PE
5938 * process.c: Fix spelling and caps in comments.
5939
e2f560b1
DN
59402012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5941
e86db54b 5942 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
5943 * sysdep.c (setpgrp): Remove definition, not used in this file.
5944
7583a3a1
JB
59452012-06-24 Juanma Barranquero <lekktu@gmail.com>
5946
5947 * makefile.w32-in: Update dependencies.
5948
696056c2
EZ
59492012-06-24 Eli Zaretskii <eliz@gnu.org>
5950
5951 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5952 (SYSTIME_H): Add nt/inc/sys/time.h.
5953
5954 * systime.h [WINDOWSNT]: Include sys/time.h.
5955
5956 * s/ms-w32.h (struct timespec): Definition moved from
5957 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5958
845ca893
PE
59592012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5960
5961 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5962 * buffer.h (buffer_slot_type_mismatch):
5963 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5964 * eval.c (unwind_to_catch):
5965 * image.c (my_png_error, my_error_exit):
5966 * keyboard.c (quit_throw_to_read_char, user_error)
5967 (Fexit_recursive_edit, Fabort_recursive_edit):
5968 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5969 (wrong_type_argument, buffer_overflow, __executable_start)
5970 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5971 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5972 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5973 (fatal):
5974 (child_setup) [!DOS_NT]:
5975 * lread.c (end_of_file_error, invalid_syntax):
5976 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5977 * puresize.h (pure_write_error):
5978 * search.c (matcher_overflow):
5979 * sound.c (sound_perror, alsa_sound_perror):
5980 * sysdep.c, syssignal.h (croak):
5981 * term.c (maybe_fatal, vfatal):
5982 * textprop.c (text_read_only):
5983 * undo.c (user_error):
5984 * unexmacosx.c (unexec_error):
5985 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5986 Use _Noreturn rather than NO_RETURN.
5987 No need for separate decl merely because of _Noreturn.
5988 * sound.c (sound_warning, parse_sound):
5989 Remove unnecessary forward decls.
5990
f1dd8073
PE
59912012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5992
5993 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5994 * lisp.h (WAIT_READING_MAX): New macro.
5995 * dispnew.c (Fsleep_for, sit_for):
5996 * keyboard.c (kbd_buffer_get_event):
5997 * process.c (Faccept_process_output):
5998 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5999 This improves on the previous patch, which introduced a bug
6000 when time_t is unsigned and as wide as intmax_t.
6001 See <http://bugs.gnu.org/9000#51>.
6002
b82c1755
EZ
60032012-06-23 Eli Zaretskii <eliz@gnu.org>
6004
6005 * dispnew.c (sit_for, Fsleep_for):
6006 * keyboard.c (kbd_buffer_get_event):
6007 * process.c (Faccept_process_output): Avoid compiler warnings when
6008 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6009
ca300656
JB
60102012-06-23 Juanma Barranquero <lekktu@gmail.com>
6011
049ec95b
JB
6012 * makefile.w32-in: Update dependencies.
6013
ca300656
JB
6014 * w32.c (ltime): Add return type and declare static.
6015 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6016
db7b8d06
PE
60172012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6018
6019 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
6020 Privately reported by Herbert J. Skuhra.
6021 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
6022 All uses changed.
6023 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
6024 not make_lisp_timeval, when the argument is of type EMACS_TIME.
6025
0bd8297f
EZ
60262012-06-23 Eli Zaretskii <eliz@gnu.org>
6027
96512555
EZ
6028 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
6029 last argument of make_unibyte_string.
6030
0bd8297f
EZ
6031 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
6032 language ID in the event parameters.
6033
6034 * w32term.c (w32_read_socket): Put the new keyboard codepage into
6035 event.code, not the obscure "character set ID".
6036
63def6b6
CY
60372012-06-23 Chong Yidong <cyd@gnu.org>
6038
6039 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
6040
e8a02204
EZ
60412012-06-23 Eli Zaretskii <eliz@gnu.org>
6042
388cdec0
EZ
6043 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
6044 * w32.c (fdutimens): New function.
6045
6046 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
6047
6048 * s/ms-w32.h (pselect): Redirect to sys_select.
6049
6050 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
6051
e8a02204
EZ
6052 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
6053 in the logic of incrementing and decrementing the value of
6054 use_relocatable_buffers.
6055
d054f3fb
PE
60562012-06-23 Paul Eggert <eggert@cs.ucla.edu>
6057
6058 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
6059 Privately reported by Herbert J. Skuhra.
6060 [__FreeBSD__]: Remove "*/" typo after "#include".
6061 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
6062 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
6063 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
6064 Don't assume EMACS_TIME and struct timeval are the same type.
6065
d35af63c
PE
60662012-06-22 Paul Eggert <eggert@cs.ucla.edu>
6067
6068 Support higher-resolution time stamps (Bug#9000).
6069 The time stamps are only nanosecond-resolution at the C level,
6070 since that's the best that any real-world system supports now.
6071 But they are picosecond-resolution at the Lisp level, as that's
6072 easy, and leaves room for future OS improvements.
6073
6074 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
6075 (LIBES): Use it.
6076
6077 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
6078 Don't get current time unless it's needed.
6079
6080 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
6081 now provides it if it's absent.
6082 (start_atimer): Port to higher-res time stamps.
6083 Check for time stamp overflow. Don't get current time more
6084 often than is needed.
6085
6086 * buffer.h (struct buffer): Buffer modtime now has high resolution.
6087 Include systime.h, not time.h.
6088 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
6089
6090 * dired.c: Include stat-time.h.
6091 (Ffile-attributes): File times now have higher resolution.
6092
6093 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
6094 (struct image): Timestamp now has higher resolution.
6095
6096 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
6097 has at least microseconds now. All uses removed.
6098 (update_frame, update_single_window, update_window, update_frame_1)
6099 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 6100 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
6101
6102 * editfns.c (time_overflow): Now extern.
6103 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
6104 (float-time, Fformat_time_string, Fcurrent_time_string)
6105 (Fcurrent_time_zone): Accept and generate higher-resolution
6106 time stamps.
6107 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
6108 (decode_time_components, lisp_seconds_argument): New functions.
6109 (make_time): Now static.
6110 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
6111 Report an error if the time is invalid, rather than having the caller
6112 do that.
6113
6114 * fileio.c: Include <stat-time.h>
6115 (Fcopy_file): Copy higher-resolution time stamps.
6116 Prefer to set the time stamp via a file descriptor if that works.
6117 (Fset_file_times, Finsert_file_contents, Fwrite_region)
6118 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
6119 (Fvisited_file_modtime, Fset_visited_file_modtime):
6120 Support higher-resolution time stamps.
6121
6122 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
6123
6124 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
6125
6126 * image.c (prepare_image_for_display, clear_image_cache)
6127 (lookup_image): Port to higer-resolution time stamps.
6128
6129 * keyboard.c (start_polling, bind_polling_period):
6130 Check for time stamp overflow.
6131 (read_char, kbd_buffer_get_event, timer_start_idle)
6132 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
6133 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
6134 Port to higher-resolution time stamps. Do not assume time_t is signed.
6135 (decode_timer): New function. Timers are now vectors of length 9,
6136 not 8, to accommodate the picosecond component.
6137 (timer_check_2): Use it.
6138
6139 * nsterm.m (select_timeout, timeval_subtract): Remove.
6140 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
6141 as they're a bit more accurate and handle overflow better.
6142 (ns_select): Change prototype to be compatible with pselect.
6143 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
6144 * nsterm.h (ns_select): Adjust prototype.
6145
6146 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
6147 us-resolution time stamps.
6148 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
6149
6150 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
6151
6152 * lisp.h (time_overflow): New decl.
6153 (wait_reading_process_output): First arg is now intmax_t, not int,
6154 to accommodate larger waits.
6155
6156 * process.h (struct Lisp_Process.read_output_delay):
6157 Now counts nanoseconds, not microseconds.
6158 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
6159 EMACS_HAS_USECS.
6160 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
6161 (wait_reading_process_output):
6162 Port to ns-resolution time stamps.
6163 (Faccept_process_output, wait_reading_process_output):
6164 Check for time stamp overflow. Do not assume time_t is signed.
6165 (select_wrapper): Remove; we now use pselect.
6166 (Fprocess_attributes): Now generates ns-resolution time stamps.
6167
6168 * sysdep.c: Include utimens.h. Don't include utime.h
6169 or worry about struct utimbuf; gnulib does that for us now.
6170 (gettimeofday): Remove; gnulib provides a substitute.
6171 (make_timeval): New function.
6172 (set_file_times): Now sets ns-resolution time stamps.
6173 New arg FD; all uses changed.
6174 (time_from_jiffies, ltime_from_jiffies, get_up_time)
6175 (system_process_attributes):
6176 Now returns ns-resolution time stamp. All uses changed.
6177 Check for time stamp overflow.
6178
6179 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
6180 provides a substitute now.
6181
6182 * systime.h: Include timespec.h rather than sys/time.h and time.h,
6183 since it guarantees struct timespec.
6184 (EMACS_TIME): Now struct timespec, so that we can support
6185 ns-resolution time stamps.
6186 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
6187 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
6188 (EMACS_USECS): Remove.
6189 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
6190 so multiply the arg by 1000 before storing it.
6191 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
6192 New macros.
6193 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
6194 Port to ns-resolution time stamps.
6195 (EMACS_TIME_NEG_P): Remove; replaced by....
6196 (EMACS_TIME_SIGN): New macro.
6197 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
6198 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
6199 (set_file_times, make_time, lisp_time_argument): Adjust signature.
6200 (make_timeval, make_lisp_time, decode_time_components): New decls.
6201 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
6202 that it mishandled time_t overflow. You can't compare by subtracting!
6203 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
6204 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
6205
6206 * term.c: Include <sys/time.h>.
6207 (timeval_to_Time): New function, for proper overflow wraparound.
6208 (term_mouse_position, term_mouse_click): Use it.
6209
6210 * undo.c (record_first_change): Support higher-resolution time stamps
6211 in the undo buffer.
6212 (Fprimitive_undo): Use them when restoring time stamps.
6213
6214 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
6215 (w32_get_internal_run_time):
6216 Port to higher-resolution Emacs time stamps.
6217 (ltime): Now accepts single 64-bit integer, as that's more convenient
6218 for callers.
6219
6220 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
6221
6222 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
6223 for compatibility with pselect. Support ns-resolution time stamps.
6224
6225 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
6226
6227 * xselect.c (wait_for_property_change, x_get_foreign_selection):
6228 Check for time stamp overflow, and support ns-resolution time stamps.
6229
6230 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
6231 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
6232 (timeval_subtract): Remove; no longer needed.
6233 (XTflash, XTring_bell, x_wait_for_event):
6234 Port to ns-resolution time stamps. Don't assume time_t is signed.
6235
b6a92dfe
CY
62362012-06-22 Chong Yidong <cyd@gnu.org>
6237
6238 * xdisp.c (x_consider_frame_title): Revert last change.
6239
d251c37c
EZ
62402012-06-22 Eli Zaretskii <eliz@gnu.org>
6241
6242 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
6243 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
6244 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
6245 staticidx goes up to 1597 out of 1600 = 0x640.)
6246
f10deafb
PE
62472012-06-20 Paul Eggert <eggert@cs.ucla.edu>
6248
6249 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
6250 Otherwise, the umask might be mistakenly 0 while handling input signals.
6251
ec6de1e2
SM
62522012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
6253
6254 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
6255
28be1ada
DA
62562012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
6257
6258 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
6259 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
6260 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
6261 access to `contents' member of Lisp_Vector objects with AREF and ASET
6262 where appropriate.
6263
c6bf3022
CY
62642012-06-19 Chong Yidong <cyd@gnu.org>
6265
6266 * frame.c (delete_frame): When selecting a frame on a different
6267 text terminal, do not alter the terminal's top-frame.
6268
6269 * xdisp.c (format_mode_line_unwind_data): Record the target
6270 frame's selected window and its terminal's top-frame.
6271 (unwind_format_mode_line): Restore them.
6272 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
6273 Callers changed.
6274 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
6275 since tty frames can be explicitly named.
6276 (prepare_menu_bars): Likewise.
6277
6278 * term.c (Ftty_top_frame): New function.
6279
defd4196
PE
62802012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6281
6282 Port byte-code-meter to modern targets.
6283 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
6284 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 6285 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
6286 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
6287 (METER_1, METER_2): Simplify.
6288
1053a871
SM
62892012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
6290
6291 * data.c (Fdefalias): Return `symbol' (bug#11686).
6292
b7e8d081
MR
62932012-06-18 Martin Rudalics <rudalics@gmx.at>
6294
6295 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
6296 gets killed during executing of this function (Bug#11665).
6297 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
6298 (Vkill_buffer_query_functions): In doc-string say that functions
6299 run by this hook should not change the current buffer.
6300
7ea2b339
PE
63012012-06-18 Paul Eggert <eggert@cs.ucla.edu>
6302
6303 Fix recently-introduced process.c problems found by static checking.
6304 * process.c (write_queue_push, write_queue_pop, send_process):
6305 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
6306 (write_queue_pop): Fix pointer signedness problem.
6307 (send_process): Remove unused local.
6308
96a313a1
CY
63092012-06-17 Chong Yidong <cyd@gnu.org>
6310
6311 * xdisp.c (redisplay_internal): No need to redisplay terminal
6312 frames that are not on top.
6313
20ca2e94
TN
63142012-06-17 Troels Nielsen <bn.troels@gmail.com>
6315
6316 * process.c (make_process): Initialize write_queue.
6317 (write_queue_push, write_queue_pop): New functions.
6318 (send_process): Use them to maintain correct ordering of process
6319 writes (Bug#10815).
6320
9a900ca9
PE
63212012-06-17 Paul Eggert <eggert@cs.ucla.edu>
6322
310fbfa8
PE
6323 * lisp.h (eassert): Assume C89 or later.
6324 This removes the need for CHECK.
6325 (CHECK): Remove. Its comments about always evaluating its
6326 argument were confusing, as 'eassert' typically does not evaluate
6327 its argument.
6328
27bb1ca4
PE
6329 * coding.c (produce_chars): Use ptrdiff_t, not int.
6330
9a900ca9
PE
6331 * xterm.c (x_draw_underwave): Check for integer overflow.
6332 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
6333
41b7f8bc 63342012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
6335
6336 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
6337 referenced (Bug#11583).
6338
9b0e3eba
AA
63392012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
6340
6341 Implement wave-style variant of underlining.
6342 * dispextern.h (face_underline_type): New enum.
6343 (face): Add field for underline type.
6344 * nsterm.m (ns_draw_underwave): New function.
6345 (ns_draw_text_decoration): Use it.
6346 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
6347 New functions.
6348 (x_draw_glyph_string): Use them.
6349 * xfaces.c (Qline, Qwave): New Lisp objects.
6350 (check_lface_attrs, merge_face_ref)
1053a871
SM
6351 (Finternal_set_lisp_face_attribute, realize_x_face):
6352 Handle wave-style underline face attributes.
9b0e3eba
AA
6353 * xterm.c (x_draw_underwave): New function.
6354 (x_draw_glyph_string): Use it.
6355
0fb52f11
JB
63562012-06-16 Juanma Barranquero <lekktu@gmail.com>
6357
6358 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
6359 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
6360 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
6361 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
6362 ($(BLD)/w32select.$(O)): Update dependencies.
6363
e5560ff7
AS
63642012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6365
6366 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
6367 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
6368 * character.c (_fetch_multibyte_char_p): Remove.
6369 * alloc.c: Include "character.h" before "buffer.h".
6370 * bidi.c: Likewise.
6371 * buffer.c: Likewise.
6372 * bytecode.c: Likewise.
6373 * callint.c: Likewise.
6374 * callproc.c: Likewise.
6375 * casefiddle.c: Likewise.
6376 * casetab.c: Likewise.
6377 * category.c: Likewise.
6378 * cmds.c: Likewise.
6379 * coding.c: Likewise.
6380 * composite.c: Likewise.
6381 * dired.c: Likewise.
6382 * dispnew.c: Likewise.
6383 * doc.c: Likewise.
6384 * dosfns.c: Likewise.
6385 * editfns.c: Likewise.
6386 * emacs.c: Likewise.
6387 * fileio.c: Likewise.
6388 * filelock.c: Likewise.
6389 * font.c: Likewise.
6390 * fontset.c: Likewise.
6391 * fringe.c: Likewise.
6392 * indent.c: Likewise.
6393 * insdel.c: Likewise.
6394 * intervals.c: Likewise.
6395 * keyboard.c: Likewise.
6396 * keymap.c: Likewise.
6397 * lread.c: Likewise.
6398 * macros.c: Likewise.
6399 * marker.c: Likewise.
6400 * minibuf.c: Likewise.
6401 * nsfns.m: Likewise.
6402 * nsmenu.m: Likewise.
6403 * print.c: Likewise.
6404 * process.c: Likewise.
6405 * regex.c: Likewise.
6406 * region-cache.c: Likewise.
6407 * search.c: Likewise.
6408 * syntax.c: Likewise.
6409 * term.c: Likewise.
6410 * textprop.c: Likewise.
6411 * undo.c: Likewise.
6412 * unexsol.c: Likewise.
6413 * w16select.c: Likewise.
6414 * w32fns.c: Likewise.
6415 * w32menu.c: Likewise.
6416 * window.c: Likewise.
6417 * xdisp.c: Likewise.
6418 * xfns.c: Likewise.
6419 * xmenu.c: Likewise.
6420 * xml.c: Likewise.
6421 * xselect.c: Likewise.
6422
2f07e6af
EZ
64232012-06-16 Eli Zaretskii <eliz@gnu.org>
6424
1053a871
SM
6425 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
6426 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 6427 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
6428 row.
6429 (handle_face_prop): Use chunk-relative overlay string index when
6430 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
6431 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
6432 the rightmost. (Bug#11720)
2f07e6af 6433
29b83cec
AS
64342012-06-16 Andreas Schwab <schwab@linux-m68k.org>
6435
6436 * category.h (CHAR_HAS_CATEGORY): Define as inline.
6437 (CATEGORY_MEMBER): Enforce 1/0 value.
6438 * category.c (_temp_category_set): Remove.
6439
4c5501e9
EZ
64402012-06-16 Eli Zaretskii <eliz@gnu.org>
6441
6442 * window.c (Fdelete_other_windows_internal)
6443 (Fdelete_window_internal): Don't access frame's mouse highlight
6444 info of the initial frame. (Bug#11677)
6445
2b570124
PE
64462012-06-14 Paul Eggert <eggert@cs.ucla.edu>
6447
e93864f9
PE
6448 * .gdbinit (xgetint): Fix recently-introduced paren typo.
6449 Assume USE_2_TAGS_FOR_INTS.
6450 (xreload): Adjust $tagmask width to match recent lisp.h change.
6451
2b570124
PE
6452 Simplify lisp.h in minor ways that should not affect code.
6453 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
6454 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
6455 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
6456 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
6457 (INTTYPEBITS): New macro, for clarity.
6458 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
6459 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
6460 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
6461 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
6462 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
6463
81755f69
JB
64642012-06-13 Juanma Barranquero <lekktu@gmail.com>
6465
6466 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
6467
16192a57
GM
64682012-06-13 Glenn Morris <rgm@gnu.org>
6469
6470 * s/bsd-common.h (BSD4_3):
6471 * s/usg5-4-common.h (USG5_4): No longer define; unused.
6472
646b5f55
AS
64732012-06-13 Andreas Schwab <schwab@linux-m68k.org>
6474
6475 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
6476 instead of union.
6477 (XLI, XIL): Define.
1053a871
SM
6478 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
6479 Use them.
6480 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 6481 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 6482 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
6483 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
6484 * frame.c (delete_frame): Remove outdated comment.
6485 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
6486 USE_LISP_UNION_TYPE.
6487 (Fw32_unregister_hot_key): Likewise.
6488 (Fw32_toggle_lock_key): Likewise.
6489 * w32menu.c (add_menu_item): Likewise.
6490 (w32_menu_display_help): Use XIL instead of checking
6491 USE_LISP_UNION_TYPE.
6492 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
6493 (init_heap): Likewise.
6494 * w32term.c (w32_read_socket): Update comment.
6495
1d3823c9
GM
64962012-06-13 Glenn Morris <rgm@gnu.org>
6497
c62ff706
GM
6498 * s/usg5-4-common.h, src/s/unixware.h:
6499 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
6500
1d3823c9
GM
6501 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
6502
bfe3e0a2
PE
65032012-06-13 Paul Eggert <eggert@cs.ucla.edu>
6504
6505 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
6506 * alloc.c (make_number) [!defined make_number]:
6507 Remove, as lisp.h always defines this now.
6508 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
6509 (roundup_size): Verify that it is a power of 2.
6510 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
6511 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
6512 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
6513 -DUSE_LSB_TAG=0, to override the automatically-selected default.
6514 USE_LSB_TAG now is always defined to be either 0 or 1.
6515 All uses changed.
6516 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
6517 code works fine either way, and efficiency is not a concern here,
6518 as the union type is for debugging, not for production.
6519 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
6520 Use an inline function on all platforms when using the union type,
6521 since this is simpler and 'static inline' can be used portably
6522 within Emacs now.
6523 (LISP_INITIALLY_ZERO): New macro.
6524 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
6525 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
6526
45fa9c0f
GM
65272012-06-12 Glenn Morris <rgm@gnu.org>
6528
b4492cba
GM
6529 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
6530
6531 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 6532
45fa9c0f
GM
6533 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
6534 Move BROKEN_SIGIO to configure.
6535
6536 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
6537 Move NO_TERMIO to configure.
6538
0e25d334
CY
65392012-06-12 Chong Yidong <cyd@gnu.org>
6540
6541 * image.c (imagemagick_load_image): Use MagickFlattenImage if
6542 MagickMergeImageLayers is undefined. Use pixel pusher loop if
6543 MagickExportImagePixels is undefined.
6544
43682bb6
PE
65452012-06-12 Paul Eggert <eggert@cs.ucla.edu>
6546
6547 * image.c (imagemagick_load_image): Remove unused label.
6548
a9be7d2b
GM
65492012-06-11 Glenn Morris <rgm@gnu.org>
6550
6551 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6552 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
6553 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
6554 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
6555
3017f87f
SM
65562012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
6557
6558 * alloc.c (make_byte_code): New function.
6559 (Fmake_byte_code): Use it. Don't purify here.
6560 * lread.c (read1): Use it as well to avoid extra allocation.
6561
1b9b4cf4
CY
65622012-06-11 Chong Yidong <cyd@gnu.org>
6563
6564 * image.c (imagemagick_load_image): Implement transparency.
6565
95988fcf
AS
65662012-06-10 Andreas Schwab <schwab@linux-m68k.org>
6567
6568 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
6569 account for preceding backslashes. (Bug#11663)
6570
cd4eb164
CY
65712012-06-09 Chong Yidong <cyd@gnu.org>
6572
6573 * term.c: Support italics in capable terminals (Bug#9652).
6574 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
6575 (turn_on_face): Output using TS_enter_italic_mode if available.
6576 Don't handle unused blinking and alt-charset cases.
6577 (turn_off_face): Handle italic case; discard unused tty_blinking_p
6578 and tty_alt_charset_p cases.
6579 (tty_capable_p, init_tty): Support italics.
6580
6581 * termchar.h (struct tty_display_info): Add field for italics.
6582 Remove unused blink field.
6583
6584 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
6585 Handle slant.
6586
6587 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
6588 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
6589 tty_alt_charset_p. Add tty_italic_p.
6590
ff88beb8
MA
65912012-06-09 Michael Albinus <michael.albinus@gmx.de>
6592
6593 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
6594 dbus_type_is_basic if available.
6595 (xd_extract_signed, xd_extract_unsigned): Rename from
6596 extract_signed and extract_unsigned, respectively. Adapt callers.
6597
44286096
CY
65982012-06-09 Chong Yidong <cyd@gnu.org>
6599
1682701f
CY
6600 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
6601
44286096
CY
6602 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
6603 case (Bug#9752).
6604
d86feb17
PE
66052012-06-08 Paul Eggert <eggert@cs.ucla.edu>
6606
6607 * xdisp.c (vmessage): Treat frame message as multibyte.
6608 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
6609 would generate the diagnostic "Making \302\247 buffer-local while
6610 let-bound!".
6611
d5c20fe8
EZ
66122012-06-08 Eli Zaretskii <eliz@gnu.org>
6613
6614 * dispnew.c (showing_window_margins_p): Undo last change, which
6615 was done due to an inadvertent commit.
6616 (adjust_frame_glyphs_for_frame_redisplay): Do call
6617 showing_window_margins_p.
6618
513749ee
SM
66192012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6620
6621 * eval.c (Fmake_var_non_special): New primitive.
6622 (syms_of_eval): Defsubr it.
6623 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
6624
d4a8f5c1
JB
66252012-06-08 Juanma Barranquero <lekktu@gmail.com>
6626
6627 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
6628 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
6629
8bbbc977
EZ
66302012-06-08 Eli Zaretskii <eliz@gnu.org>
6631
6632 * alloc.c (allocate_vectorlike): Fix last change.
6633
f3372c87
DA
66342012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
6635
6636 Block-based vector allocation of small vectors.
6637 * lisp.h (struct vectorlike_header): New field `nbytes',
6638 adjust comment accordingly.
6639 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 6640 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
6641 mark_maybe_pointer, valid_lisp_object_p) accordingly.
6642 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
6643 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
6644 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
6645 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
6646 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
6647 (roundup_size): New constant.
6648 (struct vector_block): New data type.
6649 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 6650 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
6651 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
6652 (sweep_vectors): New functions.
6653 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 6654 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
6655 or equal to VBLOCK_BYTES_MAX.
6656 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
6657 (init_alloc_once): Add call to init_vectors.
6658
4f18a4ed
SM
66592012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
6660
6661 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
6662
86f158bc
PE
66632012-06-07 Paul Eggert <eggert@cs.ucla.edu>
6664
6665 * doprnt.c (doprnt): Truncate multibyte char correctly.
6666 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
6667 would mishandle a string argument "Xc" if X was a multibyte
6668 character of length 2: it would truncate after X's first byte
6669 rather than including all of X.
6670
c5cfcbe0
CY
66712012-06-06 Chong Yidong <cyd@gnu.org>
6672
6673 * buffer.c (word_wrap): Doc fix.
6674
c05cf390
PE
66752012-06-04 Paul Eggert <eggert@cs.ucla.edu>
6676
6677 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
6678
0c3461de
GM
66792012-06-03 Glenn Morris <rgm@gnu.org>
6680
6681 * xdisp.c (tool-bar-style): Doc fix.
6682
c71232db
UM
66832012-06-03 Ulrich Müller <ulm@gentoo.org>
6684
6685 * Makefile.in (PAXCTL): Define.
6686 (temacs$(EXEEXT)): Disable memory randomization for the temacs
6687 binary via PaX flags if the paxctl utility is available.
6688 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6689 Restore PaX flags to their default. (Bug#11398)
6690
383f7350
CY
66912012-06-03 Chong Yidong <cyd@gnu.org>
6692
6693 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
6694 buffer (Bug#11226).
6695
5f2c76c6
CY
66962012-06-03 Chong Yidong <cyd@gnu.org>
6697
6698 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
6699 (note_mode_line_or_margin_highlight): If there is no help echo,
6700 use mode-line-default-help-echo. Handle the case where the mouse
6701 position is past the end of the mode line string.
6702
6703 * buffer.c (buffer_local_value_1): New function, split from
6704 Fbuffer_local_value; can return Qunbound.
6705 (Fbuffer_local_value): Use it.
6706 (Vmode_line_format): Docstring tweaks.
6707
773d47f6
PE
67082012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6709
6710 * sysdep.c (system_process_attributes): Improve comment.
6711
f2d6a3df
SM
67122012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
6713
6714 * keyboard.c: Export real-this-command to Elisp.
6715 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
6716 and DEFVAR it. Update all users.
6717
63810350
PE
67182012-06-02 Paul Eggert <eggert@cs.ucla.edu>
6719
7bd5c1f4
PE
6720 * minibuf.c (Fassoc_string): Remove duplicate declaration.
6721
63810350
PE
6722 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
6723 Convert pctcpu and pctmem to Lisp float properly.
6724 Let the compiler fold better, as 100.0/0x8000 is exact.
6725
a2821611
AS
67262012-06-02 Andreas Schwab <schwab@linux-m68k.org>
6727
6728 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6729 cons_block.
6730
5fceba1d
PE
67312012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6732
6733 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6734
c98ff5dd
DA
67352012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6736
6737 For a 'struct window', replace some Lisp_Object fields to
6738 bitfields where appropriate, remove unused fields.
6739 * window.h (struct window): Remove unused 'last_mark_x' and
6740 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6741 change it's type from Lisp_Object to bitfield.
6742 Change type of 'force_start', 'optional_new_start',
6743 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 6744 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 6745
ca34e0be
PE
67462012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6747
6748 Pacify gcc -Wdouble-precision when using Xaw.
6749 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6750 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6751 Use 'float' consistently, rather than 'float' in most places
6752 and 'double' in a couple of places.
6753
efc00ab1 67542012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
6755
6756 * xdisp.c (handle_stop): Detect whether we have overlay strings
6757 loaded by testing it->current.overlay_string_index to be
6758 non-negative, instead of checking whether n_overlay_strings is
6759 positive. (Bug#11587)
6760
efc00ab1 67612012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
6762
6763 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6764
6765 * doc.c (Fsubstitute_command_keys): Doc fix.
6766
efc00ab1 67672012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
6768
6769 * search.c (search_buffer): Remove calls to
6770 r_alloc_inhibit_buffer_relocation, as it is now called by
6771 maybe_unify_char, which was the cause of relocation of buffer text
6772 in bug#11519.
6773
efc00ab1 67742012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
6775
6776 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6777 for the duration of call to load_charset, to avoid problems with
6778 callers of maybe_unify_char that access buffer text through C
6779 pointers.
6780
6781 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6782 decrement the inhibition flag, instead of just setting or
6783 resetting it.
6784
ba93a187
PE
67852012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6786
6787 Remove obsolete '#define static' cruft.
6788 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6789 This #undef was "temporary" in 2000; it is no longer needed
6790 now that '#define static' has gone away.
6791 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6792 (gray_bitmap_bits): Remove; no longer needed.
6793 All uses replaced with definiens.
6794 * xterm.c: Include "bitmaps/gray.xbm".
6795
9e4bf381
PE
67962012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6797
6798 Clean up __executable_start, monstartup when --enable-profiling.
6799 The following changes affect the code only when profiling.
6800 * dispnew.c (__executable_start): Rename from safe_bcopy.
6801 Define only on platforms that need it.
6802 * emacs.c: Include <sys/gmon.h> when profiling.
6803 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6804 (__executable_start): Remove decl, since lisp.h does it now.
6805 (safe_bcopy): Remove decl; no longer has that name.
6806 (main): Coalesce #if into single bit of code, for simplicity.
6807 Cast pointers to uintptr_t, since standard libraries want integers
6808 and not pointers.
6809 * lisp.h (__executable_start): New decl.
6810
32d72c2f
GM
68112012-05-31 Glenn Morris <rgm@gnu.org>
6812
6813 * image.c (Fimagemagick_types): Doc fix.
6814
baac5bc7
JM
68152012-05-30 Jim Meyering <meyering@redhat.com>
6816
6817 * callproc.c (Fcall_process_region): Include directory component
6818 in mkstemp error message (Bug#11586).
6819
72cb32cf
PE
68202012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6821
6822 * alloc.c, lisp.h (make_pure_vector): Now static.
6823
61b108cc
SM
68242012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6825
6826 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6827 Move to byte-run.el.
6828 (Fautoload): Do the hash-doc more carefully.
6829 * data.c (Fdefalias): Purify definition, except for keymaps.
6830 (Qdefun): Move from eval.c.
6831 * lisp.h (Qdefun): Remove.
6832 * lread.c (read1): Tiny simplification.
6833
471fe23d
TN
68342012-05-29 Troels Nielsen <bn.troels@gmail.com>
6835
934f3f58 6836 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
6837 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6838 Bug#9642, but explicitly check that the buffer the overlay would
6839 be moved to is live and rearrange lines to make sure that errors
6840 will not put the overlay in an inconsistent state.
6841 (Fdelete_overlay): Cosmetics.
6842
85d0efd1
EZ
68432012-05-28 Eli Zaretskii <eliz@gnu.org>
6844
6845 * w32term.c (my_bring_window_to_top): New function.
6846 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
6847 could be different from the original one.
6848 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
6849 (Bug#11513)
6850
6851 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6852 by calling BringWindowToTop.
6853
6854 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6855 (WM_EMACS_END): Increase by one.
6856
da92a98c
PE
68572012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6858
6859 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6860 This avoids undefined behavior that might cause the eassert
6861 to not catch an out-of-range value.
6862
74d1f848
JB
68632012-05-28 Juanma Barranquero <lekktu@gmail.com>
6864
6865 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6866 Update dependencies.
6867
9e1a06fc
EZ
68682012-05-27 Eli Zaretskii <eliz@gnu.org>
6869
6870 * bidi.c (bidi_mirror_char): Fix last change.
6871
f3dd7312
AS
68722012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6873
6874 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6875 when referring to sectname field in printf format.
6876
81899c91
PE
68772012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6878
57b81a9f
PE
6879 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6880 Only r_alloc_inhibit_buffer_relocation needed to be added;
6881 the others were already declared.
6882
81899c91
PE
6883 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6884 before checking whether it's out of range. Put the check inside
6885 eassert. See
6886 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6887
33017faf 68882012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
6889
6890 * callproc.c (Fcall_process): Restore a line that was accidentally
6891 commented out in the 2011-02-13 change (bug#11547).
6892
33017faf 68932012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
6894
6895 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6896 defined on ralloc.c.
6897
6898 * buffer.c [REL_ALLOC]: Remove prototypes of
6899 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6900 they are now on lisp.h.
6901
6902 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6903
6904 * search.c (search_buffer): Use it to inhibit relocation of buffer
6905 text while re_search_2 is doing its job, because re_search_2 is
6906 passed C pointers to buffer text. (Bug#11519)
6907
23415acf
EZ
6908 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6909 Update value to 24.
6910
44e27368
EZ
6911 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6912 state after an additional call to move_it_in_display_line_to, keep
6913 the values of it->max_ascent and it->max_descent found for the
6914 entire line.
6915 (pos_visible_p): Revert the comparison against bottom_y to what it
6916 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6917 (Bug#11464)
6918
c1892f11
PE
69192012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6920
6921 Fix coding-related core dumps with gcc -ftrapv.
6922 The code was computing A - B, where A and B are pointers, and B is
6923 random garbage. This can lead to core dumps on platforms that
6924 have special pointer registers, and it also leads to core dumps on
6925 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6926 A - B only when B is initialized properly.
6927 * coding.c (coding_set_source, coding_set_destination): Return void.
6928 (coding_change_source, coding_change_destinations): New functions,
6929 with the old behaviors of coding_set_source and coding_set_destination.
6930 All callers that need an offset changed to use these new functions.
6931
eb7afdad
GM
69322012-05-26 Glenn Morris <rgm@gnu.org>
6933
6934 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6935
f12fdf02
EZ
69362012-05-26 Eli Zaretskii <eliz@gnu.org>
6937
53a63be6 6938 Extend mouse support on W32 text-mode console.
61b108cc
SM
6939 * xdisp.c (draw_row_with_mouse_face):
6940 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 6941
eb3f6f01 6942 * w32console.c: Include window.h.
61b108cc
SM
6943 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6944 New functions.
eb3f6f01
EZ
6945 (initialize_w32_display): Initialize mouse-highlight data.
6946
53a63be6
EZ
6947 * w32inevt.c: Include termchar.h and window.h.
6948 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6949 moves, call note_mouse_highlight. If help_echo changed, call
6950 gen_help_event to produce help-echo message in the echo area.
6951 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6952 highlight info.
6953
4cfd81f6
PE
69542012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6955
6956 * lread.c (read1): Simplify slightly to avoid an overflow warning
6957 with GCC 4.7.0 on x86-64.
6958
4446092a
EZ
69592012-05-26 Eli Zaretskii <eliz@gnu.org>
6960
6961 * bidi.c (bidi_mirror_char): Revert last change: an int is
6962 definitely wide enough here.
6963
42b2a986 69642012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 6965
42b2a986 6966 Fix integer width and related bugs (Bug#9874).
eb106a49 6967 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
6968 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6969 (string_bytes, check_sblock, allocate_string_data):
6970 (compact_small_strings, Fmake_bool_vector, make_string)
6971 (make_unibyte_string, make_multibyte_string)
6972 (make_string_from_bytes, make_specified_string)
6973 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6974 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6975 (mark_vectorlike):
6976 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6977 (allocate_pseudovector):
6978 Use int, not EMACS_INT, where int is wide enough.
6979 (inhibit_garbage_collection, Fgarbage_collect):
6980 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6981 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6982 int might not be wide enough.
6983 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6984 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6985 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6986 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6987 (bidi_level_of_next_char, bidi_move_to_visually_next):
6988 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6989 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6990 (Fkill_buffer, Fset_buffer_major_mode)
6991 (advance_to_char_boundary, Fbuffer_swap_text)
6992 (Fset_buffer_multibyte, overlays_at, overlays_in)
6993 (overlay_touches_p, struct sortvec, record_overlay_string)
6994 (overlay_strings, recenter_overlay_lists)
6995 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6996 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6997 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6998 (Foverlay_recenter, last_overlay_modification_hooks_used)
6999 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7000 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
7001 (validate_region): Omit unnecessary test for b <= e,
7002 since that's guaranteed by the previous test.
d311d28c
PE
7003 (adjust_overlays_for_delete): Avoid pos + length overflow.
7004 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7005 (report_overlay_modification):
7006 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7007 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7008 Omit pointer cast, which isn't needed anyway, and doesn't work
7009 after the EMACS_INT -> ptrdiff_t change.
02481186 7010 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
7011 * buffer.h: Adjust decls to match defn changes elsewhere.
7012 (struct buffer_text, struct buffer):
7013 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7014 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
7015 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7016 not int, to avoid needless 32-bit limit on 64-bit hosts.
7017 (exec_byte_code): Use tighter memory-full test, one that checks
7018 for alloca overflow. Don't compute the address of the object just
7019 before an array, as that's not portable. Use EMACS_INT, not
7020 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
7021 * callint.c (Fcall_interactively):
7022 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7023 * callproc.c (call_process_kill, Fcall_process):
7024 Don't assume pid_t fits into an Emacs fixnum.
7025 (call_process_cleanup, Fcall_process, child_setup):
7026 Don't assume pid_t fits into int.
7027 (call_process_cleanup, Fcall_process, delete_temp_file)
7028 (Fcall_process_region):
7029 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7030 (Fcall_process): Simplify handling of volatile integers.
7031 Use int, not EMACS_INT, where int will do.
7032 * casefiddle.c (casify_object, casify_region, operate_on_word)
7033 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
7034 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7035 (casify_object): Avoid integer overflow when overallocating buffer.
7036 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 7037 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
7038 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
7039 * category.h (CATEGORYP): Don't assume arg is nonnegative.
7040 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
7041 integers are now checked earlier. All uses replaced with XINT.
7042 (ccl_driver):
7043 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7044 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
7045 (ccl_driver, Fregister_code_conversion_map):
7046 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
7047 (resolve_symbol_ccl_program): Check that vector header is in range.
7048 Always copy the vector, so that we can check its contents reliably
7049 now rather than having to recheck each instruction as it's being
7050 executed. Check that vector words fit in 'int'.
7051 (ccl_get_compiled_code, Fregister_ccl_program)
7052 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
7053 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
7054 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
7055 contents are in range.
7056 (Fccl_execute_on_string): Check that status is in range.
7057 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
7058 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
7059 Accept and return EMACS_INT, not int, because callers can pass values
7060 out of 'int' range.
7061 (c_string_width, strwidth, lisp_string_width, chars_in_text)
7062 (multibyte_chars_in_text, parse_str_as_multibyte)
7063 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
7064 (str_as_unibyte, str_to_unibyte, string_count_byte8)
7065 (string_escape_byte8, Fget_byte):
7066 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 7067 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
7068 avoid mishandling large integers.
7069 * character.h: Adjust decls to match defn changes elsewhere.
7070 * charset.c (load_charset_map_from_file, find_charsets_in_text)
7071 (Ffind_charset_region):
7072 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7073 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
7074 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 7075 Don't assume fixnum fits in int.
d311d28c
PE
7076 (load_charset_map_from_vector, Fmap_charset_chars):
7077 Remove now-unnecessary CHECK_NATNUMs.
7078 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
7079 Don't rely on undefined behavior with signed left shift overflow.
7080 Don't assume unsigned int fits into fixnum, or that fixnum fits
7081 into unsigned int. Don't require max_code to be a valid fixnum;
7082 that's not true for gb10830 4-byte on a 32-bit host. Allow
7083 invalid_code to be a cons, for the same reason. Require code_offset
7084 to be a character. Avoid int overflow if max_char is close
7085 to INT_MAX.
7086 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
7087 this is intended anyway and avoids some undefined behavior.
7088 (load_charset_map): Pass unsigned, not int, as 2nd arg of
7089 INDEX_TO_CODE_POINT, as that's what it expects.
7090 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
7091 * charset.h (DECODE_CHAR): Return int, not unsigned;
7092 this is what was intended anyway, and it avoids undefined behavior.
7093 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
7094 integer-overflow issues.
7095 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
7096 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
7097 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
7098 * chartab.c (Fmake_char_table, Fset_char_table_range)
7099 (uniprop_get_decoder, uniprop_get_encoder):
7100 Don't assume fixnum fits in int.
7101 * cmds.c (move_point): New function, that does the gist of
7102 Fforward_char and Fbackward_char, but does so while checking
7103 for integer overflow more accurately.
c96e5d6a 7104 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
7105 (Fforward_line, Fend_of_line, internal_self_insert)
7106 (internal_self_insert):
7107 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7108 Fix a FIXME, by checking for integer overflow when calculating
7109 target_clm and actual_clm.
7110 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 7111 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
7112 (ASSURE_DESTINATION, coding_alloc_by_realloc)
7113 (coding_alloc_by_making_gap, alloc_destination)
7114 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
7115 (encode_coding_utf_16, detect_coding_emacs_mule)
7116 (decode_coding_emacs_mule, encode_coding_emacs_mule)
7117 (detect_coding_iso_2022, decode_coding_iso_2022)
7118 (encode_invocation_designation, encode_designation_at_bol)
7119 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7120 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
7121 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
7122 (encode_coding_ccl, encode_coding_raw_text)
7123 (detect_coding_charset, decode_coding_charset)
7124 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
7125 (produce_composition, produce_charset, produce_annotation)
7126 (decode_coding, handle_composition_annotation)
7127 (handle_charset_annotation, consume_chars, decode_coding_gap)
7128 (decode_coding_object, encode_coding_object, detect_coding_system)
7129 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
7130 (code_convert_region, code_convert_string)
8f50130c
PE
7131 (Fdefine_coding_system_internal)
7132 (coding_set_source, coding_set_destination):
d311d28c
PE
7133 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7134 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
7135 (Fdefine_coding_system_internal):
7136 Don't assume fixnums fit in int.
7137 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 7138 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
7139 (Funencodable_char_position, Fcheck_coding_systems_region)
7140 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 7141 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 7142 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 7143 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 7144 Don't access memory outside of the args array.
d311d28c 7145 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
7146 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
7147 result of ENCODE_CHAR.
d311d28c
PE
7148 * coding.h: Adjust decls to match defn changes elsewhere.
7149 (struct coding_system):
7150 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7151 * composite.c (get_composition_id, find_composition)
7152 (run_composition_function, update_compositions)
7153 (compose_text, composition_gstring_put_cache)
7154 (composition_gstring_p, composition_gstring_width)
7155 (fill_gstring_header, fill_gstring_body, autocmp_chars)
7156 (composition_compute_stop_pos, composition_reseat_it)
7157 (composition_update_it, struct position_record)
7158 (find_automatic_composition, composition_adjust_point)
7159 (Fcomposition_get_gstring, Ffind_composition_internal):
7160 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7161 (update_compositions):
7162 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7163 * composite.h: Adjust decls to match defn changes elsewhere.
7164 (struct composition):
7165 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7166 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
7167 Do not attempt to compute the address of the object just before a
7168 buffer; this is not portable.
7169 (Faref, Faset):
7170 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7171 (Faset): Use int, not EMACS_INT, where int is wide enough.
7172 (Fstring_to_number): Don't assume fixnums fit in int.
7173 (Frem): Don't assume arg is nonnegative.
7174 * dbusbind.c (xd_append_arg): Check for integers out of range.
7175 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 7176 (extract_signed, extract_unsigned): New functions.
243e0530
PE
7177 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
7178 (xd_get_connection_references): Return ptrdiff_t, not int.
7179 All uses changed.
7180 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
7181 (xd_read_message_1):
7182 Use int, not unsigned, where the dbus API uses int.
7183 (Fdbus_message_internal): Don't overflow mtype.
7184 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
7185 * dired.c (directory_files_internal, file_name_completion, scmp)
7186 (file_name_completion_stat):
7187 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7188 (file_name_completion): Don't overflow matchcount.
7189 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
7190 * dispextern.h: Adjust decls to match defn changes elsewhere.
7191 (struct text_pos, struct glyph, struct bidi_saved_info)
7192 (struct bidi_string_data, struct bidi_it, struct composition_it)
7193 (struct it):
7194 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7195 (struct display_pos, struct composition_it, struct it):
7196 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7197 * dispnew.c (increment_matrix_positions)
7198 (increment_row_positions, mode_line_string)
7199 (marginal_area_string):
7200 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 7201 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
7202 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7203 (duration_to_sec_usec): New function, to check for overflow better.
7204 (Fsleep_for, sit_for): Use it.
7205 * doc.c (get_doc_string, store_function_docstring):
7206 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7207 (get_doc_string, Fsnarf_documentation):
7208 Use int, not EMACS_INT, where int is wide enough.
7209 (get_doc_string):
7210 Use SAFE_ALLOCA, not alloca.
7211 Check for overflow when converting EMACS_INT to off_t.
7212 * doprnt.c (doprnt):
7213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7214 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
7215 Don't assume uid_t fits into fixnum.
7216 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
7217 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
7218 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
7219 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
7220 (general_insert_function)
7221 (Finsert_char, make_buffer_string, make_buffer_string_both)
7222 (update_buffer_properties, Fbuffer_substring)
7223 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
7224 (Fsubst_char_in_region, check_translation)
7225 (Ftranslate_region_internal, save_restriction_restore, Fformat)
7226 (transpose_markers, Ftranspose_regions):
7227 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7228 (clip_to_bounds): Move to lisp.h as an inline function).
7229 (Fconstrain_to_field): Don't assume integers are nonnegative.
7230 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
7231 (Fsubst_char_in_region, Fsave_restriction):
7232 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7233 (Femacs_pid): Don't assume pid_t fits into fixnum.
7234 (lo_time): Use int, not EMACS_INT, when int suffices.
7235 (lisp_time_argument): Check for usec out of range.
7236 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
7237 (Fuser_login_name, Fuser_full_name): Signal an error
7238 if a uid argument is out of range, rather than relying on
7239 undefined behavior.
c8d5c857
PE
7240 (Fformat_time_string): Remove now-unnecessary check.
7241 lisp_time_argument checks for out-of-range usec now.
243e0530 7242 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
7243 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
7244 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
7245 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
7246 (init_cmdargs, Fdump_emacs):
7247 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7248 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
7249 the bottom (typically) 32 bits of the fixnum.
7250 * eval.c (specpdl_size, call_debugger):
7251 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7252 (when_entered_debugger, Fbacktrace_debug):
7253 Don't assume fixnum can fit in int.
7254 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
7255 the object just before a buffer; this is not portable.
7256 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
7257 (grow_specpdl, unbind_to):
7258 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7259 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
7260 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 7261 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
7262 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
7263 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
7264 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7265 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
7266 (a_write, e_write):
7267 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7268 (Fcopy_file, non_regular_nbytes, read_non_regular)
7269 (Finsert_file_contents):
7270 Use int, not EMACS_INT, where int is wide enough.
7271 (READ_BUF_SIZE): Verify that it fits in int.
7272 (Finsert_file_contents): Check that counts are in proper range,
7273 rather than assuming fixnums fit into ptrdiff_t etc.
7274 Don't assume fixnums fit into int.
125b3835 7275 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
7276 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
7277 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
7278 (string_char_to_byte, string_byte_to_char)
7279 (string_make_multibyte, string_to_multibyte)
7280 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
7281 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
7282 (substring_both, Fdelete, internal_equal, Ffillarray)
7283 (Fclear_string, mapcar1)
7284 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
7285 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
7286 (larger_vector, make_hash_table, maybe_resize_hash_table)
7287 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
7288 (Fmaphash, secure_hash):
7289 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7290 (concat): Check for string index and length overflow.
7291 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
7292 (Frequire):
7293 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7294 (larger_vector): New API (vec, incr_min, size_max) replaces old
7295 one (vec, new_size, init). This catches size overflow.
7296 INIT was removed because it was always Qnil.
7297 All callers changed.
7298 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
7299 the upper bound on a hash table index size.
7300 (make_hash_table, maybe_resize_hash_table): Use it.
7301 (secure_hash): Computer start_byte and end_byte only after
7302 they're known to be in ptrdiff_t range.
7303 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
7304 (Ffont_get_glyphs, Ffont_at):
7305 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7306 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
7307 (Flist_fonts, Fopen_font):
7308 Don't assume fixnum can fit in int.
7309 (check_gstring): Don't assume index can fit in int.
7310 (font_match_p): Check that fixnum is a character, not a nonnegative
7311 fixnum, since the later code needs to stuff it into an int.
7312 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
7313 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
7314 conversion overflow issues.
7315 (Fopen_font): Check for integer out of range.
7316 (Ffont_get_glyphs): Don't assume index can fit in int.
7317 * font.h: Adjust decls to match defn changes elsewhere.
7318 * fontset.c (reorder_font_vector): Redo score calculation to avoid
7319 integer overflow.
7320 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
7321 printmax_t, where ptrdiff_t is wide enough.
7322 (Finternal_char_font):
7323 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7324 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
7325 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
7326 (Fset_frame_position, x_set_frame_parameters)
7327 (x_set_line_spacing, x_set_border_width)
7328 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
7329 Check that fixnums are in proper range for system types.
7330 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
7331 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7332 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
7333 Use SAFE_ALLOCA_LISP, not alloca.
7334 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
7335 intptr_t is wide enough.
7336 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
7337 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
7338 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
7339 Check for fixnum out of range.
7340 * ftfont.c (ftfont_list): Don't assume index fits in int.
7341 Check that fixnums are in proper range for system types.
7342 (ftfont_shape_by_flt):
7343 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
7344 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7345 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7346 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
7347 Check that fixnums are in proper range for system types.
7348 * gnutls.h: Adjust decls to match defn changes elsewhere.
7349 * gtkutil.c (xg_dialog_run):
7350 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7351 (update_frame_tool_bar):
7352 Check that fixnums are in proper range for system types.
7353 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 7354 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
7355 * indent.c (last_known_column, last_known_column_point):
7356 (current_column_bol_cache):
7357 (skip_invisible, current_column, check_display_width):
7358 (check_display_width, scan_for_column, current_column_1)
7359 (Findent_to, Fcurrent_indentation, position_indentation)
7360 (indented_beyond_p, Fmove_to_column, compute_motion):
7361 (Fcompute_motion, Fvertical_motion):
7362 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7363 (last_known_column_modified): Use EMACS_INT, not int.
7364 (check_display_width):
7365 (Fcompute_motion):
7366 Check that fixnums and floats are in proper range for system types.
7367 (compute_motion): Don't assume index or fixnum fits in int.
7368 (compute_motion, Fcompute_motion):
7369 Use int, not EMACS_INT, when it is wide enough.
7370 (vmotion): Omit local var start_hpos that is always 0; that way
7371 we don't need to worry about overflow in expressions involving it.
7372 * indent.h: Adjust decls to match defn changes elsewhere.
7373 (struct position):
7374 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7375 Use int, not EMACS_INT, where int is wide enough.
7376 Remove unused members ovstring_chars_done and tab_offset;
7377 all uses removed.
7378 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
7379 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
7380 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
7381 (make_gap, copy_text, insert, insert_and_inherit)
7382 (insert_before_markers, insert_before_markers_and_inherit)
7383 (insert_1, count_combining_before, count_combining_after)
7384 (insert_1_both, insert_from_string)
7385 (insert_from_string_before_markers, insert_from_string_1)
7386 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
7387 (adjust_after_replace, adjust_after_insert, replace_range)
7388 (replace_range_2, del_range, del_range_1, del_range_byte)
7389 (del_range_both, del_range_2, modify_region)
7390 (prepare_to_modify_buffer, signal_before_change)
7391 (signal_after_change, Fcombine_after_change_execute):
7392 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7393 * intervals.c (traverse_intervals, rotate_right, rotate_left)
7394 (balance_an_interval, split_interval_right, split_interval_left)
7395 (find_interval, next_interval, update_interval)
7396 (adjust_intervals_for_insertion, delete_node, delete_interval)
7397 (interval_deletion_adjustment, adjust_intervals_for_deletion)
7398 (static_offset_intervals, offset_intervals)
7399 (merge_interval_right, merge_interval_left, make_new_interval)
7400 (graft_intervals_into_buffer, temp_set_point_both)
7401 (temp_set_point, set_point, adjust_for_invis_intang)
7402 (set_point_both, move_if_not_intangible, get_property_and_range)
7403 (get_local_map, copy_intervals, copy_intervals_to_string)
7404 (compare_string_intervals, set_intervals_multibyte_1):
7405 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7406 * intervals.h: Adjust decls to match defn changes elsewhere.
7407 (struct interval):
7408 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7409 * keyboard.c (this_command_key_count, this_single_command_key_start)
7410 (before_command_key_count, before_command_echo_length, echo_now)
7411 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
7412 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
7413 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
7414 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
7415 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7416 (last_non_minibuf_size, last_point_position, echo_truncate)
7417 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
7418 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
7419 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
7420 (stuff_buffered_input):
7421 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7422 (last_auto_save, command_loop_1, read_char):
7423 Use EMACS_INT, not int, to avoid integer overflow.
7424 (record_char): Avoid overflow in total_keys computation.
7425 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
7426 * keyboard.h: Adjust decls to match defn changes elsewhere.
7427 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
7428 (Fkey_description, Fdescribe_vector, Flookup_key):
7429 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7430 (click_position): New function, to check that positions are in range.
7431 (Fcurrent_active_maps):
7432 (describe_command):
7433 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7434 (Faccessible_keymaps, Fkey_description):
7435 (preferred_sequence_p):
7436 Don't assume fixnum can fit into int.
7437 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
7438 Check for integer overflow in size calculations.
7439 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
7440 avoid mishandling large integers.
7441 * lisp.h: Adjust decls to match defn changes elsewhere.
7442 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
7443 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
7444 (struct Lisp_Marker):
7445 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7446 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
7447 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
7448 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
7449 All callers changed.
7450 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
7451 Assume the arg has valid form, since it always does.
7452 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
7453 unsigned integer system type.
7454 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
7455 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
7456 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7457 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
7458 (duration_to_sec_usec): New decl.
7459 * lread.c (read_from_string_index, read_from_string_index_byte)
7460 (read_from_string_limit, readchar, unreadchar, openp)
7461 (read_internal_start, read1, oblookup):
7462 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7463 (Fload, readevalloop, Feval_buffer, Feval_region):
7464 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7465 (openp): Check for out-of-range argument to 'access'.
7466 (read1): Use int, not EMACS_INT, where int is wide enough.
7467 Don't assume fixnum fits into int.
6efdadfd 7468 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
7469 (read_filtered_event): Use duration_to_sec_usec
7470 to do proper overflow checking on durations.
d311d28c
PE
7471 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
7472 in size calculation.
7473 (Fexecute_kbd_macro):
7474 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7475 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
7476 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
7477 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
7478 (set_marker_both, set_marker_restricted_both, marker_position)
7479 (marker_byte_position, Fbuffer_has_markers_at):
7480 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7481 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 7482 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
7483 It now merely ensures that the menu is large enough, without
7484 necessarily growing it, as this avoids some integer overflow issues.
7485 All callers changed.
7486 (keymap_panes, parse_single_submenu, Fx_popup_menu):
7487 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7488 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
7489 Use SAFE_ALLOCA_LISP, not alloca.
7490 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
7491 to EMACS_INT. Check that fixnums are in proper range for system types.
7492 * minibuf.c (minibuf_prompt_width, string_to_object)
7493 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
7494 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
7495 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7496 (get_minibuffer, read_minibuf_unwind):
7497 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7498 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
7499 this simplifies overflow checking. All callers changed.
7500 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
7501 (Ftest_completion):
7502 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7503 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
7504 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
7505 Check that fixnums are in proper range for system types.
7506 (Fx_create_frame, Fx_show_tip):
7507 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7508 * nsfont.m (ns_findfonts, nsfont_list_family):
7509 Don't assume fixnum fits in long.
7510 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
7511 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7512 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
7513 wide enough.
17fdb222 7514 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
7515 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7516 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
7517 (PRINTDECLARE, PRINTPREPARE):
7518 (strout, print_string):
7519 (print, print_preprocess, print_check_string_charset_prop)
7520 (print_object):
7521 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7522 (PRINTDECLARE):
7523 (temp_output_buffer_setup, Fprin1_to_string, print_object):
7524 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7525 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 7526 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 7527 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
7528 (print_error_message): Use SAFE_ALLOCA, not alloca.
7529 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
7530 (print_depth, new_backquote_output, print_number_index):
7531 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
7532 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
7533 (Fset_process_window_size, Fformat_network_address)
7534 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 7535 (sigchld_handler):
d311d28c 7536 Check that fixnums are in proper range for system types.
d44287d4 7537 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
7538 Check for process-ids out of pid_t range rather than relying on
7539 undefined behavior.
e4d81efc 7540 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
7541 (Fformat_network_address, read_process_output, send_process)
7542 (Fprocess_send_region, status_notify):
7543 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7544 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
7545 (wait_reading_process_output, read_process_output, exec_sentinel):
7546 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7547 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
7548 (Faccept_process_output): Use duration_to_sec_usec to do proper
7549 overflow checking on durations.
dde14581
PE
7550 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
7551 Don't assume pid_t fits in int.
02481186
PE
7552 * process.h (struct Lisp_Process): Members tick and update_tick
7553 are now of type EMACS_INT, not int.
b62b53e8
PE
7554 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
7555 configured --with-wide-int.
d311d28c
PE
7556 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
7557 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
7558 * search.c (looking_at_1, string_match_1):
7559 (fast_string_match, fast_c_string_match_ignore_case)
7560 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
7561 (scan_newline, find_before_next_newline, search_command)
7562 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
7563 (set_search_regs, wordify):
7564 (Freplace_match):
7565 (Fmatch_data):
7566 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7567 (string_match_1, search_buffer, set_search_regs):
7568 (Fmatch_data):
7569 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7570 (wordify): Check for overflow in size calculation.
7571 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
7572 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
7573 Check that fixnums are in proper range for system types.
7574 * sound.c (struct sound_device)
7575 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
7576 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7577 (Fplay_sound_internal):
7578 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 7579 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
7580 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
7581 (Fparse_partial_sexp):
7582 Don't assume fixnums can fit in int.
7583 (struct lisp_parse_state, find_start_pos, find_start_value)
7584 (find_start_value_byte, find_start_begv)
7585 (update_syntax_table, char_quoted, dec_bytepos)
7586 (find_defun_start, prev_char_comend_first, back_comment):
7587 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
7588 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
7589 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7590 (Finternal_describe_syntax_value): Check that match_lisp is a
7591 character, not an integer, since the code stuffs it into int.
7592 (scan_words, scan_sexps_forward):
7593 Check that fixnums are in proper range for system types.
7594 (Fforward_word):
7595 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7596 (scan_sexps_forward):
7597 Use CHARACTERP, not INTEGERP, since the value must fit into int.
7598 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
7599 * syntax.h: Adjust decls to match defn changes elsewhere.
7600 (struct gl_state_s):
7601 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
7602 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
7603 MOST_POSITIVE_FIXNUM.
d311d28c
PE
7604 * sysdep.c (wait_for_termination_1, wait_for_termination)
7605 (interruptible_wait_for_termination, mkdir):
7606 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
7607 (emacs_read, emacs_write):
7608 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
7609 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
7610 and double all fit in int.
d311d28c
PE
7611 * term.c (set_tty_color_mode):
7612 Check that fixnums are in proper range for system types.
7613 * termhooks.h (struct input_event):
7614 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7615 * textprop.c (validate_interval_range, interval_of)
7616 (Fadd_text_properties, set_text_properties_1)
7617 (Fremove_text_properties, Fremove_list_of_text_properties)
7618 (Ftext_property_any, Ftext_property_not_all)
7619 (copy_text_properties, text_property_list, extend_property_ranges)
7620 (verify_interval_modification):
7621 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7622 (Fnext_single_char_property_change)
7623 (Fprevious_single_char_property_change):
7624 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
7625 (copy_text_properties):
7626 Check for integer overflow in index calculation.
d311d28c
PE
7627 * undo.c (last_boundary_position, record_point, record_insert)
7628 (record_delete, record_marker_adjustment, record_change)
7629 (record_property_change):
7630 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7631 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
7632 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7633 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7634 (Fx_hide_tip, Fx_file_dialog):
7635 * w32menu.c (set_frame_menubar):
7636 Use ptrdiff_t, not int, for consistency with rest of code.
7637 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
7638 (select_window, Fdelete_other_windows_internal)
7639 (window_scroll_pixel_based, window_scroll_line_based)
7640 (Frecenter, Fset_window_configuration):
7641 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7642 (Fset_window_hscroll, run_window_configuration_change_hook)
7643 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 7644 (Fscroll_other_window, Frecenter):
d311d28c
PE
7645 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7646 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
7647 Don't assume fixnum fits in int.
7648 (Fset_window_scroll_bars):
7649 Check that fixnums are in proper range for system types.
7650 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
7651 (string_pos, c_string_pos, number_of_chars, init_iterator)
7652 (in_ellipses_for_invisible_text_p, init_from_display_pos)
7653 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
7654 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
7655 (face_before_or_after_it_pos, handle_invisible_prop)
7656 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
7657 (display_prop_intangible_p, string_buffer_position_lim)
7658 (string_buffer_position, handle_composition_prop, load_overlay_strings)
7659 (get_overlay_strings_1, get_overlay_strings)
7660 (iterate_out_of_display_property, forward_to_next_line_start)
7661 (back_to_previous_visible_line_start, reseat, reseat_to_string)
7662 (get_next_display_element, set_iterator_to_next)
7663 (get_visually_first_element, compute_stop_pos_backwards)
7664 (handle_stop_backwards, next_element_from_buffer)
7665 (move_it_in_display_line_to, move_it_in_display_line)
7666 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7667 (add_to_log, message_dolog, message_log_check_duplicate)
7668 (message2, message2_nolog, message3, message3_nolog
7669 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
7670 (current_message_1, truncate_echo_area, truncate_message_1)
7671 (set_message, set_message_1, store_mode_line_noprop)
7672 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
7673 (text_outside_line_unchanged_p, check_point_in_composition)
7674 (reconsider_clip_changes)
7675 (redisplay_internal, set_cursor_from_row, try_scrolling)
7676 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
7677 (redisplay_window, find_last_unchanged_at_beg_row)
7678 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
7679 (trailing_whitespace_p, find_row_edges, display_line)
7680 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
7681 (display_mode_element, store_mode_line_string)
7682 (pint2str, pint2hrstr, decode_mode_spec)
7683 (display_count_lines, display_string, draw_glyphs)
7684 (x_produce_glyphs, x_insert_glyphs)
7685 (rows_from_pos_range, mouse_face_from_buffer_pos)
7686 (fast_find_string_pos, mouse_face_from_string_pos)
7687 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7688 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7689 (safe_call, init_from_display_pos, handle_fontified_prop)
7690 (handle_single_display_spec, load_overlay_strings)
7691 (with_echo_area_buffer, setup_echo_area_for_printing)
7692 (display_echo_area, echo_area_display)
7693 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
7694 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
7695 (redisplay_window, dump_glyph_row, display_mode_line)
7696 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 7697 (handle_display_spec, display_prop_string_p):
d311d28c
PE
7698 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7699 (handle_single_display_spec, build_desired_tool_bar_string)
7700 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
7701 (get_specified_cursor_type):
7702 Check that fixnums are in proper range for system types.
7703 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
7704 (Flookup_image_map):
7705 Don't assume fixnums fit in int.
7706 (compare_overlay_entries):
7707 Avoid mishandling comparisons due to subtraction overflow.
7708 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
7709 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
7710 (handle_tool_bar_click):
7711 Use int, not unsigned, since we prefer signed and the signedness
7712 doesn't matter here.
7713 (get_next_display_element, next_element_from_display_vector):
7714 Use int, not EMACS_INT, when int is wide enough.
7715 (start_hourglass): Use duration_to_sec_usec to do proper
7716 overflow checking on durations.
7717 * xfaces.c (Fbitmap_spec_p):
7718 Check that fixnums are in proper range for system types.
7719 (compare_fonts_by_sort_order):
7720 Avoid mishandling comparisons due to subtraction overflow.
7721 (Fx_family_fonts, realize_basic_faces):
7722 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7723 (Fx_family_fonts):
7724 Don't assume fixnum fits in int.
7725 Use SAFE_ALLOCA_LISP, not alloca.
7726 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
7727 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
7728 (face_at_buffer_position, face_for_overlay_string)
7729 (face_at_string_position):
7730 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7731 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7732 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7733 (Fx_show_tip):
7734 Check that fixnums are in proper range for system types.
7735 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7736 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7737 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7738 (Fx_change_window_property): Don't assume fixnums fit in int.
7739 * xfont.c (xfont_chars_supported):
7740 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7741 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7742 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7743 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7744 * xml.c (parse_region):
7745 * xrdb.c (magic_file_p):
7746 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7747 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7748 (x_get_local_selection, x_reply_selection_request)
7749 (x_handle_selection_request, wait_for_property_change):
7750 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7751 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7752 short is wide enough.
7753 (x_send_client_event): Don't assume fixnum fits in int.
7754 * xterm.c (x_x_to_emacs_modifiers):
7755 Don't assume EMACS_INT overflows nicely into int.
7756 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7757 may come from Lisp.
7758 (handle_one_xevent): NATNUMP can eval its arg twice.
7759 (x_connection_closed):
7760 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7761 * xterm.h: Adjust decls to match defn changes elsewhere.
7762 (struct scroll_bar): Use struct vectorlike_header
7763 rather than rolling our own approximation.
7764 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7765
c6574eb5
GM
77662012-05-25 Glenn Morris <rgm@gnu.org>
7767
7768 * lisp.mk (lisp): Update for more files being compiled now.
7769
e8d32c7e
SM
77702012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7771
48def666
SM
7772 * lread.c: Remove `read_pure' which makes no difference.
7773 (read_pure): Remove var.
7774 (unreadpure): Remove function.
7775 (readevalloop): Don't call read_list with -1 flag.
7776 (read1, read_vector): Don't test read_pure any more.
7777 (read_list): Simplify.
7778
e8d32c7e
SM
7779 * fileio.c, character.h: Minor style tweaks.
7780
4b2addb7
DA
77812012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7782
7783 * window.h (clip_changed): Remove useless declaration.
7784
584461b2
JB
77852012-05-22 Juanma Barranquero <lekktu@gmail.com>
7786
7787 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7788 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7789
34374650
PE
77902012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7791
7792 Remove src/m/*.
7793 This directory predates autoconf and is no longer needed nowadays.
7794 Move its few remaining bits of functionality to where they're needed.
7795 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7796 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7797 * m/template.h: Remove.
7798 * Makefile.in (M_FILE): Remove. All uses removed.
7799 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7800 * lisp.h (USE_LSB_TAG):
7801 * mem-limits.h (EXCEEDS_LISP_PTR):
7802 Use VAL_MAX, not VALBITS, in #if.
7803 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7804 (EMACS_UINT): Define unconditionally now.
7805 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7806 (BITS_PER_EMACS_INT): New constants, replacing
7807 what used to be in config.h, but not useful in #if.
7808 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7809 define them any more.
7810 (VAL_MAX): New macro.
7811 (VALMASK): Use it.
7812 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7813 BITS_PER_EMACS_INT, in #if.
7814 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7815 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7816 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7817 * s/ms-w32.h (DATA_START):
7818 Move here from removed file m/intel386.h.
7819 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7820 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7821
261cb4bb
PE
78222012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7823
7824 Assume C89 or later.
7825 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7826 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7827 (xrealloc):
7828 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7829 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7830 * textprop.c, tparam.c (NULL): Remove.
7831 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7832 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7833 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7834 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7835 * xterm.c (input_signal_count): Assume volatile works.
7836
ff23cd9f
KB
78372012-05-21 Ken Brown <kbrown@cornell.edu>
7838
7839 * xgselect.c (xg_select): Fix first argument in call to 'select'
7840 (bug#11508).
7841
1b170bc6
KB
78422012-05-20 Ken Brown <kbrown@cornell.edu>
7843
7844 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 7845 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 7846
b2f4d39f
KB
78472012-05-19 Ken Brown <kbrown@cornell.edu>
7848
7849 * xfns.c (x_in_use): Remove `static' qualifier.
7850 * xterm.h (x_in_use): Declare.
7851 * xgselect.c: Include xterm.h.
7852 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7853 and `display_arg' (bug#9754).
7854
003fdae2
PE
78552012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7856
9232a6d9
PE
7857 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7858
003fdae2
PE
7859 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7860 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7861
784b56e2
EZ
78622012-05-18 Eli Zaretskii <eliz@gnu.org>
7863
7864 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7865
7866 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 7867 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
7868
7869 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7870 reference to image_cache->refcount.
7871 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7872
a0a79cde
JL
78732012-05-17 Juri Linkov <juri@jurta.org>
7874
7875 * search.c (Fword_search_regexp, Fword_search_backward)
7876 (Fword_search_forward, Fword_search_backward_lax)
7877 (Fword_search_forward_lax): Move functions to isearch.el
7878 (bug#10145, bug#11381).
7879
b0572523
PE
78802012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7881
7882 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7883
9660f5fc
SM
78842012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7885
7886 * lread.c (init_obarray): Declare Qt and Qnil as special.
7887
4374de83
GM
78882012-05-14 Glenn Morris <rgm@gnu.org>
7889
7890 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 7891 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 7892
dc44c39a
PE
78932012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7894
078c97cb
PE
7895 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7896
dc44c39a
PE
7897 * unexaix.c: Port to more-recent AIX compilers.
7898 (report_error, report_error_1, make_hdr, copy_sym)
7899 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7900 Make arguments const char *, not char *, to avoid violations of C
7901 standard and to fix some AIX warnings reported by Gilles Pion.
7902
e18afed7 79032012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
7904
7905 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7906 already have overlays loaded.
7907 (handle_single_display_spec): Before returning without displaying
7908 fringe bitmap, synchronize the bidi iterator with the main display
7909 iterator, by calling iterate_out_of_display_property.
7910 (iterate_out_of_display_property): Detect buffer iteration by
7911 testing that it->string is a Lisp string.
7912 (get_next_display_element): When the current object is exhausted,
7913 and there's something on it->stack, call set_iterator_to_next to
7914 proceed with what's on the stack, instead of returning zero.
7915 (set_iterator_to_next): If called at the end of a Lisp string,
7916 proceed to consider_string_end without incrementing string
7917 position. Don't increment display vector index past the end of
7918 the display vector. (Bug#11417)
c8fb9dc6
EZ
7919 (pos_visible_p): Don't report a position visible when move_it_to
7920 stopped at the last line of window, which happens to be scanned
7921 backwards by the bidi iteration. (Bug#11464)
ac268e67 7922
e18afed7 79232012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
7924
7925 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7926 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
7927 are on a TTY, and thus unable to display on the fringes.
7928 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
7929 so we need to signal to the caller that this is a "replacing"
7930 display spec. This fixes display when the spec is invalid or we
7931 are on a TTY.
7932
e18afed7 79332012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
7934
7935 * unexaix.c (make_hdr): Fix typo in prototype.
7936 This bug broke the build on AIX. Problem reported by Gilles Pion.
7937
9d0a235a
MA
79382012-05-14 Michael Albinus <michael.albinus@gmx.de>
7939
7940 * keyboard.c (kbd_buffer_get_event): Read special events also in
7941 batch mode. (Bug#11415)
7942
9e6b06ed
GM
79432012-05-12 Glenn Morris <rgm@gnu.org>
7944
7945 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7946
c1a1d7a3
EZ
79472012-05-12 Eli Zaretskii <eliz@gnu.org>
7948
7949 * lisp.mk (lisp): Add newcomment.elc.
7950
3fe7cdc8
GM
79512012-05-12 Glenn Morris <rgm@gnu.org>
7952
7953 * Makefile.in (MKDIR_P): New, set by configure.
7954 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7955
53f7d2c0
PE
79562012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7957
7958 Remove unused function hourglass_started.
7959 * dispextern.h (hourglass_started):
7960 * w32fns.c (hourglass_started):
7961 * xdisp.c (hourglass_started): Remove.
7962
75aafb17
JB
79632012-05-10 Juanma Barranquero <lekktu@gmail.com>
7964
7965 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7966 Update dependencies.
7967
12959e8e
PE
79682012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7969
97107e2e
PE
7970 * xgselect.c (xg_select): Put maxfds+1 into a var.
7971 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7972
12959e8e
PE
7973 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7974
836d29b3
DA
79752012-05-10 Dave Abrahams <dave@boostpro.com>
7976
7977 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7978 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7979
5cb67954
MA
79802012-05-09 Michael Albinus <michael.albinus@gmx.de>
7981
7982 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7983 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7984 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7985 Initialize xd_registered_buses.
7986
3478ec45
PE
79872012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7988
b263a6b0
PE
7989 Untag more efficiently if USE_LSB_TAG.
7990 This is based on a proposal by YAMAMOTO Mitsuharu in
7991 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7992 For an admittedly artificial (nth 8000 longlist) benchmark on
7993 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7994 Emacs's overall text size by 1%.
7995 * lisp.h (XUNTAG): New macro.
7996 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7997 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7998 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7999 * eval.c (Fautoload):
8000 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8001 * frame.h (XFRAME): Use XUNTAG.
8002
3478ec45
PE
8003 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8004 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8005 Remove unportable assumptions about print widths of types like
8006 dbus_uint32_t.
8007 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8008 intptr_t when converting between pointer and integer, to avoid GCC
8009 warnings about wrong width.
8010
666b903b 80112012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
8012
8013 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8014 stack for each reader_thread, instead of defaulting to 8MB
8015 determined by the linker. This avoids failures in creating
8016 subprocesses on Windows 7, see the discussion in this thread:
8017 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
8018
b120cc17
JC
80192012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
8020
8021 Fix up display of the *Minibuf-0* buffer in the mini window.
8022 * keyboard.c (read_char): Don't clear the echo area if there's no
8023 message to clear.
8024 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 8025 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 8026
9a4b36f8
MA
80272012-05-07 Michael Albinus <michael.albinus@gmx.de>
8028
8029 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
8030 batch mode.
8031
e5f9458f
CY
80322012-05-06 Chong Yidong <cyd@gnu.org>
8033
8034 * lisp.mk (lisp): Update.
8035
eceeb5fc 80362012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
8037
8038 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
8039
71873e2b
SM
80402012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
8041
8042 * data.c (PUT_ERROR): New macro.
8043 (syms_of_data): Use it. Add new error type `user-error'.
8044 * undo.c (user_error): New function.
8045 (Fprimitive_undo): Use it.
8046 * print.c (print_error_message): Adjust print style for `user-error'.
8047 * keyboard.c (user_error): New function.
8048 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
8049
ab0fa4e4
PE
80502012-05-03 Paul Eggert <eggert@cs.ucla.edu>
8051
8052 Do not limit current-time-string to years 1000..9999.
8053 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
8054 (Fcurrent_time_string): Support any year that is supported by the
8055 underlying localtime representation. Don't use asctime, as it
8056 has undefined behavior for years outside the range -999..9999.
8057
7ed806a7
PE
80582012-05-02 Paul Eggert <eggert@cs.ucla.edu>
8059
8060 Fix race conditions involving setenv, gmtime, localtime, asctime.
8061 Without this fix, interrupts could mess up code that uses these
8062 nonreentrant functions, since setting TZ invalidates existing
8063 tm_zone or tzname values, and since most of these functions return
8064 pointers to static storage.
8065 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
8066 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
8067 Grow the critical sections to include not just invoking
8068 localtime/gmtime, but also accessing these functions' results
8069 including their tm_zone values if any, and any related TZ setting.
8070 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
8071 so that the struct tm is saved in the critical section.
8072 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
8073 motivated by the fact that memory allocation needs to be outside
8074 the critical section.
8075
0c16dfed
DA
80762012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
8077
8078 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
8079 with RESET_INTERVAL.
8080
8081 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8082 Remove duplicated buffer name initialization.
8083
3f83ace8
JM
80842012-05-02 Jim Meyering <jim@meyering.net>
8085
8086 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
8087
c7b8541e
JM
8088 * xfns.c (x_window): Use xstrdup (Bug#11375).
8089
90207a15 80902012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
8091
8092 * xdisp.c (pos_visible_p): If already at a newline from the
8093 display string before the 'while' loop, don't walk back the glyphs
8094 from it3.glyph_row. Solves assertion violation when the display
8095 string begins with a newline (egg.el). (Bug#11367)
8096
b593d6a9
AH
80972012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
8098
8099 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
8100 Move to simple.el.
8101
4737362e
GM
81022012-05-01 Glenn Morris <rgm@gnu.org>
8103
99cf43f9
GM
8104 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
8105 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
8106 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
8107 All were removed before 23.1.
8108
9311dcff
GM
8109 * dispnew.c: Remove HAVE_LIBNCURSES test;
8110 it is always true on relevant platforms.
8111
4d5c6349
GM
8112 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
8113 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
8114
4737362e
GM
8115 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
8116
74dd3a6b
AS
81172012-04-30 Andreas Schwab <schwab@linux-m68k.org>
8118
8119 * .gdbinit (xpr): Remove checks for no longer existing misc types.
8120 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
8121 Remove.
8122
13c379ee
PE
81232012-04-28 Paul Eggert <eggert@cs.ucla.edu>
8124
8125 Do not avoid creating empty evaporating overlays (Bug#9642).
8126 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
8127 That is, do not delete an evaporating overlay if it becomes
8128 empty after its bounds are adjusted to fit within its buffer.
8129 This fix caused other problems, and I'm reverting it until we get
8130 to the bottom of them.
8131
a8e7d6d7 81322012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
8133
8134 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
8135
a8e7d6d7 81362012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
8137
8138 * xdisp.c (pos_visible_p): If the window start position is beyond
8139 ZV, start the display from buffer beginning. Prevents assertion
8140 violation in init_iterator when the minibuffer window is scrolled
8141 via the scroll bar.
8142
8143 * window.c (window_scroll_pixel_based): Likewise.
8144
a8e7d6d7 81452012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
8146
8147 * keymap.c (where_is_internal): Doc fix (Bug#10872).
8148
a8e7d6d7 81492012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
8150
8151 * fileio.c (Fcopy_file, Fset_file_selinux_context):
8152 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
8153
a8e7d6d7 81542012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 8155
b593d6a9
AH
8156 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
8157 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 8158
1c6900d9
EZ
81592012-04-26 Eli Zaretskii <eliz@gnu.org>
8160
4c3fa1d9
EZ
8161 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
8162 display element, check also the underlying string or buffer
8163 character. (Bug#11341)
8164
1c6900d9
EZ
8165 * w32menu.c: Include w32heap.h.
8166 (add_menu_item): If the call to AppendMenuW (via
8167 unicode_append_menu) fails, disable Unicode menus only if we are
8168 running on Windows 9X/Me.
8169
42bf8205
AS
81702012-04-24 Andreas Schwab <schwab@linux-m68k.org>
8171
8172 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
8173 (xgetint): Add missing shift for LSB tags.
8174
b1bac16e
MR
81752012-04-24 Martin Rudalics <rudalics@gmx.at>
8176
8177 * keyboard.c (read_char): Don't wipe echo area for select window
8178 events: These might get delayed via `mouse-autoselect-window'
8179 (Bug#11304).
8180
d69621cc
JB
81812012-04-24 Juanma Barranquero <lekktu@gmail.com>
8182
8183 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
8184 manipulation of :loaded-from data.
8185
02fd101b
JB
81862012-04-23 Juanma Barranquero <lekktu@gmail.com>
8187
8188 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
8189 now a cons (bug#11311).
8190
888bec30
PE
81912012-04-23 Paul Eggert <eggert@cs.ucla.edu>
8192
89a438bd
PE
8193 Do not create empty overlays with the evaporate property (Bug#9642).
8194 * buffer.c (Fmove_overlay): Delete an evaporating overlay
8195 if it becomes empty after its bounds are adjusted to fit within
8196 its buffer. Without this fix, in a nonempty buffer (let ((o
8197 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
8198 yields an empty overlay that has the evaporate property, which is
8199 not supposed to happen.
8200
1068fe4d
PE
8201 Fix minor GTK3 problems found by static checking.
8202 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8203 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8204 (struct _EmacsFixedClass, emacs_fixed_get_type):
8205 Move decls here from emacsgtkfixed.h, since they needn't be public.
8206 (emacs_fixed_get_type): Now static.
8207 (emacs_fixed_class_init): Omit unused local.
8208 (emacs_fixed_child_type): Remove; unused.
8209 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
8210 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
8211 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
8212 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
8213 (EMACS_FIXED_GET_CLASS): Remove; unused.
8214 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
8215
888bec30
PE
8216 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
8217 Problem reported by Juanma Barranquero for Windows -Wunused-function.
8218
de85e130
PE
82192012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8220
d0baac98 8221 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 8222 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
8223 (__malloc_size_t, __malloc_ptrdiff_t):
8224 Remove. All uses removed, replaced by the definiens if needed,
8225 since we can assume C89 or better now.
8226 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
8227 (protect_malloc_state, align, get_contiguous_space)
8228 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
8229 (malloc_atfork_handler_child, malloc_enable_thread)
8230 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
8231 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
8232 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
8233 (special_realloc, _realloc_internal_nolock, _realloc_internal)
8234 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
8235 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
8236 Define using prototypes, not old style.
8237 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
8238 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
8239 (align): Don't assume that signed integer overflow wraps around.
8240 Omit unused local var.
8241 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
8242 (_free_internal_nolock, memalign, mallochook, reallochook):
8243 Omit no-longer-needed casts.
8244 (valloc): Use getpagesize, not __getpagesize.
8245 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
8246 (struct hdr): The 'magic' member is now size_t, not unsigned long.
8247
de85e130
PE
8248 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
8249
dcbf5805
MA
82502012-04-22 Michael Albinus <michael.albinus@gmx.de>
8251
8252 Move functions from C to Lisp. Make non-blocking method calls
8253 the default. Implement further D-Bus standard interfaces.
8254
8255 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
8256 (QCdbus_request_name_allow_replacement)
8257 (QCdbus_request_name_replace_existing)
8258 (QCdbus_request_name_do_not_queue)
8259 (QCdbus_request_name_reply_primary_owner)
8260 (QCdbus_request_name_reply_in_queue)
8261 (QCdbus_request_name_reply_exists)
8262 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
8263 (QCdbus_registered_serial, QCdbus_registered_method)
8264 (QCdbus_registered_signal): New Lisp objects.
8265 (XD_DEBUG_MESSAGE): Use sizeof.
8266 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
8267 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
8268 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
8269 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
8270 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
8271 (xd_signature, xd_append_arg): Allow float for integer types.
8272 (xd_get_connection_references): New function.
b593d6a9
AH
8273 (xd_get_connection_address): Rename from xd_initialize.
8274 Return cached address.
dcbf5805
MA
8275 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
8276 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
8277 level.
8278 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 8279 Return number of refcounts.
dcbf5805
MA
8280 (Fdbus_get_unique_name): Make stronger parameter check.
8281 (Fdbus_message_internal): New defun.
8282 (Fdbus_call_method, Fdbus_call_method_asynchronously)
8283 (Fdbus_method_return_internal, Fdbus_method_error_internal)
8284 (Fdbus_send_signal, Fdbus_register_service)
8285 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
8286 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
8287 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
8288 (Vdbus_compiled_version, Vdbus_runtime_version)
8289 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
8290 (Vdbus_message_type_method_return, Vdbus_message_type_error)
8291 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
8292 (Vdbus_registered_buses, Vdbus_registered_objects_table):
8293 Adapt docstring.
dcbf5805 8294
52828e02
PE
82952012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8296
da05bc4c
PE
8297 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
8298 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
8299 Do not assume ptrdiff_t is the same width as 'int'.
8300
52828e02
PE
8301 * alloc.c: Handle unusual debugging option combinations.
8302 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
8303 since the two debugging options are incompatible.
8304 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
8305 is defined.
8306 (mem_init, mem_insert, mem_insert_fixup):
8307 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
8308 (NEED_MEM_INSERT): Remove; no longer needed.
8309
f01769f9
LL
83102012-04-22 Leo Liu <sdl.web@gmail.com>
8311
8312 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
8313
5790543d
PE
83142012-04-22 Paul Eggert <eggert@cs.ucla.edu>
8315
8316 * sysdep.c [__FreeBSD__]: Minor cleanups.
8317 (list_system_processes, system_process_attributes) [__FreeBSD__]:
8318 Use Emacs indenting style more consistently. Avoid some casts.
8319 Use 'double' consistently rather than mixing 'float' and 'double'.
8320
b91b7e4d
EW
83212012-04-21 Eduard Wiebe <usenet@pusto.de>
8322
b593d6a9
AH
8323 * sysdep.c (list_system_processes, system_process_attributes):
8324 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 8325
6114eb15
AS
83262012-04-21 Andreas Schwab <schwab@linux-m68k.org>
8327
8328 * lisp.mk (lisp): Update.
8329
2f38dff7
PE
83302012-04-20 Paul Eggert <eggert@cs.ucla.edu>
8331
8332 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
8333 It is never used otherwise.
8334
4ae29f89
SM
83352012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
8336
8337 * print.c (print_preprocess): Only check print_depth if print-circle
8338 is nil.
8339 (print_object): Check for cycles even when print-circle is nil and
8340 print-gensym is t, but only check print_depth if print-circle is nil.
8341
f30d612a
CY
83422012-04-20 Chong Yidong <cyd@gnu.org>
8343
8344 * process.c (wait_reading_process_output): If EIO occurs on a pty,
8345 set the status to "failed" and ensure that sentinel is run.
8346
c07a4c0b 83472012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
8348
8349 * process.c (Fset_process_inherit_coding_system_flag)
8350 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 8351 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 8352
c07a4c0b 83532012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
8354
8355 * xdisp.c (string_buffer_position_lim): Limit starting position to
8356 BEGV.
8357 (set_cursor_from_row): If called for a mode-line or header-line
8358 row, return zero immediately.
8359 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
8360 farther than the first row after the header line, if any.
8361 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
8362 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
8363
c07a4c0b 83642012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8365
4ae29f89
SM
8366 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
8367 (bug#11238).
ad3a2b41 8368
c07a4c0b 83692012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 83702012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
8371
8372 configure: new option --enable-gcc-warnings (Bug#11207)
8373 * Makefile.in (C_WARNINGS_SWITCH): Remove.
8374 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
8375 (ALL_CFLAGS): Use new macros rather than old.
8376 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
8377 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
8378 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
8379 -Wunused-result, -Wunused-variable. This should go away once
8380 the Emacs and Gnulib regex code is merged.
8381 (xmalloc, xrealloc): Now static.
8382
aba027e8
PE
83832012-04-17 Paul Eggert <eggert@cs.ucla.edu>
8384
8385 * dired.c (Fsystem_groups): Remove unused local.
8386
e5a36063
GM
83872012-04-17 Glenn Morris <rgm@gnu.org>
8388
8389 * dired.c (Fsystem_users): Doc fix.
8390
316411f0
DA
83912012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
8392
8393 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
8394 (syms_of_dired): Add them.
8395
9426aba4
PE
83962012-04-16 Paul Eggert <eggert@cs.ucla.edu>
8397
b62a57be
PE
8398 Fix minor alloc.c problems found by static checking.
8399 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
8400 New extern decls, to avoid calling undeclared functions.
8401 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
8402 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
8403 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
8404 (NEED_MEM_INSERT): New macro.
8405 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 8406 Remove one incorrect comment and fix another.
b62a57be 8407
3539f31f
PE
8408 Fix minor ralloc.c problems found by static checking.
8409 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8410 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
8411 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
8412 (r_alloc_sbrk): Now static.
8413
a041960a
PE
8414 Improve ralloc.c interface checking.
8415 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
8416 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
8417 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
8418 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
8419 [REL_ALLOC]: ... to here, to check interface.
8420 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
8421 Remove decls. This fixes an "It stinks!".
8422
9426aba4
PE
8423 * alloc.c (which_symbols): Fix alignment issue / type clash.
8424
d55c12ed
AS
84252012-04-15 Andreas Schwab <schwab@linux-m68k.org>
8426
8427 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
8428 (struct Lisp_Misc_Any): Likewise.
8429 (struct Lisp_Free): Likewise.
8430 * alloc.c (union aligned_Lisp_Symbol): Define.
8431 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
8432 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
8433 (union aligned_Lisp_Misc): Define.
8434 (MARKER_BLOCK_SIZE, struct marker_block): Use union
8435 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 8436 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 8437
b948ce8b
PE
84382012-04-14 Paul Eggert <eggert@cs.ucla.edu>
8439
8440 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
8441 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
8442 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
8443 * s/netbsd.h, s/sol2-6.h:
8444 Remove definition of GC_MARK_STACK, since the default now works.
8445 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
8446 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
8447 no longer the default.
8448 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
8449
35dc09a1 84502012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 8451
35dc09a1
GM
8452 * lread.c (lisp_file_lexically_bound_p):
8453 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 8454
35dc09a1
GM
84552012-04-14 Eli Zaretskii <eliz@gnu.org>
8456
8457 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
8458 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
8459
84602012-04-14 Jan Djärv <jan.h.d@swipnet.se>
8461
8462 * nsterm.m (constrainFrameRect): Always constrain when there is only
8463 one screen (Bug#10962).
8464
bcd86815
KB
84652012-04-13 Ken Brown <kbrown@cornell.edu>
8466
8467 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
8468
c25df26e
RT
84692012-04-13 Reuben Thomas <rrt@sc3d.org>
8470
8471 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
8472
0fc59f1e
DC
84732012-04-11 Daniel Colascione <dancol@dancol.org>
8474
8475 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
8476 against is gone. It's better to use vfork now so that when Cygwin
8477 gains a new, working vfork, we use it automatically (bug#10398).
8478
de8c03dc
SM
84792012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8480
8481 * window.c (save_window_save): Obey window-point-insertion-type.
8482
2f097256
GM
84832012-04-11 Glenn Morris <rgm@gnu.org>
8484
8485 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
8486
453b951e
SM
84872012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
8488
8489 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
8490
75f1671a 84912012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
8492
8493 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
8494 (force_quit_count): New var.
8495 (handle_interrupt): Use it.
8496
2a8ce227
JB
84972012-04-10 Juanma Barranquero <lekktu@gmail.com>
8498
8499 * w32.c (w32_delayed_load): Record the full path of the library
8500 being loaded (bug#10424).
8501
935396c0
GM
85022012-04-09 Glenn Morris <rgm@gnu.org>
8503
05920a43
GM
8504 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
8505 not just in the obarray, before snarfing them. (Bug#11036)
8506
935396c0
GM
8507 * Makefile.in ($(leimdir)/leim-list.el):
8508 Pass EMACS rather than BUILT_EMACS.
8509
a18ecafa
TZ
85102012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
8511
8512 * process.c (make_process):
8513 * process.h: Add integer `gnutls_handshakes_tried' member to
8514 process struct.
8515
6bbef4e5
JC
8516 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
8517 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
8518
8519 * gnutls.c (gnutls_log_function2i): Convenience log function.
8520 (emacs_gnutls_read): Use new log functions,
8521 `gnutls_handshakes_tried' process member, and
8522 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
8523 attempts per process (connection).
8524
b4d3bc10
CY
85252012-04-09 Chong Yidong <cyd@gnu.org>
8526
8527 * eval.c (Fuser_variable_p, user_variable_p_eh)
8528 (lisp_indirect_variable): Functions deleted.
8529 (Fdefvar): Caller changed.
8530
8531 * callint.c (Finteractive, Fcall_interactively):
8532 * minibuf.c (Fread_variable): Callers changed.
8533
70f4d973
EZ
85342012-04-09 Eli Zaretskii <eliz@gnu.org>
8535
8536 * xdisp.c (set_cursor_from_row): If the display string appears in
8537 the buffer at position that is closer to point than the position
8538 after the display string, display the cursor on the first glyph of
8539 the display string. Fixes cursor display when a 'display' text
8540 property immediately follows invisible text. (Bug#11094)
8541
cb3c2e3e
PE
85422012-04-09 Paul Eggert <eggert@cs.ucla.edu>
8543
8544 composite.c: use 'double' consistently
8545 * composite.c (get_composition_id): Use 'double' consistently
8546 instead of converting 'float' to 'double' and vice versa; this is
8547 easier to understand and avoids a GCC warning.
8548
fd06db5d
GM
85492012-04-09 Glenn Morris <rgm@gnu.org>
8550
50fe702a
GM
8551 * Makefile.in: Generate leim-list with bootstrap-emacs, in
8552 preparation for dumping it with emacs. (Bug#4789)
8553 (leimdir): New variable.
8554 ($(leimdir)/leim-list.el): New rule.
8555 (emacs$(EXEEXT)): Depend on leim-list.el.
8556
fd06db5d
GM
8557 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
8558 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
8559 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
8560
55c131ee
AS
85612012-04-08 Andreas Schwab <schwab@linux-m68k.org>
8562
8563 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
8564 proper alignment.
8565
9209588f
JB
85662012-04-07 Juanma Barranquero <lekktu@gmail.com>
8567
8568 * xml.c (init_libxml2_functions) [WINDOWSNT]:
8569 Remove unused local variable.
8570
e3fb2efb
PE
85712012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8572
8573 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
8574 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
8575 (mark_memory): Mark Lisp_Objects only if pointers might hide in
8576 objects, as mark_maybe_pointer will catch them otherwise.
8577 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
8578 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
8579
b5385551
PE
85802012-04-07 Paul Eggert <eggert@cs.ucla.edu>
8581
8582 Fix typo that broke non-Windows builds.
8583 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
8584
9078ead6
EZ
85852012-04-07 Eli Zaretskii <eliz@gnu.org>
8586
8587 Support building on MS-Windows with libxml2.
8588
8589 * makefile.w32-in (OBJ2): Add xml.$(O).
8590 (GLOBAL_SOURCES): Add xml.c.
8591 ($(BLD)/xml.$(O)): New dependency list.
8592
8593 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
8594 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
8595 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
8596 [!WINDOWSNT]: New macros.
8597 (init_libxml2_functions, libxml2_loaded_p): New functions.
8598 (parse_region): Call fn_xmlCheckVersion instead of using the macro
8599 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
8600 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
8601 Calls xmlCleanupParser only if libxml2 was loaded (or statically
8602 linked in).
6bbef4e5
JC
8603 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
8604 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
8605 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
8606
8607 * emacs.c: Don't include libxml/parser.h.
8608 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
8609 xmlCleanupParser directly.
8610
8611 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
8612
3811fdf3
EZ
86132012-04-07 Eli Zaretskii <eliz@gnu.org>
8614
8615 * indent.c (Fvertical_motion): If there is a display string at
8616 point, use it.vpos to compute how many lines to backtrack after
8617 move_it_to point. (Bug#11133)
8618
2f8e16b2
EZ
86192012-04-06 Eli Zaretskii <eliz@gnu.org>
8620
8621 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
8622 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
8623 about subtle differences between FETCH_CHAR* and STRING_CHAR*
8624 macros related to unification of CJK characters. For the details,
8625 see the discussion following the message here:
8626 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
8627
3d439cd1
CY
86282012-04-04 Chong Yidong <cyd@gnu.org>
8629
8630 * keyboard.c (Vdelayed_warnings_list): Doc fix.
8631
8bc53d00
EZ
86322012-04-01 Eli Zaretskii <eliz@gnu.org>
8633
8634 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
8635 instead of alloca. (Bug#11138)
8636
3b0512a3
AS
86372012-04-01 Andreas Schwab <schwab@linux-m68k.org>
8638
8639 * w32menu.c (is_simple_dialog): Properly check lisp types.
8640 (Bug#11141)
8641
8427ddd2
EZ
86422012-03-31 Eli Zaretskii <eliz@gnu.org>
8643
979022ef
EZ
8644 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
8645 position we get to after a call to move_it_to fails the
8646 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
8647 only if we wind up in a string from display property. (Bug#11063)
8648
a6b1c7cc
EZ
8649 * window.c (Fdelete_other_windows_internal): Invalidate the row
8650 and column information about mouse highlight, so that redisplay
8651 restores it after reallocating the glyph matrices. (Bug#7464)
8652
8427ddd2
EZ
8653 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
8654 string comes from a `display' text property, use the buffer
8655 position of that property as if we actually saw that position in
8656 the row's glyphs.
697ba24b
EZ
8657 (move_it_by_lines): Remove the assertion that
8658 "it->current_x == 0 && it->hpos == 0" which can be legitimately
8659 violated when there's a before-string at the beginning of a line.
8660 (Bug#11063)
8427ddd2 8661
65a0a738
EZ
86622012-03-30 Eli Zaretskii <eliz@gnu.org>
8663
8664 * xdisp.c (append_space_for_newline): If the default face was
8665 remapped, use the remapped face for the appended newline.
8666 (extend_face_to_end_of_line): Use the remapped default face for
8667 extending the face to the end of the line.
8668 (display_line): Call extend_face_to_end_of_line when the default
8669 face was remapped. (Bug#11068)
8670
581355cc
EZ
86712012-03-29 Eli Zaretskii <eliz@gnu.org>
8672
8673 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
8674
e8fc049f
SM
86752012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
8676
8677 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
8678
4fb9a543
GM
86792012-03-27 Glenn Morris <rgm@gnu.org>
8680
8681 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
8682 Doc fixes.
8683
679910f1
KH
86842012-03-26 Kenichi Handa <handa@m17n.org>
8685
8686 * dispextern.h (struct glyph): Fix previous change. Change the
8687 bit length of glyphless.ch to 25 (Bug#11082).
8688
90d49b7f
CY
86892012-03-26 Chong Yidong <cyd@gnu.org>
8690
8691 * keyboard.c (Vselection_inhibit_update_commands): New variable.
8692 (command_loop_1): Use it; inhibit selection update for
8693 handle-select-window too (Bug#8996).
8694
f514f6f0
FP
86952012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
8696
e8fc049f 8697 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 8698
bf43fa51
KH
86992012-03-25 Kenichi Handa <handa@m17n.org>
8700
8701 * dispextern.h (struct glyph): Change the bit length of
8702 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
8703
8a0c01dd
EZ
87042012-03-24 Eli Zaretskii <eliz@gnu.org>
8705
8706 * s/ms-w32.h (tzname): Include time.h before redirecting to
8707 _tzname. Fixes the MSVC build. (Bug#9960)
8708
7d1c3a76
AS
87092012-03-24 Andreas Schwab <schwab@linux-m68k.org>
8710
8ed79523
AS
8711 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
8712 characters.
8713
7d1c3a76
AS
8714 * xterm.c (XTread_socket): Only modify handling_signal if
8715 !SYNC_INPUT. (Bug#11080)
8716
e99a9b8b
EZ
87172012-03-23 Eli Zaretskii <eliz@gnu.org>
8718
8719 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
8720 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
8721 when fetching a multibyte character consumes more bytes than
8722 CHAR_BYTES returns, due to unification of CJK characters in
8723 string_char. (Bug#11073)
8724
5063c0e1
TN
87252012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
8726
8727 * process.c (wait_reading_process_output): Handle pty disconnect
8728 by refraining from sending oneself a SIGCHLD (bug#10933).
8729
9f851fbd
CY
87302012-03-22 Chong Yidong <cyd@gnu.org>
8731
8732 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8733
5063c0e1 8734 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
8735 Mark string as coming from a prefix property.
8736 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8737 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8738
fb5b8aca
CY
87392012-03-21 Chong Yidong <cyd@gnu.org>
8740
8741 * xfaces.c (Vface_remapping_alist): Doc fix.
8742
62356a1b
EZ
87432012-03-20 Eli Zaretskii <eliz@gnu.org>
8744
8745 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
8746 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8747 Doc fixes.
62356a1b 8748
025de85b
CY
87492012-03-20 Chong Yidong <cyd@gnu.org>
8750
8751 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8752 to reflect default non-nil value of redisplay-dont-pause.
8753
4827f94e
KH
87542012-03-19 Kenichi Handa <handa@m17n.org>
8755
8756 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8757 it fit in a valid range (Bug#11003).
8758
e50a24a2
EZ
87592012-03-18 Eli Zaretskii <eliz@gnu.org>
8760
8761 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8762 that is not from display property, accept the row as a "cursor
8763 row" if one of the string's character has a non-nil `cursor'
8764 property. Fixes cursor positioning when there are newlines in
8765 overlay strings, e.g. in icomplete.el. (Bug#11035)
8766
9af5ed87
PE
87672012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8768
8769 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8770
d1f55f16
CY
87712012-03-12 Chong Yidong <cyd@gnu.org>
8772
8773 * eval.c (inhibit_lisp_code): Rename from
8774 inhibit_window_configuration_change_hook; move from window.c.
8775
8776 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8777 * window.c (run_window_configuration_change_hook)
8778 (syms_of_window): Callers changed.
8779
66c5eebd
CY
87802012-03-11 Chong Yidong <cyd@gnu.org>
8781
413df973
CY
8782 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8783
66c5eebd
CY
8784 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8785
1de11f56
CY
87862012-03-10 Chong Yidong <cyd@gnu.org>
8787
8788 * frame.c (other_visible_frames): Don't assume the selected frame
8789 is visible (Bug#10955).
8790
cae07000
SM
87912012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8792
8793 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8794
89c94350
JD
87952012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8796
8797 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8798 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8799 zero (Bug#10954).
8800
999dd333
GM
88012012-03-03 Glenn Morris <rgm@gnu.org>
8802
01a6dcc8 8803 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 8804
de0100f2
EZ
88052012-03-02 Eli Zaretskii <eliz@gnu.org>
8806
8807 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8808 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
8809 (redisplay_window, next_element_from_string): Fix typos in
8810 comments.
3e441275
EZ
8811 (redisplay_window): Pass to move_it_vertically the margin in
8812 pixels, not in screen lines.
de0100f2 8813
96a72ee9
GM
88142012-03-02 Glenn Morris <rgm@gnu.org>
8815
8816 * buffer.c (buffer-list-update-hook): Doc fix.
8817
312508d7
EZ
88182012-02-29 Eli Zaretskii <eliz@gnu.org>
8819
8820 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8821 push_it before setting up the iterator for the first overlay
8822 string, even if we have an empty string loaded.
8823 (next_overlay_string): If there's an empty string on the iterator
8824 stack, pop the stack. (Bug#10903)
8825
27f3c637
PE
88262012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8827
8828 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8829 Suggested by Stefan Monnier in
8830 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8831 * alloc.c (widen_to_Lisp_Object): New static function.
8832 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8833 and widening them to Lisp_Objects. This would work even if
8834 USE_LSB_TAG is defined and wide integers are used, which might
8835 happen in a future version of Emacs.
8836
3c9dfce6
CY
88372012-02-25 Chong Yidong <cyd@gnu.org>
8838
fa74b241
CY
8839 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8840 Doc fix.
8841
3c9dfce6
CY
8842 * xselect.c (Fx_selection_exists_p): Doc fix.
8843 (x_clipboard_manager_save_all): Print an informative message
8844 before saving to clipboard manager.
8845
9486df08
CY
88462012-02-24 Chong Yidong <cyd@gnu.org>
8847
8848 * keyboard.c (process_special_events): Handle all X selection
8849 requests in kbd_buffer, not just the next one (Bug#8869).
8850
f01d3321
CY
88512012-02-23 Chong Yidong <cyd@gnu.org>
8852
8853 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8854 call when setting menu-bar-lines and tool-bar-lines parameters.
8855 (unwind_create_frame_1): New helper function.
8856
8857 * window.c (inhibit_window_configuration_change_hook): New var.
8858 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 8859 (syms_of_window): Initialize it.
f01d3321 8860
86b847b6
CY
88612012-02-22 Chong Yidong <cyd@gnu.org>
8862
8863 * xterm.c (x_draw_image_relief): Add missing type check for
8864 Vtool_bar_button_margin (Bug#10743).
8865
a59225b1
CY
88662012-02-21 Chong Yidong <cyd@gnu.org>
8867
8868 * fileio.c (Vfile_name_handler_alist): Doc fix.
8869
8870 * buffer.c (Fget_file_buffer): Protect against invalid file
8871 handler return value.
8872
310f5bd4
PE
88732012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8874
cb3a28cc
PE
8875 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8876 when computing $valmask.
8877
310f5bd4
PE
8878 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8879 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8880 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8881 It's useless in that case, and it can cause problems on hosts
8882 that allocate halves of EMACS_INT values separately.
8883 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8884 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8885 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8886 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8887 it avoids undefined behavior on hosts where shifting right by more
8888 than the word width has undefined behavior.
8889
2375c96a
CY
88902012-02-19 Chong Yidong <cyd@gnu.org>
8891
8892 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8893 (Funhandled_file_name_directory, Ffile_name_as_directory)
8894 (Fdirectory_file_name, Fexpand_file_name)
8895 (Fsubstitute_in_file_name): Protect against invalid file handler
8896 return values (Bug#10845).
8897
3eb49e71
EZ
88982012-02-18 Eli Zaretskii <eliz@gnu.org>
8899
8900 * .gdbinit (pitx): Fix incorrect references to fields of the
8901 iterator stack.
8902
7b926f3f
CY
89032012-02-17 Chong Yidong <cyd@gnu.org>
8904
8905 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8906
11273115
PE
89072012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8908
8909 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8910 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8911
c3a70e2b
CY
89122012-02-15 Chong Yidong <cyd@gnu.org>
8913
8914 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8915 marked as special. Also, starting docstrings with * is obsolete.
8916
0ca43699
AS
89172012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8918
8919 * gnutls.c (emacs_gnutls_write): Fix last change.
8920
2e8f3c56
LI
89212012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8922
8923 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8924 send_process.
8925
af70074f
SM
89262012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8927
8928 * keymap.c (Fsingle_key_description): Handle char ranges.
8929
95986d52
CY
89302012-02-12 Chong Yidong <cyd@gnu.org>
8931
afd83bd1
CY
8932 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8933 as that creates a dangerous corner case.
8934
95986d52
CY
8935 * window.c (Fdelete_window_internal): Invalidate the mouse
8936 highlight (Bug#9904).
8937
bd7da63e
GM
89382012-02-12 Glenn Morris <rgm@gnu.org>
8939
8940 * xselect.c (Fx_own_selection_internal)
8941 (Fx_get_selection_internal, Fx_disown_selection_internal)
8942 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8943 * nsselect.m (Fx_own_selection_internal)
8944 (Fx_disown_selection_internal, Fx_selection_exists_p)
8945 (Fx_selection_owner_p, Fx_get_selection_internal):
8946 Sync docs and argument specs with the xselect.c versions.
8947
77abcbc2
LI
89482012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8949
8950 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8951
90b671e2
EZ
89522012-02-11 Eli Zaretskii <eliz@gnu.org>
8953
1c0ca0b7
EZ
8954 * w32select.c (Fx_selection_exists_p): Sync doc string and
8955 argument list with xselect.c. (Bug#10783)
8956
8957 * w16select.c (Fx_selection_exists_p): Sync doc string and
8958 argument list with xselect.c. (Bug#10783)
90b671e2 8959
49241268
GM
89602012-02-10 Glenn Morris <rgm@gnu.org>
8961
8962 * fns.c (Fsecure_hash): Doc fix.
8963
f998bbe7 89642012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
8965
8966 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8967
0992bd9c
CY
89682012-02-07 Chong Yidong <cyd@gnu.org>
8969
8970 * buffer.c (Fbuffer_local_variables)
8971 (buffer_lisp_local_variables): Handle unbound vars correctly;
8972 don't let Qunbound leak into Lisp.
8973
af008560
GM
89742012-02-07 Glenn Morris <rgm@gnu.org>
8975
dd605cc4
GM
8976 * image.c (Fimagemagick_types): Doc fix.
8977
af008560
GM
8978 * image.c (imagemagick-render-type): Change it from a lisp object
8979 to an integer. Move the doc here from the lisp manual.
8980 Treat all values not equal to 0 the same.
8981
1449fa1d
CY
89822012-02-06 Chong Yidong <cyd@gnu.org>
8983
8984 * doc.c (store_function_docstring): Avoid applying docstring of
8985 alias to base function (Bug#2603).
8986
3723ec07
AS
89872012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8988
8989 * .gdbinit (pp1, pv1): Remove redundant defines.
8990 (pr): Use pp.
8991
79c1cc1e
CY
89922012-02-04 Chong Yidong <cyd@gnu.org>
8993
8994 * nsterm.m: Declare a global (Bug#10694).
8995
d7f29f8e
EZ
89962012-02-04 Eli Zaretskii <eliz@gnu.org>
8997
cae07000
SM
8998 * w32.c (get_emacs_configuration_options):
8999 Include --enable-checking, if specified, in the return value.
d7f29f8e 9000
3b95a6f9
MR
90012012-02-04 Martin Rudalics <rudalics@gmx.at>
9002
9003 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9004 after rounding frame sizes. (Bug#9723)
9005
d6fa96a6
EZ
90062012-02-04 Eli Zaretskii <eliz@gnu.org>
9007
9008 * keyboard.c (adjust_point_for_property): Don't position point
9009 before BEGV. (Bug#10696)
9010
df0b2940
PE
90112012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9012
9013 Handle overflow when computing char display width (Bug#9496).
9014 * character.c (char_width): Return EMACS_INT, not int.
9015 (char_width, c_string_width): Check for overflow when
9016 computing the width; this is possible now that individual
9017 characters can have unbounded width. Problem introduced
9018 by merge from Emacs 23 on 2012-01-19.
9019
6bee44d6
MA
90202012-02-02 Michael Albinus <michael.albinus@gmx.de>
9021
9022 * dbusbind.c (Fdbus_register_method): Mention the return value
9023 :ignore in the docstring.
9024
44f92739
GM
90252012-02-02 Glenn Morris <rgm@gnu.org>
9026
1b9f60cc
GM
9027 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
9028
44f92739
GM
9029 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9030 Unconditionally set to t. (Bug#10673)
9031 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
9032 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
9033 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
9034
c5d3843c
KH
90352012-02-02 Kenichi Handa <handa@m17n.org>
9036
9037 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
9038 0, do not call append_composite_glyph.
9039
159462d4 90402012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
9041
9042 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
9043 NULL (Bug#6988).
9044 (x_produce_glyphs): If the component of a composition is a null
9045 string, set it->pixel_width to 1 to avoid zero-width glyph.
9046
78cef877
EZ
90472012-02-01 Eli Zaretskii <eliz@gnu.org>
9048
9049 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
9050 first 2 arguments are identical. This makes inserting large
9051 output from a subprocess an order of magnitude faster on
9052 MS-Windows, where all sbrk'ed memory is always contiguous.
9053
97897668
GM
90542012-01-31 Glenn Morris <rgm@gnu.org>
9055
9056 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 9057 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
9058 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
9059
31fd3586
GM
90602012-01-29 Glenn Morris <rgm@gnu.org>
9061
9062 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
9063
0e24a8b2
CY
90642012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
9065
9066 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
9067
cc0adcb0
CY
90682012-01-28 Chong Yidong <cyd@gnu.org>
9069
9070 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
9071
acc28cb9
CY
90722012-01-26 Chong Yidong <cyd@gnu.org>
9073
9c69cfb7
CY
9074 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
9075
acc28cb9
CY
9076 * search.c (Fsearch_forward, Fsearch_backward): Document negative
9077 repeat counts (Bug#10507).
9078
48da7392
GM
90792012-01-26 Glenn Morris <rgm@gnu.org>
9080
9081 * lread.c (syms_of_lread): Doc fix.
9082
14af5f7f
CY
90832012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
9084
9085 * coding.c (encode_designation_at_bol): Change return value to
9086 EMACS_INT.
9087
0b21c100
CY
90882012-01-25 Chong Yidong <cyd@gnu.org>
9089
9090 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
9091
3c2907f7
CY
90922012-01-21 Chong Yidong <cyd@gnu.org>
9093
9094 * floatfns.c (Fcopysign): Make the second argument non-optional,
9095 since nil is not allowed anyway.
9096
959ad23f
AS
90972012-01-21 Andreas Schwab <schwab@linux-m68k.org>
9098
9099 * process.c (read_process_output): Use p instead of XPROCESS (proc).
9100 (send_process): Likewise.
9101
34a02f46
MR
91022012-01-19 Martin Rudalics <rudalics@gmx.at>
9103
9104 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
9105 (Vwindow_persistent_parameters): Do not use Qstate.
9106 Rewrite doc-strings.
34a02f46 9107
1259009a 91082012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
9109
9110 * character.c (char_width): New function.
70d4fdf6
GM
9111 (Fchar_width, c_string_width, lisp_string_width):
9112 Use char_width (Bug#9496).
25ed9e61 9113
6a6ee00d
MR
91142012-01-16 Martin Rudalics <rudalics@gmx.at>
9115
9116 * window.c (Vwindow_persistent_parameters): New variable.
9117 (Fset_window_configuration, save_window_save): Handle persistent
9118 window parameters.
9119
c85efaf7
EZ
91202012-01-14 Eli Zaretskii <eliz@gnu.org>
9121
9122 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
9123 thrashing the stack of the thread. (Bug#9087)
9124
5944709e
PE
91252012-01-12 Paul Eggert <eggert@cs.ucla.edu>
9126
9127 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
9128
e71f5d99
EZ
91292012-01-11 Eli Zaretskii <eliz@gnu.org>
9130
9131 * xdisp.c (rows_from_pos_range): Handle the case where the
9132 highlight ends on a newline. (Bug#10464)
9133 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
9134 he end column for display of highlight that ends on a newline
9135 before a R2L line.
9136
ce316182
GM
91372012-01-11 Glenn Morris <rgm@gnu.org>
9138
9139 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
9140 from load-path also when installation-directory is nil. (Bug#10208)
9141
5b43da69
GM
91422012-01-10 Glenn Morris <rgm@gnu.org>
9143
74cc8ff9
GM
9144 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
9145
7d8d6e4e
GM
9146 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
9147 Update template values to be closer to their typical values these days.
5b43da69 9148
a0db8d43
EZ
91492012-01-09 Eli Zaretskii <eliz@gnu.org>
9150
9151 * xdisp.c (rows_from_pos_range): Accept additional argument
9152 DISP_STRING, and accept any glyph in a row whose object is that
9153 string as eligible for mouse highlight. Fixes mouse highlight of
9154 display strings from overlays. (Bug#10464)
9155
9a0115ab 91562012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 9157
b9110d6a 9158 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
9159 * fileio.c (auto_saving_dir_umask): New static var.
9160 (Fmake_directory_internal): Use it.
9161 (do_auto_save_make_dir): Set it, instead of invoking chmod after
9162 creating the directory. The old code temporarily assigns
9163 too-generous permissions to the directory.
9164 (do_auto_save_eh): Clear it.
b9110d6a 9165 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
9166 that the var is always cleared.
9167
6c1bd3f3
EZ
91682012-01-07 Eli Zaretskii <eliz@gnu.org>
9169
9170 * search.c (scan_buffer): Pass character positions to
9171 know_region_cache, not byte positions. (Bug#6540)
9172
069d2b50
L
91732012-01-07 LynX <_LynX@bk.ru> (tiny change)
9174
9175 * w32.c (sys_rename): Report EXDEV when rename of a directory
9176 fails because the target is on another logical disk. (Bug#10284)
9177
75bf0d33
DB
91782012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
9179
9180 * xterm.c (x_embed_request_focus): New function.
9181
9182 * xterm.h: Add prototype.
9183
9184 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
9185
1c6e5a32
GM
91862012-01-05 Glenn Morris <rgm@gnu.org>
9187
9188 * emacs.c (emacs_copyright): Update short copyright year to 2012.
9189
651e947e
EZ
91902012-01-01 Eli Zaretskii <eliz@gnu.org>
9191
9192 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
9193 Load gnutls_transport_set_lowat only if GnuTLS version is below
9194 2.11.1.
9195 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
9196 GnuTLS versions below 2.11.1.
9197
3778cdd8
AL
91982011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
9199
9200 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
9201 to the doc string advising against its use for altering the way
9202 windows are scrolled.
9203
0e5317f7
KH
92042011-12-28 Kenichi Handa <handa@m17n.org>
9205
9206 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
9207 coding-system ASCII compatible only when it does not produce BOM
9208 on encoding (Bug#10383).
9209
93d5ca1f
JD
92102011-12-26 Jan Djärv <jan.h.d@swipnet.se>
9211
9212 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
9213 can scroll.
9214 (create_and_show_popup_menu): Always use menu_position_func for
9215 Gtk3 (Bug#10361).
9216
ca22b785
AS
92172011-12-24 Andreas Schwab <schwab@linux-m68k.org>
9218
9219 * callint.c (Fcall_interactively): Don't truncate prompt string.
9220
d048e1e6
EZ
92212011-12-23 Eli Zaretskii <eliz@gnu.org>
9222
9223 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
9224 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 9225 resumed from there (after widening). (Bug#10360)
d048e1e6 9226
5ccaba1f
JD
92272011-12-22 Jan Djärv <jan.h.d@swipnet.se>
9228
9229 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
9230
204ee57f
JD
92312011-12-21 Jan Djärv <jan.h.d@swipnet.se>
9232
b81d40f0
JB
9233 * nsterm.m (x_free_frame_resources):
9234 Release f->output_data.ns->miniimage.
204ee57f
JD
9235 (ns_index_color): Fix indentation. Do not retain
9236 color_table->colors[i].
9237
9238 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
9239 before returning.
9240
9241 * nsfns.m (x_set_background_color): Assign return value from
9242 ns_index_color to face-background instead of NSColor*.
9243 (ns_implicitly_set_icon_type): Fix indentation.
9244 Change assignment in for loop to comparison.
9245
9246 * emacs.c (ns_pool): New variable.
9247 (main): Assign ns_pool.
9248 (Fkill_emacs): Call ns_release_autorelease_pool.
9249
9250 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
9251 autorelease fdesc, release fdAttrs and tdict.
9252 (ns_get_covering_families): Release charset.
9253 (ns_findfonts): Release NSFontDescriptor created with new.
9254 (ns_uni_to_glyphs): Fix indentation.
9255 (setString): Release attrStr before assigning new value.
9256
c803b2b7
JD
92572011-12-18 Jan Djärv <jan.h.d@swipnet.se>
9258
678f4426
JD
9259 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
9260 and NS_IMPL_COCOA.
9261 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
9262 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
9263
cd394be1 92642011-12-18 David Reitter <reitter@cmu.edu>
678f4426 9265
5fecd5fc
JD
9266 * nsterm.m (ns_term_init): Subscribe for notifications
9267 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
9268 to method trackingNotification in EmacsMenu.
9269
9270 * nsmenu.m (trackingMenu): New variable.
3771cb17 9271 (trackingNotification): New method (from Aquamacs).
5fecd5fc 9272 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 9273 from Aquamacs (Bug#7030).
678f4426
JD
9274
92752011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 9276
c803b2b7
JD
9277 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
9278 (symbol_to_nsstring): Fix indentation.
9279 (ns_symbol_to_pb): New function.
cae07000
SM
9280 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
9281 (Fns_rotate_cut_buffers_internal): Remove.
9282 (Fns_store_selection_internal): Rename from
c803b2b7
JD
9283 Fns_store_cut_buffer_internal.
9284 (ns_get_foreign_selection, Fx_own_selection_internal)
9285 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
9286 (Fns_get_selection_internal, Fns_store_selection_internal):
9287 Use ns_symbol_to_pb and check if return value is nil.
9288 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
9289 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
9290 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
9291 renamed to Sns_store_selection_internal.
9292 (ns_handle_selection_request): Move code to Fx_own_selection_internal
9293 and remove this function.
9294 (ns_handle_selection_clear): Remove, never used.
9295 (Fx_own_selection_internal): Move code from ns_handle_selection_request
9296 here.
9297
e1b01a3a
KB
92982011-12-17 Ken Brown <kbrown@cornell.edu>
9299
9300 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
9301 GID is unknown (Bug#10257).
9302
2adb6e85
PE
93032011-12-17 Paul Eggert <eggert@cs.ucla.edu>
9304
9305 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
9306 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
9307 which caused a build failure on GNU/Linux IA-64. This problem was
9308 introduced by my 2011-10-07 patch.
9309
d1d7b339
JL
93102011-12-15 Juri Linkov <juri@jurta.org>
9311
9312 * image.c (imagemagick_error): New function. (Bug#10112)
9313 (imagemagick_load_image): Comment out `MagickSetResolution' call.
9314 Use `imagemagick_error' where ImageMagick functions return
9315 `MagickFalse'.
9316 (Fimagemagick_types): Add `Fnreverse' to return the list in the
9317 proper order.
9318
100d5755
KH
93192011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9320
9321 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
9322 fill background (Bug#8992).
9323
454592a6
MR
93242011-12-13 Martin Rudalics <rudalics@gmx.at>
9325
9326 * window.c (Vwindow_combination_resize)
9327 (Vwindow_combination_limit): Use t instead of non-nil in
9328 doc-strings.
61d4b438
MR
9329 (Vrecenter_redisplay): Add first sentence of doc-string on
9330 separate line.
53524d93 9331 (Frecenter): Fix doc-string typo.
454592a6 9332
3633e3aa
KH
93332011-12-11 Kenichi Handa <handa@m17n.org>
9334
9335 * coding.c (Funencodable_char_position): Pay attention to the
9336 buffer text relocation (Bug#9389).
9337
7b9d523a 93382011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 9339
7b9d523a
JD
9340 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
9341 gtk_init (Bug#10100).
9342
b73189c6
EZ
93432011-12-10 Eli Zaretskii <eliz@gnu.org>
9344
9345 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
9346 IT->string is nil. (Bug#10263)
9347
f7dfe5d6
JD
93482011-12-10 Jan Djärv <jan.h.d@swipnet.se>
9349
83faebb4
JD
9350 * nsterm.h (x_free_frame_resources): Declare.
9351
f7dfe5d6
JD
9352 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
9353 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
9354
9355 * nsterm.h (ns_get_defaults_value): Declare.
9356
9357 * nsterm.m (ns_default): Call ns_get_defaults_value.
9358
7cd4e72c
EZ
93592011-12-09 Eli Zaretskii <eliz@gnu.org>
9360
9361 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
9362 (Bug#10170)
9363
b34d7317
YM
93642011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9365
9366 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
9367 that where the value of an _OBJC_* symbol points to is in the .bss
9368 section (Bug#10240).
9369
76470ad1
KH
93702011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9371
9372 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 9373 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 9374
745fff94
KH
93752011-12-08 Kenichi Handa <handa@m17n.org>
9376
9377 * ftfont.c (get_adstyle_property): Fix previous change
9378 (Bug#10233).
9379
6e44397c
JB
93802011-12-07 Juanma Barranquero <lekktu@gmail.com>
9381
9382 * w32.c (init_environment): If no_site_lisp, remove site-lisp
9383 dirs from the default value of EMACSLOADPATH (bug#10208).
9384
7efa6272
GM
93852011-12-07 Glenn Morris <rgm@gnu.org>
9386
9387 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
9388 installation and source directories as well. (Bug#10208)
9389
f6fc4d87
CY
93902011-12-06 Chong Yidong <cyd@gnu.org>
9391
9392 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
9393
2bf26180
GM
93942011-12-06 Glenn Morris <rgm@gnu.org>
9395
9396 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
9397 as an error, not just -1. (Bug#10217)
9398
3a6ad4f0
CY
93992011-12-05 Chong Yidong <cyd@gnu.org>
9400
9401 * keyboard.c (process_special_events): New function.
9402 (swallow_events, Finput_pending_p): Use it (Bug#10195).
9403
75a3b399
PE
94042011-12-05 Paul Eggert <eggert@cs.ucla.edu>
9405
9406 * coding.c (encode_designation_at_bol): Don't use uninitialized
9407 local variable (Bug#9318).
9408
c3c9e25e
KH
94092011-12-05 Kenichi Handa <handa@m17n.org>
9410
9411 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
9412 return Qnil (Bug#8046, Bug#10193).
9413
5eb05ea3
KH
94142011-12-05 Kenichi Handa <handa@m17n.org>
9415
9416 * coding.c (encode_designation_at_bol): New args charbuf_end and
9417 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
9418 (coding_set_source): Return how many bytes coding->source was
9419 relocated.
9420 (coding_set_destination): Return how many bytes
9421 coding->destination was relocated.
9422 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 9423 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
9424
94252011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
9426
9427 * coding.c (CODING_CHAR_CHARSET_P): New macro.
9428 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
9429 macro (Bug#9318).
9430
94312011-12-05 Andreas Schwab <schwab@linux-m68k.org>
9432
9433 The following changes are to fix Bug#9318.
9434
a79703f5 9435 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
9436 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
9437 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 9438 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 9439
7dbda6df
JB
94402011-12-05 Juanma Barranquero <lekktu@gmail.com>
9441
9442 * lisp.h (process_quit_flag): Fix external declaration.
9443
6d5eb5b0
SM
94442011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
9445
9446 Don't macro-inline non-performance-critical code.
9447 * eval.c (process_quit_flag): New function.
9448 * lisp.h (QUIT): Use it.
9449
a0c3fad0
JD
94502011-12-04 Jan Djärv <jan.h.d@swipnet.se>
9451
9452 * nsfns.m (get_geometry_from_preferences): New function.
9453 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
9454
6c07aac2
AS
94552011-12-04 Andreas Schwab <schwab@linux-m68k.org>
9456
9457 * emacs.c (Qkill_emacs): Define.
9458 (syms_of_emacs): Initialize it.
9459 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
9460 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
9461 (quit_throw_to_read_char): Add parameter `from_signal'.
9462 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
9463 * lisp.h (QUIT): Call Fkill_emacs if requested.
9464
c052ead4
JD
94652011-12-03 Jan Djärv <jan.h.d@swipnet.se>
9466
9467 * widget.c (update_wm_hints): Return if wmshell is null.
9468 (widget_update_wm_size_hints): New function.
9469
9470 * widget.h (widget_update_wm_size_hints): Declare.
9471
9472 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
9473 widget_update_wm_size_hints (Bug#10104).
9474
9e49252b
EZ
94752011-12-03 Eli Zaretskii <eliz@gnu.org>
9476
9477 * xdisp.c (handle_invisible_prop): If the invisible text ends just
9478 before a newline, prepare the bidi iterator for consuming the
9479 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 9480 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 9481
02b16839
JL
94822011-12-02 Juri Linkov <juri@jurta.org>
9483
9484 * search.c (Fword_search_regexp): New Lisp function created from
9485 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
9486 (Fword_search_backward, Fword_search_forward)
9487 (Fword_search_backward_lax, Fword_search_forward_lax):
9488 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
9489 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
9490
0068070e
SM
94912011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
9492
9493 * fileio.c (Finsert_file_contents): Move after-change-function call
9494 to before the "handled:" label, since all "goto handled" appear in
9495 cases where the *-change-functions have already been properly called
9496 (bug#10117).
9497
3360a3fc
AS
94982011-12-01 Andreas Schwab <schwab@linux-m68k.org>
9499
9500 * keyboard.c (interrupt_signal): Don't call kill-emacs when
9501 waiting for input. (Bug#10169)
9502
73d6c093
EZ
95032011-11-30 Eli Zaretskii <eliz@gnu.org>
9504
9505 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
9506 verifies glyph row's hash code--we have just reallocated the
9507 glyphs, so their contents can be complete garbage. (Bug#10164)
9508
febe6bea
JB
95092011-11-30 Juanma Barranquero <lekktu@gmail.com>
9510
9511 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
9512
801a4313
EZ
95132011-11-30 Eli Zaretskii <eliz@gnu.org>
9514
9515 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
9516 attributes are tested _before_ calling verify_row_hash, to protect
9517 against GCC re-ordering of the tests. (Bug#10164)
9518
2b56b87e
JD
95192011-11-29 Jan Djärv <jan.h.d@swipnet.se>
9520
9521 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
9522
9523 * xterm.c (handle_one_xevent): Only set async_visible and friends
9524 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 9525 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
9526 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
9527
dbf31225
PE
95282011-11-28 Paul Eggert <eggert@cs.ucla.edu>
9529
9530 Remove GCPRO-related macros that exist only to avoid shadowing locals.
9531 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
9532 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
9533 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9534 All uses changed to use GCPRO1 etc.
9535 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
9536 Revert to old implementation (i.e., before 2011-03-11).
9537
1305621b
YM
95382011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9539
9540 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
9541 of scroll runs so as to avoid assigning disabled bogus rows and
9542 unnecessary graphics copy operations.
9543
8c9afb46
EZ
95442011-11-27 Eli Zaretskii <eliz@gnu.org>
9545
9546 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
9547 (snprintf) [_MSC_VER]: Redirect to _snprintf.
9548 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
9549 (malloc, free, realloc, calloc): Redirect to e_* only when
9550 compiling Emacs.
9551
9552 * lisp.h (GCTYPEBITS): Move before first use.
9553 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
9554 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
9555 this macro definition.
9556
9557 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
9558 _MSC_VER.
9559
54e9e3bf
JD
95602011-11-27 Jan Djärv <jan.h.d@swipnet.se>
9561
6d5eb5b0
SM
9562 * gtkutil.c (xg_create_frame_widgets):
9563 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
9564 present with Gtk+ 2.0.
9565
83aca1cb
PE
95662011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9567
9568 * fileio.c (Finsert_file_contents): Undo previous change; see
9569 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
9570
5b76caa4
PE
95712011-11-26 Paul Eggert <eggert@cs.ucla.edu>
9572
9573 Rename locals to avoid shadowing.
9574 * fileio.c (Finsert_file_contents):
9575 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
9576 * process.c (wait_reading_process_output):
9577 Rename inner 'proc' to 'p' to avoid shadowing.
9578 Indent for consistency with usual Emacs style.
9579
8c535114
EZ
95802011-11-25 Eli Zaretskii <eliz@gnu.org>
9581
9582 * xdisp.c (redisplay_window): If cursor row is not fully visible
9583 after recentering, and scroll-conservatively is set to a large
9584 number, scroll window by a few more lines to make the cursor fully
9585 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
9586 (start_display): Don't move to the next line if the display should
9587 start at a newline that is part of a display vector or an overlay
9588 string. (Bug#10119)
8c535114 9589
fa4fdb5c
JL
95902011-11-24 Juri Linkov <juri@jurta.org>
9591
9592 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
9593 after the `MagickPingImage' call. (Bug#10112)
9594
90ec88df
CY
95952011-11-23 Chong Yidong <cyd@gnu.org>
9596
9597 * window.c (Fcoordinates_in_window_p): Accept only live windows.
9598
56e2e794
MR
95992011-11-23 Martin Rudalics <rudalics@gmx.at>
9600
9601 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
9602 making another buffer current. (Bug#10114)
9603
b6e64c41
GM
96042011-11-23 Glenn Morris <rgm@gnu.org>
9605
9606 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
9607
6b21de18
CY
96082011-11-23 Chong Yidong <cyd@gnu.org>
9609
9610 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
9611 using it (Bug#5984).
9612
b12cd789
EZ
96132011-11-22 Eli Zaretskii <eliz@gnu.org>
9614
9615 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
9616 and header-lines, as they don't have one computed for them.
9617 (Bug#10098)
9618
9619 * .gdbinit (prow): Make displayed values more self-explaining.
9620 Add row's hash code.
9621
261b6fd4
LMI
96222011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
9623
9624 * process.c (wait_reading_process_output): Fix asynchrounous
9625 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 9626 (wait_reading_process_output): Add comment and URL.
261b6fd4 9627
e7cfd277
JD
96282011-11-21 Jan Djärv <jan.h.d@swipnet.se>
9629
9630 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
9631
a9b9b7f5
CY
96322011-11-21 Chong Yidong <cyd@gnu.org>
9633
9634 * window.c (Fnext_window, Fprevious_window): Doc fix.
9635
b0d15b4f
SM
96362011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9637
9638 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
9639
fe7a3057
JB
96402011-11-20 Juanma Barranquero <lekktu@gmail.com>
9641
9642 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
9643
d2999b1a
MR
96442011-11-20 Martin Rudalics <rudalics@gmx.at>
9645
9646 * window.c (Fset_window_combination_limit): Rename argument
9647 STATUS to LIMIT.
9648 (Vwindow_combination_limit): Remove "status" from doc-string.
9649
d5ff9cd0
AS
96502011-11-20 Andreas Schwab <schwab@linux-m68k.org>
9651
9652 * m/ibms390.h: Remove.
9653 * m/ibms390x.h: Don't include "ibms390.h".
9654
a5bb9bd3
SM
96552011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
9656
9657 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
9658 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
9659
cd1181db
JB
96602011-11-20 Juanma Barranquero <lekktu@gmail.com>
9661
9662 * casetab.c (Fset_case_table):
9663 * charset.c (Fcharset_after): Fix typos.
9664
615a3b8d 96652011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 9666
17e845af
PE
9667 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9668 Otherwise, valgrind does not work on some platforms.
9669 Problem reported by Andreas Schwab in
6a0bf43d
PE
9670 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
9671 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
9672 is set, removing the need for VIRT_ADDRESS_VARIES.
9673 (PURE_P): Use a more-efficient implementation that needs just one
9674 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
9675 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
9676 to 4 (xorl, subq, cmpq, setbe).
9677 * alloc.c (pure): Always extern now, since that's the
9678 VIRT_ADDR_VARIES behavior.
9679 (PURE_POINTER_P): Use a single comparison, not two, for
9680 consistency with the new puresize.h.
9681 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
9682 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
9683 Remove VIRT_ADDR_VARIES no longer needed.
9684
f8fe6f96
EZ
96852011-11-19 Eli Zaretskii <eliz@gnu.org>
9686
9687 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
9688 (erase_phys_cursor, update_window_cursor, show_mouse_face)
9689 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
9690 behave as if the cursor position were at the window margin.
9691
9692 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
9693 and the cursor position is out of bounds, behave as if the cursor
9694 position were at the window margin. (Bug#10075)
9695
df05a53c
CY
96962011-11-18 Chong Yidong <cyd@gnu.org>
9697
9698 * window.c (Fwindow_combination_limit): Make first argument
9699 non-optional, since it is meaningless for live windows like the
9700 selected window.
61ccba97 9701
2071918e
DA
97022011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
9703
9704 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
9705
b50a28de
SM
97062011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
9707
9708 * intervals.c: Fix grafting over the whole buffer (bug#10071).
9709 (graft_intervals_into_buffer): Simplify.
9710
015137db
EZ
97112011-11-18 Eli Zaretskii <eliz@gnu.org>
9712
9713 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
9714 hash values of the two rows.
9715 (copy_row_except_pointers): Preserve the used[] arrays and the
9716 hash values of the two rows. (Bug#10035)
68c95424 9717 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
9718
9719 * xdisp.c (row_hash): New function, body extracted from
9720 compute_line_metrics.
9721 (compute_line_metrics): Call row_hash, instead of computing the
9722 hash code inline.
9723
9724 * dispnew.c (verify_row_hash): Call row_hash for computing the
9725 hash code of a row, instead of duplicating code from xdisp.c.
9726
9727 * dispextern.h (row_hash): Add prototype.
9728
a2addb04
TH
97292011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9730
9731 * frame.c (delete_frame): Don't delete the terminal when the last
9732 X frame is closed if emacs is built with GTK toolkit.
9733
df85d315
JB
97342011-11-17 Juanma Barranquero <lekktu@gmail.com>
9735
9736 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9737
a0c2d0ae
MR
97382011-11-17 Martin Rudalics <rudalics@gmx.at>
9739
9740 * window.c (Vwindow_splits): Rename to
9741 Vwindow_combination_resize. Suggested by Juri Linkov.
9742 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9743 of Vwindow_splits.
9744
58179cce
JB
97452011-11-16 Juanma Barranquero <lekktu@gmail.com>
9746
7877f373
JB
9747 * nsfns.m (Fns_font_name):
9748 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 9749
b6f67890
MR
97502011-11-16 Martin Rudalics <rudalics@gmx.at>
9751
9752 * window.h (window): Rename slot "nest" to "combination_limit".
9753 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9754 (Fset_window_nest): Rename to Fset_window_combination_limit.
9755 (Vwindow_nest): Rename to Vwindow_combination_limit.
9756 (recombine_windows, make_parent_window, make_window)
9757 (Fsplit_window_internal, saved_window)
9758 (Fset_window_configuration, save_window_save): Rename all
9759 occurrences of window_nest to window_combination_limit.
9760
c7015153
JB
97612011-11-15 Juanma Barranquero <lekktu@gmail.com>
9762
9763 * image.c (imagemagick_load_image): Fix typo.
9764
322ad6ec
EZ
97652011-11-14 Eli Zaretskii <eliz@gnu.org>
9766
9767 * xdisp.c (display_line): Move the call to
9768 highlight_trailing_whitespace before the call to
9769 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
9770 faces of all the glyphs to compute ROW's hash value.
9771 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 9772
f067b8ec
JB
97732011-11-14 Juanma Barranquero <lekktu@gmail.com>
9774
9775 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9776 just return (bug#10044).
9777
1e5b2111
EZ
97782011-11-12 Eli Zaretskii <eliz@gnu.org>
9779
7ef3cbd5
EZ
9780 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9781 with user-defined heap size. Bump the default size of the temacs
9782 heap to 27MB, to avoid memory warning when running temacs.
9783 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9784
1e5b2111
EZ
9785 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9786 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
9787 (verify_row_hash) [XASSERTS]: New function.
9788 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9789 that the hash value of glyph rows is correct.
1e5b2111 9790
89d61221
MR
97912011-11-12 Martin Rudalics <rudalics@gmx.at>
9792
9793 * window.h (window): Remove splits slot.
9794 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9795 (Fdelete_other_windows_internal, make_parent_window)
9796 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9797 (Fset_window_configuration, save_window_save): Don't deal with
9798 split status of windows.
9799 (saved_window): Remove splits slot.
9800 (Vwindow_splits): Rewrite doc-string.
9801
97f18cc8
JD
98022011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9803
9804 * xfns.c (unwind_create_frame):
9805 * nsfns.m (unwind_create_frame):
9806 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9807 Vframe_list (Bug#9999).
9808
22a648b4
DA
98092011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9810
0b381c7e 9811 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 9812
659afede
KH
98132011-11-11 Kenichi Handa <handa@m17n.org>
9814
9815 * callproc.c (Fcall_process): Set the member dst_multibyte of
9816 process_coding.
9817
9ac0394b
KH
98182011-11-11 Johan Bockgård <bojohan@gnu.org>
9819
9820 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9821 avoid a crash (bug#9496).
9822
2fbdc249
CY
98232011-11-09 Chong Yidong <cyd@gnu.org>
9824
9825 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9826 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9827
ac6b1f81
PE
98282011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9829
9830 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9831
09db192c
PE
98322011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9833
9834 Avoid some portability problems by eschewing 'extern inline' functions.
9835 The trivial performance wins aren't worth the portability hassles; see
9836 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9837 et seq.
9838 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9839 (window_box_width, window_box_left, window_box_left_offset)
9840 (window_box_right, window_box_right_offset): Undo previous change,
9841 by removing the "extern"s.
9842 * intervals.c (adjust_intervals_for_insertion)
9843 (adjust_intervals_for_deletion): Undo previous change,
9844 making these static again.
9845 (offset_intervals, temp_set_point_both, temp_set_point)
9846 (copy_intervals_to_string): No longer inline.
9847 * xdisp.c (window_text_bottom_y, window_box_width)
9848 (window_box_height, window_box_left_offset)
9849 (window_box_right_offset, window_box_left, window_box_right)
9850 (window_box): No longer inline.
9851
105216ed
CY
98522011-11-08 Chong Yidong <cyd@gnu.org>
9853
9854 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
9855 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9856 Signal an error if not a live window.
105216ed
CY
9857 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9858 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9859
ae9e237f
JB
98602011-11-07 Juanma Barranquero <lekktu@gmail.com>
9861
9862 * lisp.h (syms_of_abbrev): Remove declaration.
9863 Reported by CHENG Gao <chenggao@royau.me>.
9864
c7aa8333
EZ
98652011-11-07 Eli Zaretskii <eliz@gnu.org>
9866
9867 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9868 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9869 of temacs in GUI mode.
9870
be7f5545
MR
98712011-11-07 Martin Rudalics <rudalics@gmx.at>
9872
9873 * window.h: Declare delete_all_child_windows instead of
9874 delete_all_subwindows.
9875 * window.c (Fwindow_nest, Fset_window_nest)
9876 (Fset_window_new_total, Fset_window_new_normal)
9877 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9878 (delete_all_subwindows): Rename to delete_all_child_windows.
9879 (Fdelete_other_windows_internal, Fset_window_configuration):
9880 Call delete_all_child_windows instead of delete_all_subwindows.
9881 * frame.c (delete_frame): Call delete_all_child_windows instead
9882 of delete_all_subwindows.
9883
ca78dc43
PE
98842011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9885
9886 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9887 This is also needed for porting to any host where GC_MARK_STACK is
9888 not GC_MAKE_GCPROS_NOOPS.
9889 (which_symbols): Use it.
9890
a0241d01
KH
98912011-11-07 Kenichi Handa <handa@m17n.org>
9892
9893 * coding.c (coding_set_destination): Check coding->src_pos only
9894 when coding->src_object is a buffer (bug#9910).
9895
9896 * process.c (send_process): Set the member src_multibyte of coding
9897 to 0 (bug#9911) when sending a unibyte text.
9898
9899 * callproc.c (Fcall_process): Set the member src_multibyte of
9900 process_coding to 0 (bug#9912).
9901
a64bfdfa 99022011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
9903
9904 * xmenu.c (cleanup_widget_value_tree): New function.
9905 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9906 calling free_menubar_widget_value_tree directly (Bug#9830).
9907
cb41b32a
PE
99082011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9909
9910 Fix some portability problems with 'inline'.
9911 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9912 (window_box_width, window_box_left, window_box_left_offset)
9913 (window_box_right, window_box_right_offset): Declare extern.
9914 Otherwise, these inline functions do not conform to C99 and
9915 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9916 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9917 * intervals.c (adjust_intervals_for_insertion)
9918 (adjust_intervals_for_deletion): Now extern, because otherwise the
9919 extern inline functions 'offset_intervals' couldn't refer to it.
9920 (static_offset_intervals): Remove.
9921 (offset_intervals): Rewrite using the old contents of
9922 static_offset_intervals. The old version didn't conform to C99
9923 because an extern inline function contained a reference to an
9924 identifier with static linkage.
9925
b7041366
AS
99262011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9927
9928 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9929 GC.
9930
88a37c4d
EZ
99312011-11-06 Eli Zaretskii <eliz@gnu.org>
9932
9933 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9934 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9935 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9936 return Qleft_to_right.
9937
49745b39
CY
99382011-11-06 Chong Yidong <cyd@gnu.org>
9939
9940 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9941 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9942 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9943 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9944 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9945 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9946 (Fwindow_vscroll): Doc fix.
9947 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9948 argument, since it makes no sense to pass a live window and for
9949 consistency with window-child.
9950
1f05cd82
CS
99512011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9952
9953 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9954 support MSVC.
9955
22610910
JR
99562011-11-05 Jason Rumney <jasonr@gnu.org>
9957
9958 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9959 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9960 fonts (Bug#6029).
9961 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9962 bitwise arithmetic preventing use of unicode-sip and non-truetype
9963 opentype fonts.
9964
a06776b2
EZ
99652011-11-05 Eli Zaretskii <eliz@gnu.org>
9966
3ad924ba
EZ
9967 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9968 "emacs"-only part.
9969
a06776b2
EZ
9970 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9971 initialization code to keep similarity to xfns.c after changes
9972 from 2011-11-05.
9973
c9e7db78
JD
99742011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9975
a97f8f3f
JD
9976 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9977 (unwind_create_frame): New function (Bug#9943).
9978 (Fx_create_frame): Restructure code to be more similar to the one in
9979 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9980 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9981 Move terminal->reference_count++ just before making the frame official
9982 (Bug#9943).
9983
9984 * nsterm.m (x_free_frame_resources): New function.
9985 (x_destroy_window): Move code to x_free_frame_resources.
9986
c9e7db78 9987 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
9988 (Fx_create_frame, x_create_tip_frame):
9989 Move terminal->reference_count++ just before making the frame
75f1671a 9990 official. Move initialization of image_cache_refcount and
c9e7db78
JD
9991 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9992
a6fc3b5c
EZ
99932011-11-05 Eli Zaretskii <eliz@gnu.org>
9994
9995 Support MSVC build with newer versions of Visual Studio.
9996 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9997 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9998 nt/gmake.defs.
9999
10000 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10001 which are not supported by MSVC.
10002 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10003 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10004 bitfields.
10005 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10006 types in bitfields.
10007 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10008
10009 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10010
58179cce 100112011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
10012
10013 Support MSVC build with newer versions of Visual Studio.
10014 * w32.c: Don't include w32api.h for MSVC.
10015 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10016
10017 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
10018 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
10019 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
10020 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
10021 e_* cousins.
10022 (alloca) [_MSC_VER]: Define to _alloca.
10023
10024 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
10025
10026 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
10027
a58c13ed
EZ
100282011-11-04 Eli Zaretskii <eliz@gnu.org>
10029
10030 * xdisp.c (note_mouse_highlight): If either of
10031 previous/next-single-property-change returns nil, treat that as
10032 the beginning or the end of the buffer. (Bug#9955)
10033
fe0b6370
JD
100342011-11-04 Jan Djärv <jan.h.d@swipnet.se>
10035
a58c13ed 10036 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
10037 label is not null (Bug#9951).
10038 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
10039 may be NULL.
10040
89bd5ee1
EZ
100412011-11-04 Eli Zaretskii <eliz@gnu.org>
10042
10043 * window.c (Fwindow_body_size): Mention in the doc string that the
10044 return value is in frame's canonical units. (Bug#9949)
10045
84c3edb9
EZ
100462011-11-03 Eli Zaretskii <eliz@gnu.org>
10047
4e2fb5c7
EZ
10048 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
10049
84c3edb9 10050 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 10051 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 10052 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 10053
bc17a887
EZ
100542011-11-01 Eli Zaretskii <eliz@gnu.org>
10055
10056 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
10057 Don't stop backward scan on the continuation glyph, even though
10058 its CHARPOS is positive.
6d5eb5b0
SM
10059 (mouse_face_from_buffer_pos, note_mouse_highlight):
10060 Rename cover_string to disp_string.
bc17a887 10061
4ee88440
MR
100622011-11-01 Martin Rudalics <rudalics@gmx.at>
10063
10064 * window.c (temp_output_buffer_show): Don't use
10065 Vtemp_buffer_show_specifiers.
10066 (Vtemp_buffer_show_specifiers): Remove unused variable.
10067
c2ff3c02
EZ
100682011-10-30 Eli Zaretskii <eliz@gnu.org>
10069
10070 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
10071 past the beginning of the current glyph matrix.
10072
58179cce 100732011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
10074
10075 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
10076 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
10077 HAVE_GTK3 (Bug#9869).
b77a6a7f 10078
3b574623
JD
10079 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
10080 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
10081
b77a6a7f
JD
10082 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
10083
10084 * xterm.c: Declare x_handle_net_wm_state to return int.
10085 (handle_one_xevent): Check if we are iconified but don't have
10086 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
10087 (get_current_wm_state): Return non-zero if not hidden,
10088 check for _NET_WM_STATE_HIDDEN (Bug#9893).
10089 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
10090 (x_handle_net_wm_state): Return what get_current_wm_state returns.
10091 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
10092
196e41e4
PE
100932011-10-29 Paul Eggert <eggert@cs.ucla.edu>
10094
10095 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
10096 so that this new function doesn't get optimized away by a
10097 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
10098
021f2e1a
AS
100992011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10100
10101 * frame.h (MOUSE_HL_INFO): Remove excess parens.
10102
8b058d44
EZ
101032011-10-29 Eli Zaretskii <eliz@gnu.org>
10104
10105 Fix the `xbytecode' command.
10106 * .gdbinit (xprintbytestr): New command.
b50a28de 10107 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
10108 (xbytecode): Print the byte-code string as well.
10109
4452fb80
EZ
101102011-10-29 Kim Storm <storm@cua.dk>
10111
8b058d44
EZ
10112 * alloc.c (which_symbols): New function.
10113
21b72067
AS
101142011-10-29 Andreas Schwab <schwab@linux-m68k.org>
10115
10116 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
10117 line. (Bug#9903)
10118
83ed7b5c
GM
101192011-10-29 Glenn Morris <rgm@gnu.org>
10120
10121 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
10122 Not clear what it was for, and it causes various bugs. (Bug#9839)
10123
5a7a728b
EZ
101242011-10-28 Eli Zaretskii <eliz@gnu.org>
10125
10126 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
10127 possible random value that matches one of those tested as
10128 condition to clear the mouse face.
10129
d3d0842f
CY
101302011-10-28 Chong Yidong <cyd@gnu.org>
10131
10132 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10133
31b39d13
DN
101342011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
10135
10136 * window.c (make_window): Initialize phys_cursor_on_p.
10137
9aba6043
SM
101382011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
10139
10140 * lisp.h (struct Lisp_Symbol): Update comments.
10141
c20992f4
JB
101422011-10-28 Juanma Barranquero <lekktu@gmail.com>
10143
10144 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
10145
db4f02f2
EZ
101462011-10-28 Eli Zaretskii <eliz@gnu.org>
10147
10148 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
10149 <oslsachem@gmail.com> for helping to debug this.
10150
10151 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
10152 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
10153 (g_b_init_get_glyph_outline_w): New static variables.
10154 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
10155 (GetGlyphOutlineW_Proc): New typedefs.
10156 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
10157 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
10158 New functions.
10159 (w32font_open_internal, compute_metrics):
10160 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
10161 instead of calling the "wide" APIs directly.
10162
10163 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
10164
10165 * w32.h (syms_of_w32font): Add prototype.
10166
87e68db4
JB
101672011-10-27 Juanma Barranquero <lekktu@gmail.com>
10168
10169 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
10170 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
10171 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
10172 (Fmove_to_window_line): Doc fix.
10173
435c1d67
CY
101742011-10-27 Chong Yidong <cyd@gnu.org>
10175
10176 * process.c (make_process): Set gnutls_state to NULL.
10177
10178 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
10179 non-NULL, regardless of GNUTLS_INITSTAGE.
10180 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
10181 an error. Set process slots as soon as we allocate them.
10182
10183 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
10184
9c6c6f49
CY
101852011-10-27 Chong Yidong <cyd@gnu.org>
10186
9aba6043
SM
10187 * gnutls.c (emacs_gnutls_deinit): New function.
10188 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
10189 (Fgnutls_deinit, Fgnutls_boot): Use it.
10190
10191 * process.c (make_process): Initialize GnuTLS credentials to NULL.
10192 (deactivate_process): Call emacs_gnutls_deinit.
10193
657d08d3
JB
101942011-10-27 Juanma Barranquero <lekktu@gmail.com>
10195
10196 * image.c (x_create_x_image_and_pixmap):
10197 * w32.c (sys_rename, w32_delayed_load):
10198 * w32font.c (fill_in_logfont):
10199 * w32reg.c (x_get_string_resource): Silence compiler warnings.
10200
5430d399
JB
102012011-10-26 Juanma Barranquero <lekktu@gmail.com>
10202
10203 * w32fns.c (w32_default_color_map): New function,
10204 extracted from Fw32_default_color_map.
a7ef684b 10205 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 10206
fe0055fa
PE
102072011-10-25 Paul Eggert <eggert@cs.ucla.edu>
10208
10209 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
10210
e6346438
SM
102112011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
10212
10213 * keyboard.c (test_undefined): New function (bug#9751).
10214 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
10215
e112cc37
ET
102162011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
10217
10218 * sysdep.c (init_sys_modes): Fix the check for the controlling
10219 terminal (Bug#6649).
10220
7b5d6677
EZ
102212011-10-20 Eli Zaretskii <eliz@gnu.org>
10222
10223 * dispextern.h (struct bidi_it): New member next_en_type.
10224
10225 * bidi.c (bidi_line_init): Initialize the next_en_type member.
10226 (bidi_resolve_explicit_1): When next_en_pos is valid for the
10227 current character, check also for next_en_type being WEAK_EN.
10228 (bidi_resolve_weak): Don't enter the expensive loop if the current
10229 position is before next_en_pos. Record the bidi type of the first
10230 non-ET, non-BN character we find, in addition to its position.
10231 (bidi_level_of_next_char): Invalidate next_en_type when
10232 next_en_pos is over-stepped.
10233
7da0b018
PE
102342011-10-20 Paul Eggert <eggert@cs.ucla.edu>
10235
10236 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
10237 * editfns.c: Rewrite current-time-zone so that it invokes
10238 the equivalent of (format-time-string "%Z") to get the time zone name.
10239 This fixes a bug when the time zone name contains characters that
10240 need converting from the system time locale to Emacs internal format.
10241 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
10242 that patch fixed format-time-string to do the conversion, but
10243 I forgot to fix current-time-zone.
10244 (format_time_string): New function, containing most of
10245 what Fformat_time_string used to contain.
10246 (Fformat_time_string): Rewrite in terms of format_time_string.
10247 This doesn't change this function's behavior.
10248 (current-time-zone): Rewrite to use format_time_string.
10249 This fixes the bug reported by Michael Schierl in
10250 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
10251 Jason Rumney's 2007-06-07 change worked around this bug, but
10252 didn't fix it.
10253 * systime.h (tzname, timezone): Remove no-longer-used declarations.
10254
8547b010
EZ
102552011-10-19 Eli Zaretskii <eliz@gnu.org>
10256
10257 * xdisp.c (start_display): If the character at POS is displayed
10258 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
10259 (try_window_reusing_current_matrix): If a line ends in a display
10260 vector or the next line starts in a display vector, continue
10261 redrawing the window even though the character position of
10262 start_row was reached.
8547b010
EZ
10263 (Bug#9771, part 2)
10264
4e948d15
CY
102652011-10-18 Chong Yidong <cyd@gnu.org>
10266
10267 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
10268 with nobreak-char-display too.
10269
4787455f
EZ
102702011-10-18 Eli Zaretskii <eliz@gnu.org>
10271
10272 Fix part 3 of bug#9771.
10273 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
10274 (bidi_resolve_neutral): Don't enter the expensive loop looking for
10275 non-neutral characters if the current character is a paragraph
10276 separator (a.k.a. Newline). This avoids running the same
10277 expensive loop twice, once when we consume the preceding newline
10278 and the other time when the line actually needs to be displayed.
10279 Avoid the loop when we see neutrals on the base embedding level
10280 following a character whose directionality is the same as the
10281 paragraph's. This avoids running the expensive loop when a line
10282 ends in a long sequence of neutrals, like control characters.
10283 Add assertion against STRONG_AL type. Slightly rearrange code
10284 that determines the type of a neutral given the first non-neutral
10285 that follows it.
10286 (bidi_level_of_next_char): Set next_en_pos to zero when
10287 invalidating its info.
10288
2c91f553
EZ
102892011-10-17 Eli Zaretskii <eliz@gnu.org>
10290
10291 * xdisp.c (push_display_prop): Determine whether to record string
10292 or buffer position by IT->string, not by IT->method. Allow
10293 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
10294 (move_it_vertically_backward): Don't look for character position
10295 immediately after the newline when in a continuation line.
10296 (Bug#9771, part 1)
2c91f553 10297
c7b08b0d
MR
102982011-10-15 Martin Rudalics <rudalics@gmx.at>
10299
10300 * window.c (coordinates_in_window): Rewrite and delabelize
10301 vertical border check. (Bug#5357) (Bug#9618)
10302
6b02f655
SM
103032011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
10304
10305 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
10306 errors in XSetWindowBorder (bug#9310).
10307
81d40c92
DA
103082011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
10309
10310 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
10311 avoid crash when xmalloc overrun checking is enabled.
10312
d4172c3b
EZ
103132011-10-13 Eli Zaretskii <eliz@gnu.org>
10314
10315 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
10316 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
10317 cursor motion with <left> and <right> arrow keys.
10318
10319 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
10320 some callers set that themselves.
10321
b00eea75
EZ
103222011-10-12 Eli Zaretskii <eliz@gnu.org>
10323
10324 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
10325 display string and the previous row comes from the same string and
10326 is empty. (Bug#9739) (Bug#9738)
10327
8fe012c4
SM
103282011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
10329
10330 * doc.c (get_doc_string): Encode file name (bug#9735).
10331
0074aef2
EZ
103322011-10-12 Eli Zaretskii <eliz@gnu.org>
10333
79beb178
EZ
10334 * bidi.c (bidi_level_of_next_char):
10335 * xdisp.c (get_visually_first_element): Remove old incorrect
10336 comments regarding the Unicode Line Separator character.
10337
0074aef2
EZ
10338 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
10339
6e4b3fbe
DA
103402011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
10341
10342 * alloc.c (Fgc_status): Do not access beyond zombies array
10343 boundary if nzombies > MAX_ZOMBIES.
10344 * alloc.c (dump_zombies): Add missing format specifier.
10345
0324f3af
PE
103462011-10-12 Paul Eggert <eggert@cs.ucla.edu>
10347
b5525cac
PE
10348 * xdisp.c (set_cursor_from_row): Simplify conditionals,
10349 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
10350
0324f3af
PE
10351 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
10352 Some packages use them to denote characters with modifiers.
10353
e9b5f888
AS
103542011-10-11 Andreas Schwab <schwab@linux-m68k.org>
10355
10356 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
10357 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
10358 matching a pp-number. Rename parameter var to var1.
10359
127827c0
SM
103602011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
10361
10362 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
10363
c8fd3bd0
GM
103642011-10-08 Glenn Morris <rgm@gnu.org>
10365
10366 * callint.c (Fcall_interactively): Give a more explicit error for the
10367 'c' case with a non-character input. (Bug#8479)
10368
352ec8ff
EZ
103692011-10-08 Eli Zaretskii <eliz@gnu.org>
10370
03669ccb
EZ
10371 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
10372 lines.
7061c986
EZ
10373 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
10374 lines that are hscrolled on the left.
03669ccb 10375
352ec8ff
EZ
10376 * dispnew.c (buffer_posn_from_coords): Account for a possible
10377 presence of header-line. (Bug#4426)
10378
a66cfb1c
SM
103792011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
10380
6b02f655
SM
10381 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
10382 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 10383
7c5ee88e
PE
103842011-10-07 Paul Eggert <eggert@cs.ucla.edu>
10385
10386 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
10387 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
10388 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
10389 this makes Emacs dump core during garbage collection on rare
10390 occasions. sizeof is obviously inferior to offsetof here, so
10391 stick with offsetof.
10392 (GC_POINTER_ALIGNMENT): New macro.
10393 (mark_memory): Omit 3rd (offset) arg; caller changed.
10394 Don't assume EMACS_INT alignment is the same as pointer alignment.
10395
df1bbe5b
SM
103962011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
10397
10398 * keyboard.c (read_key_sequence_remapped): New var.
10399 (read_key_sequence): Compute remapping in the right buffer.
10400 (command_loop_1): Use read_key_sequence's remapping directly.
10401
51553db6
SM
104022011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
10403
32c1fffd
SM
10404 * dired.c (file_name_completion): Don't expand file name.
10405 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
10406 before checking file name handler.
10407
51553db6
SM
10408 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
10409 they've been requested explicitly (bug#9591).
10410
b6bd1599 104112011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
10412
10413 * keymap.c (Fsingle_key_description): Use make_specified_string
10414 instead of build_string to build string from push_key_description.
10415 (Bug#5193)
10416
f701dc2a
PE
104172011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10418
4222c55d
PE
10419 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
10420 This fixes a Y2038 bug on 64-bit hosts.
10421 * buffer.c (reset_buffer):
10422 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
10423 (Fclear_buffer_auto_save_failure):
10424 Use 0, not -1, to represent an unset failure time, since time_t
10425 might not be signed.
10426
f701dc2a
PE
10427 Remove dependency on glibc malloc internals.
10428 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10429 Move back here from lisp.h, but with their new implementations.
10430 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10431 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
10432 * charset.c (charset_table_init): New static var.
10433 (syms_of_charset): Use it instead of xmalloc. This removes a
10434 dependency on glibc malloc internals. See Eli Zaretskii's comment in
10435 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
10436 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10437 Move back to alloc.c.
10438 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10439 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
10440
9ceebf39
JD
104412011-09-30 Jan Djärv <jan.h.d@swipnet.se>
10442
10443 * nsterm.m (windowDidResize): Call x_set_window_size only when
10444 ns_in_resize is true. Otherwise set pixelwidth/height and
10445 call change_frame_size (Bug#9628).
10446
cb993c58
PE
104472011-09-30 Paul Eggert <eggert@cs.ucla.edu>
10448
3930c88b
PE
10449 Port --enable-checking=all to Fedora 14 x86-64.
10450 * charset.c (syms_of_charset): Also account for glibc malloc's
10451 internal overhead when calculating the initial malloc maximum.
10452
cb993c58
PE
10453 Port --enable-checking=all to Fedora 14 x86.
10454 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10455 Move to lisp.h.
10456 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
10457 (overrun_check_realloc, overrun_check_free):
10458 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
10459 That way, xmalloc returns a properly-aligned pointer even if
10460 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
10461 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
10462 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
10463 into account when calculating the initial malloc maximum.
10464 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
10465 Move here from alloc.c, so that charset.c can use it too.
10466 Properly align; the old code wasn't right for common 32-bit hosts
10467 when configured with --enable-checking=all.
10468 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
10469 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
10470
31bed486
EZ
104712011-09-29 Eli Zaretskii <eliz@gnu.org>
10472
04c70788 10473 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
10474 use EDOM.
10475
fbcaa2f3
EZ
104762011-09-28 Eli Zaretskii <eliz@gnu.org>
10477
10478 * xdisp.c (compute_display_string_end): If there's no display
10479 string at CHARPOS, return -1.
10480
10481 * bidi.c (bidi_fetch_char): When compute_display_string_end
10482 returns a negative value, treat the character as a normal
10483 character not covered by a display string. (Bug#9624)
10484
a239d4e9
JB
104852011-09-28 Juanma Barranquero <lekktu@gmail.com>
10486
10487 * lread.c (Fread_from_string): Fix typo in docstring.
10488
88652fd5
EZ
104892011-09-27 Eli Zaretskii <eliz@gnu.org>
10490
10491 * xdisp.c (handle_invisible_prop): If invisible text ends on a
10492 newline, reseat the iterator instead of bidi-iterating there one
10493 character at a time. (Bug#9610)
32c1fffd
SM
10494 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
10495 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 10496
ed497dd4
AS
104972011-09-27 Andreas Schwab <schwab@linux-m68k.org>
10498
10499 * lread.c (readevalloop): Use correct code for NBSP.
10500 (read1): Likewise. (Bug#9608)
10501
b2bf61aa
MA
105022011-09-25 Michael Albinus <michael.albinus@gmx.de>
10503
10504 * dbusbind.c (Fdbus_register_signal): When service is not
10505 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
10506
32bbb17c
GM
105072011-09-25 Glenn Morris <rgm@gnu.org>
10508
10509 * buffer.c (truncate-lines): Doc fix.
10510
94e0933e
CY
105112011-09-24 Chong Yidong <cyd@stupidchicken.com>
10512
10513 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
10514 (Fset_window_next_buffers): Doc fix.
10515
cddde921
GM
105162011-09-24 Glenn Morris <rgm@gnu.org>
10517
10518 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
10519
1260aef1
PE
105202011-09-24 Paul Eggert <eggert@cs.ucla.edu>
10521
25b4bfa0
PE
10522 Fix minor problems found by static checking.
10523 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
10524 * indent.c (Fvertical_motion): Fix == vs = typo.
10525
e3cbd34b
EZ
105262011-09-24 Eli Zaretskii <eliz@gnu.org>
10527
a66cfb1c
SM
10528 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
10529 Default value is now t. Doc fix.
6bf7006f 10530
e3cbd34b 10531 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 10532 logic when moving up, not only when moving down. Fix the
e3cbd34b 10533 confusing name and values of the it_overshoot_expected variable;
32c1fffd 10534 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
10535
10536 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
10537 CHARPOS is covered by a display string which includes newlines.
10538 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
10539 is covered by a display string with embedded newlines.
10540
a3de0cbd
MA
105412011-09-24 Michael Albinus <michael.albinus@gmx.de>
10542
10543 * dbusbind.c (Fdbus_register_signal): Add match rule to
10544 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
10545 (Fdbus_register_method, Vdbus_registered_objects_table):
10546 Fix docstring.
a3de0cbd 10547
b260039d
JM
105482011-09-24 Jim Meyering <meyering@redhat.com>
10549
32c1fffd 10550 do not ignore write error for any output size
b260039d
JM
10551 The previous change was incomplete.
10552 While it makes emacs --batch detect the vast majority of stdout
10553 write failures, errors were still ignored whenever the output size is
10554 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
10555 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
10556 && echo FAIL: ignored write error
10557 FAIL: ignored write error
10558 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
10559 && echo FAIL: ignored write error
10560 FAIL: ignored write error
10561 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
10562
8eca8a7c
AS
105632011-09-23 Andreas Schwab <schwab@linux-m68k.org>
10564
10565 * emacs.c (Fkill_emacs): In noninteractive mode exit
10566 non-successfully if a write error occurred on stdout. (Bug#9574)
10567
3341db62
EZ
105682011-09-21 Eli Zaretskii <eliz@gnu.org>
10569
10570 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
10571 the xassert test.
10572
10573 * dispextern.h (struct it): Update the comment documenting what
10574 can it->OBJECT be.
10575
8c203dbf
EZ
105762011-09-20 Eli Zaretskii <eliz@gnu.org>
10577
10578 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
10579 a display string, extend search for cursor position to end of row.
10580 (find_row_edges): If the row ends in a newline from a display
10581 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
10582 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
10583 (Fcurrent_bidi_paragraph_direction): Fix search for previous
10584 non-empty line. Fixes confusing cursor motion with arrow keys at
10585 the beginning of a line that starts with whitespace.
8c203dbf 10586
a4824228
LMI
105872011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10588
10589 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
10590 (bug#9493).
10591
33ed493b
CY
105922011-09-18 Chong Yidong <cyd@stupidchicken.com>
10593
10594 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
10595 boolean (Bug#9154).
10596
56cd55c8
EZ
105972011-09-18 Eli Zaretskii <eliz@gnu.org>
10598
10599 * xdisp.c (display_line): Record maximum and minimum buffer
10600 positions even if no glyphs were produced (e.g., by a zero-width
10601 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
10602 buffer positions that will be removed from the glyph row because
10603 they don't fit.
c02dcedf
EZ
10604 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
10605 column is beyond frame width: don't subtract 1 "pixel" when
10606 computing width of the stretch.
3e62b7e0
EZ
10607 (reseat_at_next_visible_line_start): Undo the change made on
10608 2011-09-17 that saved paragraph information and restored it after
10609 the call to `reseat'. (Bug#9545)
56cd55c8 10610
5ed99d36 106112011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
10612
10613 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
10614 and turn window cursor on if cleared (Bug#9415).
10615
5ed99d36 106162011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
10617
10618 * search.c (boyer_moore): Take unibyte characters from pattern
10619 literally. (Bug#9458)
10620
9bade7b2
EZ
106212011-09-18 Eli Zaretskii <eliz@gnu.org>
10622
10623 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
10624
e5e9d610
PE
106252011-09-18 Paul Eggert <eggert@cs.ucla.edu>
10626
87e4427a
PE
10627 Fix minor problem found by static checking.
10628 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
10629 initialized, to pacify gcc -Wuninitialized.
10630
e5e9d610
PE
10631 * fileio.c: Report proper errno when syscall falls.
10632 (Finsert_file_contents): Save and restore errno,
10633 so that report_file_error outputs the correct diagnostic.
10634 (Fwrite_region) [CLASH_DETECTION]: Likewise.
10635
a1674f0b
EZ
106362011-09-18 Eli Zaretskii <eliz@gnu.org>
10637
10638 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
10639
fbfb6dd4
EZ
106402011-09-17 Eli Zaretskii <eliz@gnu.org>
10641
10642 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
10643 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
10644
bb187662
EZ
106452011-09-17 Eli Zaretskii <eliz@gnu.org>
10646
1137e8b8 10647 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 10648 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
10649
10650 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
10651 (bidi_find_paragraph_start): Search back for paragraph beginning
10652 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
10653 (bidi_move_to_visually_next): Only trigger paragraph-related
10654 computations when the last character is a newline or at EOB, not
10655 just any NEUTRAL_B. (Bug#9470)
10656
bb187662
EZ
10657 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
10658 truncated lines if point is covered by a display string. (Bug#9524)
10659
2e621251
PE
106602011-09-16 Paul Eggert <eggert@cs.ucla.edu>
10661
10662 * xselect.c: Relax test for outgoing X longs (Bug#9498).
10663 (cons_to_x_long): New function.
10664 (lisp_data_to_selection_data): Use it. Correct the test for
10665 short-versus-long data; it was negated. Break out of vector
10666 loop, for efficiency, when a long datum is discovered.
10667
91a15bc6
SM
106682011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
10669
10670 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
10671
b41c3a35
EZ
106722011-09-16 Eli Zaretskii <eliz@gnu.org>
10673
10674 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
10675 GCC PR/17406) by declaring this function with external scope.
10676
7812ba2d
PE
106772011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10678
10679 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
10680 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
10681
cf7edc2a
AS
106822011-09-15 Andreas Schwab <schwab@linux-m68k.org>
10683
10684 * editfns.c (Fformat): Correctly handle text properties on "%%".
10685
bd01620e
EZ
106862011-09-15 Eli Zaretskii <eliz@gnu.org>
10687
10688 * xterm.c (x_draw_composite_glyph_string_foreground):
10689 * w32term.c (x_draw_composite_glyph_string_foreground):
10690 * term.c (encode_terminal_code):
10691 * composite.c (composition_update_it, get_composition_id):
10692 * xdisp.c (get_next_display_element)
10693 (fill_composite_glyph_string): Add comments about special meaning
10694 of TAB characters in a composition.
10695
a02719a3
PE
106962011-09-15 Paul Eggert <eggert@cs.ucla.edu>
10697
10698 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
10699 This occurs when processing a multibyte format.
10700 Problem reported by Wolfgang Jenker.
a02719a3 10701
72589a3c
JB
107022011-09-15 Johan Bockgård <bojohan@gnu.org>
10703
10704 * xdisp.c (try_cursor_movement): Only check for exact match if
10705 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
10706
1c14176c
PE
107072011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10708
10709 Remove unused external symbols.
10710 * dispextern.h (calc_pixel_width_or_height): Remove decl.
10711 * xdisp.c (calc_pixel_width_or_height): Now static.
10712 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
10713 * indent.c (check_display_width):
10714 * w32term.c: Fix comment to match code.
10715 * xterm.c, xterm.h (x_catching_errors): Remove.
10716
d2eea5b5
PE
107172011-09-14 Paul Eggert <eggert@cs.ucla.edu>
10718
10719 * xselect.c: Use signed conversions more consistently (Bug#9498).
10720 (selection_data_to_lisp_data): Assume incoming selection data are
10721 signed integers, not unsigned. This is to be consistent with
10722 outgoing selection data, which was modified to use signed integers
10723 in as part of the fix to Bug#9196 in response to Jan D.'s comment
10724 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
10725 expects long, not unsigned long.
10726
46888499
EZ
107272011-09-14 Eli Zaretskii <eliz@gnu.org>
10728
10729 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10730 computation of loop end. Reported by Johan Bockgård
10731 <bojohan@gnu.org>.
10732
ef8ef9fb
CY
107332011-09-13 Chong Yidong <cyd@stupidchicken.com>
10734
10735 * frame.c (Fother_visible_frames_p): Function deleted.
10736
fa819fed
EZ
107372011-09-12 Eli Zaretskii <eliz@gnu.org>
10738
10739 * indent.c (compute_motion): Process display vector front to back
10740 rather than the other way around. (Bug#2496)
10741
2ba8e008
SM
107422011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10743
10744 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10745
20f53c69
CY
107462011-09-11 Chong Yidong <cyd@stupidchicken.com>
10747
10748 * minibuf.c (Fread_from_minibuffer): Doc fix.
10749
d562d7a4
EZ
107502011-09-11 Eli Zaretskii <eliz@gnu.org>
10751
10752 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10753 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10754
1c4d7f3d
LMI
107552011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10756
10757 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10758 value for non-existent files.
10759
b885bf36
EZ
107602011-09-11 Eli Zaretskii <eliz@gnu.org>
10761
10762 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10763 set its "size" to -1. This will set the modtime_size field of
10764 the corresponding buffer to -1, which is what
10765 verify-visited-file-modtime expects for files that do not exist.
10766 (Bug#9139)
10767
6612f0bf
PE
107682011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10769
10770 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10771 here ...
10772 * lisp.h: ... from here. push_key_description is no longer
10773 defined in keyboard.c, so its declaration should not be in
10774 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10775 logically belongs with push_key_description.
10776
dfb3f755
PE
107772011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10778
10779 * buffer.h: Include <sys/types.h> instead of <time.h>.
10780 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10781 Problem reported by Herbert J. Skuhra.
10782
3134906c
LMI
107832011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10784
10785 * xml.c (parse_region): Make the parsing work for
10786 non-comment-starting XML files again (bug#9144).
10787
8d903f4e
AS
107882011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10789
10790 * image.c (gif_load): Fix calculation of bottom and right corner.
10791 (Bug#9468)
10792
80ad64f4
EZ
107932011-09-10 Eli Zaretskii <eliz@gnu.org>
10794
10795 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10796 redisplay in small windows.
10797
208a048d
EZ
107982011-09-09 Eli Zaretskii <eliz@gnu.org>
10799
10800 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10801
9b1c252e
MR
108022011-09-08 Martin Rudalics <rudalics@gmx.at>
10803
10804 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10805 Operate on live windows only.
10806
2949f33b
JB
108072011-09-08 Juanma Barranquero <lekktu@gmail.com>
10808
10809 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10810
e08dcafd
EZ
108112011-09-07 Eli Zaretskii <eliz@gnu.org>
10812
10813 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10814 only under bidi iteration.
10815
115b96bd
JD
108162011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10817
10818 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10819
c8199d0f
PE
108202011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10821
10822 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10823 Without this fix, the command to link temacs failed due to an
10824 undefined symbol __builtin_isnan. This is because
10825 /usr/include/iso/math_c99.h #defines isnan(x) to
10826 __builtin_isnan(x), but the bundled gcc, which identifies itself
10827 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10828 a __builtin_isnan.
10829 * floatfns.c (isnan): #undef, and then #define to a clone of
10830 what's in data.c.
10831 (Fisnan): Always define, since it's always available now.
10832 (syms_of_floatfns): Always define isnan at the Lisp level.
10833
e39b275c 108342011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
10835
10836 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10837
b2db44d9 108382011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 10839
f4af5137 10840 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
10841 The previous code assumed that file offsets (off_t values) fit in
10842 EMACS_INT variables, which is not true on typical 32-bit hosts.
10843 The code messed up by falsely reporting buffer overflow in cases
10844 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10845 when "big" contains more than 2**29 bytes, even though this
10846 inserts just one byte and does not overflow the buffer.
10847 (Finsert_file_contents): Store file offsets as off_t
10848 values, not as EMACS_INT values. Check for overflow when
10849 converting between EMACS_INT and off_t. When checking for
10850 buffer overflow or for overlap, take the offsets into account.
10851 Don't use EMACS_INT for small values where int suffices.
10852 When checking for overlap, fix a typo: ZV was used where
10853 ZV_BYTE was intended.
10854 (Fwrite_region): Don't assume off_t fits into 'long'.
10855 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10856
ecfc0a49
MA
108572011-09-05 Michael Albinus <michael.albinus@gmx.de>
10858
10859 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10860
6511acf2 108612011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 10862
0999621a 10863 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
10864
10865 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 10866 (esprintf, exprintf, evxprintf): New functions.
62f19c19 10867 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 10868 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
10869 (modify_event_symbol): Do not assume that the length of
10870 name_alist_or_stem is safe to alloca and fits in int.
10871 (Fexecute_extended_command): Likewise for function name and binding.
10872 (Frecursion_depth): Wrap around reliably on integer overflow.
10873 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10874 since some callers pass EMACS_INT values.
10875 (Fsingle_key_description): Don't crash if symbol name contains more
10876 than MAX_ALLOCA bytes.
10877 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10878 (get_minibuffer): Arg is now EMACS_INT, not int.
10879 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 10880 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
10881 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10882
2be7d702
PE
10883 * dbusbind.c (signature_cat): New function.
10884 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
10885 Do not overrun buffer; instead, report string overflow.
10886
9d1df220
PE
10887 * dispnew.c (add_window_display_history): Don't overrun buffer.
10888 Truncate instead; this is OK since it's just a log.
10889
33ef5c64
PE
10890 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10891 even if the time zone offset is outlandishly large.
10892 Don't mishandle offset == INT_MIN.
10893
66c6fdd5
PE
10894 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10895 when creating daemon; the previous buffer-overflow check was incorrect.
10896
d749b01b
PE
10897 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10898 which has the guts of the old verror function.
10899
b5cd1905
PE
10900 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10901 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10902
6e1a67fb
PE
10903 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10904 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 10905 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 10906 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
10907 length of string rather than counting it via multiple sprintfs;
10908 that's simpler and more reliable.
c21721cc
PE
10909 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10910 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10911 sprintf, in case result does not fit in int.
10912
c57b67fc
PE
10913 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10914 (fontset_from_font): Print it.
10915
8a401434
PE
10916 * frame.c (tty_frame_count): Now printmax_t, not int.
10917 (make_terminal_frame, set_term_frame_name): Print it.
10918 (x_report_frame_params): In X, window IDs are unsigned long,
10919 not signed long, so print them as unsigned.
10920 (validate_x_resource_name): Check for implausibly long names,
10921 and don't assume name length fits in 'int'.
10922 (x_get_resource_string): Don't blindly alloca invocation name;
10923 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10924 not fit in int.
10925
6e1a67fb
PE
10926 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10927 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
10928 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10929
0df02bf3
PE
10930 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10931 Use esprintf, not sprintf, in case result does not fit in int.
10932
48e30793
PE
10933 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10934 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10935 it as a large positive number.
10936 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10937 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10938
a66ff6d8
PE
10939 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10940 in case result does not fit in int.
10941
aca216ff
PE
10942 * print.c (float_to_string): Detect width overflow more reliably.
10943 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10944 buffer overrun. Don't assume list length fits in 'int'. Treat
10945 print length of 0 as 0, not as infinity; to be consistent with other
10946 uses of print length in this function. Don't overflow print length
10947 index. Don't assume hash table size fits in 'long', or that
10948 vectorlike size fits in 'unsigned long'.
10949
31c286f7
PE
10950 * process.c (make_process): Use printmax_t, not int, to format
10951 process-name gensyms.
10952
55e5faa1
PE
10953 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10954
80f2e268
PE
10955 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10956 to avoid potential buffer overrun.
10957
670741ab
PE
10958 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10959 if X resource line is longer than 512 bytes.
10960
b7163a50
PE
10961 * xfns.c (x_window): Make sprintf buffer a bit bigger
10962 to avoid potential buffer overrun.
10963
ae58ff1f
PE
10964 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10965
c43c8a6a
PE
10966 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10967
3f8236f4
PE
109682011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10969
53e9fe90 10970 Integer overflow fixes for scrolling, etc.
6511acf2
PE
10971 Without these, Emacs silently mishandles large integers sometimes.
10972 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
10973 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10974
6511acf2
PE
10975 * xdisp.c (try_window_id): Check Emacs fixnum range before
10976 converting to 'int'.
806add1d 10977
6511acf2 10978 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
10979 Check that an Emacs fixnum is in range before assigning it to 'int'.
10980 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10981 values converted from Emacs fixnums.
10982 (Frecenter): Don't wrap around a line count if it is out of 'int'
10983 range; instead, treat it as an extreme value.
10984 (Fset_window_configuration, compare_window_configurations):
10985 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10986
6511acf2
PE
10987 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10988 that can exceed INT_MAX. Check that EMACS_INT value is in range
10989 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
10990 (match_limit): Don't assume that a fixnum can fit in 'int'.
10991
6511acf2 10992 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
10993 exceed INT_MAX.
10994
6511acf2 10995 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
10996 (Fvertical_motion): Don't wrap around LINES values that don't fit
10997 in 'int'. Instead, treat them as extreme values. This is good
10998 enough for windows, which can't have more than INT_MAX lines anyway.
10999
fcb901a7
LMI
110002011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11001
0f2f6b6d
LMI
11002 * Require libxml/parser.h to avoid compilation warning.
11003
fcb901a7
LMI
11004 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11005
11006 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11007 since this reportedly can destroy thread storage.
11008
6e20a0d4
CY
110092011-08-30 Chong Yidong <cyd@stupidchicken.com>
11010
11011 * syntax.c (find_defun_start): Update all cache variables if
11012 exiting early (Bug#9401).
11013
148ae00e
EZ
110142011-08-30 Eli Zaretskii <eliz@gnu.org>
11015
f6cfbd8f
EZ
11016 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
11017
148ae00e
EZ
11018 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
11019 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
11020 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
11021
11022 * term.c (tty_append_glyph): New function.
11023 (produce_stretch_glyph): Static function and its prototype deleted.
11024
a66cfb1c
SM
11025 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
11026 Add prototypes.
148ae00e 11027
c4a07a4c
PE
110282011-08-29 Paul Eggert <eggert@cs.ucla.edu>
11029
11030 * image.c (parse_image_spec): Check for nonnegative, not for positive,
11031 when checking :margin (Bug#9390).
11032 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 11033 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
11034 so that the name doesn't mislead. All uses changed.
11035
6bc8cd65
JB
110362011-08-28 Johan Bockgård <bojohan@gnu.org>
11037
11038 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
11039 set_tty_hooks.
11040
dca4927e
EZ
110412011-08-27 Eli Zaretskii <eliz@gnu.org>
11042
11043 * xdisp.c (move_it_to): Don't bail out early when reaching
11044 position beyond to_charpos, if we are scanning backwards.
11045 (move_it_vertically_backward): When DY == 0, make sure we get to
11046 the first character in the line after the newline.
11047
f2cad773
PE
110482011-08-27 Paul Eggert <eggert@cs.ucla.edu>
11049
11050 * ccl.c: Improve and simplify overflow checking (Bug#9196).
11051 (ccl_driver): Do not generate an out-of-range pointer.
11052 (Fccl_execute_on_string): Remove unnecessary check for
11053 integer overflow, noted by Stefan Monnier in
11054 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
11055 Remove a FIXME that didn't need fixing.
11056 Simplify the newly-introduced buffer reallocation code.
11057
0cae2cdb
JB
110582011-08-27 Juanma Barranquero <lekktu@gmail.com>
11059
11060 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
11061
5fc295a4 110622011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 11063
70c60eb2 11064 Integer and memory overflow issues (Bug#9196).
726e0ab1 11065
d31850da
PE
11066 * doc.c (get_doc_string): Rework so that
11067 get_doc_string_buffer_size is the actual buffer size, rather than
11068 being 1 less than the actual buffer size; this makes xpalloc more
11069 convenient.
11070
a69fbedb
PE
11071 * image.c (x_allocate_bitmap_record, cache_image):
11072 * xselect.c (Fx_register_dnd_atom):
11073 Simplify previous changes by using xpalloc.
11074
fe5c5d37
PE
11075 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
11076 since either will do and ptrdiff_t is convenient with xpalloc.
11077
0065d054
PE
11078 * charset.c (charset_table_size)
11079 (struct charset_sort_data.priority): Now ptrdiff_t.
11080 (charset_compare): Don't overflow if priorities differ greatly.
11081 (Fsort_charsets): Don't assume list length fits in int.
11082 Check for size-calculation overflow when allocating sort data.
11083 (syms_of_charset): Allocate an initial charset table that is
11084 just under 64 KiB, to avoid problems with glibc malloc and mmap.
11085
11086 * cmds.c (internal_self_insert): Check for size-calculation overflow.
11087
11088 * composite.h (struct composition.glyph_len): Now int, not unsigned.
11089 The actual value is always <= INT_MAX, and leaving it unsigned made
11090 overflow checking harder.
11091
11092 * dispextern.h (struct glyph_matrix.rows_allocated)
11093 (struct face_cache.size): Now ptrdiff_t, for convenience in use
11094 with xpalloc. The values are still always <= INT_MAX.
11095
11096 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
11097
11098 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
11099 (SAFE_NALLOCA): New macro.
11100
11101 * region-cache.c (struct boundary.pos, find_cache_boundary)
11102 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
11103 (set_cache_region, invalidate_region_cache)
11104 (revalidate_region_cache, know_region_cache, region_cache_forward)
11105 (region_cache_backward, pp_cache):
11106 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
11107 so that ptrdiff_t * can be passed to xpalloc.
11108 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
11109 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
11110 (pp_cache): Don't assume cache_len fits in int.
11111 * region-cache.h: Adjust extern decls to match.
11112
11113 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
11114 EMACS_INT, since either will do, for xpalloc.
11115
11116 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
11117 (xnmalloc, xnrealloc, xpalloc): New functions.
11118
726e0ab1
PE
11119 * bidi.c (bidi_shelve_header_size): New constant.
11120 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
11121 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
11122
51f30bc5 11123 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
11124 * buffer.c (overlays_at, overlays_in, record_overlay_string)
11125 (overlay_strings):
11126 Don't update size of array until after memory allocation succeeds,
11127 because xmalloc/xrealloc may not return.
0065d054
PE
11128 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
11129 now that we have proper integer overflow checking.
11130 (record_overlay_string, overlay_strings): Catch overflows when
11131 calculating size of overlay_str_buf.
726e0ab1 11132
0065d054
PE
11133 * callproc.c (Fcall_process): Check for size overflow when
11134 calculating size of args2.
11135 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
11136 Normally we prefer signed values, but sticking with ptrdiff_t would
11137 require adding more-complicated checks.
726e0ab1
PE
11138
11139 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
11140 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
11141 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 11142 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
11143
11144 * character.c (Fstring): Check for size-calculation overflow.
11145
11146 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
11147 unnecessary integer overflow. Check for size overflow.
11148 (encode_coding_object): Don't update size until xmalloc succeeds.
11149
11150 * composite.c (get_composition_id): Check for overflow in glyph
11151 length calculations.
11152
11153 Integer and memory overflow fixes for display code.
11154 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
11155 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
11156 (scrolling_window): Check for overflow in size calculations.
11157 (line_draw_cost, realloc_glyph_pool, add_row_entry):
11158 Don't assume glyph table len fits in int.
11159 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
11160 (row_table_size): Now ptrdiff_t, not int.
11161 (scrolling_window): Avoid overflow in size calculations.
11162 Don't update size until allocation succeeds.
11163 * fns.c (concat): Check for overflow in size calculations.
11164 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
11165 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11166 (NEXT_ALMOST_PRIME_LIMIT): New constant.
11167
11168 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
11169 (get_doc_string): Check for size calculation overflow.
11170 Don't update size until allocation succeeds.
11171 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
11172 EMACS_INT, where ptrdiff_t will do.
11173 (Fsubstitute_command_keys): Check for string overflow.
11174
11175 * editfns.c (set_time_zone_rule): Don't assume environment length
11176 fits in int.
11177 (message_length): Now ptrdiff_t, not int.
11178 (Fmessage_box): Don't update size until allocation succeeds.
11179 Don't assume message length fits in int.
11180 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
11181
0065d054
PE
11182 * emacs.c (main): Do not reallocate argv, since there is a null at
11183 the end that can be overwritten, and this way there's no need to
11184 worry about size-calculation overflow.
11185 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
11186
11187 * eval.c (init_eval_once, grow_specpdl): Don't update size until
11188 alloc succeeds.
11189 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
11190
11191 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
11192 (x_set_scroll_bar_width, x_figure_window_size):
11193 Check for integer overflow.
11194 (x_set_alpha): Do not assume XINT fits in int.
11195
11196 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
11197 This is for the members text_lines, text_cols, total_lines, total_cols,
11198 where the system imposes an 'int' limit.
11199
11200 * fringe.c (Fdefine_fringe_bitmap):
11201 Don't update size until alloc works.
11202
11203 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
11204 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
11205
11206 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
11207 Check for size-calculation overflow.
11208 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
11209 do, as we prefer signed integers.
11210 (id_to_widget.max_size, id_to_widget.used)
11211 (xg_store_widget_in_map, xg_remove_widget_from_map)
11212 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
11213 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
11214 Use and return ptrdiff_t, not int.
11215 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
11216 * gtkutil.h: Change prototypes to match the above.
11217
11218 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
11219 are duplicate now that they've been promoted to lisp.h.
11220 (x_allocate_bitmap_record, x_alloc_image_color)
11221 (make_image_cache, cache_image, xpm_load):
11222 Don't update size until alloc is done.
11223 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
11224 (x_detect_edges):
3256efce 11225 Check for size calculation overflow.
726e0ab1
PE
11226 (ct_colors_allocated_max): New constant.
11227 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
11228 overflow.
3256efce 11229
726e0ab1
PE
11230 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
11231 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
11232 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
11233 Use ptrdiff_t, not int, to count maps.
11234 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
11235 calculations. Don't update size until allocation succeeds.
11236 Redo calculations to avoid overflow.
726e0ab1
PE
11237 * keyboard.h: Change prototypes to match the above.
11238
11239 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
11240 to count maps.
11241 (current_minor_maps): Check for size calculation overflow.
11242 * keymap.h: Change prototypes to match the above.
11243
11244 * lread.c (read1, init_obarray): Don't update size until alloc done.
11245
11246 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
11247 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
11248
726e0ab1
PE
11249 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
11250 Now ptrdiff_t, not int.
11251 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
11252 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
11253
11254 * process.c (Fnetwork_interface_list): Check for overflow
11255 in size calculation.
11256
11257 * region-cache.c (move_cache_gap): Check for size calculation overflow.
11258
11259 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
11260 overflow. Don't bother calling xmalloc when xrealloc will do.
11261
11262 * search.c (Freplace_match): Check for size calculation overflow.
11263 (Fset_match_data): Don't assume list lengths fit in 'int'.
11264
11265 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
11266 for command line length. Do not attempt to address one before the
11267 beginning of an array, as that's not portable.
11268
11269 * term.c (max_frame_lines): Remove; unused.
11270 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
11271 not int.
11272 (encode_terminal_code, calculate_costs): Check for size
11273 calculation overflow.
11274 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
11275 table lengths and related sizes. Don't update size until alloc
11276 done. Redo calculations to avoid overflow.
11277 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
11278
11279 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
11280 subtracting pointers.
11281 (gobble_line): Check for overflow more carefully. Don't update size
11282 until alloc done.
11283
11284 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
11285 Don't update size until alloc done.
11286 Redo size calculations to avoid overflow.
11287 Check for size calculation overflow.
0065d054 11288 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
11289
11290 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
11291 Use ptrdiff_t, not int, for sizes.
11292 (store_mode_line_noprop_char): Don't update size until alloc done.
11293
0065d054
PE
11294 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
11295 Use ptrdiff_t, not int, for sizes.
11296 (Finternal_make_lisp_face, cache_face):
11297 Check for size calculation overflow.
11298 (cache_face): Treat size calculation overflows as if they were
11299 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
11300
11301 * xfns.c (x_encode_text, x_set_name_internal)
11302 (Fx_change_window_property): Use ptrdiff_t, not int, to count
11303 sizes, since they can exceed INT_MAX in size. Check for size
11304 calculation overflow.
11305
0065d054
PE
11306 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
11307 (xg_select): Check for size calculation overflow.
726e0ab1
PE
11308 Don't update size until alloc done.
11309
0065d054 11310 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 11311 as sprintf is limited to int lengths.
1d526e2f 11312
252c5ee1
PE
11313 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
11314 (X_LONG_MIN): New macros.
864d7ce7
PE
11315 Use them to make the following changes clearer.
11316 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
11317 This change doesn't affect the value now, but it may help remind
11318 future maintainers not to raise the value too much later.
11319 (SELECTION_QUANTUM): Remove, replacing with ...
11320 (selection_quantum): ... new function, which avoids overflow.
11321 All uses changed.
11322 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
11323 assumption that selection length fits in 'int'.
11324 (x_reply_selection_request, x_handle_selection_request)
11325 (x_get_window_property, receive_incremental_selection)
11326 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
11327 (lisp_data_to_selection_data, clean_local_selection_data):
11328 Use ptrdiff_t, not int, to record length of selection.
11329 (x_reply_selection_request, x_get_window_property)
11330 (receive_incremental_selection, x_property_data_to_lisp):
11331 Redo calculations to avoid overflow.
11332 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 11333 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
11334 something.
11335 (x_get_window_property, receive_incremental_selection)
11336 (lisp_data_to_selection_data, x_property_data_to_lisp):
11337 Check for size-calculation overflow.
11338 (x_get_window_property, receive_incremental_selection)
11339 (lisp_data_to_selection_data, Fx_register_dnd_atom):
11340 Don't store size until memory allocation succeeds.
11341 (x_get_window_property): Plug memory leak on memory exhaustion.
11342 Don't double-block input; malloc is safe here. Don't assume 2**34
11343 - 4 fits in unsigned long. Add an xassert to check
11344 XGetWindowProperty overflow. Be more careful about overflow
11345 calculations, and distinguish size from memory overflow better.
11346 (receive_incremental_selection): When tracing, don't assume
11347 unsigned int is less than INT_MAX.
11348 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
11349 harmful) conversions of unsigned short to int.
11350 (lisp_data_to_selection_data): Don't assume that integers
11351 in the range -65535 through -1 fit in an X unsigned short.
11352 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
11353 result parameters unless successful. Rely on cons_to_unsigned
11354 to report problems with elements; the old code wasn't right anyway.
11355 (x_check_property_data): Check for int overflow; we cannot use
11356 a wider type due to X limits.
11357 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
11358
726e0ab1 11359 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 11360
0065d054
PE
11361 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
11362 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
11363 (x_color_cells): Don't store size until memory allocation succeeds.
11364 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 11365 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
11366 (x_term_init): Don't assume length fits in int (sprintf is limited
11367 to int size).
bc18e09d 11368
ebfa62c0
PE
11369 Use ptrdiff_t for composition IDs.
11370 * character.c (lisp_string_width):
11371 * composite.c (composition_table_size, n_compositions)
11372 (get_composition_id, composition_gstring_from_id):
11373 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
11374 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
11375 * window.c (Frecenter):
11376 Use ptrdiff_t, not int, for composition IDs.
11377 * composite.c (get_composition_id): Check for integer overflow.
11378 * composite.h: Adjust prototypes to match the above changes.
11379
d3411f89
PE
11380 Use ptrdiff_t for hash table indexes.
11381 * category.c (hash_get_category_set):
11382 * ccl.c (ccl_driver):
11383 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
11384 * coding.c (coding_system_charset_list, detect_coding_system):
11385 * coding.h (struct coding_system.id):
11386 * composite.c (get_composition_id, gstring_lookup_cache):
11387 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
11388 * image.c (xpm_get_color_table_h):
11389 * lisp.h (hash_lookup, hash_put):
11390 * minibuf.c (Ftest_completion):
11391 Use ptrdiff_t for hash table indexes, not int (which is too
11392 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
11393 32-bit --with-wide-int hosts).
11394
e097a6fa
PE
11395 * charset.c (Fdefine_charset_internal): Check for integer overflow.
11396 Add a FIXME comment about memory leaks.
11397 (syms_of_charset): Don't assume xmalloc returns.
11398
5637687f
PE
11399 Don't assume that stated character widths fit in int.
11400 * character.c (Fchar_width, c_string_width, lisp_string_width):
11401 * character.h (CHAR_WIDTH):
11402 * indent.c (MULTIBYTE_BYTES_WIDTH):
11403 Use sanitize_char_width to avoid undefined and/or bad behavior
11404 with outlandish widths.
a66cfb1c 11405 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
11406 now that we have two such functions. All uses changed.
11407 (sanitize_char_width): New inline function.
11408
a2271ba2
PE
11409 Don't assume that tab-width fits in int.
11410 * character.h (sanitize_width): New inline function.
11411 (SANE_TAB_WIDTH): New macro.
11412 (ASCII_CHAR_WIDTH): Use it.
11413 * indent.c (sane_tab_width): Remove. All uses replaced by
11414 SANE_TAB_WIDTH (current_buffer).
11415 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
11416
18c52557
PE
11417 * fileio.c: Integer overflow issues with file modes.
11418 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
11419
caeeedc1
PE
11420 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
11421 Remove unreachable code.
11422 (read_hex, load_charset_map_from_file): Check for integer overflow.
11423
6df6ae42 11424 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
11425 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
11426 (x_send_scroll_bar_event): Likewise. Check that the size does not
11427 exceed limits imposed by XClientMessageEvent, as well as the usual
11428 ptrdiff_t and size_t limits.
11429
b13995db
PE
11430 * keyboard.c: Overflow, signedness and related fixes.
11431 (make_lispy_movement): Use same integer type in forward decl
11432 that is used in the definition.
11433 (read_key_sequence, keyremap_step):
11434 Change bufsize argument back to int, undoing my 2011-03-30 change.
11435 We prefer signed types, and int is wide enough here.
11436 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
11437 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
11438 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
11439 length, not size_t. Use ptrdiff_t for index, not int.
11440 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
11441 possibility of integer overflow.
11442
13464394
PE
11443 Overflow, signedness and related fixes for images.
11444
11445 * dispextern.h (struct it.stack[0].u.image.image_id)
11446 (struct_it.image_id, struct image.id, struct image_cache.size)
11447 (struct image_cache.used, struct image_cache.ref_count):
11448 * gtkutil.c (update_frame_tool_bar):
11449 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
11450 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
11451 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
11452 * nsmenu.m (update_frame_tool_bar):
11453 * xdisp.c (calc_pixel_width_or_height):
11454 * xfns.c (image_cache_refcount):
11455 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
11456 on typical 64-bit hosts.
11457
11458 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
11459 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
11460 Omit unnecessary casts to int.
11461 (parse_image_spec): Check that integers fall into 'int' range
11462 when the callers expect that.
11463 (image_ascent): Redo ascent calculation to avoid int overflow.
11464 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
11465 (lookup_image): Remove unnecessary tests.
11466 (xbm_image_p): Locals are now of int, not EMACS_INT,
11467 since parse_image_check makes sure they fit into int.
11468 (png_load, gif_load, svg_load_image):
11469 Prefer int to unsigned where either will do.
11470 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
11471 old tiff_error_handler and tiff_warning_handler.
11472 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
11473 stack buffer overflows. It uses only the features of vsnprintf
11474 that are common to both POSIX and native Microsoft.
11475 (tiff_error_handler, tiff_warning_handler): Use it.
11476 (tiff_load, gif_load, imagemagick_load_image):
11477 Don't assume :index value fits in 'int'.
11478 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
11479 (imagemagick_load_image): Check that crop parameters fit into
11480 the integer types that MagickCropImage accepts. Don't assume
11481 Vimagemagick_render_type has a nonnegative value. Don't assume
11482 size_t fits in 'long'.
11483 (gs_load): Use printmax_t to print the widest integers possible.
11484 Check for integer overflow when computing image height and width.
11485
c11821d4
EZ
114862011-08-26 Eli Zaretskii <eliz@gnu.org>
11487
11488 * xdisp.c (redisplay_window): Don't force window start if point
11489 will be invisible in the resulting window. (Bug#9324)
11490
0c95fcf7
EZ
114912011-08-25 Eli Zaretskii <eliz@gnu.org>
11492
11493 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
11494 the display spec is of the form `(space ...)'.
11495 (handle_display_spec): Return the value returned by
11496 handle_single_display_spec, not just 1 or zero.
11497 (handle_single_display_spec): If the display spec is of the form
11498 `(space ...)', and specifies display in the text area, return 2
11499 rather than 1.
fee65a97 11500 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
11501 accurately, and prefer exact match for point under bidi.
11502 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
11503
11504 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
11505 into disp_prop; all users changed.
11506
11507 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
11508 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
11509 for the text covered by the display property.
11510
e4ed06f1
CY
115112011-08-25 Chong Yidong <cyd@stupidchicken.com>
11512
11513 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
11514 Change return value to nil.
11515 (Frecord_buffer): Delete unused function.
11516
f67cdd7f
EZ
115172011-08-24 Eli Zaretskii <eliz@gnu.org>
11518
5980d4c6
EZ
11519 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
11520 buffers, return left-to-right.
8610fe8b
EZ
11521 (set_cursor_from_row): Consider candidate row a win if its glyph
11522 represents a newline and point is on that newline. Fixes cursor
11523 positioning on the newline at EOL of R2L text within L2R
11524 paragraph, and vice versa.
11525 (try_cursor_movement): Check continued rows, in addition to
11526 continuation rows. Fixes unwarranted scroll when point enters a
11527 continued line of R2L text within an L2R paragraph, or vice versa.
11528 (cursor_row_p): Consider the case of point being equal to
11529 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
11530 from the end of a short line to the beginning of a continued line
11531 of R2L text within L2R paragraph.
11532 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
11533 composed characters.
5980d4c6 11534
f67cdd7f
EZ
11535 * bidi.c (bidi_check_type): Use xassert.
11536 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
11537 members.
11538
bca633fb
EZ
115392011-08-23 Eli Zaretskii <eliz@gnu.org>
11540
11541 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
11542 a character.
11543
4a5885a7
CY
115442011-08-23 Chong Yidong <cyd@stupidchicken.com>
11545
11546 * nsfont.m (ns_otf_to_script): Fix typo.
11547
0902a04e
KH
115482011-08-22 Kenichi Handa <handa@m17n.org>
11549
11550 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
11551 extra slot even if the purpose is char-code-property-table.
11552
1a2e6670
EZ
115532011-08-23 Eli Zaretskii <eliz@gnu.org>
11554
8ddde651
EZ
11555 * xdisp.c (redisplay_window): When computing centering_position,
11556 account for the height of the header line. (Bug#8874)
11557
425cc014
EZ
11558 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
11559 instead of CHAR_TO_BYTE. Fixes a crash when a completion
11560 candidate is selected by the mouse, and that candidate has a
11561 composed character under the mouse.
11562
1a2e6670
EZ
11563 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
11564 coordinates reported by pos-visible-in-window-p for a composed
11565 character in column zero.
11566
8b76d6f8
SM
115672011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
11568
11569 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
11570
dac347dd
EZ
115712011-08-22 Eli Zaretskii <eliz@gnu.org>
11572
11573 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
11574 consider it a hit if to_charpos is anywhere in the range of the
11575 composed buffer positions.
11576
e013fb34
CY
115772011-08-22 Chong Yidong <cyd@stupidchicken.com>
11578
11579 * image.c (gif_load): Don't assume that each subimage has the same
11580 dimensions as the base image. Handle disposal method that is
11581 "undefined" by the gif spec (Bug#9335).
11582
bd1ba3e8
CY
115832011-08-20 Chong Yidong <cyd@stupidchicken.com>
11584
11585 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 11586 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 11587
54a1215b
EZ
115882011-08-19 Eli Zaretskii <eliz@gnu.org>
11589
823564e5
EZ
11590 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
11591 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
11592 from an Org mode buffer to a Speedbar frame.
11593
54a1215b
EZ
11594 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
11595 a composition, take its buffer position from IT->cmp_it.charpos.
11596 Fixes cursor positioning at the beginning of a line that begins
11597 with a composed character.
11598
9778ebcc
EZ
115992011-08-18 Eli Zaretskii <eliz@gnu.org>
11600
0be6ee06
EZ
11601 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
11602 character bidirectional type, use STRONG_L instead. Fixes crashes
11603 in a buffer produced by `describe-categories'.
11604
9778ebcc
EZ
11605 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
11606 members before the level stack, so they would be saved and
11607 restored when copying iterator state. Fixes incorrect reordering
11608 around TABs covered by display properties.
11609
156bffbe
AS
116102011-08-18 Andreas Schwab <schwab@linux-m68k.org>
11611
6b02f655 11612 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 11613
72ad093b
CY
116142011-08-17 Chong Yidong <cyd@stupidchicken.com>
11615
11616 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
11617 (internal_condition_case_2, internal_condition_case_n):
11618 Remove unnecessary aborts (Bug#9081).
72ad093b 11619
35774242
EZ
116202011-08-17 Eli Zaretskii <eliz@gnu.org>
11621
11622 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
11623 has no `load' handler, try opening the file locally. (Bug#9311)
11624
db76dd85
KB
116252011-08-16 Ken Brown <kbrown@cornell.edu>
11626
11627 * gmalloc.c: Expand comment.
11628
b215eee5
EZ
116292011-08-16 Eli Zaretskii <eliz@gnu.org>
11630
11631 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
11632 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
11633
a4579d33
KB
116342011-08-16 Ken Brown <kbrown@cornell.edu>
11635
11636 Fix memory allocation problems in Cygwin build (Bug#9273).
11637
11638 * unexcw.c ( __malloc_initialized): Declare external variable.
11639 (fixup_executable): Force the dumped emacs to reinitialize malloc.
11640
8b76d6f8
SM
11641 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
11642 New variables.
a4579d33
KB
11643 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
11644 dumped emacs.
11645 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
11646 in the static heap.
11647 [CYGWIN] (special_realloc): New function.
11648 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
11649 requests to realloc storage in the static heap.
11650
3ebec551
PE
116512011-08-15 Paul Eggert <eggert@cs.ucla.edu>
11652
11653 * bidi.c (bidi_initialize): Remove unused local.
11654
9fd8be00
EZ
116552011-08-15 Eli Zaretskii <eliz@gnu.org>
11656
6b02f655
SM
11657 * bidimirror.h:
11658 * biditype.h: Remove file.
11659 * makefile.w32-in ($(BLD)/bidi.$(O)):
11660 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
11661
11662 * dispextern.h: Fix a typo in the comment to bidi_type_t.
11663
11664 * chartab.c: Improve commentary for the uniprop_table API.
11665
32413314
EZ
11666 * bidi.c (bidi_paragraph_init): Support zero value of
11667 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
11668 (bidi_initialize): Use uniprop_table instead of including
11669 biditype.h and bidimirror.h.
32413314 11670
9fd8be00
EZ
11671 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
11672 coordinates of the iterator when restoring from ppos_it.
11673 (Bug#9296)
11674
5cf2b69b
KH
116752011-08-14 Kenichi Handa <handa@m17n.org>
11676
11677 * process.c (create_process): Call setup_process_coding_systems
72ad093b 11678 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 11679
daf17d00
EZ
116802011-08-14 Eli Zaretskii <eliz@gnu.org>
11681
11682 * xdisp.c (move_it_in_display_line_to): Don't invoke
11683 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
11684 ppos_it. Fixes vertical cursor motion when line beginning is
11685 covered by an image. (Bug#9296)
11686
08e3161a
JD
116872011-08-14 Jan Djärv <jan.h.d@swipnet.se>
11688
11689 * nsterm.h (ns_run_ascript): Declare.
11690 (NSAPP_DATA2_RUNASSCRIPT): Define.
11691
11692 * nsfns.m (as_script, as_result, as_status): New static variables.
11693 (ns_run_ascript): New function.
5e617bc2 11694 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
11695 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
11696 the event loop. Get status from as_status (Bug#7276).
11697
11698 * nsterm.m (sendEvent): If event is NSApplicationDefined and
11699 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
11700 the event loop (Bug#7276).
11701
a3720aa2
AS
117022011-08-14 Andreas Schwab <schwab@linux-m68k.org>
11703
11704 * gnutls.c (QCgnutls_bootprop_priority)
11705 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
11706 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
11707 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
11708 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
11709 (QCgnutls_bootprop_verify_hostname_error)
11710 (QCgnutls_bootprop_callbacks_verify): Rename from
11711 Qgnutls_bootprop_..., all uses changed.
11712
11713 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
11714 uses changed.
11715
0a0d27fb
PE
117162011-08-14 Paul Eggert <eggert@cs.ucla.edu>
11717
19d5c50c
PE
11718 * xfaces.c (Qframe_set_background_mode): Now static.
11719 * dispextern.h (Qframe_set_background_mode): Remove decl.
11720
0a0d27fb
PE
11721 * process.c (Fnetwork_interface_info): Declare local only if needed.
11722
377538cb
JD
117232011-08-13 Jan Djärv <jan.h.d@swipnet.se>
11724
11725 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
11726 (Fnetwork_interface_list): Allocate in increments of bytes instead
11727 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
11728 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11729 sockaddr.
11730 (struct ifflag_def): notrailers is smart on OSX.
11731 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11732 Get hardware address with getifaddrs if available.
11733
08fff70c
EZ
117342011-08-12 Eli Zaretskii <eliz@gnu.org>
11735
11736 * xdisp.c (iterate_out_of_display_property): xassert that
11737 IT->position is set to within IT->object's boundaries. Break from
11738 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
11739 when IT->position is set up wrongly due to some bug.
11740 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
11741 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11742 entry. Force push_it to save on the stack the current
11743 buffer/string position, to be restored by pop_it. Fix flags in
11744 the iterator structure wrt the object coming from a display
11745 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11746 properties. (Bug#9284)
11747
7be1c708 117482011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 11749
7be1c708
CY
11750 * fontset.c (fontset_get_font_group): Add proper type checks.
11751 (Bug#9172)
aac0c6e3 11752
7be1c708 117532011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 11754
7be1c708
CY
11755 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11756 and LC_VERSION_MIN_MACOSX.
11757 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11758 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 11759
97bb72a6
EZ
117602011-08-08 Eli Zaretskii <eliz@gnu.org>
11761
11762 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
11763 no-display-properties-and-no-overlays under bidi display.
11764 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 11765 properties and overlays.
97bb72a6 11766
d5617611
CY
117672011-08-08 Chong Yidong <cyd@stupidchicken.com>
11768
37e11a63
CY
11769 * editfns.c (Fset_time_zone_rule): Document relationship with the
11770 setenv function.
11771
d5617611
CY
11772 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11773 the font entity extracted from the cache (Bug#8109).
11774
58872834
CY
117752011-08-07 Chong Yidong <cyd@stupidchicken.com>
11776
11777 * composite.c (autocmp_chars): Don't reset point. That is done by
11778 restore_point_unwind (Bug#5984).
11779
75bfc667
JL
117802011-08-07 Juri Linkov <juri@jurta.org>
11781
11782 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11783 to show the arg `TIME' instead of `TIMEVAL'.
11784
d1410150
EZ
117852011-08-06 Eli Zaretskii <eliz@gnu.org>
11786
11787 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11788 display property strides EOL and includes a newline, as in
11789 longlines-mode. (Bug#9254)
75b771e4
EZ
11790 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11791 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
11792
11793 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11794 is non-zero, even if the data buffer is NULL. Fixes a crash in
11795 vertical-motion with longlines-mode. (Bug#9254)
11796
35928349
EZ
117972011-08-05 Eli Zaretskii <eliz@gnu.org>
11798
ec7cc85b
EZ
11799 * bidi.c <bidi_cache_total_alloc>: Now static.
11800 (bidi_initialize): Initialize bidi_cache_total_alloc.
11801
8b76d6f8 11802 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
11803 cache. (Bug#9221)
11804
11805 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11806 amount allocated this far in `bidi_cache_total_alloc'.
11807 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11808 non-zero, only free the data buffer without restoring the cache
11809 contents. All callers changed.
11810
11811 * dispextern.h (bidi_unshelve_cache): Update prototype.
11812
11813 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11814 (move_it_in_display_line, move_it_to)
11815 (move_it_vertically_backward, move_it_by_lines): Replace the call
11816 to xfree to an equivalent call to bidi_unshelve_cache.
11817 (move_it_in_display_line_to): Fix logic of returning
412b6358 11818 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 11819
e2e2423b
EZ
118202011-08-05 Eli Zaretskii <eliz@gnu.org>
11821
11822 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11823 came from a string character with a `cursor' property. (Bug#9229)
11824
ae9e757a
JD
118252011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11826
11827 * Makefile.in (LIB_PTHREAD): New variable.
11828 (LIBES): Add LIB_PTHREAD (Bug#9216).
11829
11830 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11831 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11832
213bd7f2
AS
118332011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11834
6b02f655 11835 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 11836
99aaf75f
JD
118372011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11838
11839 * xterm.c (x_find_topmost_parent): New function.
11840 (x_set_frame_alpha): Find topmost parent window with
11841 x_find_topmost_parent and set the property there also (bug#9181).
11842 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11843
c74e9d86
PE
118442011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11845
11846 * callproc.c (Fcall_process): Avoid vfork clobbering
11847 the local vars buffer, coding_systems, current_dir.
11848
640c8776
SM
118492011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11850
11851 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11852
f26d0e4c
PE
118532011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11854
8a10d76c
PE
11855 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11856 so that it is not optimized away.
11857
f26d0e4c
PE
11858 * xdisp.c (compute_display_string_pos): Remove unused local.
11859
55439c61
EZ
118602011-08-02 Eli Zaretskii <eliz@gnu.org>
11861
11862 Fix slow cursor motion and scrolling in large buffers with
11863 selective display, like Org Mode buffers. (Bug#9218)
11864
11865 * dispextern.h (struct bidi_it): New member disp_prop_p.
11866
11867 * xdisp.c: Remove one-slot cache of display string positions.
11868 (compute_display_string_pos): Accept an additional argument
5e617bc2 11869 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
11870 for a display string or property. If found, set DISP_PROP_P
11871 non-zero.
11872
11873 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
11874 DISP_PROP_P, and pass it to compute_display_string_pos.
11875 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
11876 non-zero. All callers of bidi_fetch_char changed.
11877
fb33fa43
SM
118782011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11879
11880 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11881
b099e063
DM
118822010-12-03 Don March <don@ohspite.net>
11883
11884 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11885 last character M-[char] is translated to ESC [char] (bug#7541).
11886
5cc7f7af
KH
118872011-08-02 Kenichi Handa <handa@m17n.org>
11888
d0fffa3f 11889 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
11890
11891 * chartab.c (uniprop_table): Make it non-static.
11892
525d5e6e
EZ
118932011-08-01 Eli Zaretskii <eliz@gnu.org>
11894
11895 * xdisp.c (forward_to_next_line_start): Accept additional argument
11896 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11897 on the newline.
11898 (reseat_at_next_visible_line_start): Use the bidi iterator state
11899 returned by forward_to_next_line_start to restore the state of
11900 it->bidi_it after backing up to previous newline. (Bug#9212)
11901
31011111
AS
119022011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11903
11904 * regex.c (re_comp): Protoize.
11905 (re_exec): Fix return type.
11906 (regexec): Fix type of `ret'. (Bug#9203)
11907
476371c4
PE
119082011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11909
e5d76069
PE
11910 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11911 This is needed if max-image-size is a floating-point number.
11912
9a79b20c
AS
119132011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11914
11915 * print.c (print_object): Print empty symbol as ##.
11916
11917 * lread.c (read1): Read ## as empty symbol.
11918
d8c2fa78
AA
119192011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11920
11921 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11922 setting frame foreground color (Bug#9175).
11923 (x_set_background_color): Likewise.
11924
ffe57a7a
AA
11925 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11926 contents (Bug#9176).
11927 (EmacsTooltip -init): Remove bezels and add shadows to
11928 tooltip windows.
11929
bf3492a5
AA
11930 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11931 or scroll bar (Bug#8470).
11932
d55e9c53
AA
11933 * nsfont.m (nsfont_open): Remove assignment to voffset and
11934 unnecessary vars hshink, expand, hd, full_height, min_height.
11935 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11936
11937 * nsterm.h (nsfont_info): Remove voffset field.
11938
d8c2fa78 119392011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
11940
11941 Implement strike-through and overline on NextStep (Bug#8863).
11942
11943 * nsfont.m (nsfont_open): Use underline position provided by font,
11944 instead of hard-coded value of 2.
11945 (nsfont_draw): Call ns_draw_text_decoration instead.
11946
11947 * nsterm.h: Add declaration for ns_draw_text_decoration.
11948
11949 * nsterm.m (ns_draw_text_decoration): New function for drawing
11950 underline, overline, and strike-through.
11951 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11952 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 11953 accommodate underlining, etc.
4843aac3 11954
4cc60b9b
EZ
119552011-07-28 Eli Zaretskii <eliz@gnu.org>
11956
bc7ece87
EZ
11957 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11958 default.
4cc60b9b 11959
476371c4
PE
119602011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11961
66606eea
PE
11962 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11963 Without this fix, if a signal arrives just after memory fills up,
11964 'malloc' might be invoked reentrantly.
11965
476371c4
PE
11966 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11967 In other words, assume that every image size is allowed, on non-X
11968 hosts. This assumption is probably wrong, but it lets Emacs compile.
11969
f3fcc40d
AS
119702011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11971
11972 * regex.c (re_iswctype): Convert return values to boolean.
11973
350c992f
EZ
119742011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11975
11976 * xdisp.c (compute_display_string_pos): Don't use cached display
11977 string position if the buffer had its restriction changed.
11978 (Bug#9184)
11979
5266b4bb
PE
119802011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11981
11982 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11983
2573a837 119842011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 11985
41f55ccd 11986 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 11987
39e378da
PE
11988 * bidi.c: Integer size and overflow fixes.
11989 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11990 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11991 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11992 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11993 (bidi_find_other_level_edge):
11994 Use ptrdiff_t instead of EMACS_INT where either will do.
11995 This works better on 32-bit hosts configured --with-wide-int.
11996 (bidi_cache_ensure_space): Check for size-calculation overflow.
11997 Use % rather than repeated addition, for better worst-case speed.
11998 Don't set bidi_cache_size until after xrealloc returns, because it
11999 might not return.
12000 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
12001 (bidi_cache_ensure_space): Also check that the bidi cache size
12002 does not exceed that of the largest Lisp string or buffer. See Eli
12003 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 12004
5e927815
PE
12005 * alloc.c (__malloc_size_t): Remove.
12006 All uses replaced by size_t. See Andreas Schwab's note
12007 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12008
ca4aa935
PE
12009 * image.c: Improve checking for integer overflow.
12010 (check_image_size): Assume that f is nonnull, since
12011 it is always nonnull in practice. This is one less thing to
12012 worry about when checking for integer overflow later.
12013 (x_check_image_size): New function, which checks for integer
12014 overflow issues inside X.
12015 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12016 This removes the need for a memory_full check.
12017 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
12018 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
12019 (xbm_read_bitmap_data): Change locals back to 'int', since
12020 their values must fit in 'int'.
12021 (xpm_load_image, png_load, tiff_load):
12022 Invoke x_create_x_image_and_pixmap earlier,
12023 to avoid much needless work if the image is too large.
12024 (tiff_load): Treat overly large images as if
12025 x_create_x_image_and_pixmap failed, not as malloc failures.
12026 (gs_load): Use x_check_image_size.
12027
5f8f9cc2
PE
12028 * gtkutil.c: Omit integer casts.
12029 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
12030 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
12031
5adf60bc
PE
12032 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
12033
c8907a93
PE
12034 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
12035 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
12036 would wrongly return t on a 64-bit host.
12037
e3c25c68
PE
12038 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
12039 The plain *_OVERFLOW macros run afoul of GCC bug 49705
12040 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
12041 and therefore cause GCC to emit a bogus diagnostic in some cases.
12042
3f791afe
PE
12043 * image.c: Integer signedness and overflow and related fixes.
12044 This is not an exhaustive set of fixes, but it's time to
12045 record what I've got.
12046 (lookup_pixel_color, check_image_size): Remove redundant decls.
12047 (check_image_size): Don't assume that arbitrary EMACS_INT values
12048 fit in 'int', or that arbitrary 'double' values fit in 'int'.
12049 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
12050 (tiff_load, imagemagick_load_image):
12051 Check for overflow in size calculations.
12052 (x_create_x_image_and_pixmap): Remove unnecessary test for
12053 xmalloc returning NULL; that can't happen.
12054 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
12055 (xpm_color_bucket): Use better integer hashing function.
12056 (xpm_cache_color): Don't possibly over-allocate memory.
12057 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
12058 (gif_memory_source):
12059 Use ptrdiff_t, not int or size_t, to record sizes.
12060 (png_load): Don't assume values greater than 2**31 fit in 'int'.
12061 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
12062 either works, as we prefer signed integers.
12063 (tiff_read_from_memory, tiff_write_from_memory):
12064 Return tsize_t, not size_t, since that's what the TIFF API wants.
12065 (tiff_read_from_memory): Don't fail simply because the read would
12066 go past EOF; instead, return a short read.
12067 (tiff_load): Omit no-longer-needed casts.
12068 (Fimagemagick_types): Don't assume size fits into 'int'.
12069
3cc5a532
PE
12070 Improve hashing quality when configured --with-wide-int.
12071 * fns.c (hash_string): New function, taken from sxhash_string.
12072 Do not discard information about ASCII character case; this
12073 discarding is no longer needed.
12074 (sxhash-string): Use it. Change sig to match it. Caller changed.
12075 * lisp.h: Declare it.
12076 * lread.c (hash_string): Remove, since we now use fns.c's version.
12077 The fns.c version returns a wider integer if --with-wide-int is
12078 specified, so this should help the quality of the hashing a bit.
12079
b312a492
PE
12080 * emacs.c: Integer overflow minor fix.
12081 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
12082 Define only if GNU_LINUX.
12083 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
12084
dfd153ae
PE
12085 * dispnew.c: Integer signedness and overflow fixes.
12086 Remove unnecessary forward decls, that were a maintenance hassle.
12087 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
12088 All uses changed.
12089 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
12090 (scrolling_window): Use ptrdiff_t, not int, for byte count.
12091 (prepare_desired_row, line_draw_cost):
12092 Use int, not unsigned, where either works.
12093 (save_current_matrix, restore_current_matrix):
12094 Use ptrdiff_t, not size_t, where either works.
12095 (init_display): Check for overflow more accurately, and without
12096 relying on undefined behavior.
12097
a81d11a3
PE
12098 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
12099 Remove, replacing with the new symbols in lisp.h. All uses changed.
12100 * fileio.c (make_temp_name):
12101 * filelock.c (lock_file_1, lock_file):
12102 * xdisp.c (message_dolog):
12103 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
12104 Use pMd etc. instead.
12105 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
12106 replacing the pWIDE etc. symbols removed from editfns.c.
12107
3300e6fd
PE
12108 * keyboard.h (num_input_events): Now uintmax_t.
12109 This is (very slightly) less likely to mess up due to wraparound.
12110 All uses changed.
12111
fd05c7e9
PE
12112 * buffer.c: Integer signedness fixes.
12113 (alloc_buffer_text, enlarge_buffer_text):
12114 Use ptrdiff_t rather than size_t when either will do, as we prefer
12115 signed integers.
12116
903fe15d
PE
12117 * alloc.c: Integer signedness and overflow fixes.
12118 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
12119 (__malloc_size_t): Default to size_t, not to int.
12120 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
12121 (Fgarbage_collect, mark_object_loop_halt, mark_object):
12122 Prefer ptrdiff_t to size_t when either would do, as we prefer
12123 signed integers.
12124 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
12125 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
12126 Now const. Initialize with values that are in range even if char
12127 is signed.
12128 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
12129 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
12130 These functions do the right thing with sizes > 2**32.
12131 (check_depth): Now ptrdiff_t, not int.
12132 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
12133 Adjust to new way of storing sizes. Check for size overflow bugs
12134 in rest of code.
12135 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
12136 slightly wrong anyway, as it missed one instance of
12137 XMALLOC_OVERRUN_CHECK_OVERHEAD.
12138 (refill_memory_reserve): Omit needless cast to size_t.
12139 (mark_object_loop_halt): Mark as externally visible.
12140
ac82cc6a
PE
12141 * xselect.c: Integer signedness and overflow fixes.
12142 (Fx_register_dnd_atom, x_handle_dnd_message):
12143 Use ptrdiff_t, not size_t, since we prefer signed.
12144 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
12145 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
12146 x_dnd_atoms_size and x_dnd_atoms_length.
12147
c2d1e36d
PE
12148 * doprnt.c: Prefer signed to unsigned when either works.
12149 * eval.c (verror):
12150 * doprnt.c (doprnt):
12151 * lisp.h (doprnt):
12152 * xdisp.c (vmessage):
12153 Use ptrdiff_t, not size_t, when using or implementing doprnt,
12154 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
12155 prefer signed arithmetic to avoid comparison confusion.
12156 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
12157 but is a bit tricky.
12158
0e926e56
PE
12159 Assume freestanding C89 headers, string.h, stdlib.h.
12160 * data.c, doprnt.c, floatfns.c, print.c:
12161 Include float.h unconditionally.
12162 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
12163 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
12164 * regex.c: Likewise for stddef.h, string.h.
12165 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
12166 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
12167 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
12168 (STDC_HEADERS): Remove obsolete defines.
12169 * sysdep.c: Include limits.h unconditionally.
12170
9cfdb3ec
PE
12171 Assume support for memcmp, memcpy, memmove, memset.
12172 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
12173 * regex.c (memcmp, memcpy):
12174 Remove; we assume C89 now.
12175
12176 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
12177 (__malloc_safe_bcopy): Remove; no longer needed.
12178
cf950e6b 12179 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
12180 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
12181 well either way, and we prefer signed to unsigned.
12182
dbf38e02
LMI
121832011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
12184
12185 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
12186 closes the connection while we're reading (bug#9182).
12187
d6f0886c 121882011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 12189
d6f0886c
JD
12190 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
12191 are specified (Bug#9168).
24e0f6b1 12192
2eb1f9e6
PE
121932011-07-25 Paul Eggert <eggert@cs.ucla.edu>
12194
12195 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
12196 Found by GCC static checking and --with-wide-int on a 32-bit host.
12197
22381272 121982011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
12199
12200 * xdisp.c (compute_display_string_pos): Fix logic of caching
12201 previous display string position. Initialize cached_prev_pos to
12202 -1. Fixes slow-down at the beginning of a buffer.
12203
f25e39b4
EZ
122042011-07-24 Eli Zaretskii <eliz@gnu.org>
12205
12206 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
12207 for attrs[LFACE_FONTSET_INDEX].
12208
04c4b52e
PE
122092011-07-23 Paul Eggert <eggert@cs.ucla.edu>
12210
12211 * xml.c (parse_region): Remove unused local
12212 that was recently introduced.
12213
c1734fbd
EZ
122142011-07-23 Eli Zaretskii <eliz@gnu.org>
12215
be18c5a5
EZ
12216 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
12217 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
12218
c1734fbd
EZ
12219 * xdisp.c (move_it_in_display_line_to): Record the best matching
12220 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
12221 exit if none of the characters scanned was an exact match.
12222 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
12223 when exact match is impossible due to invisible text, and the
12224 lines are truncated.
12225
a258d627
JD
122262011-07-23 Jan Djärv <jan.h.d@swipnet.se>
12227
12228 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
12229 for OSX >= 10.7.
12230
b6d5a689
EZ
122312011-07-22 Eli Zaretskii <eliz@gnu.org>
12232
0f74f785
EZ
12233 Fix a significant slow-down of cursor motion with C-n, C-p,
12234 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
12235 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 12236 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
12237 (next_element_from_buffer): Call compute_stop_pos_backwards to
12238 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
12239 base_level_stop.
12240 (reseat): Don't look for prev_stop, as that could mean a very long
12241 run.
12242 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
12243 <cached_disp_overlay_modiff>: Cache for last found display string
12244 position.
551918c1 12245 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
12246 about the same buffer in the same area of character positions, and
12247 the buffer wasn't changed since the time the display string
12248 position was cached.
551918c1 12249
b2d0c91a
EZ
122502011-07-22 Eli Zaretskii <eliz@gnu.org>
12251
12252 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
12253 is an integer, which is important for empty lines. (Bug#9149)
12254
043604ee
CY
122552011-07-22 Chong Yidong <cyd@stupidchicken.com>
12256
12257 * frame.c (Fmodify_frame_parameters): In tty case, update the
12258 default face if necessary (Bug#4238).
12259
da4adb04
CY
122602011-07-21 Chong Yidong <cyd@stupidchicken.com>
12261
12262 * editfns.c (Fstring_to_char): No need to explain what a character
12263 is in the docstring (Bug#6576).
12264
9abd0532
LMI
122652011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12266
12267 * xml.c (parse_region): Make sure we always return a tree.
12268
36881d16
HK
122692011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
12270
12271 * xml.c (parse_region): If a document contains only comments,
12272 return that, too.
12273
1e98674d
LMI
122742011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
12275
12276 * xml.c (make_dom): Return comments, too.
12277
590bd467
PE
122782011-07-19 Paul Eggert <eggert@cs.ucla.edu>
12279
12280 Port to OpenBSD.
12281 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
12282 and the surrounding thread.
12283 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
12284 rather than fgets, and retry after EINTR. Otherwise, 'emacs
12285 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
12286 timer goes off.
12287 * s/openbsd.h (BROKEN_SIGIO): Define.
12288 * unexelf.c (unexec) [__OpenBSD__]:
12289 Don't update the .mdebug section of the Alpha COFF symbol table.
12290
f41628b2
LMI
122912011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12292
12293 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
12294 (bug#8460).
12295
b59b67c5
PE
122962011-07-18 Paul Eggert <eggert@cs.ucla.edu>
12297
15e3a074
PE
12298 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
12299 This fixes some race conditions on the permissions of any newly
12300 created file.
12301
41bed37d
PE
12302 * alloc.c (valid_pointer_p): Use pipe, not open.
12303 This fixes some permissions issues when debugging.
12304
b59b67c5
PE
12305 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
12306 If fchown fails to set both uid and gid, try to set just gid,
12307 as that is sometimes allowed. Adjust the file's mode to eliminate
12308 setuid or setgid bits that are inappropriate if fchown fails.
12309
925a6be7
SM
123102011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
12311
12312 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
12313 to compare Lisp_Objects.
12314 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
12315 global_gnutls_log_level, don't mistake it for a Lisp_Object.
12316 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
12317
52968808
AS
123182011-07-17 Andreas Schwab <schwab@linux-m68k.org>
12319
0a6a104b
AS
12320 * lread.c (read_integer): Unread even EOF character.
12321 (read1): Likewise. Properly record start position of symbol.
12322
52968808
AS
12323 * lread.c (read1): Read `#:' as empty uninterned symbol if no
12324 symbol character follows.
12325
9e381cdd
PE
123262011-07-17 Paul Eggert <eggert@cs.ucla.edu>
12327
12328 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
12329 This works around a problem with the previous change to Fcopy_file.
12330 Recent glibc declares fchown with __attribute__((warn_unused_result)),
12331 and without this change, GCC might complain about discarding
12332 fchown's return value.
12333
b5641435
JB
123342011-07-16 Juanma Barranquero <lekktu@gmail.com>
12335
12336 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
12337
a8031457
PE
123382011-07-16 Paul Eggert <eggert@cs.ucla.edu>
12339
12340 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
12341
dd889327
LMI
123422011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
12343
750c33f7
LMI
12344 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
12345 it's used from the C level.
12346
dd889327
LMI
12347 * process.c: Use the same condition for POLL_FOR_INPUT in both
12348 keyboard.c and process.c (bug#1858).
12349
87e86684
LM
123502011-07-09 Lawrence Mitchell <wence@gmx.li>
12351
12352 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
12353 (Fgnutls_boot): Use it.
12354
64348f40
AS
123552011-07-15 Andreas Schwab <schwab@linux-m68k.org>
12356
12357 * doc.c (Fsubstitute_command_keys): Revert last change.
12358
1d698799
LMI
123592011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
12360
f863868c
LMI
12361 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
12362 quotes the next character, and doesn't affect other longer
12363 sequences (bug#8935).
12364
1d698799
LMI
12365 * lread.c (syms_of_lread): Clarify that is isn't only
12366 `eval-buffer' and `eval-defun' that's affected by
12367 `lexical-binding' (bug#8460).
12368
aa4b6df6
EZ
123692011-07-15 Eli Zaretskii <eliz@gnu.org>
12370
12371 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 12372 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 12373
5d856da6
PE
123742011-07-14 Paul Eggert <eggert@cs.ucla.edu>
12375
ad6042bb
PE
12376 Fix minor problems found by static checking.
12377 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
12378 (elsz): Now a signed constant, not a size_t var. We prefer signed
12379 types to unsigned, to avoid integer comparison confusion. Without
12380 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
12381 "cannot optimize loop, the loop counter may overflow", a symptom
12382 of the confusion.
f00bbb22 12383 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
12384 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
12385
6468f31c
LMI
123862011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12387
49080b10
LMI
12388 * search.c (Fre_search_backward): Mention `case-fold-search' in
12389 all the re_search_* functions (bug#8138).
12390
6468f31c
LMI
12391 * keyboard.c (Fopen_dribble_file): Document when the file is
12392 closed (bug#8056).
12393
c965adc5
EZ
123942011-07-14 Eli Zaretskii <eliz@gnu.org>
12395
df9733bf
EZ
12396 * bidi.c (bidi_dump_cached_states): Fix format of displaying
12397 bidi_cache_idx.
12398
0bb23927
EZ
12399 Support bidi reordering of display and overlay strings.
12400 * xdisp.c (compute_display_string_pos)
12401 (compute_display_string_end): Accept additional argument STRING.
12402 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
12403 (reseat_to_string): Initialize bidi_it->string.s and
12404 bidi_it->string.schars.
12405 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
12406 NULL (avoids a crash in bidi_paragraph_init).
12407 Initialize itb.string.lstring.
0bb23927
EZ
12408 (init_iterator): Call bidi_init_it only of a valid
12409 buffer position was specified. Initialize paragraph_embedding to
12410 L2R.
12411 (reseat_to_string): Initialize the bidi iterator.
12412 (display_string): If we need to ignore text properties of
12413 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
12414 original value of -1 will not work with bidi.)
12415 (compute_display_string_pos): First arg is now struct
12416 `text_pos *'; all callers changed. Support display properties on
12417 Lisp strings.
12418 (compute_display_string_end): Support display properties on Lisp
12419 strings.
12420 (init_iterator, reseat_1, reseat_to_string): Initialize the
12421 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
12422 when iterating on a string not from display properties).
640c8776
SM
12423 (compute_display_string_pos, compute_display_string_end):
12424 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
12425 arrow keys.
12426 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
12427 base_level_stop; instead, set base_level_stop to BEGV.
12428 Fixes crashes in vertical-motion.
0bb23927
EZ
12429 (next_element_from_buffer): Improve commentary for when
12430 the iterator is before prev_stop.
12431 (init_iterator): Initialize bidi_p from the default value of
12432 bidi-display-reordering, not from buffer-local value. Use the
12433 buffer-local value only if initializing for buffer iteration.
12434 (handle_invisible_prop): Support invisible properties on strings
12435 that are being bidi-reordered.
12436 (set_iterator_to_next): Support bidi reordering of C strings and
12437 Lisp strings.
12438 (next_element_from_string): Support bidi reordering of Lisp
12439 strings.
12440 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
12441 (display_string): Support display of R2L glyph rows.
12442 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
12443 (init_iterator): Don't initialize it->bidi_p for strings
12444 here.
12445 (reseat_to_string): Initialize it->bidi_p for strings here.
12446 (next_element_from_string, next_element_from_c_string)
12447 (next_element_from_buffer): Add xassert's for correspondence
12448 between IT's object being iterated and it->bidi_it.string
12449 structure.
12450 (face_before_or_after_it_pos): Support bidi iteration.
12451 (next_element_from_c_string): Handle the case of the first string
12452 character that is not the first one in the visual order.
12453 (get_visually_first_element): New function, refactored from common
12454 parts of next_element_from_buffer, next_element_from_string, and
12455 next_element_from_c_string.
12456 (tool_bar_lines_needed, redisplay_tool_bar)
12457 (display_menu_bar): Force left-to-right direction. Add a FIXME
12458 comment for making that be controlled by a user option.
12459 (push_it, pop_it): Save and restore the state of the
12460 bidi iterator. Save and restore the bidi_p flag.
12461 (pop_it): Iterate out of display property for string iteration as
12462 well.
12463 (iterate_out_of_display_property): Support iteration over strings.
12464 (handle_single_display_spec): Set up it->bidi_it for iteration
12465 over a display string, and call bidi_init_it.
12466 (handle_single_display_spec, next_overlay_string)
12467 (get_overlay_strings_1, push_display_prop): Set up the bidi
12468 iterator for displaying display or overlay strings.
12469 (forward_to_next_line_start): Don't use the shortcut if
12470 bidi-iterating.
12471 (back_to_previous_visible_line_start): If handle_display_prop
12472 pushed the iterator stack, restore the internal state of the bidi
12473 iterator by calling bidi_pop_it same number of times.
12474 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
12475 and we are bidi-iterating, don't decrement the iterator position;
12476 instead, set the first_elt flag in the bidi iterator, to produce
12477 the same effect.
12478 (reseat_1): Remove redundant setting of string_from_display_prop_p.
12479 (push_display_prop): xassert that we are iterating a buffer.
12480 (push_it, pop_it): Save and restore paragraph_embedding member.
12481 (handle_single_display_spec, next_overlay_string)
12482 (get_overlay_strings_1, reseat_1, reseat_to_string)
12483 (push_display_prop): Set up the `unibyte' member of bidi_it.string
12484 correctly. Don't assume unibyte strings are not bidi-reordered.
12485 (compute_display_string_pos)
12486 (compute_display_string_end): Fix handling the case of C string.
12487 (push_it, pop_it): Save and restore from_disp_prop_p.
12488 (handle_single_display_spec, push_display_prop): Set the
12489 from_disp_prop_p flag.
12490 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
12491 (pop_it): Call iterate_out_of_display_property only if we are
12492 popping after iteration over a string that came from a display
12493 property. Fix a typo in popping stretch info. Add an assertion
12494 for verifying that the iterator position is in sync with the bidi
12495 iterator.
12496 (handle_single_display_spec, get_overlay_strings_1)
12497 (push_display_prop): Fix initialization of paragraph direction for
12498 string when that of the parent object is not yet determined.
12499 (reseat_1): Call bidi_init_it to resync the bidi
12500 iterator with IT's position. (Bug#7616)
12501 (find_row_edges): If ROW->start.pos gives position
12502 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
12503 (handle_stop, back_to_previous_visible_line_start, reseat_1):
12504 Reset the from_disp_prop_p flag.
12505 (SAVE_IT, RESTORE_IT): New macros.
12506 (pos_visible_p, face_before_or_after_it_pos)
12507 (back_to_previous_visible_line_start)
12508 (move_it_in_display_line_to, move_it_in_display_line)
12509 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12510 (try_scrolling, redisplay_window, display_line): Use them when
12511 saving a temporary copy of the iterator and restoring it back.
12512 (back_to_previous_visible_line_start, reseat_1)
12513 (init_iterator): Empty the bidi cache "stack".
12514 (move_it_in_display_line_to): If iterator ended up at
12515 EOL, but we never saw any buffer positions smaller than
12516 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
12517 motion in bidi-reordered lines.
12518 (move_it_in_display_line_to): Record prev_method and prev_pos
12519 immediately before the call to set_iterator_to_next. Fixes cursor
12520 motion in bidi-reordered lines with stretch glyphs and strings
12521 displayed in margins. (Bug#8133) (Bug#8867)
12522 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
12523 TO_CHARPOS.
640c8776
SM
12524 (pos_visible_p): Support positions in bidi-reordered lines.
12525 Save and restore bidi cache.
0bb23927
EZ
12526
12527 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
12528 (bidi_paragraph_info): Delete unused struct.
12529 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
12530 (bidi_cache_start): New variable.
12531 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
12532 to zero.
12533 (bidi_cache_fetch_state, bidi_cache_search)
12534 (bidi_cache_find_level_change, bidi_cache_iterator_state)
12535 (bidi_cache_find, bidi_peek_at_next_level)
12536 (bidi_level_of_next_char, bidi_find_other_level_edge)
12537 (bidi_move_to_visually_next): Compare cache index with
12538 bidi_cache_start rather than with zero.
12539 (bidi_fetch_char): Accept new argument STRING; all callers
12540 changed. Support iteration over a string. Support strings with
12541 display properties. Support unibyte strings. Fix the type of
12542 `len' according to what STRING_CHAR_AND_LENGTH expects.
12543 (bidi_paragraph_init, bidi_resolve_explicit_1)
12544 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
12545 (bidi_level_of_next_char, bidi_move_to_visually_next):
12546 Support iteration over a string.
0bb23927
EZ
12547 (bidi_set_sor_type, bidi_resolve_explicit_1)
12548 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
12549 can now be zero (for strings); special values 0 and -1 were
12550 changed to -1 and -2, respectively.
12551 (bidi_char_at_pos): New function.
12552 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
12553 Call it instead of FETCH_MULTIBYTE_CHAR.
12554 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
12555 initialized to valid values.
12556 (bidi_init_it): Don't initialize charpos and bytepos with invalid
12557 values.
12558 (bidi_level_of_next_char): Allow the sentinel "position" to pass
12559 the test for valid cached positions. Fix the logic for looking up
12560 the sentinel state in the cache. GCPRO the Lisp string we are
12561 iterating.
12562 (bidi_push_it, bidi_pop_it): New functions.
12563 (bidi_initialize): Initialize the bidi cache start stack pointer.
12564 (bidi_cache_ensure_space): New function, refactored from part of
12565 bidi_cache_iterator_state. Don't assume the required size is just
12566 one BIDI_CACHE_CHUNK away.
12567 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
12568 (bidi_count_bytes, bidi_char_at_pos): New functions.
12569 (bidi_cache_search): Don't assume bidi_cache_last_idx is
12570 always valid if bidi_cache_idx is valid.
12571 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
12572 is valid if it's going to be used.
12573 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
12574 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
12575 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12576 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
12577 (bidi_find_other_level_edge, bidi_cache_start_stack):
12578 All variables related to cache indices are now EMACS_INT.
c965adc5 12579
0bb23927
EZ
12580 * dispextern.h (struct bidi_string_data): New structure.
12581 (struct bidi_it): New member `string'. Make flag members be 1-bit
12582 fields, and put them last in the struct.
640c8776
SM
12583 (compute_display_string_pos, compute_display_string_end):
12584 Update prototypes.
0bb23927
EZ
12585 (bidi_push_it, bidi_pop_it): Add prototypes.
12586 (struct iterator_stack_entry): New members bidi_p,
12587 paragraph_embedding, and from_disp_prop_p.
12588 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
12589 (bidi_shelve_cache, bidi_unshelve_cache):
12590 Declare prototypes.
0bb23927
EZ
12591
12592 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
12593 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
12594 and vector-like objects.
12595
12596 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
12597 cache around display iteration.
12598
12599 * window.c (Fwindow_end, window_scroll_pixel_based)
12600 (displayed_window_lines, Frecenter): Save and restore the bidi
12601 cache around display iteration.
12602
3bbd2265
LMI
126032011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
12604
12605 * editfns.c (Fdelete_region): Clarify the use of the named
12606 parameters (bug#6788).
12607
adc47434
MR
126082011-07-14 Martin Rudalics <rudalics@gmx.at>
12609
12610 * indent.c (Fvertical_motion): Set and restore w->pointm when
12611 saving and restoring the window's buffer (Bug#9006).
12612
837c31f8
LMI
126132011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
12614
12615 * editfns.c (Fstring_to_char): Clarify just what is returned
12616 (bug#6576). Text by Eli Zaretskii.
12617
ac389d0c
JB
126182011-07-13 Juanma Barranquero <lekktu@gmail.com>
12619
12620 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
12621
0be0ce47
EZ
126222011-07-13 Eli Zaretskii <eliz@gnu.org>
12623
12624 * buffer.c (mmap_find): Fix a typo.
12625
cd18e7e3
JB
126262011-07-13 Johan Bockgård <bojohan@gnu.org>
12627
12628 Fix execution of x selection hooks.
12629 * xselect.c (Qx_lost_selection_functions)
12630 (Qx_sent_selection_functions): New vars.
12631 (syms_of_xselect): DEFSYM them.
12632 (x_handle_selection_request): Pass Qx_sent_selection_functions
12633 rather than Vx_sent_selection_functions to Frun_hook_with_args.
12634 (x_handle_selection_clear,x_clear_frame_selections):
12635 Pass Qx_lost_selection_functions rather than
12636 Vx_lost_selection_functions to Frun_hook_with_args.
12637
47ea7f44
PE
126382011-07-13 Paul Eggert <eggert@cs.ucla.edu>
12639
ac389d0c 12640 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
12641 The old code sometimes used this field without initializing it.
12642
47ea7f44
PE
12643 * alloc.c (gc_sweep): Don't read past end of array.
12644 In theory, the old code could also have corrupted Emacs internals,
12645 though it'd be very unlikely.
12646
bc985c87
AS
126472011-07-12 Andreas Schwab <schwab@linux-m68k.org>
12648
12649 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 12650 argument. (Bug#4026)
bc985c87 12651
0cf34688
LMI
126522011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
12653
b3dadd76
LMI
12654 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
12655 key" (bug#4257).
12656
0cf34688
LMI
12657 * window.c (Fset_window_start): Doc fix (bug#4199).
12658 (Fset_window_hscroll): Ditto.
12659
270768cd
PE
126602011-07-12 Paul Eggert <eggert@cs.ucla.edu>
12661
077e3dda 12662 Fix minor new problems caught by GCC 4.6.1.
270768cd 12663 * term.c (init_tty): Remove unused local.
490011a6 12664 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 12665 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 12666 not used otherwise.
270768cd 12667
b1f58454
CY
126682011-07-12 Chong Yidong <cyd@stupidchicken.com>
12669
12670 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
12671
22b9578d
LMI
126722011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12673
6e70ab07
LMI
12674 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
12675 are the mini-buffer and the echo area (bug#3320).
12676
22b9578d
LMI
12677 * term.c (init_tty): Remove support for supdup, c10 and perq
12678 terminals, which are no longer supported (bug#1482).
12679
8974cc9f
JB
126802011-07-10 Johan Bockgård <bojohan@gnu.org>
12681
12682 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
12683
a560d974
JD
126842011-07-10 Jan Djärv <jan.h.d@swipnet.se>
12685
12686 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
12687 for non-popups (Bug#3642).
12688
1dae0f0a
AS
126892011-07-10 Andreas Schwab <schwab@linux-m68k.org>
12690
268c2c36 12691 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 12692 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
12693 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
12694 * cm.c (losecursor): Likewise.
1dae0f0a
AS
12695 * data.c (fmod): Likewise.
12696 * dispnew.c (swap_glyphs_in_rows): Likewise.
12697 * emacs.c (memory_warning_signal): Likewise.
12698 * floatfns.c (float_error): Likewise.
12699 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
12700 (otf_open, font_otf_capability, generate_otf_features)
12701 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
12702 Likewise.
12703 * image.c (pbm_read_file): Likewise.
12704 * indent.c (string_display_width): Likewise.
12705 * intervals.c (check_for_interval, search_for_interval)
12706 (inc_interval_count, count_intervals, root_interval)
12707 (adjust_intervals_for_insertion, make_new_interval): Likewise.
12708 * lread.c (defalias): Likewise.
268c2c36 12709 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
12710 * regex.c (set_image_of_range_1, set_image_of_range)
12711 (regex_grow_registers): Likewise.
12712 * sysdep.c (strerror): Likewise.
12713 * termcap.c (valid_filename_p, tprint, main): Likewise.
12714 * tparam.c (main): Likewise.
12715 * unexhp9k800.c (run_time_remap, save_data_space)
12716 (update_file_ptrs, read_header, write_header, calculate_checksum)
12717 (copy_file, copy_rest, display_header): Likewise.
12718 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
12719 Likewise.
12720 * xdisp.c (check_it): Likewise.
12721 * xfaces.c (register_color, unregister_color, unregister_colors):
12722 Likewise.
12723 * xfns.c (print_fontset_result): Likewise.
12724 * xrdb.c (member, fatal, main): Likewise.
12725
99033785
PE
127262011-07-10 Paul Eggert <eggert@cs.ucla.edu>
12727
12728 Fix minor problems found by static checking (Bug#9031).
12729 * chartab.c (char_table_set_range, map_sub_char_table):
12730 Remove unused locals.
12731 (uniprop_table): Now static.
12732 * composite.c (_work_char): Remove unused static var.
12733
9cb2ac56
JB
127342011-07-09 Juanma Barranquero <lekktu@gmail.com>
12735
12736 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12737
f25661f0
JD
127382011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12739
12740 * gtkutil.c (qttip_cb): Remove code without function.
12741
8278c4fe
EZ
127422011-07-09 Eli Zaretskii <eliz@gnu.org>
12743
12744 * w32.c (pthread_sigmask): New stub.
12745
1692ae2d 127462011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 12747
8a6ebd58 12748 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
12749 sigprocmask is portable only for single-threaded applications, and
12750 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
12751 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12752 (LIBES): Use it.
12753 * callproc.c (Fcall_process):
12754 * process.c (create_process):
12755 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12756 Use pthread_sigmask, not sigprocmask.
123403e4 12757
1b854618
JD
127582011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12759
12760 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12761 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12762 wrong (Bug#8591).
12763
3fe4b549
JD
127642011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12765
0ce7e563
JD
12766 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12767 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12768 (xg_hide_tooltip): Fix comment.
12769
3fe4b549
JD
12770 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12771 in registerServicesMenuSendTypes.
12772 (validRequestorForSendType): Don't check ns_return_types.
12773
12774 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12775 ns_return_type.
12776
5df75e47
JR
127772011-07-08 Jason Rumney <jasonr@gnu.org>
12778
22610910
JR
12779 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12780 SH_SHOW for hidden windows (Bug#5482).
12781
5df75e47
JR
12782 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12783 frame struct members of non-existent frames (Bug#6284).
12784
699c10bd
JD
127852011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12786
4393663b
JD
12787 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12788 variable firstTime not needed on OSX >= 10.6.
12789 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12790 >= 10.5. Use setKnobProportion, setDoubleValue.
12791
12792 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12793 (MAC_OS_X_VERSION_10_5): Define if not defined.
12794 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12795 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12796 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12797
12798 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 12799 cString and lossyCString on OSX >= 10.4.
4393663b 12800
58179cce 12801 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
12802 sizeToFit on OSX >= 10.2.
12803
12804 * nsimage.m (allocInitFromFile): Don't use deprecated method
12805 bestRepresentationForDevice on OSX >= 10.6.
12806
12807 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12808 to avoid warning.
12809
12810 * emacs.c: Declare unexec_init_emacs_zone.
12811
a63e0781
JD
12812 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12813
699c10bd
JD
12814 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12815
12816 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12817 on svcsMenu (Bug#8842).
12818
12819 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12820 ns_return_types.
12821 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12822
12823 * nsterm.m (QUTF8_STRING): Declare.
12824 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12825 (validRequestorForSendType): Return type is (id).
12826 Change indexOfObjectIdenticalTo to indexOfObject.
12827 Check if we have local selection before returning self (Bug#8842).
12828 (writeSelectionToPasteboard): Put local selection into paste board
12829 if we have a local selection (Bug#8842).
12830 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12831
12832 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12833 (ns_get_local_selection): Declare.
12834
54e10184
LMI
128352011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12836
9888ff71
LMI
12837 * keymap.c (describe_map_tree): Don't insert a double newline at
12838 the end of the buffer (bug#1169) and return whether we inserted
12839 something.
12840
54e10184
LMI
12841 * callint.c (Fcall_interactively): Change "reading args" to
12842 "providing args" to try to clarify what it does (bug#1010).
12843
15fa4783
KH
128442011-07-07 Kenichi Handa <handa@m17n.org>
12845
12846 * composite.c (composition_compute_stop_pos): Ignore a static
12847 composition starting before CHARPOS (Bug#8915).
12848
12849 * xdisp.c (handle_composition_prop): Likewise.
12850
a8815b00
EZ
128512011-07-07 Eli Zaretskii <eliz@gnu.org>
12852
12853 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12854 (Bug#9015)
12855
ef7b981d 128562011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
12857
12858 * character.h (unicode_category_t): New enum type.
12859
12860 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12861 (Qchar_code_property_table): New variable.
12862 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12863 (UNIPROP_COMPRESSED_FORM_P): New macros.
12864 (char_table_ascii): Uncompress the compressed values.
12865 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12866 Uncompress the compressed values.
ac389d0c 12867 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
12868 (char_table_ref_and_range): Uncompress the compressed values.
12869 (sub_char_table_set): New arg is_uniprop. Callers changed.
12870 Uncompress the compressed values.
12871 (sub_char_table_set_range): Args changed. Callers changed.
12872 (char_table_set_range): Adjuted for the above change.
12873 (map_sub_char_table): Delete args default_val and parent. Add arg
12874 top. Give decoded values to a Lisp function.
640c8776 12875 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
12876 values to a Lisp function. Gcpro more variables.
12877 (uniprop_table_uncompress)
12878 (uniprop_decode_value_run_length): New functions.
12879 (uniprop_decoder, uniprop_decoder_count): New variables.
12880 (uniprop_get_decoder, uniprop_encode_value_character)
12881 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12882 New functions.
12883 (uniprop_encoder, uniprop_encoder_count): New variables.
12884 (uniprop_get_encoder, uniprop_table)
12885 (Funicode_property_table_internal, Fget_unicode_property_internal)
12886 (Fput_unicode_property_internal): New functions.
12887 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12888 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 12889 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
12890 char-code-property-alist.
12891
640c8776 12892 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
12893 Vunicode_category_table.
12894
640c8776 12895 * font.c (font_range): Adjust for the change of
c805dec0
KH
12896 Vunicode_category_table.
12897
76b397fb
DN
128982011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12899
12900 * m/iris4d.h: Remove file, move contents ...
12901 * s/irix6-5.h: ... here.
12902
22b4128e
PE
129032011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12904
12905 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
12906 * alloc.c (mark_buffer):
12907 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12908 (clone_per_buffer_values): Don't assume that
22b4128e
PE
12909 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12910 This isn't true in general, and it's particularly not true
12911 if Emacs is configured with --with-wide-int.
12912 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12913 New macros, used in the buffer.c change.
12914
869795d6
JD
129152011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12916
12917 * xsettings.c: Use both GConf and GSettings if both are available.
12918 (store_config_changed_event): Add comment.
12919 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12920 (store_tool_bar_style_changed): New functions.
5e617bc2 12921 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
12922 (struct xsettings): Move font inside HAVE_XFT.
12923 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 12924 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 12925 Move inside HAVE_XFT.
640c8776 12926 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
12927 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12928 also.
12929 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 12930 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 12931 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
12932 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12933 (parse_settings): Move check for font inside HAVE_XFT.
12934 (read_settings, apply_xft_settings): Add comment.
12935 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12936 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12937 call store_font_name_changed.
12938 (xft_settings_event): Add comment.
12939 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12940 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12941 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12942 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12943 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
12944 (xsettings_get_system_font, xsettings_get_system_normal_font):
12945 Add comment.
869795d6 12946
d8ed26bd
PE
129472011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12948
12949 Random fixes. E.g., (random) never returned negative values.
12950 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12951 subseconds part to the entropy, as that's a bit more random.
12952 Prefer signed to unsigned, since the signedness doesn't matter and
12953 in general we prefer signed. When given a limit, use a
12954 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12955 latter isn't right if USE_2_TAGS_FOR_INTS.
12956 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12957 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12958
cabf1cac
SM
129592011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12960
12961 * textprop.c (text_property_stickiness):
12962 Obey Vtext_property_default_nonsticky.
12963 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12964 * w32fns.c (syms_of_w32fns):
12965 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12966
6e9b2be9
PE
129672011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12968
12969 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12970 This is more efficient than Ffile_directory_p and avoids a minor race.
12971
90186c68
LMI
129722011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12973
7c301272
LMI
12974 * buffer.c (Foverlay_put): Say what the return value is
12975 (bug#7835).
12976
c4f2d8d4
LMI
12977 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12978 is a directory before asking whether to use the file name
12979 (bug#7564).
ad637907
LMI
12980 (barf_or_query_if_file_exists): Make the "File is a directory"
12981 error be more correct.
c4f2d8d4 12982
90186c68
LMI
12983 * fns.c (Frequire): Remove the mention of the .gz files, since
12984 that's installation-specific, but keep the mention of
12985 `get-load-suffixes'.
12986
da64016e
PE
129872011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12988
12989 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12990 Report string overflow if the output is too long.
12991
7d47b580
JB
129922011-07-04 Juanma Barranquero <lekktu@gmail.com>
12993
a555cb87
JB
12994 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12995 (syms_of_gnutls): Remove duplicate DEFSYM for
12996 Qgnutls_bootprop_verify_hostname_error, an error for
12997 Qgnutls_bootprop_verify_error (which is no longer used).
12998
7d47b580
JB
12999 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13000 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13001 Also (re)move comments that are misplaced or no longer relevant.
13002
1e49bfab
LMI
130032011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13004
13005 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13006
1485f4c0
CY
130072011-07-03 Chong Yidong <cyd@stupidchicken.com>
13008
13009 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13010 and background color parameters if they have been changed.
13011
a9ab721e
LMI
130122011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13013
13014 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13015
cf7cff57
PE
130162011-07-03 Paul Eggert <eggert@cs.ucla.edu>
13017
2e13213d
PE
13018 * xsettings.c (SYSTEM_FONT): Define only when used.
13019 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
13020
cf7cff57
PE
13021 * keymap.c (access_keymap_1): Now static.
13022
7a8e04f7
CY
130232011-07-02 Chong Yidong <cyd@stupidchicken.com>
13024
13025 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
13026 leave any prefix arg for the up event (Bug#1586).
13027
61352f62
LMI
130282011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
13029
69bb1ef7
LMI
13030 * lread.c (syms_of_lread): Mention single symbols defined by
13031 `defvar' or `defconst' (bug#7154).
13032
61352f62 13033 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 13034 (Frequire): Mention get-load-suffixes.
61352f62 13035
28545e04
MR
130362011-07-02 Martin Rudalics <rudalics@gmx.at>
13037
13038 * window.h (window): Remove clone_number slot.
13039 * window.c (Fwindow_clone_number, Fset_window_clone_number):
13040 Remove.
13041 (make_parent_window, make_window, saved_window)
13042 (Fset_window_configuration, save_window_save): Don't deal with
13043 clone numbers.
13044 * buffer.c (Qclone_number): Remove declaration.
13045 (sort_overlays, overlay_strings): Don't deal with clone numbers.
13046
3349e122
SM
130472011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
13048
13049 Add multiple inheritance to keymaps.
13050 * keymap.c (Fmake_composed_keymap): New function.
13051 (Fset_keymap_parent): Simplify.
13052 (fix_submap_inheritance): Remove.
13053 (access_keymap_1): New function extracted from access_keymap to handle
13054 embedded parents and handle lists of maps.
13055 (access_keymap): Use it.
13056 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
13057 (Fcopy_keymap): Handle embedded parents.
13058 (Fcommand_remapping, define_as_prefix): Simplify.
13059 (Fkey_binding): Simplify.
13060 (syms_of_keymap): Move minibuffer-local-completion-map,
13061 minibuffer-local-filename-completion-map,
13062 minibuffer-local-must-match-map, and
13063 minibuffer-local-filename-must-match-map to Elisp.
13064 (syms_of_keymap): Defsubr make-composed-keymap.
13065 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
13066 (parse_menu_item): Trivial simplification.
13067
3279eb87
GM
130682011-07-01 Glenn Morris <rgm@gnu.org>
13069
13070 * Makefile.in (SETTINGS_LIBS): Fix typo.
13071
39cb9e56 130722011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
13073
13074 * coding.c (Fencode_coding_string): Record the last coding system
13075 used, as the function doc string says (bug#8738).
13076
0949d2b6
JD
130772011-07-01 Jan Djärv <jan.h.d@swipnet.se>
13078
13079 * xsettings.c (store_monospaced_changed): Take new font as arg and
13080 check for change against current_mono_font.
13081 (EMACS_TYPE_SETTINGS): Remove this and related defines.
13082 (emacs_settings_constructor, emacs_settings_get_property)
13083 (emacs_settings_set_property, emacs_settings_class_init)
13084 (emacs_settings_init, gsettings_obj): Remove.
13085 (something_changedCB): New function for HAVE_GSETTINGS.
13086 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
13087 with value as argument.
13088 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
13089 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 13090 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
13091 "changed".
13092
13093 * xgselect.c: Add defined (HAVE_GSETTINGS).
13094 (xgselect_initialize): Ditto.
13095
13096 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
13097 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
13098 xg_select.
13099
bbc6b304
PE
131002011-07-01 Paul Eggert <eggert@cs.ucla.edu>
13101
13102 * eval.c (struct backtrace): Simplify and port the data structure.
13103 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
13104 signed bit field, as this assumption is not portable and it makes
13105 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
13106 "char debug_on_exit : 1" as this is not portable either; instead,
13107 use the portable "unsigned int debug_on_exit : 1". Remove unused
13108 member evalargs. Remove obsolete comments about cc bombing out.
13109
9851bfc5
JD
131102011-06-30 Jan Djärv <jan.h.d@swipnet.se>
13111
51bb811f 13112 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
13113 Let HAVE_GSETTINGS override HAVE_GCONF.
13114 (store_monospaced_changed): New function.
13115 (EMACS_SETTINGS): A new type derived from GObject to handle
13116 GSettings notifications.
13117 (emacs_settings_constructor, emacs_settings_get_property)
13118 (emacs_settings_set_property, emacs_settings_class_init):
13119 New functions.
13120 (gsettings_client, gsettings_obj): New variables.
13121 (GSETTINGS_SCHEMA): New define.
13122 (something_changedCB): Call store_monospaced_changed.
13123 (init_gsettings): New function.
13124 (xsettings_initialize): Call init_gsettings.
13125 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
13126 to NULL.
13127
640c8776 13128 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
13129 GCONF_CFLAGS/LIBS.
13130
5386012d
MR
131312011-06-29 Martin Rudalics <rudalics@gmx.at>
13132
13133 * window.c (resize_root_window, grow_mini_window)
13134 (shrink_mini_window): Rename Qresize_root_window to
13135 Qwindow_resize_root_window and Qresize_root_window_vertically to
13136 Qwindow_resize_root_window_vertically.
13137
f13e0b08
PE
131382011-06-28 Paul Eggert <eggert@cs.ucla.edu>
13139
13140 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
13141
94515237
JB
131422011-06-27 Juanma Barranquero <lekktu@gmail.com>
13143
13144 * makefile.w32-in: Redesign dependencies so they reflect more
13145 clearly which files are directly included by each source file,
13146 and not through other includes.
13147
e43b6e43
MR
131482011-06-27 Martin Rudalics <rudalics@gmx.at>
13149
13150 * buffer.c (Qclone_number): Declare static and DEFSYM it.
13151 (sort_overlays, overlay_strings): When an overlay's clone number
13152 matches the window's clone number process the overlay even if
13153 the overlay's window property doesn't match the current window.
13154
d68443dc
MR
13155 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
13156 (Fwindow_hchild): Rename to Fwindow_left_child.
13157 (Fwindow_next): Rename to Fwindow_next_sibling.
13158 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
13159 (resize_window_check): Rename to window_resize_check.
13160 (resize_window_apply): Rename to window_resize_apply.
13161 (Fresize_window_apply): Rename to Fwindow_resize_apply.
13162 (Fdelete_other_windows_internal, resize_frame_windows)
13163 (Fsplit_window_internal, Fdelete_window_internal)
13164 (grow_mini_window, shrink_mini_window)
13165 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 13166
c7e73be5
JD
131672011-06-26 Jan Djärv <jan.h.d@swipnet.se>
13168
13169 * emacsgtkfixed.h: State that this is only used with Gtk+3.
13170 (emacs_fixed_set_min_size): Remove.
13171 (emacs_fixed_new): Take frame as argument.
13172
13173 * emacsgtkfixed.c: State that this is only used with Gtk+3.
13174 (_EmacsFixedPrivate): Remove minwidth/height.
13175 Add struct frame *f.
13176 (emacs_fixed_init): Initialize priv->f.
13177 (get_parent_class, emacs_fixed_set_min_size): Remove.
13178 (emacs_fixed_new): Set priv->f to argument.
13179 (emacs_fixed_get_preferred_width)
13180 (emacs_fixed_get_preferred_height): Use min_width/height from
13181 frames size_hint to set minimum and natural (Bug#8919).
13182 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
13183 and use min_width/height from frames size_hint to set
13184 min_width/height (Bug#8919).
13185
13186 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
13187 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
13188 Fix indentation.
c7e73be5 13189
cf99dcf8
EZ
131902011-06-26 Eli Zaretskii <eliz@gnu.org>
13191
13192 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
13193 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
13194 called at ZV.
13195
029529ac
CY
131962011-06-26 Chong Yidong <cyd@stupidchicken.com>
13197
13198 * process.c (wait_reading_process_output): Bypass select if
13199 waiting for a cell while ignoring keyboard input, and input is
13200 pending. Suggested by Jan Djärv (Bug#8869).
13201
7a7ef429
PE
132022011-06-25 Paul Eggert <eggert@cs.ucla.edu>
13203
13204 Use gnulib's dup2 module instead of rolling our own.
13205 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
13206
11fdef7d 132072011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
13208
13209 * dispnew.c (scrolling_window): Before scrolling, turn off a
13210 mouse-highlight in the window being scrolled.
13211
cd3520a4
JB
132122011-06-24 Juanma Barranquero <lekktu@gmail.com>
13213
13214 Move DEFSYM to lisp.h and use everywhere.
13215
13216 * character.h (DEFSYM): Move declaration...
13217 * lisp.h (DEFSYM): ...here.
13218
13219 * gnutls.c:
13220 * minibuf.c:
13221 * w32menu.c:
13222 * w32proc.c:
13223 * w32select.c: Don't include character.h.
13224
13225 * alloc.c (syms_of_alloc):
13226 * buffer.c (syms_of_buffer):
13227 * bytecode.c (syms_of_bytecode):
13228 * callint.c (syms_of_callint):
13229 * casefiddle.c (syms_of_casefiddle):
13230 * casetab.c (init_casetab_once):
13231 * category.c (init_category_once, syms_of_category):
13232 * ccl.c (syms_of_ccl):
13233 * cmds.c (syms_of_cmds):
13234 * composite.c (syms_of_composite):
13235 * dbusbind.c (syms_of_dbusbind):
13236 * dired.c (syms_of_dired):
13237 * dispnew.c (syms_of_display):
13238 * doc.c (syms_of_doc):
13239 * editfns.c (syms_of_editfns):
13240 * emacs.c (syms_of_emacs):
13241 * eval.c (syms_of_eval):
13242 * fileio.c (syms_of_fileio):
13243 * fns.c (syms_of_fns):
13244 * frame.c (syms_of_frame):
13245 * fringe.c (syms_of_fringe):
13246 * insdel.c (syms_of_insdel):
13247 * keymap.c (syms_of_keymap):
13248 * lread.c (init_obarray, syms_of_lread):
13249 * macros.c (syms_of_macros):
13250 * msdos.c (syms_of_msdos):
13251 * print.c (syms_of_print):
13252 * process.c (syms_of_process):
13253 * search.c (syms_of_search):
13254 * sound.c (syms_of_sound):
13255 * syntax.c (init_syntax_once, syms_of_syntax):
13256 * terminal.c (syms_of_terminal):
13257 * textprop.c (syms_of_textprop):
13258 * undo.c (syms_of_undo):
13259 * w32.c (globals_of_w32):
13260 * window.c (syms_of_window):
13261 * xdisp.c (syms_of_xdisp):
13262 * xfaces.c (syms_of_xfaces):
13263 * xfns.c (syms_of_xfns):
13264 * xmenu.c (syms_of_xmenu):
13265 * xsettings.c (syms_of_xsettings):
13266 * xterm.c (syms_of_xterm): Use DEFSYM.
13267
4228cf16
TZ
132682011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
13269
cd3520a4 13270 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 13271
7fcccf1e
PE
132722011-06-23 Paul Eggert <eggert@cs.ucla.edu>
13273
7efb4e0e
PE
13274 Integer and buffer overflow fixes (Bug#8873).
13275
ff5844ad
PE
13276 * print.c (printchar, strout): Check for string overflow.
13277 (PRINTPREPARE, printchar, strout):
13278 Don't set size unless allocation succeeds.
13279
90532f02
PE
13280 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
13281 for sizes. Check for string overflow more accurately.
13282 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
13283
6d84508d
PE
13284 * macros.c: Integer and buffer overflow fixes.
13285 * keyboard.h (struct keyboard.kbd_macro_bufsize):
13286 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
13287 Use ptrdiff_t, not int, for sizes.
13288 Don't increment bufsize until after realloc succeeds.
13289 Check for size-calculation overflow.
13290 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
13291
437b2cb4
PE
13292 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
13293
8b9ac8b4
PE
13294 * lread.c: Integer overflow fixes.
13295 (read_integer): Radix is now EMACS_INT, not int,
13296 to improve quality of diagnostics for out-of-range radices.
13297 Calculate buffer size correctly for out-of-range radices.
13298 (read1): Check for integer overflow in radices, and in
13299 read-circle numbers.
82cb60d3
PE
13300 (read_escape): Avoid int overflow.
13301 (Fload, openp, read_buffer_size, read1)
13302 (substitute_object_recurse, read_vector, read_list, map_obarray):
13303 Use ptrdiff_t, not int, for sizes.
13304 (read1): Use EMACS_INT, not int, for sizes.
20270765 13305 Check for size overflow.
8b9ac8b4 13306
7fcccf1e
PE
13307 * image.c (cache_image): Check for size arithmetic overflow.
13308
bfbbd7e7
PE
13309 * lread.c: Integer overflow issues.
13310 (saved_doc_string_size, saved_doc_string_length)
13311 (prev_saved_doc_string_size, prev_saved_doc_string_length):
13312 Now ptrdiff_t, not int.
13313 (read1): Don't assume doc string length fits in int. Check for
13314 out-of-range doc string lengths.
13315 (read_list): Don't assume file position fits in int.
39019e54 13316 (read_escape): Check for hex character overflow.
bfbbd7e7 13317
4e323265
LL
133182011-06-22 Leo Liu <sdl.web@gmail.com>
13319
13320 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
13321 Move to minibuffer.el.
13322
85fece3e
PE
133232011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13324
20b84ce9 13325 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
13326 The following patches are for when GLYPH_DEBUG && !XASSERT.
13327 * dispextern.h (trace_redisplay_p, dump_glyph_string):
13328 * dispnew.c (flush_stdout):
13329 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
13330 Mark as externally visible.
13331 * dispnew.c (check_window_matrix_pointers): Now static.
13332 * dispnew.c (window_to_frame_vpos):
13333 * xfns.c (unwind_create_frame):
13334 * xterm.c (x_check_font): Remove unused local.
13335 * scroll.c (CHECK_BOUNDS):
13336 * xfaces.c (cache_fache): Rename local to avoid shadowing.
13337 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
13338 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
13339 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
13340 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
13341 Now static.
13342 (debug_method_add): Use va_list and vsprintf rather than relying
13343 on undefined behavior with wrong number of arguments.
13344 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
13345 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
13346 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
13347 since we're not interested in debugging glyphs with old libraries.
13348 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
13349 GCC 4.6.0's static checking.
13350
0766b489
PE
133512011-06-22 Paul Eggert <eggert@cs.ucla.edu>
13352
31fd4b32
PE
13353 Integer overflow and signedness fixes (Bug#8873).
13354 A few related buffer overrun fixes, too.
13355
b79e8648
PE
13356 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
13357
0766b489
PE
13358 * dispextern.h (struct face.stipple):
13359 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
13360 (x_bitmap_mask, x_allocate_bitmap_record)
13361 (x_create_bitmap_from_data, x_create_bitmap_from_file)
13362 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
13363 (x_create_bitmap_from_xpm_data):
13364 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
13365 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
13366 (.bitmaps_last):
13367 * xfaces.c (load_pixmap):
13368 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
13369 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
13370 (.bitmaps_last, struct x_output.icon_bitmap):
13371 Use ptrdiff_t, not int, for bitmap indexes.
13372 (x_allocate_bitmap_record): Check for size overflow.
13373 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
13374
b081724f
PE
13375 Use ptrdiff_t, not int, for overlay counts.
13376 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
13377 * editfns.c (overlays_around, get_pos_property):
13378 * textprop.c (get_char_property_and_overlay):
13379 * xdisp.c (next_overlay_change, note_mouse_highlight):
13380 * xfaces.c (face_at_buffer_position):
21514da7
PE
13381 * buffer.c (OVERLAY_COUNT_MAX): New macro.
13382 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
13383 (Fnext_overlay_change, Fprevious_overlay_change)
13384 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 13385 Use ptrdiff_t, not int, for sizes.
21514da7 13386 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 13387
3de73e5e
PE
13388 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
13389
2606c57b
PE
13390 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
13391 (x_session_initialize): Do not assume string length fits in int.
13392
aaafe47a
PE
13393 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
13394 This is unlikely, but can occur if DPI is outlandish.
13395
2674ddc8 13396 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
13397 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
13398
28154962
PE
13399 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
13400 * xrdb.c (magic_file_p, search_magic_path):
13401 Omit last arg SUFFIX; it was always 0. All callers changed.
13402 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
13403
7de51af5
PE
13404 * xfont.c (xfont_match): Avoid need for strlen.
13405
25ed6cc3
PE
13406 * xfns.c: Don't assume strlen fits in int.
13407 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
13408
4eab31dd
PE
13409 * xdisp.c (message_log_check_duplicate): Return intmax_t,
13410 not unsigned long, as we prefer signed integers. All callers changed.
13411 Detect integer overflow in repeat count.
13412 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 13413 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 13414
171e2a58
PE
13415 * termcap.c: Don't assume sizes fit in int and never overflow.
13416 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
13417 (gobble_line): Check for size-calculation overflow.
13418
ad39faca 13419 * minibuf.c (Fread_buffer):
6e5bb2dc 13420 * lread.c (intern, intern_c_string):
74ca2eb3
PE
13421 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
13422 Don't assume string length fits in int.
13423
52c61c22 13424 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
13425 * gtkutil.c (style_changed_cb): Avoid need for strlen.
13426
b5b8c9e5
PE
13427 * font.c: Don't assume string length fits in int.
13428 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
13429 Use ptrdiff_t, not int.
ccd6111c
PE
13430 (font_intern_prop): Don't assume string length fits in int.
13431 Don't assume integer property fits in fixnum.
13432 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 13433
882f0d81 13434 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 13435 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
13436 Reformulate so as not to need the command string.
13437 Invoke gzip -cd rather than gunzip, as it's more portable.
13438 (lock_info_type, lock_file_1, lock_file):
13439 Don't assume pid_t and time_t fit in unsigned long.
13440 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
13441 (current_lock_owner): Prefer signed type for sizes.
13442 Use memcpy, not strncpy, where memcpy is what is really wanted.
13443 Don't assume (via atoi) that time_t and pid_t fit in int.
13444 Check for time_t and/or pid_t out of range, e.g., via a network share.
13445 Don't alloca where an auto var works fine.
13446
93f4cf88
PE
13447 * fileio.c: Fix some integer overflow issues.
13448 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
13449 Don't assume string length fits in int.
13450 (directory_file_name): Don't assume string length fits in long.
13451 (make_temp_name): Don't assume pid fits in int, or that its print
13452 length is less than 20.
13453
f3e92b69
PE
13454 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
13455
1bfdaf10
PE
13456 * coding.c (make_subsidiaries): Don't assume string length fits in int.
13457
35016e9a
PE
13458 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
13459
3d1e65a1
PE
13460 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
13461 We prefer signed integers, even for size calculations.
13462
0b963a93
PE
13463 * emacs.c: Don't assume string length fits in 'int'.
13464 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
13465 (main): Don't invoke strlen when not needed.
13466
573f4b54
PE
13467 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
13468 (XD_DEBUG_MESSAGE): Don't waste a byte.
13469
989f33ba
PE
13470 * callproc.c (getenv_internal_1, getenv_internal)
13471 (Fgetenv_internal):
965d34eb
PE
13472 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
13473
e4d29b33
PE
13474 * lread.c (invalid_syntax): Omit length argument.
13475 All uses changed. This doesn't fix a bug, but it simplifies the
13476 code away from its former Hollerith-constant appearance, and it's
13477 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 13478 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 13479
eb49b136
PE
13480 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
13481 This didn't break anything, but it didn't help either.
13482 It's confusing to put a bogus integer in a place where the actual
13483 value does not matter.
9f62aeb1 13484 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 13485 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 13486
15375a22
PE
13487 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
13488 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
13489 implementation.
b61cc01c
PE
13490 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
13491 We prefer signed types, and the value cannot exceed the EMACS_INT
13492 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
13493 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
13494 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
13495 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 13496
53b2623d
PE
13497 * indent.c (sane_tab_width): New function.
13498 (current_column, scan_for_column, Findent_to, position_indentation)
13499 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 13500 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 13501
51cab52b 13502 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 13503
f2ed8a70
PE
13504 * lisp.h (lint_assume): New macro.
13505 * composite.c (composition_gstring_put_cache):
13506 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
13507
abe80cc6
PE
13508 * editfns.c, insdel.c:
13509 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 13510
b02c740e
PE
13511 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
13512
ebc96716
PE
13513 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
13514
b4e50fa0 13515 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 13516 Use much-faster test for byte-length change.
311d5d7c 13517 Don't assume string byte-length fits in 'int'.
a4cf38e4 13518 Check that character arg fits in 'int'.
85461888 13519 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 13520
c0c1ee9f
PE
13521 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
13522
a498d7f4
PE
13523 * fns.c (concat): Catch string overflow earlier.
13524 Do not rely on integer wraparound.
13525
51cab52b
PE
13526 * dispextern.h (struct it.overlay_strings_charpos)
13527 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
13528 * xdisp.c (forward_to_next_line_start)
13529 (back_to_previous_visible_line_start)
13530 (reseat_at_next_visible_line_start, next_element_from_buffer):
13531 Don't arbitrarily truncate the value of 'selective' to int.
13532
76031fad
PE
13533 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
13534
5eb55db9
PE
13535 * composite.c: Don't truncate sizes to 'int'.
13536 (composition_gstring_p, composition_reseat_it)
13537 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
13538 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
13539 not EMACS_UINT, for indexes.
5eb55db9 13540
0703a717
PE
13541 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
13542
d6202519
PE
13543 * buffer.c: Include <verify.h>.
13544 (struct sortvec.priority, struct sortstr.priority):
8961a454 13545 Now EMACS_INT, not int.
c20998a7 13546 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
13547 (struct sortstr.size, record_overlay_string)
13548 (struct sortstrlist.size, struct sortlist.used):
13549 Don't truncate size to int.
13550 (record_overlay_string): Check for size-calculation overflow.
d6202519 13551 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 13552
d5a19415
JM
135532011-06-22 Jim Meyering <meyering@redhat.com>
13554
029529ac 13555 Don't leak an XBM-image-sized buffer
d5a19415
JM
13556 * image.c (xbm_load): Free the image buffer after using it.
13557
a9041e6c
PE
135582011-06-21 Paul Eggert <eggert@cs.ucla.edu>
13559
13560 Port to Sun C.
13561 * composite.c (find_automatic_composition): Omit needless 'return 0;'
13562 that Sun C diagnosed.
13563 * fns.c (secure_hash): Fix pointer signedness issue.
13564 * intervals.c (static_offset_intervals): New function.
13565 (offset_intervals): Use it.
13566
7f3f739f
LL
135672011-06-21 Leo Liu <sdl.web@gmail.com>
13568
13569 * deps.mk (fns.o):
13570 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
13571 sha512.h.
13572
13573 * fns.c (secure_hash): Rename from crypto_hash_function and change
13574 the first arg to accept symbols.
5b66d427 13575 (Fsecure_hash): New primitive.
7f3f739f
LL
13576 (syms_of_fns): New symbols.
13577
76147d94
DD
135782011-06-20 Deniz Dogan <deniz@dogan.se>
13579
13580 * process.c (Fset_process_buffer): Clarify return value in
13581 docstring.
13582
7d7d0045
CY
135832011-06-18 Chong Yidong <cyd@stupidchicken.com>
13584
13585 * dispnew.c (add_window_display_history): Use BVAR.
13586
13587 * xdisp.c (debug_method_add): Use BVAR.
13588 (check_window_end, dump_glyph_matrix, dump_glyph)
13589 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
13590
13591 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
13592 Likewise.
13593
13594 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
13595 check till after the cache is created in init_frame_faces.
13596
ff2bc410
SM
135972011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
13598
13599 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
13600
28177add
PE
136012011-06-16 Paul Eggert <eggert@cs.ucla.edu>
13602
dd3482fe
PE
13603 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
13604 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
13605 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
13606
393d71f3 13607 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
13608 * fileio.c (Finsert_file_contents):
13609 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
13610 Remove the old (too-loose) buffer overflow checks.
13611 They weren't needed, since make_gap checks for buffer overflow.
13612 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
13613 The old code merely checked for Emacs fixnum overflow, and relied
13614 on undefined (wraparound) behavior. The new code avoids undefined
13615 behavior, and also checks for ptrdiff_t and/or size_t overflow.
13616
2e6813b0 13617 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
13618 Tune. Don't use wider integers than needed. Don't use alloca.
13619 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 13620
599a9e4f
PE
13621 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
13622
99561444
PE
13623 * insdel.c, lisp.h (buffer_overflow): New function.
13624 (insert_from_buffer_1, replace_range, replace_range_2):
13625 * insdel.c (make_gap_larger):
13626 * editfns.c (Finsert_char):
13627 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
13628
28177add
PE
13629 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
13630
e69dafad
PE
136312011-06-15 Paul Eggert <eggert@cs.ucla.edu>
13632
4baa020d 13633 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 13634
b1c46f02
PE
13635 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
13636 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
13637
e69dafad
PE
13638 * fileio.c: Don't assume EMACS_INT fits in off_t.
13639 (emacs_lseek): New static function.
13640 (Finsert_file_contents, Fwrite_region): Use it.
13641 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
13642
566684ea
PE
13643 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
13644
e6966cd6
PE
13645 * fns.c: Don't overflow int when computing a list length.
13646 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
13647 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
13648 truncation on 64-bit hosts. Check for QUIT every
13649 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
13650 faster and is responsive enough.
13651 (Flength): Report an error instead of overflowing an integer.
13652 (Fsafe_length): Return a float if the value is not representable
13653 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 13654 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 13655 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 13656
dd0b0efb
PE
13657 * alloc.c: Check that resized vectors' lengths fit in fixnums.
13658 (header_size, word_size): New constants.
13659 (allocate_vectorlike): Don't check size overflow here.
13660 (allocate_vector): Check it here instead, since this is the only
13661 caller of allocate_vectorlike that could cause overflow.
13662 Check that the new vector's length is representable as a fixnum.
13663
86fe5cfe
PE
13664 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
13665 The previous code was bogus. For example, next_almost_prime (32)
13666 returned 39, which is undesirable as it is a multiple of 3; and
13667 next_almost_prime (24) returned 25, which is a multiple of 5 so
13668 why was the code bothering to check for multiples of 7?
13669
80e88859
PE
13670 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
13671
4a2f0ad6
PE
13672 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
13673
f66c7cf8
PE
13674 Variadic C functions now count arguments with ptrdiff_t.
13675 This partly undoes my 2011-03-30 change, which replaced int with size_t.
13676 Back then I didn't know that the Emacs coding style prefers signed int.
13677 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
13678 were being counted with int, which may truncate counts on 64-bit
13679 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
13680 * lisp.h (struct Lisp_Subr.function.aMANY)
13681 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
13682 Arg counts are now ptrdiff_t, not size_t.
13683 All variadic functions and their callers changed accordingly.
13684 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
13685 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
13686 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
13687 * callint.c (Fcall_interactively): Check arg count for overflow,
13688 to avoid potential buffer overrun. Use signed char, not 'int',
13689 for 'varies' array, so that we needn't bother to check its size
13690 calculation for overflow.
13691 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
13692 * eval.c (apply_lambda):
13693 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
13694 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
13695 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
13696
a1759b76
PE
13697 * callint.c (Fcall_interactively): Don't use index var as event count.
13698
d96be9fc
PE
13699 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
13700 * mem-limits.h (SIZE): Remove; no longer used.
13701
a690a978 13702 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 13703
578c21e6
PE
13704 Remove unnecessary casts.
13705 * xterm.c (x_term_init):
13706 * xfns.c (x_set_border_pixel):
13707 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
13708 These aren't needed now that we assume ANSI C.
13709
96f53c6c
PE
13710 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
13711 It's more likely to cause problems (due to unsigned overflow)
13712 than to cure them.
13713
83c77d31
PE
13714 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
13715
ee2079f1
PE
13716 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
13717
6da65536
PE
13718 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
13719
7147c4a4
PE
13720 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
13721
193e32d9
PE
13722 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
13723
e5533da6
PE
13724 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
13725
9910e595
PE
13726 GLYPH_CODE_FACE returns EMACS_INT, not int.
13727 * dispextern.h (merge_faces):
13728 * xfaces.c (merge_faces):
01103c44
PE
13729 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13730 Don't assume EMACS_INT fits in int.
9910e595 13731
2638320e
PE
13732 * character.h (CHAR_VALID_P): Remove unused parameter.
13733 * fontset.c, lisp.h, xdisp.c: All uses changed.
13734
045eb8d9
PE
13735 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13736
c1f134b5
PE
13737 * fns.c (concat): Minor tuning based on overflow analysis.
13738 This doesn't fix any bugs. Use int to hold character, instead
13739 of constantly refetching from Emacs object. Use XFASTINT, not
13740 XINT, for value known to be a character. Don't bother comparing
13741 a single byte to 0400, as it's always less.
13742
395fcb93 13743 * floatfns.c (Fexpt):
327eeec8
PE
13744 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13745
abbd3d23
PE
13746 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13747 for characters.
13748
684a03ef
PE
13749 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13750
0fed43f3
PE
13751 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13752 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13753 incorrectly succeed when S was a string, because 4294967386 was
13754 truncated before it was used.
13755
8fd02eb7
PE
13756 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13757 Otherwise, an out-of-range integer could cause undefined behavior
13758 on a 64-bit host.
13759
f8c86b69
PE
13760 * composite.c: Use int, not EMACS_INT, for characters.
13761 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13762 EMACS_INT, for values that are known to be in character range.
13763 This doesn't fix any bugs but is the usual style inside Emacs and
13764 may generate better code on 32-bit machines.
13765
34206dd2
PE
13766 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13767 This is for reasons similar to the recent CHAR_STRING fix.
13768 * charset.c (Fencode_char): Check that character arg is actually
13769 a character. Pass an int to ENCODE_CHAR.
13770 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13771 wider than 'int', as a compile-time check to prevent future regressions
13772 in this area.
13773
c5958d4c 13774 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
13775
13776 Make sure a 64-bit char is never passed to CHAR_STRING.
13777 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13778 by silently ignoring the top 32 bits, allowing some values
13779 that were far too large to be valid characters.
13780 * character.h: Include <verify.h>.
13781 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13782 arguments are no wider than unsigned, as a compile-time check
13783 to prevent future regressions in this area.
13784 * data.c (Faset):
01103c44 13785 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
13786 (Fsubst_char_in_region):
13787 * fns.c (concat):
13788 * xdisp.c (decode_mode_spec_coding):
13789 Adjust to CHAR_STRING's new requirement.
13790 * editfns.c (Finsert_char, Fsubst_char_in_region):
13791 * fns.c (concat): Check that character args are actually
13792 characters. Without this test, these functions did the wrong
13793 thing with wildly out-of-range values on 64-bit hosts.
13794
d37ca623
PE
13795 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13796 These casts should not be needed on 32-bit hosts, either.
13797 * keyboard.c (read_char):
13798 * lread.c (Fload): Remove casts to unsigned.
13799
ea204efb
PE
13800 * lisp.h (UNSIGNED_CMP): New macro.
13801 This fixes comparison bugs on 64-bit hosts.
13802 (ASCII_CHAR_P): Use it.
13803 * casefiddle.c (casify_object):
01103c44 13804 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
13805 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13806 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13807 * dispextern.h (FACE_FROM_ID):
13808 * keyboard.c (read_char): Use UNSIGNED_CMP.
13809
41cb286c
PE
13810 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13811 not to EMACS_INT, to avoid GCC warning.
13812
4a1b9832
PE
13813 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13814
55daad71
PE
13815 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13816 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13817 isn't needed on 32-bit machines.
8f95c75c 13818
01103c44
PE
13819 * buffer.c (Fgenerate_new_buffer_name):
13820 Use EMACS_INT for count, not int.
0ceccced 13821 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
13822
13823 * data.c (Qcompiled_function): Now static.
13824
c6f072e7
PE
13825 * window.c (window_body_lines): Now static.
13826
20ce5912
PE
13827 * image.c (gif_load): Rename local to avoid shadowing.
13828
9c4c5f81
PE
13829 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13830 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13831 * alloc.c (make_save_value): Integer argument is now of type
13832 ptrdiff_t, not int.
13833 (mark_object): Use ptrdiff_t, not int.
13834 * lisp.h (pD): New macro.
13835 * print.c (print_object): Use it.
13836
c0c5c8ae
PE
13837 * alloc.c: Use EMACS_INT, not int, to count objects.
13838 (total_conses, total_markers, total_symbols, total_vector_size)
13839 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
13840 (total_free_floats, total_floats, total_free_intervals)
13841 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
13842 Now EMACS_INT, not int. All uses changed.
13843 (Fgarbage_collect): Compute overall total using a double, so that
13844 integer overflow is less likely to be a problem. Check for overflow
13845 when converting back to an integer.
5a25e253
PE
13846 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13847 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13848 These were 'int' variables that could overflow on 64-bit hosts;
13849 they were never used, so remove them instead of repairing them.
211a0b2a 13850 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
13851 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13852 Previously, this ceilinged at INT_MAX, but that doesn't work on
13853 64-bit machines.
e46bb31a 13854 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 13855
c78baabf 13856 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 13857 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
13858 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13859 when a (possibly-narrower) signed value would do just as well.
13860 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 13861
c9d624c6
PE
13862 * alloc.c: Catch some string size overflows that we were missing.
13863 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13864 for convenience in STRING_BYTES_MAX.
13865 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13866 The definition here is exact; the one in lisp.h was approximate.
13867 (allocate_string_data): Check for string overflow. This catches
13868 some instances we weren't catching before. Also, it catches
13869 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13870 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13871 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 13872
c9d624c6
PE
13873 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13874 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 13875 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 13876
353032ce
PE
13877 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13878
2bccce07
PE
13879 * alloc.c (Fmake_string): Check for out-of-range init.
13880
0ac30604
SM
138812011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13882
13883 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13884
c195f2de
JD
138852011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13886
13887 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13888 xg_get_default_scrollbar_width.
13889
13890 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13891 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13892 (style_changed_cb): Call update_theme_scrollbar_width and call
13893 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13894 all frames (Bug#8505).
13895 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13896 Call gtk_window_set_resizable if HAVE_GTK3.
13897 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13898 and height if HAVE_GTK3 (Bug#8505).
13899 (scroll_bar_width_for_theme): New variable.
13900 (update_theme_scrollbar_width): New function.
13901 (xg_get_default_scrollbar_width): Move code to
13902 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13903 (xg_initialize): Call update_theme_scrollbar_width.
13904
13905 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13906
13907 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13908
e10ac9f1
MR
139092011-06-12 Martin Rudalics <rudalics@gmx.at>
13910
13911 * frame.c (make_frame): Call other_buffer_safely instead of
13912 other_buffer.
13913
13914 * window.c (temp_output_buffer_show): Call display_buffer with
13915 second argument Vtemp_buffer_show_specifiers and reset latter
13916 immediately after the call.
13917 (Vtemp_buffer_show_specifiers): New variable.
13918 (auto_window_vscroll_p, next_screen_context_lines)
13919 (Vscroll_preserve_screen_position): Remove leading asterisks from
13920 doc-strings.
13921
2d3c217e 139222011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 13923
7b7f97e8 13924 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
13925 * buffer.c (Qclone_number): Remove for now, as it's unused.
13926 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13927 (record_buffer): Remove unused local.
13928 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13929 (set_frame_buffer_list): Remove; unused.
13930 * frame.h (other_visible_frames): Remove decl.
13931 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13932 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13933 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13934 if HAVE_GPM.
13935 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13936 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13937 Define only if HAVE_GPM.
13938 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13939 (update_hints_inhibit): Remove; never set. All uses removed.
13940 * widgetprv.h (emacsFrameClassRec): Remove decl.
13941 * window.c (delete_deletable_window): Now returns void, since it
13942 wasn't returning anything.
13943 (compare_window_configurations): Remove unused locals.
13944 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13945 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
13946 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13947 the same widths as pointers. This follows up on the 2011-05-06 patch.
13948 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13949 * xterm.h: Likewise.
13950 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13951
1384b89e
JB
139522011-06-12 Juanma Barranquero <lekktu@gmail.com>
13953
13954 * makefile.w32-in: Update dependencies.
13955 (LISP_H): Add lib/intprops.h.
13956
1100a63c
CY
139572011-06-11 Chong Yidong <cyd@stupidchicken.com>
13958
13959 * image.c (gif_load): Add animation frame delay to the metadata.
13960 (syms_of_image): Use DEFSYM. New symbol `delay'.
13961
6198ccd0
MR
139622011-06-11 Martin Rudalics <rudalics@gmx.at>
13963
13964 * window.c (delete_deletable_window): Re-add.
13965 (Fset_window_configuration): Rewrite to handle dead buffers and
13966 consequently deletable windows.
13967 (window_tree, Fwindow_tree): Remove. Supply functionality in
13968 window.el.
13969 (compare_window_configurations): Simplify code.
13970
b6e3633c
AS
139712011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13972
1ab0dee5
AS
13973 * image.c (imagemagick_load_image): Fix type mismatch.
13974 (Fimagemagick_types): Likewise.
13975
b6e3633c
AS
13976 * window.h (replace_buffer_in_windows): Declare.
13977
9397e56f
MR
139782011-06-11 Martin Rudalics <rudalics@gmx.at>
13979
13980 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13981 Qclone_number. Remove external declaration of Qdelete_window.
13982 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13983 code.
640c8776
SM
13984 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13985 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
13986 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13987 buffer list implementation.
13988 (other_buffer_safely): New function.
13989 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13990 calls to replace_buffer_in_windows and
13991 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13992 if allowed.
13993 (record_buffer): Inhibit quitting and rewrite using quittable
13994 functions. Run Qbuffer_list_update_hook if allowed.
13995 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
13996 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13997 Move switch-to-buffer to window.el.
9397e56f
MR
13998 (bury-buffer): Move to window.el.
13999 (Vbuffer_list_update_hook): New variable.
14000
14001 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14002 section.
14003
14004 * window.h (resize_frame_windows): Move up in code.
14005 (Fwindow_frame): Remove EXFUN.
14006 (replace_buffer_in_all_windows): Remove prototype.
14007 (replace_buffer_in_windows_safely): Add prototype.
14008
14009 * window.c: Declare Qdelete_window static again. Move down
14010 declaration of select_count.
14011 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14012 (Fother_window): Move to window.el.
14013 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14014 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14015 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14016 window.el.
14017 (replace_buffer_in_windows): Implement by calling
14018 Qreplace_buffer_in_windows.
14019 (replace_buffer_in_all_windows): Remove with some functionality
14020 moved into replace_buffer_in_windows_safely.
14021 (replace_buffer_in_windows_safely): New function.
14022 (select_window_norecord, select_frame_norecord): Move in front
14023 of run_window_configuration_change_hook. Remove now obsolete
14024 declarations.
640c8776
SM
14025 (Fset_window_buffer): Rewrite doc-string.
14026 Call Qrecord_window_buffer.
9397e56f
MR
14027 (keys_of_window): Move binding for other-window to window.el.
14028
b50691aa
CY
140292011-06-11 Chong Yidong <cyd@stupidchicken.com>
14030
14031 * dispextern.h (struct image): Replace data member, whose int_val
14032 and ptr_val fields were not used by anything, with a single
14033 lisp_val object.
14034
14035 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
14036 (gif_clear_image, gif_load, imagemagick_load_image)
14037 (gs_clear_image, gs_load): Callers changed.
14038
3f754b86
PE
140392011-06-10 Paul Eggert <eggert@cs.ucla.edu>
14040
cca69397
PE
14041 * buffer.h: Include <time.h>, for time_t.
14042 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
14043
109e28d0
PE
14044 Fix minor problems found by static checking.
14045
60737f02
PE
14046 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
14047
4b66faf3
PE
14048 Make identifiers static if they are not used in other modules.
14049 * data.c (Qcompiled_function, Qframe, Qvector):
14050 * image.c (QimageMagick, Qsvg):
14051 * minibuf.c (Qmetadata):
14052 * window.c (resize_window_check, resize_root_window): Now static.
14053 * window.h (resize_window_check, resize_root_window): Remove decls.
14054
109e28d0
PE
14055 * window.c (window_deletion_count, delete_deletable_window):
14056 Remove; unused.
46a4ce9e
PE
14057 (window_body_lines): Now static.
14058 (Fdelete_other_windows_internal): Mark vars as initialized.
14059 Make sure 'resize_failed' is initialized.
14060 (run_window_configuration_change_hook): Rename local to avoid shadowing.
14061 (resize_window_apply): Remove unused local.
14062 * window.h (delete_deletable_window): Remove decl.
14063
109e28d0 14064 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
14065 (imagemagick_load_image): Fix pointer signedness problem by changing
14066 last arg from unsigned char * to char *. All uses changed.
14067 Also, fix a local for similar reasons.
14068 Remove unused locals. Remove locals to avoid shadowing.
14069 (fn_rsvg_handle_free): Remove; unused.
14070 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 14071 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 14072
3f754b86
PE
14073 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
14074
2547adb1
CY
140752011-06-10 Chong Yidong <cyd@stupidchicken.com>
14076
14077 * image.c (gif_load): Fix omitted cast error introduced by
14078 2011-06-06 change.
14079
2c8e37d4
MR
140802011-06-10 Martin Rudalics <rudalics@gmx.at>
14081
14082 * window.h (resize_proportionally, orig_total_lines)
14083 (orig_top_line): Remove from window structure.
14084 (set_window_height, set_window_width, change_window_heights)
14085 (Fdelete_window): Remove prototypes.
14086 (resize_frame_windows): Remove duplicate declaration.
14087
440a42e3
EZ
140882011-06-10 Eli Zaretskii <eliz@gnu.org>
14089
14090 * window.h (resize_frame_windows, resize_window_check)
14091 (delete_deletable_window, resize_root_window)
14092 (resize_frame_windows): Declare prototypes.
14093
14094 * window.c (resize_window_apply): Make definition be "static" to
14095 match the prototype.
14096
562dd5e9
MR
140972011-06-10 Martin Rudalics <rudalics@gmx.at>
14098
14099 * window.c: Remove declarations of Qwindow_size_fixed,
14100 window_min_size_1, window_min_size_2, window_min_size,
14101 size_window, window_fixed_size_p, enlarge_window, delete_window.
14102 Remove static from declaration of Qdelete_window, it's
14103 temporarily needed by Fbury_buffer.
14104 (replace_window): Don't assign orig_top_line and
14105 orig_total_lines.
14106 (Fdelete_window, delete_window): Remove. Window deletion is
14107 handled by window.el.
640c8776
SM
14108 (window_loop): Remove DELETE_OTHER_WINDOWS case.
14109 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
14110 (Fdelete_other_windows): Remove. Deleting other windows is
14111 handled by window.el.
14112 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
14113 handled in window.el.
14114 (window_min_size_2, window_min_size_1, window_min_size): Remove.
14115 Window minimum sizes are handled in window.el.
14116 (shrink_windows, size_window, set_window_height)
14117 (set_window_width, change_window_heights, window_height)
14118 (window_width, CURBEG, CURSIZE, enlarge_window)
14119 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
14120 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
14121 handled in window.el.
14122 (make_dummy_parent): Rename to make_parent_window and give it a
14123 second argument horflag.
14124 (make_window): Don't set resize_proportionally any more.
14125 (Fsplit_window): Remove. Windows are split in window.el.
14126 (save_restore_action, save_restore_orig_size)
14127 (shrink_window_lowest_first, save_restore_orig_size): Remove.
14128 Resize mini windows in window.el.
14129 (grow_mini_window, shrink_mini_window): Implement by calling
14130 Qresize_root_window_vertically, resize_window_check and
14131 resize_window_apply.
640c8776
SM
14132 (saved_window, Fset_window_configuration, save_window_save):
14133 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
14134 resize_proportionally.
14135 (window_min_height, window_min_width): Move to window.el.
14136 (keys_of_window): Move bindings for delete-other-windows,
14137 split-window, delete-window and enlarge-window to window.el.
14138
14139 * buffer.c: Temporarily extern Qdelete_window.
14140 (Fbury_buffer): Temporarily call Qdelete_window instead of
14141 Fdelete_window (Fbury_buffer will move to window.el soon).
14142
14143 * frame.c (set_menu_bar_lines_1): Remove code handling
14144 orig_top_line and orig_total_lines.
14145
14146 * dispnew.c (adjust_frame_glyphs_initially): Don't use
14147 set_window_height but set heights directly.
14148 (change_frame_size_1): Use resize_frame_windows.
14149
14150 * xdisp.c (init_xdisp): Don't use set_window_height but set
14151 heights directly.
14152
640c8776
SM
14153 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
14154 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
14155 run_window_configuration_change_hook.
14156
14157 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
14158 instead of change_window_heights and run
14159 run_window_configuration_change_hook.
14160
1a13852e
MR
141612011-06-09 Martin Rudalics <rudalics@gmx.at>
14162
14163 * window.c (replace_window): Rename second argument REPLACEMENT to
14164 NEW. New third argument SETFLAG. Rewrite.
14165 (delete_window, make_dummy_parent): Call replace_window with
14166 third argument 1.
14167 (window_list_1): Move down in code.
14168 (run_window_configuration_change_hook): Move set_buffer part
14169 before select_frame_norecord part in order to unwind correctly.
14170 Rename count1 to count.
14171 (recombine_windows, delete_deletable_window, resize_root_window)
14172 (Fdelete_other_windows_internal)
14173 (Frun_window_configuration_change_hook, make_parent_window)
14174 (resize_window_check, resize_window_apply, Fresize_window_apply)
14175 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
14176 (Fdelete_window_internal, Fresize_mini_window_internal):
14177 New functions.
1a13852e
MR
14178 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
14179
f3d1777e
MR
141802011-06-08 Martin Rudalics <rudalics@gmx.at>
14181
496e208e
MR
14182 * window.h (window): Add some new members to window structure -
14183 normal_lines, normal_cols, new_total, new_normal, clone_number,
14184 splits, nest, prev_buffers, next_buffers.
14185 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 14186 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 14187
f3d1777e
MR
14188 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
14189 Remove.
496e208e
MR
14190 (make_dummy_parent): Set new members of windows structure.
14191 (make_window): Move down in code. Handle new members of window
14192 structure.
14193 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
14194 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
14195 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
14196 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
14197 (Fset_window_next_buffers, Fset_window_clone_number):
14198 New functions.
496e208e
MR
14199 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
14200 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
14201 Doc-string fixes.
14202 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
14203 Argument WINDOW can be now internal window too.
14204 (Fwindow_use_time): Move up in code.
14205 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
14206 Rewrite doc-string.
14207 (Fset_window_configuration, saved_window)
14208 (Fcurrent_window_configuration, save_window_save): Handle new
14209 members of window structure.
b9e809c2
MR
14210 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
14211 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
14212 (syms_of_window): New Lisp objects Qrecord_window_buffer,
14213 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
14214 Qget_mru_window, Qresize_root_window,
14215 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
14216 Qauto_buffer_name; staticpro them.
f3d1777e 14217
abde8f8c
MR
142182011-06-07 Martin Rudalics <rudalics@gmx.at>
14219
14220 * window.c (Fwindow_total_size, Fwindow_left_column)
14221 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
14222 (Fwindow_list_1): New functions.
14223 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
14224 (Fwindow_width, Fscroll_left, Fscroll_right):
14225 Use window_body_cols instead of window_box_text_cols.
14226 (delete_window, Fset_window_configuration):
14227 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
14228 (delete_all_subwindows): Take a window as argument and not a
14229 structure. Rewrite.
190b47e6
MR
14230 (window_loop): Remove handling of GET_LRU_WINDOW and
14231 GET_LARGEST_WINDOW.
14232 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
14233
14234 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
14235 window_box_text_cols. delete_all_subwindows now takes a
14236 Lisp_Object as argument.
abde8f8c 14237
640c8776
SM
14238 * indent.c (compute_motion, Fcompute_motion):
14239 Use window_body_cols instead of window_box_text_cols.
abde8f8c 14240
fa8a67e6
MR
14241 * frame.c (delete_frame): Call delete_all_subwindows with root
14242 window as argument.
14243
a54e3482
DC
142442011-06-07 Daniel Colascione <dan.colascione@gmail.com>
14245
14246 * fns.c (Fputhash): Document return value.
14247
60002bf5
CY
142482011-06-06 Chong Yidong <cyd@stupidchicken.com>
14249
14250 * image.c (gif_load): Implement gif89a spec "no disposal" method.
14251
0c671da6 142522011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 14253
b862a52a 14254 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 14255
be44ca6c
PE
14256 Check for overflow when converting integer to cons and back.
14257 * charset.c (Fdefine_charset_internal, Fdecode_char):
14258 Use cons_to_unsigned to catch overflow.
14259 (Fencode_char): Use INTEGER_TO_CONS.
14260 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
14261 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
14262 * data.c (long_to_cons, cons_to_long): Remove.
14263 (cons_to_unsigned, cons_to_signed): New functions.
14264 These signal an error for invalid or out-of-range values.
14265 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
14266 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
14267 * font.c (Ffont_variation_glyphs):
14268 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
14269 * lisp.h: Include <intprops.h>.
14270 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
14271 (cons_to_signed, cons_to_unsigned): New decls.
14272 (long_to_cons, cons_to_long): Remove decls.
14273 * undo.c (record_first_change): Use INTEGER_TO_CONS.
14274 (Fprimitive_undo): Use CONS_TO_INTEGER.
14275 * xfns.c (Fx_window_property): Likewise.
14276 * xselect.c: Include <limits.h>.
14277 (x_own_selection, selection_data_to_lisp_data):
14278 Use INTEGER_TO_CONS.
14279 (x_handle_selection_request, x_handle_selection_clear)
14280 (x_get_foreign_selection, Fx_disown_selection_internal)
14281 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
14282 (lisp_data_to_selection_data): Use cons_to_unsigned.
14283 (x_fill_property_data): Use cons_to_signed.
14284 Report values out of range.
14285
d1f3d2af
PE
14286 Check for buffer and string overflow more precisely.
14287 * buffer.h (BUF_BYTES_MAX): New macro.
14288 * lisp.h (STRING_BYTES_MAX): New macro.
14289 * alloc.c (Fmake_string):
14290 * character.c (string_escape_byte8):
14291 * coding.c (coding_alloc_by_realloc):
14292 * doprnt.c (doprnt):
14293 * editfns.c (Fformat):
14294 * eval.c (verror):
14295 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
14296 since they may not be the same number.
14297 * editfns.c (Finsert_char):
14298 * fileio.c (Finsert_file_contents):
14299 Likewise for BUF_BYTES_MAX.
14300
dd52fcea
PE
14301 * image.c: Use ptrdiff_t, not int, for sizes.
14302 (slurp_file): Switch from int to ptrdiff_t.
14303 All uses changed.
14304 (slurp_file): Check that file size fits in both size_t (for
14305 malloc) and ptrdiff_t (for sanity and safety).
14306
7f9bbdbb
PE
14307 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
14308 if b->modtime has its maximal value.
14309
dfe18f82
PE
14310 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
14311
84acfcf0
PE
14312 Don't assume time_t can fit into int.
14313 * buffer.h (struct buffer.modtime): Now time_t, not int.
14314 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
14315 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
14316
ccd9a01a
PE
14317 Minor fixes for signed vs unsigned integers.
14318 * character.h (MAYBE_UNIFY_CHAR):
14319 * charset.c (maybe_unify_char):
14320 * keyboard.c (read_char, reorder_modifiers):
14321 XINT -> XFASTINT, since the integer must be nonnegative.
14322 * ftfont.c (ftfont_spec_pattern):
14323 * keymap.c (access_keymap, silly_event_symbol_error):
14324 XUINT -> XFASTINT, since the integer must be nonnegative.
14325 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
14326 since it makes no difference and we prefer signed.
14327 * keyboard.c (record_char): Use XUINT when all the neighbors do.
14328 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
14329 nonnegative.
14330
d6d100dd
SM
143312011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
14332
14333 * window.h (Fwindow_frame): Declare.
14334
2b6148e4
PE
143352011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14336
14337 * alloc.c: Simplify handling of large-request failures (Bug#8800).
14338 (SPARE_MEMORY): Always define.
14339 (LARGE_REQUEST): Remove.
14340 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
14341
f230ecc9
MR
143422011-06-06 Martin Rudalics <rudalics@gmx.at>
14343
727e958e
MR
14344 * lisp.h: Move EXFUNS for Fframe_root_window,
14345 Fframe_first_window and Fset_frame_selected_window to window.h.
14346
14347 * window.h: Move EXFUNS for Fframe_root_window,
14348 Fframe_first_window and Fset_frame_selected_window here from
14349 lisp.h.
14350
14351 * frame.c (Fwindow_frame, Fframe_first_window)
14352 (Fframe_root_window, Fframe_selected_window)
14353 (Fset_frame_selected_window): Move to window.c.
14354 (Factive_minibuffer_window): Move to minibuf.c.
14355 (Fother_visible_frames_p): New function.
14356
14357 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
14358
f230ecc9
MR
14359 * window.c (decode_window, decode_any_window): Move up in code.
14360 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
14361 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
14362 (Fwindow_buffer): Move up and rewrite doc-string.
14363 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
14364 (Fwindow_prev): New functions.
727e958e
MR
14365 (Fwindow_frame): Move here from frame.c. Accept any window as
14366 argument.
14367 (Fframe_root_window, Fframe_first_window)
14368 (Fframe_selected_window): Move here from frame.c. Accept frame
14369 or arbitrary window as argument. Update doc-strings.
14370 (Fminibuffer_window): Move up in code.
14371 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
14372 (Fset_frame_selected_window): Move here from frame.c.
14373 Marginal rewrite.
727e958e
MR
14374 (Fselected_window, select_window, Fselect_window): Move up in
14375 code. Minor doc-string fixes.
f230ecc9 14376
4d09bcf6
PE
143772011-06-06 Paul Eggert <eggert@cs.ucla.edu>
14378
14379 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
14380 Do not assume that spare memory exists; that assumption is valid
14381 only if SYSTEM_MALLOC.
14382 (LARGE_REQUEST): New macro, so that the issue of large requests
14383 is separated from the issue of spare memory.
14384
810928a2
AS
143852011-06-05 Andreas Schwab <schwab@linux-m68k.org>
14386
172418ad
AS
14387 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
14388 format. (Bug#8806)
14389
43f862f7
AS
14390 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
14391
810928a2
AS
14392 * xfns.c (x_set_scroll_bar_default_width): Move declarations
14393 before statements.
14394
a059fe24
JD
143952011-06-05 Jan Djärv <jan.h.d@swipnet.se>
14396
14397 * gtkutil.c (xg_get_default_scrollbar_width): New function.
14398
14399 * gtkutil.h: Declare xg_get_default_scrollbar_width.
14400
14401 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
14402 min width by calling x_set_scroll_bar_default_width (Bug#8505).
14403
989bf368
JB
144042011-06-05 Juanma Barranquero <lekktu@gmail.com>
14405
14406 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
14407
4b80f674
CY
144082011-06-04 Chong Yidong <cyd@stupidchicken.com>
14409
14410 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
14411 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
14412 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
14413 New error handlers.
4b80f674
CY
14414 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
14415 Obey Vx_select_enable_clipboard_manager. Catch errors in
14416 x_clipboard_manager_save (Bug#8779).
14417 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 14418 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 14419
99a33b77 144202011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
14421
14422 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
14423
99a33b77 144242011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
14425
14426 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
14427 in the current matrix if keep_current_p is non-zero.
14428
8264569d
EZ
144292011-06-04 Eli Zaretskii <eliz@gnu.org>
14430
14431 * bidi.c (bidi_level_of_next_char): Fix last change.
14432
57f97249
EZ
144332011-06-03 Eli Zaretskii <eliz@gnu.org>
14434
fec2107c 14435 Support bidi reordering of text covered by display properties.
57f97249 14436
fec2107c
EZ
14437 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
14438 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
14439 (bidi_cache_search, bidi_cache_iterator_state)
14440 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
14441 (bidi_level_of_next_char, bidi_move_to_visually_next):
14442 Support character positions inside a run of characters covered by a
fec2107c
EZ
14443 display string.
14444 (bidi_paragraph_init, bidi_resolve_explicit_1)
14445 (bidi_level_of_next_char): Call bidi_fetch_char and
14446 bidi_fetch_char_advance instead of FETCH_CHAR and
14447 FETCH_CHAR_ADVANCE.
14448 (bidi_init_it): Initialize new members.
14449 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
14450 definitions.
14451 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
14452 instead of using explicit *_CHAR codes.
d6d100dd
SM
14453 (bidi_resolve_explicit, bidi_resolve_weak):
14454 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
14455 bidirectional text is supported only in multibyte buffers.
14456 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
14457 it to initialize the frame_window_p member of struct bidi_it.
14458 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
14459 (bidi_resolve_explicit, bidi_resolve_weak)
14460 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
14461 bidi_it->nchars is non-positive.
14462 (bidi_level_of_next_char): Don't try to lookup the cache for the
14463 next/previous character if nothing is cached there yet, or if we
14464 were just reseat()'ed to a new position.
c40e2fb2 14465
0e14fe90
EZ
14466 * xdisp.c (set_cursor_from_row): Set start and stop points
14467 according to the row's direction when priming the loop that looks
14468 for the glyph on which to display cursor.
14469 (single_display_spec_intangible_p): Function deleted.
14470 (display_prop_intangible_p): Reimplement to call
14471 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
14472 Accept 3 additional arguments needed by handle_display_spec.
14473 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
14474 values: lists, `(when COND...)' forms, etc.
14475 (single_display_spec_string_p): Support property values that are
14476 lists with the argument STRING its top-level element.
14477 (display_prop_string_p): Fix the condition for processing a
14478 property that is a list to be consistent with handle_display_spec.
fec2107c 14479 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
14480 last portion of handle_display_prop.
14481 (compute_display_string_pos): Accept additional argument
14482 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
14483 value of a `display' property is a "replacing spec".
14484 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
14485 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
14486 the display property, but just return a value indicating whether
14487 the display property will replace the characters it covers.
14488 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
14489 frame_window_p members of struct bidi_it.
d6d100dd
SM
14490 (compute_display_string_pos, compute_display_string_end):
14491 New functions.
fec2107c
EZ
14492 (push_it): Accept second argument POSITION, where pop_it should
14493 jump to continue iteration.
14494 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 14495
fec2107c
EZ
14496 * keyboard.c (adjust_point_for_property): Adjust the call to
14497 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
14498
14499 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
14500 (bidi_init_it): Update prototypes.
14501 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
14502 (compute_display_string_pos, compute_display_string_end):
14503 Declare prototypes.
fec2107c
EZ
14504 (struct bidi_it): New members nchars and disp_pos. ch_len is now
14505 EMACS_INT.
fc6f18ce 14506
40087514 145072011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 14508
57f53182
PE
14509 Malloc failure behavior now depends on size of allocation.
14510 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
14511 * lisp.h: Change signatures accordingly.
14512 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
14513 All callers changed. (Bug#8762)
14514
14515 * gnutls.c: Use Emacs's memory allocators.
14516 Without this change, the gnutls library would invoke malloc etc.
14517 directly, which causes problems on non-SYNC_INPUT hosts, and which
14518 runs afoul of improving memory_full behavior. (Bug#8761)
14519 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
14520 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
14521 xfree instead of the default malloc, realloc, free.
14522 (Fgnutls_boot): No need to check for memory allocation failure,
14523 since xmalloc does that for us.
14524
ac32cd99 14525 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
14526 * category.c (hash_get_category_set):
14527 * ccl.c (ccl_driver):
14528 * charset.c (Fdefine_charset_internal):
14529 * charset.h (struct charset.hash_index):
14530 * composite.c (get_composition_id, gstring_lookup_cache)
14531 (composition_gstring_put_cache):
14532 * composite.h (struct composition.hash_index):
14533 * dispextern.h (struct image.hash):
14534 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
14535 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
14536 (hashfn_equal, hashfn_user_defined, make_hash_table)
14537 (maybe_resize_hash_table, hash_lookup, hash_put)
14538 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
14539 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
14540 (Fsxhash, Fgethash, Fputhash, Fmaphash):
14541 * image.c (make_image, search_image_cache, lookup_image)
14542 (xpm_put_color_table_h):
14543 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 14544 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 14545 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 14546 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
14547 * alloc.c (allocate_vectorlike):
14548 Check for overflow in vector size calculations.
14549 * ccl.c (ccl_driver):
14550 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
14551 * fns.c, image.c: Remove unnecessary static decls that would otherwise
14552 need to be updated by these changes.
40087514
PE
14553 * fns.c (make_hash_table, maybe_resize_hash_table):
14554 Check for integer overflow with large hash tables.
0de4bb68
PE
14555 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
14556 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
14557 (SXHASH_REDUCE): New macro.
14558 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
14559 Use it instead of discarding useful hash info with large hash values.
14560 (sxhash_float): New function.
14561 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
14562 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
14563 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
14564 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
14565 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
14566 Adjust signatures to match updated version of code.
14567 (consing_since_gc): Now EMACS_INT, since a single hash table can
14568 use more than INT_MAX bytes.
14569
698d32e2
DN
145702011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
14571
14572 Make it possible to build with GCC-4.6+ -O2 -flto.
14573
14574 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
14575
fd6fa53f
SM
145762011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
14577
14578 * minibuf.c (get_minibuffer, read_minibuf_unwind):
14579 Call minibuffer-inactive-mode.
14580
864db017
JB
145812011-05-31 Juanma Barranquero <lekktu@gmail.com>
14582
14583 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
14584 Update dependencies.
14585
2ad0baf4
DN
145862011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14587
14588 * data.c (init_data): Remove code for UTS, this system is not
14589 supported anymore.
14590
4fcc2638
DN
145912011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14592
14593 Don't force ./temacs to start in terminal mode.
14594
14595 * frame.c (make_initial_frame): Initialize faces in all cases, not
14596 only when CANNOT_DUMP is defined.
14597 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
14598
c56e0fd5
DN
145992011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14600
14601 * dispnew.c (add_window_display_history): Use const for the string
14602 pointer. Remove declaration, not needed.
14603
333d54da 146042011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 14605
55d4c1b2 14606 Use 'inline', not 'INLINE'.
333d54da 14607 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
14608 * alloc.c, fontset.c (INLINE): Remove.
14609 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
14610 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
14611 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
14612 * gmalloc.c (register_heapinfo): Use inline unconditionally.
14613 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
14614
738db178
DN
146152011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
14616
14617 Make it possible to run ./temacs.
14618
14619 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
14620 syms_of_callproc does the same thing. Remove test for
14621 "initialized", do it in the caller.
14622 * emacs.c (main): Avoid calling set_initial_environment when dumping.
14623
620c53a6
SM
146242011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
14625
14626 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
14627 (read_minibuf): Use get_minibuffer.
14628 (syms_of_minibuf): Use DEFSYM.
14629 (Qmetadata): New var.
14630 * data.c (Qbuffer): Don't make it static.
14631 (syms_of_data): Use DEFSYM.
14632
e003a292
PE
146332011-05-31 Paul Eggert <eggert@cs.ucla.edu>
14634
14635 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
14636 (CCL_CODE_MIN): New macro.
14637
ed008a6d
PE
146382011-05-30 Paul Eggert <eggert@cs.ucla.edu>
14639
3687c2ef
PE
14640 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
14641
ed008a6d
PE
14642 * eval.c (Qdebug): Now static.
14643 * lisp.h (Qdebug): Remove decl. This reverts a part of the
14644 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
14645 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
14646
d66c4c7c
CY
146472011-05-29 Chong Yidong <cyd@stupidchicken.com>
14648
14649 * image.c: Various fixes to ImageMagick code comments.
14650 (Fimagemagick_types): Doc fix.
14651
5fbc2025
PE
146522011-05-29 Paul Eggert <eggert@cs.ucla.edu>
14653
0196f88a
PE
14654 Minor fixes prompted by GCC 4.6.0 warnings.
14655
14656 * xselect.c (converted_selections, conversion_fail_tag): Now static.
14657
5fbc2025
PE
14658 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
14659 (x_clipboard_manager_save_all): Move extern decl to ...
14660 * xterm.h: ... here, so that it can be checked for consistency.
14661
1dd3c2d9
CY
146622011-05-29 Chong Yidong <cyd@stupidchicken.com>
14663
14664 * xselect.c (x_clipboard_manager_save_frame)
14665 (x_clipboard_manager_save_all): New functions.
14666 (Fx_clipboard_manager_save): Lisp function deleted.
14667
14668 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
14669 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
14670
14671 * xterm.h: Update prototype.
14672
5ba6571d
WX
146732011-05-28 William Xu <william.xwl@gmail.com>
14674
14675 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
14676 exiting (Bug#8239).
14677
3eaff834
JM
146782011-05-28 Jim Meyering <meyering@redhat.com>
14679
e1900994 14680 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
14681 * fns.c (to_uchar): Define.
14682 (crypto_hash_function): Use it to convert some newly-signed
14683 variables to unsigned, to avoid sign-extension bugs. For example,
14684 without this change, (md5 "truc") would evaluate to
14685 45723a2aff78ff4fff7fff1114760e62 rather than the expected
14686 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 14687 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 14688
0f6990a7
PE
146892011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14690
14691 Integer overflow fixes.
c8a9ca5a 14692
08686060
PE
14693 * dbusbind.c: Serial number integer overflow fixes.
14694 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
14695 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
14696 to hold a serial number that is too large for a fixnum.
14697 (Fdbus_method_return_internal, Fdbus_method_error_internal):
14698 Check for serial numbers out of range. Decode any serial number
59568bf0 14699 that was so large that it became a float. (Bug#8722)
08686060 14700
2d1fc3c7
PE
14701 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
14702 (Fdbus_call_method, Fdbus_call_method_asynchronously):
14703 Use XFASTINT rather than XUINT when numbers are nonnegative.
14704 (xd_append_arg, Fdbus_method_return_internal):
14705 (Fdbus_method_error_internal): Likewise. Also, for unsigned
14706 arguments, check that Lisp number is nonnegative, rather than
59568bf0 14707 silently wrapping negative numbers around. (Bug#8722)
30217ff0 14708 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 14709 (Bug#8722)
2d1fc3c7 14710
c8a9ca5a
PE
14711 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
14712
519e1d69
PE
14713 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
14714
6df6ae42 14715 ccl: Add integer overflow checks.
30569699
PE
14716 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
14717 (IN_INT_RANGE): New macros.
14718 (ccl_driver): Use them to check for integer overflow when
14719 decoding a CCL program. Many of the new checks are whether XINT (x)
14720 fits in int; it doesn't always, on 64-bit hosts. The new version
14721 doesn't catch all possible integer overflows, but it's an
847044ea 14722 improvement. (Bug#8719)
30569699 14723
c11285dc
PE
14724 * alloc.c (make_event_array): Use XINT, not XUINT.
14725 There's no need for unsigned here.
14726
fdccd48e
PE
14727 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
14728 This follows up to the 2011-05-06 change that substituted uintptr_t
14729 for EMACS_INT. This case wasn't caught back then.
14730
37910ab2
PE
14731 Rework Fformat to avoid integer overflow issues.
14732 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14733 now (part of C89). Include <verify.h>.
14734 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14735 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14736 (Fformat): Avoid the prepass trying to compute sizes; it was only
14737 approximate and thus did not catch overflow reliably. Instead, walk
14738 through the format just once, formatting and computing sizes as we go,
14739 checking for integer overflow at every step, and allocating a larger
14740 buffer as needed. Keep track separately whether the format is
14741 multibyte. Keep only the most-recently calculated precision, rather
14742 than them all. Record whether each argument has been converted to
14743 string. Use EMACS_INT, not int, for byte and char and arg counts.
14744 Support field widths and precisions larger than INT_MAX. Avoid
14745 sprintf's undefined behavior with conversion specifications such as %#d
14746 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14747 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14748 formatting out-of-range floating point numbers with int
9173deec 14749 formats. (Bug#8668)
37910ab2 14750
2e6578fb
PE
14751 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14752
0ae6bdee
PE
14753 * data.c: Avoid integer truncation in expressions involving floats.
14754 * data.c: Include <intprops.h>.
14755 (arith_driver): When there's an integer overflow in an expression
14756 involving floating point, convert the integers to floating point
14757 so that the resulting value does not suffer from catastrophic
14758 integer truncation. For example, on a 64-bit host (* 4
14759 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14760 Do not rely on undefined behavior after integer overflow.
14761
de883a70
PE
14762 merge count_size_as_multibyte, parse_str_to_multibyte
14763 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 14764 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
14765 Check for integer overflow.
14766 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14767 since it's now a duplicate of the other. This is more of
14768 a character than a buffer op, so better that it's in character.c.
14769 * fns.c, print.c: Adjust to above changes.
14770
2ff916cb
PE
147712011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14772
14773 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14774
f1b54466
PE
147752011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14776
fb1ac845
PE
14777 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14778 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14779 (x_clipboard_manager_save): Now static.
14780 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14781
f1b54466
PE
14782 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14783 (crypto_hash_function): Now static.
14784 Fix pointer signedness problems. Avoid unnecessary initializations.
14785
a9f737ee
CY
147862011-05-27 Chong Yidong <cyd@stupidchicken.com>
14787
14788 * termhooks.h (Vselection_alist): Make it terminal-local.
14789
14790 * terminal.c (create_terminal): Initialize it.
14791
14792 * xselect.c: Support for clipboard managers.
14793 (Vselection_alist): Move to termhooks.h as terminal-local var.
14794 (LOCAL_SELECTION): New macro.
14795 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14796 (symbol_to_x_atom): Remove gratuitous arg.
14797 (x_handle_selection_request, lisp_data_to_selection_data)
14798 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
14799 (x_own_selection, x_get_local_selection, x_convert_selection):
14800 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
14801 (some_frame_on_display): Delete unused function.
14802 (Fx_own_selection_internal, Fx_get_selection_internal)
14803 (Fx_disown_selection_internal, Fx_selection_owner_p)
14804 (Fx_selection_exists_p): New optional frame arg.
14805 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14806 (x_handle_selection_clear): Don't treat other terminals with the
14807 same keyboard specially. Use the terminal-local Vselection_alist.
14808 (x_clear_frame_selections): Use Frun_hook_with_args.
14809
14810 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14811
14812 * xterm.h: Add support for those atoms.
14813
e067f0c1
CY
148142011-05-26 Chong Yidong <cyd@stupidchicken.com>
14815
14816 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14817 (converted_selections, conversion_fail_tag): New global variables.
14818 (x_selection_request_lisp_error): Free the above.
14819 (x_get_local_selection): Remove unnecessary code.
14820 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
14821 of converted selections stored in converted_selections.
14822 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
14823 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14824 (x_convert_selection): New function.
14825 (x_handle_selection_event): Simplify.
14826 (x_get_foreign_selection): Don't ignore incoming requests while
14827 waiting for an answer; this will fail when we implement
14828 SAVE_TARGETS, and seems unnecessary anyway.
14829 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14830 (Vx_sent_selection_functions): Doc fix.
14831
0f4aebc0
LL
148322011-05-26 Leo Liu <sdl.web@gmail.com>
14833
14834 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14835
e61124cd
YM
148362011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14837
14838 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14839
14840 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14841 for fringe update if it has periodic bitmap.
ac389d0c 14842 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
14843 and fringe_bitmap_periodic_p.
14844
14845 * fringe.c (get_fringe_bitmap_data): New function.
14846 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14847 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14848 row. Mark glyph row for fringe update if periodicity changed.
14849
14850 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14851 for fringe update unless it has periodic bitmap.
14852
f16d9837
KH
148532011-05-25 Kenichi Handa <handa@m17n.org>
14854
14855 * xdisp.c (get_next_display_element): Set correct it->face_id for
14856 a static composition.
14857
e1b90ef6
LL
148582011-05-24 Leo Liu <sdl.web@gmail.com>
14859
14860 * deps.mk (fns.o):
14861 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14862
14863 * fns.c (crypto_hash_function, Fsha1): New function.
14864 (Fmd5): Use crypto_hash_function.
14865 (syms_of_fns): Add Ssha1.
14866
7400048f
PE
148672011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14868
14869 * gnutls.c: Remove unused macros.
14870 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14871 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14872 Remove macros that are defined and never used.
14873 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14874
abb71cf4
CY
148752011-05-22 Chong Yidong <cyd@stupidchicken.com>
14876
14877 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14878 (Fx_get_selection_internal): Minor cleanup.
14879 (Fx_own_selection_internal): Rename arguments for consistency with
14880 select.el.
14881
6307db39
PE
148822011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14883
14884 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14885
f3d4e0a4
CY
148862011-05-22 Chong Yidong <cyd@stupidchicken.com>
14887
14888 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14889
4d8ade89
YM
148902011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14891
14892 * dispnew.c (scrolling_window): Don't exclude the case that the
14893 last enabled row in the desired matrix touches the bottom boundary.
14894
32078c8d
GM
148952011-05-21 Glenn Morris <rgm@gnu.org>
14896
14897 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
14898 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14899 and add some more files.
32078c8d 14900
7285dc67
EZ
149012011-05-20 Eli Zaretskii <eliz@gnu.org>
14902
14903 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14904 report_file_error introduced by the change from 2011-05-07.
14905
89d1bd22
PE
149062011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14907
14908 * systime.h (Time): Define only if emacs is defined.
14909 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14910 where the include path doesn't have X11/X.h by default. See
14911 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14912
cd394be1 149132011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
14914
14915 * composite.c (find_automatic_composition): Fix previous change.
14916
b9704ad9
GM
149172011-05-20 Glenn Morris <rgm@gnu.org>
14918
14919 * lisp.mk: New file, split from Makefile.in.
14920 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14921 (shortlisp): Remove.
14922 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14923
4a720484
GM
149242011-05-19 Glenn Morris <rgm@gnu.org>
14925
14926 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14927 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14928 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14929 (lisp): Set the order to that of loadup.el.
14930 (shortlisp): Make it a copy of $lisp.
14931 (SOME_MACHINE_LISP): Remove.
14932 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14933 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14934
a28d4396
KH
149352011-05-18 Kenichi Handa <handa@m17n.org>
14936
14937 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14938 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14939 (find_automatic_composition): Mostly rewrite for efficiency.
14940
a2b1fa8e
JB
149412011-05-18 Juanma Barranquero <lekktu@gmail.com>
14942
14943 * makefile.w32-in: Update dependencies.
14944
8e1f5610
CS
149452011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14946
14947 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 14948 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 14949
7025ee00 149502011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 14951
cdfa6eab
PE
14952 Fix some integer overflow issues, such as string length overflow.
14953
06d6db33
PE
14954 * insdel.c (count_size_as_multibyte): Check for string overflow.
14955
2b4560a8
PE
14956 * character.c (lisp_string_width): Check for string overflow.
14957 Use EMACS_INT, not int, for string indexes and lengths; in
14958 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14959 the resulting string length overflows an EMACS_INT; instead,
14960 report a string overflow if no precision given. When checking for
14961 precision exhaustion, use a check that cannot possibly have
14962 integer overflow. (Bug#8675)
14963 * character.h (lisp_string_width): Adjust to new signature.
14964
cb93f9be
PE
14965 * alloc.c (string_overflow): New function.
14966 (Fmake_string): Use it. This doesn't change behavior, but saves
14967 a few bytes and will simplify future changes.
14968 * character.c (string_escape_byte8): Likewise.
14969 * lisp.h (string_overflow): New decl.
14970
1a1f3366
PE
14971 Fixups, following up to the user-interface timestamp change.
14972 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14973 for UI timestamps, instead of unsigned long.
9fbd6841
PE
14974 * msdos.c (mouse_get_pos): Likewise.
14975 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
14976 * w32gui.h (Time): Define by including "systime.h" rather than by
14977 declaring it ourselves. (Bug#8664)
14978
d4e3e4d3
PE
14979 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14980 * image.c (clear_image_cache): Likewise.
14981
f6a24d19
PE
14982 * term.c (term_mouse_position): Don't assume time_t wraparound.
14983
08dc5ae6
PE
14984 Be more systematic about user-interface timestamps.
14985 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
14986 and sometimes 'EMACS_UINT', to represent these timestamps.
14987 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
14988 This makes the code easier to follow, and makes it easier to catch
14989 integer overflow bugs such as Bug#8664.
14990 * frame.c (Fmouse_position, Fmouse_pixel_position):
14991 Use Time, not unsigned long, for user-interface timestamps.
14992 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14993 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14994 * keyboard.h (last_event_timestamp): Likewise.
14995 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14996 * menu.h (xmenu_show): Likewise.
14997 * term.c (term_mouse_position): Likewise.
14998 * termhooks.h (struct input_event.timestamp): Likewise.
14999 (struct terminal.mouse_position_hook): Likewise.
15000 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15001 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15002 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15003 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15004 what it was before.
15005 * menu.h, termhooks.h: Include "systime.h", for Time.
15006
8e55734a
PE
15007 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15008 Don't assume that the difference between two unsigned long values
15009 can fit into an integer. At this point, we know button_down_time
15010 <= event->timestamp, so the difference must be nonnegative, so
15011 there's no need to cast the result if double-click-time is
15012 nonnegative, as it should be; check that it's nonnegative, just in
15013 case. This bug is triggered when events are more than 2**31 ms
86db42d2 15014 apart (about 25 days). (Bug#8664)
8e55734a 15015
841f1b75 15016 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 15017 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 15018
3e26f69c
PE
15019 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
15020 that always fit in int. Use a sentinel instead of a counter, to
15021 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
15022 * frame.h (struct frame): Use int for menu_bar_items_used
15023 instead of EMACS_INT, since it always fits in int.
3e26f69c 15024
5cc152c0
PE
15025 * menu.c (grow_menu_items): Check for int overflow.
15026
d89eb65e
PE
15027 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
15028
5235bd3e
PE
15029 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
15030 Before, the code was not consistent. These values cannot exceed
15031 2**31 - 1 so there's no need to make them unsigned.
15032 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
15033 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
15034 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
15035 as modifiers.
15036 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
15037
bc827e23
PE
15038 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
15039 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
15040 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
15041 presumably because the widths might not match.
15042
78eb494e
PE
15043 * window.c (size_window): Avoid needless test at loop start.
15044
04f2d78b
CB
150452011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
15046
15047 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
15048
d2fc7e3d 150492011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
15050
15051 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
15052
d2fc7e3d 150532011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
15054
15055 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
15056 `width' to `bar_area_x' and `bar_area_width', respectively.
15057 (x_scroll_run): Take account of fringe background extension.
15058
04f2d78b
CB
15059 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
15060 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
15061 `bar_area_width', respectively.
15062 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
15063 background extension.
15064
79b70037
GM
150652011-05-10 Jim Meyering <meyering@redhat.com>
15066
15067 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
15068
2f142cc5
JB
150692011-05-10 Juanma Barranquero <lekktu@gmail.com>
15070
15071 * image.c (Finit_image_library): Return t for built-in image types,
15072 like pbm and xbm. (Bug#8640)
15073
57679c86
AS
150742011-05-09 Andreas Schwab <schwab@linux-m68k.org>
15075
15076 * w32menu.c (set_frame_menubar): Fix submenu allocation.
15077
888c9e86
EZ
150782011-05-07 Eli Zaretskii <eliz@gnu.org>
15079
b0512a1d
EZ
15080 * w32console.c (Fset_screen_color): Doc fix.
15081 (Fget_screen_color): New function.
15082 (syms_of_ntterm): Defsubr it.
15083
7285dc67
EZ
15084 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
15085 unlink the temporary file if Fcall_process didn't create it in the
15086 first place.
15087 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
15088 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
15089 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
15090 cue to call_process_cleanup not to close that handle.
15091
4d3fcc8e
BK
150922011-05-07 Ben Key <bkey76@gmail.com>
15093
15094 * makefile.w32-in: The bootstrap-temacs rule now makes use of
15095 one of two shell specific rules, either bootstrap-temacs-CMD or
15096 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
15097 to the previous implementation of the bootstrap-temacs rule.
15098 The bootstrap-temacs-CMD rule is similar to the previous
15099 implementation of the bootstrap-temacs rule except that it
15100 makes use of the ESC_CFLAGS variable instead of the CFLAGS
15101 variable.
15102
15103 These changes, along with some changes to nt/configure.bat,
15104 nt/gmake.defs, and nt/nmake.defs, are required to extend my
15105 earlier fix to add support for --cflags and --ldflags options
15106 that include quotes so that it works whether make uses cmd or
15107 sh as the shell.
15108
b4289b64
MA
151092011-05-06 Michael Albinus <michael.albinus@gmx.de>
15110
15111 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
15112 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
15113 is a constant.
15114 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
15115 a string. Handle both cases.
15116 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
15117 (Fdbus_register_method): Use Qinvalid_function.
15118
af4c0e28
JB
151192011-05-06 Juanma Barranquero <lekktu@gmail.com>
15120
15121 * makefile.w32-in: Update dependencies.
15122 (LISP_H): Add inttypes.h and stdin.h.
15123 (PROCESS_H): Add unistd.h.
15124
c51453d9
EZ
151252011-05-06 Eli Zaretskii <eliz@gnu.org>
15126
15127 * lread.c: Include limits.h (fixes the MS-Windows build broken by
15128 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
15129
8ff0ac3c 151302011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 15131
4c4b566b
PE
15132 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
15133
aab2b9b5
PE
15134 * term.c (vfatal): Remove stray call to va_end.
15135 It's not needed and the C Standard doesn't allow it here anyway.
15136
c378da0b
PE
15137 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
15138 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
15139
288b08c7
PE
15140 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
15141 bytes.
15142
e3601888
PE
15143 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
15144
db6c0e74
PE
15145 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15146
dd5963ea
PE
15147 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
15148
88c9450f
PE
15149 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
15150
2f9442b8
PE
15151 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
15152
c032b5f8
PE
15153 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
15154 * charset.c (Fdefine_charset_internal): Don't initialize
15155 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 15156 32-bit int (Bug#8600).
a108c10b
PE
15157
15158 * lread.c (read_integer): Be more consistent with string-to-number.
15159 Use string_to_number to do the actual conversion; this avoids
15160 rounding errors and fixes some other screwups. Without this fix,
15161 for example, #x1fffffffffffffff was misread as -2305843009213693952.
15162 (digit_to_number): Move earlier, for benefit of read_integer.
15163 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 15164 not a digit in any supported base. (Bug#8602)
a108c10b 15165
ad5f9eea
PE
15166 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
15167
aec1708a
PE
15168 * dispnew.c (scrolling_window): Return 1 if we scrolled,
15169 to match comment at start of function. This also removes a
15170 GCC warning about overflow in a 32+64-bit port.
15171
47be4ab5
PE
15172 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
15173
371cac43
PE
15174 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
15175 Reported by Stefan Monnier in
15176 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
15177 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15178 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 15179
d01a7826
PE
15180 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
15181 (EMACS_UINTPTR): Likewise, with uintptr_t.
15182
7fd47d5c
PE
15183 * lisp.h: Prefer 64-bit EMACS_INT if available.
15184 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
15185 on 32-bit hosts that have 64-bit int, so that they can access
15186 large files.
122b0c86
PE
15187 However, temporarily disable this change unless the temporary
15188 symbol WIDE_EMACS_INT is defined.
7fd47d5c 15189
8727937b
PE
15190 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
15191
8ac068ac
PE
15192 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
15193 This removes an assumption that EMACS_INT and long are the same
15194 width as pointers. The assumption is true for Emacs porting targets
15195 now, but we want to make other targets possible.
15196 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
15197 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
15198 In the rest of the code, change types of integers that hold casted
15199 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
15200 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
15201 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
15202 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
15203 No need to cast type when ORing.
15204 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
15205 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
15206 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
15207 assume EMACS_INT is the same width as char *.
15208 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
15209 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
15210 Remove no-longer-needed casts.
15211 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
15212 (xg_tool_bar_help_callback, xg_make_tool_item):
15213 Use EMACS_INTPTR to hold an integer
15214 that will be cast to void *; this can avoid a GCC warning
15215 if EMACS_INT is not the same width as void *.
15216 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
15217 * xdisp.c (display_echo_area_1, resize_mini_window_1):
15218 (current_message_1, set_message_1):
15219 Use a local to convert to proper width without a cast.
15220 * xmenu.c (dialog_selection_callback): Likewise.
15221
ede49d71
PE
15222 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
15223 Also, don't assume VALBITS / RAND_BITS is less than 5,
15224 and don't rely on undefined behavior when shifting a 1 left into
15225 the sign bit.
15226 * lisp.h (get_random): Change signature to match.
15227
2f30ecd0
PE
15228 * lread.c (hash_string): Use size_t, not int, for hash computation.
15229 Normally we prefer signed values; but hashing is special, because
15230 it's better to use unsigned division on hash table sizes so that
15231 the remainder is nonnegative. Also, size_t is the natural width
15232 for hashing into memory. The previous code used 'int', which doesn't
15233 retain enough info to hash well into very large tables.
15234 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
15235
2a866e7b
PE
15236 * dbusbind.c: Don't possibly lose pointer info when converting.
15237 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
15238 Use XPNTR rather than XHASH, so that the high-order bits of
15239 the pointer aren't lost when converting through void *.
15240
51639eac
PE
15241 * eval.c (Fautoload): Don't double-shift a pointer.
15242
92394119
PE
15243 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
15244
dbdb9a7c
JB
152452011-05-06 Juanma Barranquero <lekktu@gmail.com>
15246
15247 * gnutls.c (DEF_GNUTLS_FN):
15248 * image.c (DEF_IMGLIB_FN): Make function pointers static.
15249
db7a0b4f
AS
152502011-05-05 Andreas Schwab <schwab@linux-m68k.org>
15251
15252 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
15253 marker. (Bug#8610)
15254
cd394be1 152552011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
15256
15257 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
15258 New version that can reserve upto 2GB of heap space.
15259
f7ff1b0f 152602011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
15261
15262 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
15263
639c109b
TZ
152642011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
15265
15266 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
15267 `gnutls_certificate_set_x509_key_file'.
15268
d2127135
JB
152692011-05-05 Juanma Barranquero <lekktu@gmail.com>
15270
15271 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
15272 Update dependencies.
15273
e968f4f3
JB
152742011-05-04 Juanma Barranquero <lekktu@gmail.com>
15275
15276 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
15277 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
15278 Remove unused parameter `fildes'.
15279 * process.c (read_process_output, send_process): Don't pass it.
15280
84d358f0
JB
152812011-05-04 Juanma Barranquero <lekktu@gmail.com>
15282
15283 Fix previous change: the library cache is defined in w32.c.
15284 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
15285 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
15286
0898ca10
JB
152872011-05-04 Juanma Barranquero <lekktu@gmail.com>
15288
15289 Implement dynamic loading of GnuTLS on Windows.
15290
15291 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
15292 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
15293 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15294 Declare.
15295
15296 * gnutls.c (Qgnutls_dll): Define.
15297 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
15298 (gnutls_*): Declare function pointers.
15299 (init_gnutls_functions): New function to initialize function pointers.
15300 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
15301 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
15302 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
15303 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
15304 (emacs_gnutls_write, emacs_gnutls_read)
15305 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
15306 (Fgnutls_available_p): New function.
15307 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
15308 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
15309 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
15310
15311 * image.c: Include w32.h.
15312 (Vimage_type_cache): Delete.
15313 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
15314 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
15315 (w32_delayed_load): Move to w32.c.
15316
15317 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
15318
15319 * w32.c (QCloaded_from, Vlibrary_cache): Define.
15320 (w32_delayed_load): Move from image.c. When loading a library, record
15321 its filename in the :loaded-from property of the library id.
15322 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
15323 Initialize and staticpro them.
15324 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
15325
15326 * process.c: Include lisp.h before w32.h, not after.
15327 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
15328 instead of gnutls_record_check_pending.
15329
15330 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
15331
ff4de4aa
TZ
153322011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
15333
15334 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
15335 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
15336 as passed in.
15337
abe95abb
JD
153382011-05-03 Jan Djärv <jan.h.d@swipnet.se>
15339
15340 * xterm.c (x_set_frame_alpha): Do not set property on anything
15341 else than FRAME_X_OUTER_WINDOW (Bug#8608).
15342
e16e55d4
JB
153432011-05-02 Juanma Barranquero <lekktu@gmail.com>
15344
15345 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
15346
bafcf6a5
JB
153472011-05-02 Juanma Barranquero <lekktu@gmail.com>
15348
15349 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
15350 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
15351 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
15352 (gnutls_global_initialized, Qgnutls_bootprop_priority)
15353 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
15354 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
15355 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
15356 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
15357 (Qgnutls_bootprop_callbacks_verify): Make static.
15358
e7a6747f
AS
153592011-05-01 Andreas Schwab <schwab@linux-m68k.org>
15360
19ed11ba
AS
15361 * callproc.c: Indentation fixup.
15362
e7a6747f 15363 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
15364 (wait_for_termination, interruptible_wait_for_termination):
15365 Move after wait_for_termination_1.
e7a6747f 15366
1ef14cb4
LMI
153672011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
15368
15369 * sysdep.c (interruptible_wait_for_termination): New function
15370 which is like wait_for_termination, but allows keyboard
15371 interruptions.
15372
15373 * callproc.c (Fcall_process): Add (:file "file") as an option for
15374 the STDOUT buffer.
15375 (Fcall_process_region): Ditto.
15376
330d880c
EZ
153772011-04-30 Eli Zaretskii <eliz@gnu.org>
15378
8db90b73
EZ
15379 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
15380 rather than `XVECTOR (FOO)->size'.
15381
330d880c
EZ
15382 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
15383 inttypes.h, as a gnulib replacement is used if it not available in
15384 system headers.
15385
15cbd324
EZ
153862011-04-21 Eli Zaretskii <eliz@gnu.org>
15387
15388 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
15389 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
15390 of MOST_POSITIVE_FIXNUM. (Bug#8528)
15391
15392 * coding.c (coding_alloc_by_realloc): Error out if destination
15393 will grow beyond MOST_POSITIVE_FIXNUM.
15394 (decode_coding_emacs_mule): Abort if there isn't enough place in
15395 charbuf for the composition carryover bytes. Reserve an extra
15396 space for up to 2 characters produced in a loop.
15397 (decode_coding_iso_2022): Abort if there isn't enough place in
15398 charbuf for the composition carryover bytes.
15399
154002011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 15401
ae940cca
EZ
15402 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
15403 aborting when %lld or %lll format is passed.
15404 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
15405 %llo or %llx format is passed. (Bug#8545)
15406
03ab8921
EZ
15407 * window.c (window_scroll_line_based): Use a marker instead of
15408 simple variables to record original value of point. (Bug#7952)
15409
afda1437
EZ
15410 * doprnt.c (doprnt): Fix the case where a multibyte sequence
15411 produced by %s or %c overflows available buffer space. (Bug#8545)
15412
f76dee0c
PE
154132011-04-28 Paul Eggert <eggert@cs.ucla.edu>
15414
15415 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 15416 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 15417
fdc5744d
JB
154182011-04-28 Juanma Barranquero <lekktu@gmail.com>
15419
15420 * w32.c (init_environment): Warn about defaulting HOME to C:\.
15421
638f053a
JB
154222011-04-28 Juanma Barranquero <lekktu@gmail.com>
15423
15424 * keyboard.c (Qdelayed_warnings_hook): Define.
15425 (command_loop_1): Run `delayed-warnings-hook'
15426 if Vdelayed_warnings_list is non-nil.
15427 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
15428 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
15429
d178f871
EZ
154302011-04-28 Eli Zaretskii <eliz@gnu.org>
15431
15432 * doprnt.c (doprnt): Don't return value smaller than the buffer
15433 size if the message was truncated. (Bug#8545).
15434
b124fd93
JB
154352011-04-28 Juanma Barranquero <lekktu@gmail.com>
15436
15437 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
15438 (Fx_window_property): #if-0 the whole functions, not just the bodies.
15439
e810457d
PE
154402011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15441
15442 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
15443
ea51cceb
JB
154442011-04-27 Juanma Barranquero <lekktu@gmail.com>
15445
15446 * makefile.w32-in: Update dependencies.
15447
94dcfacf
EZ
154482011-04-27 Eli Zaretskii <eliz@gnu.org>
15449
15450 Improve `doprnt' and its usage. (Bug#8545)
15451 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
15452 `format_end'. Remove support for %l as a conversion specifier.
15453 Don't use xrealloc. Improve diagnostics when the %l size modifier
15454 is used. Update the commentary.
15455
15456 * eval.c (verror): Simplify calculation of size_t.
15457
15458 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
15459 messages.
15460
f61f41d7
PE
154612011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
15462
15463 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
15464 change.
15465
96fb4434
PE
154662011-04-27 Paul Eggert <eggert@cs.ucla.edu>
15467
15468 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
15469 This makes this file independent of the recent pseudovector change.
15470
671875da 154712011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 15472
69e9b5a3
PE
15473 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
15474
b5f869a7 15475 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 15476 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 15477 Remove unused local.
c8926152 15478 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 15479
841a1577 15480 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
15481 GCC 4.6.0 optimizes based on type-based alias analysis.
15482 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
15483 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
15484 != &v->size, and therefore "v->size = 1; b->size = 2; return
15485 v->size;" must therefore return 1. This assumption is incorrect
15486 for Emacs, since it type-puns struct Lisp_Vector * with many other
15487 types. To fix this problem, this patch adds a new type struct
f904488f 15488 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
15489 and pseudovectors, and helps optimizing compilers not get fooled
15490 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
15491 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
15492 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
15493 the size member.
eab3844f
PE
15494 (XSETPVECTYPE): Rewrite in terms of new macro.
15495 (XSETPVECTYPESIZE): New macro, specifying both type and size.
15496 This is a bit clearer, and further avoids the possibility of
15497 undesirable aliasing.
15498 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 15499 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
15500 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
15501 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
15502 (ASIZE): Now uses header.size rather than size.
15503 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
15504 to avoid the hassle of writing XVECTOR (foo)->header.size.
15505 (struct vectorlike_header): New type.
eab3844f
PE
15506 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
15507 object, to help avoid aliasing.
15508 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
15509 (SUBRP): Likewise, since Lisp_Subr is a special case.
15510 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
15511 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
15512 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 15513 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
15514 changed to be "header.size" and "header.next".
15515 * buffer.h (struct buffer): Likewise.
15516 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
15517 * frame.h (struct frame): Likewise.
15518 * process.h (struct Lisp_Process): Likewise.
15519 * termhooks.h (struct terminal): Likewise.
15520 * window.c (struct save_window_data, struct saved_window): Likewise.
15521 * window.h (struct window): Likewise.
15522 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
15523 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
15524 * buffer.c (init_buffer_once): Likewise.
15525 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
15526 special case.
15527 * process.c (Fformat_network_address): Use local var for size,
15528 for brevity.
15529
0df1eac5
PE
15530 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
15531
847ab9d1 15532 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
15533 * data.c (atof): Remove decl; no longer used or needed.
15534 (digit_to_number): Move to lread.c.
15535 (Fstring_to_number): Use new string_to_number function, to be
15536 consistent with how the Lisp reader treats infinities and NaNs.
15537 Do not assume that floating-point numbers represent EMACS_INT
15538 without losing information; this is not true on most 64-bit hosts.
15539 Avoid double-rounding errors, by insisting on integers when
15540 parsing non-base-10 numbers, as the documentation specifies.
15541 * lisp.h (string_to_number): New decl, replacing ...
15542 (isfloat_string): Remove.
bc0a5c13 15543 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 15544 (read1): Do not accept +. and -. as integers; this
452f4150
PE
15545 appears to have been a coding error. Similarly, do not accept
15546 strings like +-1e0 as floating point numbers. Do not report
15547 overflow for integer overflows unless the base is not 10 which
15548 means we have no simple and reliable way to continue.
15549 Break out the floating-point parsing into a new
15550 function string_to_number, so that Fstring_to_number parses
15551 floating point numbers consistently with the Lisp reader.
04f2d78b 15552 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
15553 (E_CHAR, EXP_INT): Remove, replacing with ...
15554 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
15555 (string_to_number): New function, replacing isfloat_string.
15556 This function checks for valid syntax and produces the resulting
15557 Lisp float number too. Rework it so that string-to-number
bc0a5c13 15558 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
15559 so that overflow for non-base-10 numbers is reported only when
15560 there's no portable and simple way to convert to floating point.
452f4150 15561
67769ffc
PE
15562 * textprop.c (set_text_properties_1): Rewrite for clarity,
15563 and to avoid GCC warning about integer overflow.
15564
c20db43f
PE
15565 * intervals.h (struct interval): Use EMACS_INT for members
15566 where EMACS_UINT might cause problems. See
15567 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
15568 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
15569 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
15570 All uses changed.
37aa2f85
PE
15571 (offset_intervals): Tell GCC not to worry about length overflow
15572 when negating a negative length.
c20db43f 15573
2538aa2f
PE
15574 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
15575 (overrun_check_free): Likewise.
15576
f2d3008d
PE
15577 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
15578 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
15579 word size.
15580
ec8df744
PE
15581 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15582 (gnutls_make_error): Rename local to avoid shadowing.
15583 (gnutls_emacs_global_deinit): ifdef out; not used.
15584 (Fgnutls_boot): Use const for pointer to readonly storage.
15585 Comment out unused local. Fix pointer signedness problems.
15586
640ee02d
PE
15587 * lread.c (openp): Don't stuff size_t into an 'int'.
15588 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
15589 about possible signed overflow.
15590
6048fb2a
PE
15591 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
15592 (GDK_KEY_g): Don't define if already defined.
15593 (xg_prepare_tooltip): Avoid pointer signedness problem.
15594 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
15595
fa3c87e1
PE
15596 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
15597 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
15598
2172544b
PE
15599 * xfns.c (Fx_window_property): Simplify a bit,
15600 to make a bit faster and to avoid GCC 4.6.0 warning.
15601 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
15602
9b821a21
PE
15603 * fns.c (internal_equal): Don't assume size_t fits in int.
15604
3c616cfa
PE
15605 * alloc.c (compact_small_strings): Tighten assertion a little.
15606
c2982e87
PE
15607 Replace pEd with more-general pI, and fix some printf arg casts.
15608 * lisp.h (pI): New macro, generalizing old pEd macro to other
15609 conversion specifiers. For example, use "...%"pI"d..." rather
15610 than "...%"pEd"...".
15611 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 15612 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
15613 * alloc.c (check_pure_size): Don't overflow by converting size to int.
15614 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
15615 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
15616 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
15617 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
15618 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
15619 64-bit hosts.
15620 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
15621 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
15622 * print.c (safe_debug_print, print_object): Likewise.
15623 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
15624 to int.
6f04d126
PE
15625 Use pI instead of if-then-else-abort. Use %p to avoid casts,
15626 avoiding the 0 flag, which is not portable.
c2982e87
PE
15627 * process.c (Fmake_network_process): Use pI to avoid cast.
15628 * region-cache.c (pp_cache): Likewise.
15629 * xdisp.c (decode_mode_spec): Likewise.
15630 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
15631 behavior on 64-bit hosts with printf arg.
6f04d126 15632 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
15633 (x_stop_queuing_selection_requests): Likewise.
15634 (x_get_window_property): Don't truncate byte count to an 'int'
15635 when tracing.
0b432f21 15636
5e073ec7
PE
15637 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
15638 here, since it parses constructs like leading '-' and spaces,
15639 which are not wanted; and it overflows with large numbers.
15640 Instead, simply match F[0-9]+, which is what is wanted anyway.
15641
36372bf9
PE
15642 * alloc.c: Remove unportable assumptions about struct layout.
15643 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
15644 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
15645 (allocate_vectorlike, make_pure_vector): Use the new macros,
15646 plus offsetof, to remove unportable assumptions about struct layout.
15647 These assumptions hold on all porting targets that I know of, but
15648 they are not guaranteed, they're easy to remove, and removing them
15649 makes further changes easier.
15650
0b432f21
PE
15651 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
15652 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
15653 (string_overrun_cookie): Now const. Use initializers that
15654 don't formally overflow signed char, to avoid warnings.
000098c1
PE
15655 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
15656 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
15657 (allocate_buffer): Don't assume sizeof (struct buffer) is a
15658 multiple of sizeof (EMACS_INT); it need not be, if
15659 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 15660 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 15661
895009e1
JB
156622011-04-26 Juanma Barranquero <lekktu@gmail.com>
15663
15664 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
15665
6a7a1b0b
TZ
156662011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
15667
15668 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 15669 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
15670 Reported by Paul Eggert <eggert@cs.ucla.edu>.
15671
841a1577 156722011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
15673
15674 * lisp.h (Qdebug): List symbol.
895009e1 15675 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
15676 * keyboard.c (debug-on-event): New variable.
15677 (handle_user_signal): Break into debugger when debug-on-event
15678 matches the current signal symbol.
15679
f2d3ba6f
DN
156802011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
15681
15682 * alloc.c (check_sblock, check_string_bytes)
15683 (check_string_free_list): Convert to standard C.
15684
42ce4c63
TZ
156852011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
15686
15687 * w32.c (emacs_gnutls_push): Fix typo.
15688
825cd63c
EZ
156892011-04-25 Eli Zaretskii <eliz@gnu.org>
15690
fb11d64d
EZ
15691 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
15692 "cast to pointer from integer of different size".
15693
825cd63c
EZ
15694 Improve doprnt and its use in verror. (Bug#8545)
15695 * doprnt.c (doprnt): Document the set of format control sequences
15696 supported by the function. Use SAFE_ALLOCA instead of always
15697 using `alloca'.
15698
15699 * eval.c (verror): Don't limit the buffer size at size_max-1, that
15700 is one byte too soon. Don't use xrealloc; instead xfree and
15701 xmalloc anew.
15702
e061a11b
TZ
157032011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
15704
15705 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
15706 callbacks stage.
15707
15708 * gnutls.c: Renamed global_initialized to
15709 gnutls_global_initialized. Added internals for the
15710 :verify-hostname-error, :verify-error, and :verify-flags
15711 parameters of `gnutls-boot' and documented those parameters in the
15712 docstring. Start callback support.
9173deec
JB
15713 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
15714 unless a fatal error occurred. Call gnutls_alert_send_appropriate
15715 on error. Return error code.
e061a11b
TZ
15716 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
15717 (emacs_gnutls_read): Likewise.
15718 (Fgnutls_boot): Return handshake error code.
15719 (emacs_gnutls_handle_error): New function.
15720 (wsaerror_to_errno): Likewise.
15721
15722 * w32.h (emacs_gnutls_pull): Add prototype.
15723 (emacs_gnutls_push): Likewise.
15724
15725 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
15726 (emacs_gnutls_push): Likewise.
15727
157282011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15729
15730 * process.c (wait_reading_process_output): Check if GnuTLS
15731 buffered some data internally if no FDs are set for TLS
15732 connections.
15733
15734 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15735 (LIBS): Link to USER_LIBS.
15736 ($(BLD)/gnutls.$(0)): New target.
15737
fa6996bc
EZ
157382011-04-24 Eli Zaretskii <eliz@gnu.org>
15739
eb35682e
EZ
15740 * xdisp.c (handle_single_display_spec): Rename the
15741 display_replaced_before_p argument into display_replaced_p, to
15742 make it consistent with the commentary. Fix typos in the
15743 commentary.
15744
e2ad650c
EZ
15745 * textprop.c (syms_of_textprop): Remove dead code.
15746 (copy_text_properties): Delete obsolete commentary about an
15747 interface that was deleted long ago. Fix typos in the description
15748 of arguments.
15749
1b2de274
EZ
15750 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15751 to changes in oldXMenu/XMenu.h from 2011-04-16.
15752 <menu_help_message, prev_menu_help_message>: Constify.
15753 (IT_menu_make_room): menu->help_text is now `const char **';
15754 adjust.
15755
15756 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15757 to changes in oldXMenu/XMenu.h from 2011-04-16.
15758 (struct XMenu): Declare `help_text' `const char **'.
15759
15760 * xfaces.c <Qunspecified>: Make extern again.
15761
15762 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 15763 required by POSIX.
1b2de274 15764
762b15be
EZ
15765 * doc.c (get_doc_string): Improve the format passed to `error'.
15766
15767 * doprnt.c (doprnt): Improve commentary.
15768
15769 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15770
15771 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15772 them with etags.
15773
f1052e5d
EZ
15774 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15775 changes in globals.h immediately force recompilation.
762b15be
EZ
15776 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15777 $(CURDIR)/s/ms-w32.h.
15778 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 15779
fa6996bc
EZ
15780 * character.c (Fchar_direction): Function deleted.
15781 (syms_of_character): Don't defsubr it.
15782 <char-direction-table>: Deleted.
15783
e6c3da20
EZ
157842011-04-23 Eli Zaretskii <eliz@gnu.org>
15785
15786 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15787 * doprnt.c: Include limits.h.
15788 (SIZE_MAX): New macro.
04f2d78b
CB
15789 (doprnt): Return a size_t value. 2nd arg is now size_t.
15790 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
15791 Improve overflow protection. Support `l' modifier for integer
15792 conversions. Support %l conversion. Don't assume an EMACS_INT
15793 argument for integer conversions and for %c.
15794
15795 * lisp.h (doprnt): Restore prototype.
15796
15797 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15798 $(SRC)/character.h.
15799
15800 * Makefile.in (base_obj): Add back doprnt.o.
15801
15802 * deps.mk (doprnt.o): Add back prerequisites.
15803 (callint.o): Depend on character.h.
15804
15805 * eval.c (internal_lisp_condition_case): Include the handler
15806 representation in the error message.
15807 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15808 when breaking from the loop.
15809
15810 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15811
15812 * callint.c (Fcall_interactively): When displaying error message
15813 about invalid control letter, pass the character's codepoint, not
15814 a pointer to its multibyte form. Improve display of the character
15815 in octal and display also its hex code.
15816
15817 * character.c (char_string): Use %x to display the (unsigned)
15818 codepoint of an invalid character, to avoid displaying a bogus
15819 negative value.
15820
15821 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15822 `error', not SYMBOL_NAME itself.
15823
15824 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15825 character arguments to `error'.
15826
15827 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15828 to `error' in error message about FINAL_CHAR argument. Make sure
15829 FINAL_CHAR is a character, and use %c when it is passed as
15830 argument to `error'.
15831
4ffd0d6b 158322011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
15833
15834 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15835
15836 * w32.c: Include <time.h>.
15837 (sys_localtime): New function.
15838
4ffd0d6b 158392011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
15840
15841 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15842
4ffd0d6b 15843 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 15844
4ffd0d6b 158452011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 15846
4ffd0d6b
GM
15847 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15848 zombies (Bug#8467).
aac0c6e3 15849
04c56954
EZ
158502011-04-19 Eli Zaretskii <eliz@gnu.org>
15851
15852 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15853 gl_state.e_property when gl_state.object is Qt.
15854
15855 * insdel.c (make_gap_larger): Remove limitation of buffer size
15856 to <= INT_MAX.
15857
16a43933
CY
158582011-04-18 Chong Yidong <cyd@stupidchicken.com>
15859
15860 * xdisp.c (lookup_glyphless_char_display)
15861 (produce_glyphless_glyph): Handle cons cell entry in
15862 glyphless-char-display.
15863 (Vglyphless_char_display): Document it.
15864
15865 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15866 glyphless-char-display.
15867
4581706e
CY
158682011-04-17 Chong Yidong <cyd@stupidchicken.com>
15869
15870 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15871
15872 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15873
15874 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15875 definition for no-X builds.
15876
4887c6e2 158772011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 15878
fd35b6f9
PE
15879 Static checks with GCC 4.6.0 and non-default toolkits.
15880
5c1ccb01
PE
15881 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15882
006c5daa
PE
15883 * process.c (keyboard_bit_set): Define only if SIGIO.
15884 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15885 (send_process): Repair possible setjmp clobbering.
15886
efc736d3
PE
15887 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15888
4e2fe2e6
PE
15889 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15890
f97334a2
PE
15891 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15892
4e75f29d
PE
15893 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15894 Define only if needed.
15895
90efadd1
PE
15896 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15897 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 15898 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 15899
3c647824
PE
15900 * dispextern.h (struct redisplay_interface): Rename param
15901 to avoid shadowing.
e264f262 15902 * termhooks.h (struct terminal): Likewise.
761383f4 15903 * xterm.c (xembed_send_message): Likewise.
3c647824 15904
b58c5c4a
PE
15905 * insdel.c (make_gap_smaller): Define only if
15906 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15907
cad59032
PE
15908 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15909 it.
15910
c339dc2e
PE
15911 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15912 so that we aren't warned about unused symbols.
15913
91a3e27b
PE
15914 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15915
399c71d3 15916 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 15917
8ffc96f5
PE
15918 * xfns.c (x_real_positions): Mark locals as initialized.
15919
eef9bc79
PE
15920 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15921
098db9dd
PE
15922 * xterm.c: Fix problems found by static analysis with other toolkits.
15923 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
15924 (x_dispatch_event): Declare static if USE_GTK, and
15925 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 15926 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 15927 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
15928 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15929 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 15930
eb18f6cc
PE
15931 * xmenu.c (menu_help_callback): Pointer type fixes.
15932 Use const pointers when pointing at readonly data. Avoid pointer
15933 signedness clashes.
15934 (FALSE): Remove unused macro.
15935 (update_frame_menubar): Remove unused decl.
15936
1fe72bf8
PE
15937 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15938
60d9e1db
PE
15939 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15940 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15941 (single_menu_item): Rename local to avoid shadowing.
15942
39261c26
PE
15943 * keyboard.c (make_lispy_event): Remove unused local var.
15944
018c5e19
PE
15945 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15946 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15947
63d2b86e
PE
15948 * bitmaps: Change bitmaps from unsigned char back to the X11
15949 compatible char. Avoid the old compiler warnings about
15950 out-of-range initializers by using, for example, '\xab' rather
15951 than 0xab.
15952
aefd87e1
PE
15953 * xgselect.c (xgselect_initialize): Check vs interface
15954 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15955
bf501fb9
PE
15956 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15957
e9829fdf
PE
15958 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15959 to read-only memory.
15960
1086c095
PE
15961 * fns.c (vector): Remove; this old hack is no longer needed.
15962
2baccd04 15963 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 15964 Remove unused var.
dde42981 15965 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 15966
72391843 15967 * xrdb.c (x_load_resources): Omit unused local.
3565b346 15968
436c16df 15969 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 15970 (x_window): Rename locals to avoid shadowing.
dc5ddd85 15971 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 15972
92bb796d 15973 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 15974 (x_term_init): Remove local to avoid shadowing.
92bb796d 15975
764430a3 15976 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
15977
15978 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15979 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15980
d1dfb56c
EZ
159812011-04-16 Eli Zaretskii <eliz@gnu.org>
15982
c4354cb4
EZ
15983 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15984
d1dfb56c
EZ
15985 Fix regex.c, syntax.c and friends for buffers > 2GB.
15986 * syntax.h (struct gl_state_s): Declare character position members
15987 EMACS_INT.
15988
15989 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15990
04f2d78b
CB
15991 * textprop.c (verify_interval_modification, interval_of):
15992 Declare arguments EMACS_INT.
d1dfb56c
EZ
15993
15994 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15995 EMACS_INT.
15996
15997 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15998
15999 * indent.c (Fvertical_motion): Local variable it_start is now
16000 EMACS_INT.
16001
16002 * regex.c (re_match, re_match_2, re_match_2_internal)
16003 (bcmp_translate, regcomp, regexec, print_double_string)
16004 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16005 (re_compile_pattern, re_exec): Declare arguments and local
16006 variables `size_t' and `ssize_t' and return values `regoff_t', as
16007 appropriate.
16008 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16009 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16010 <compile_stack_type>: `size' and `avail' are now `size_t'.
16011
16012 * regex.h <regoff_t>: Use ssize_t, not int.
16013 (re_search, re_search_2, re_match, re_match_2): Arguments that
16014 specify buffer/string position and length are now ssize_t and
16015 size_t. Return type is regoff_t.
16016
613052cd
BK
160172011-04-16 Ben Key <bkey76@gmail.com>
16018
16019 * nsfont.m: Fixed bugs in ns_get_family and
16020 ns_descriptor_to_entity that were caused by using free to
16021 deallocate memory blocks that were allocated by xmalloc (via
16022 xstrdup). This caused Emacs to crash when compiled with
16023 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
16024 --enable-checking=xmallocoverrun). xfree is now used to
16025 deallocate these memory blocks.
16026
4170f62f 160272011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 16028
71b41406
PE
16029 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
16030
9587a89d
PE
16031 emacs_write: Accept and return EMACS_INT for sizes.
16032 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
16033 et seq.
16034 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
16035 Accept and return EMACS_INT.
16036 (emacs_gnutls_write): Return the number of bytes written on
16037 partial writes.
16038 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
16039 (emacs_read, emacs_write): Remove check for negative size, as the
16040 Emacs source code has been audited now.
9587a89d
PE
16041 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
16042 (emacs_read, emacs_write): Use it.
273a5f82
PE
16043 * process.c (send_process): Adjust to the new signatures of
16044 emacs_write and emacs_gnutls_write. Do not attempt to store
16045 a byte offset into an 'int'; it might overflow.
9587a89d 16046 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 16047
3e047f51
PE
16048 * sound.c: Don't assume sizes fit in 'int'.
16049 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 16050 Return EMACS_INT, not int.
3e047f51 16051 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
16052 Accept EMACS_INT, not int.
16053 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
16054 record read return values.
16055
cc39a9db
BK
160562011-04-15 Ben Key <bkey76@gmail.com>
16057
c9d0ec6d
JB
16058 * keyboard.c (Qundefined): Don't declare static since it is used
16059 in nsfns.m.
16060 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
16061 static since they are used in nsfont.m.
cc39a9db 16062
6c60eb9f
SM
160632011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
16064
16065 * process.c (Qprocessp): Don't declare static.
16066 * lisp.h (Qprocessp): Declare again.
16067
7990b61a
JB
160682011-04-15 Juanma Barranquero <lekktu@gmail.com>
16069
16070 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
16071
5d4cb038
PE
160722011-04-14 Paul Eggert <eggert@cs.ucla.edu>
16073
8bd7b830 16074 Improve C-level modularity by making more things 'static'.
cd64ea1d 16075
e3b27b31
PE
16076 Don't publish debugger-only interfaces to other modules.
16077 * lisp.h (safe_debug_print, debug_output_compilation_hack):
16078 (verify_bytepos, count_markers): Move decls to the only modules
16079 that need them.
16080 * region-cache.h (pp_cache): Likewise.
16081 * window.h (check_all_windows): Likewise.
16082 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
16083
5d4cb038
PE
16084 * sysdep.c (croak): Now static, if
16085 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
16086 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
16087
16088 * alloc.c (refill_memory_reserve): Now static if
16089 !defined REL_ALLOC || defined SYSTEM_MALLOC.
16090 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 16091
e87b6180
PE
16092 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
16093 Define only if USE_LUCID.
16094
ac64929e
PE
16095 * xrdb.c (x_customization_string, x_rm_string): Now static.
16096
6f37259d
PE
16097 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
16098 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
16099
1683e3ab
PE
16100 * xdisp.c (draw_row_with_mouse_face): Now static.
16101 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
16102
de9c2632
PE
16103 * window.h (check_all_windows): Mark externally visible.
16104
2b96acb7
PE
16105 * window.c (window_deletion_count): Now static.
16106
16107 * undo.c: Make symbols static if they're not exported.
16108 (last_undo_buffer, last_boundary_position, pending_boundary):
16109 Now static.
16110
50436f33
PE
16111 * textprop.c (interval_insert_behind_hooks): Now static.
16112 (interval_insert_in_front_hooks): Likewise.
16113
64520e5c
PE
16114 * term.c: Make symbols static if they're not exported.
16115 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
16116 (max_frame_lines, tty_set_terminal_modes):
16117 (tty_reset_terminal_modes, tty_turn_off_highlight):
16118 (get_tty_terminal): Now static.
16119 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
16120 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 16121 HAVE_WINDOW_SYSTEM.
64520e5c
PE
16122 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
16123 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
16124
1fa53021
PE
16125 * sysdep.c: Make symbols static if they're not exported.
16126 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
16127 Now static.
16128 (sigprocmask_set, full_mask): Remove; unused.
16129 (wait_debugging): Mark as visible.
16130 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
16131 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
16132
d4b43b22
PE
16133 * syntax.c (syntax_temp): Define only if !__GNUC__.
16134
b7c513d0
PE
16135 * sound.c (current_sound_device, current_sound): Now static.
16136
989b29ad
PE
16137 * search.c (searchbufs, searchbuf_head): Now static.
16138
13a55a78
PE
16139 * scroll.c (scroll_cost): Remove; unused.
16140 * dispextern.h (scroll_cost): Remove decl.
16141
de68a1fc
PE
16142 * region-cache.h (pp_cache): Mark as externally visible.
16143
40ccffa6
PE
16144 * process.c: Make symbols static if they're not exported.
16145 (process_tick, update_tick, create_process, chan_process):
16146 (Vprocess_alist, proc_buffered_char, datagram_access):
16147 (fd_callback_data, send_process_frame, process_sent_to): Now static.
16148 (deactivate_process): Mark defn as static, as well as decl.
16149 * lisp.h (create_process): Remove decl.
16150 * process.h (chan_process, Vprocess_alist): Remove decls.
16151
ad64fc97
PE
16152 * print.c: Make symbols static if they're not exported.
16153 (print_depth, new_backquote_output, being_printed, print_buffer):
16154 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
16155 (print_interval, print_number_index, initial_stderr_stream):
16156 Now static.
16157 * lisp.h (Fprinc): Remove decl.
16158 (debug_output_compilation_hack): Mark as externally visible.
16159
adddb265
PE
16160 * sysdep.c (croak): Move decl from here to syssignal.h.
16161 * syssignal.h (croak): Put it here, so the API can be checked when
16162 'croak' is called from dissociate_if_controlling_tty.
16163
1717ede2
PE
16164 * minibuf.c: Make symbols static if they're not exported.
16165 (minibuf_save_list, choose_minibuf_frame): Now static.
16166 * lisp.h (choose_minibuf_frame): Remove decl.
16167
fa5fb2bc
PE
16168 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
16169
1e3890d1
PE
16170 * lread.c: Make symbols static if they're not exported.
16171 (read_objects, initial_obarray, oblookup_last_bucket_number):
16172 Now static.
16173 (make_symbol): Remove; unused.
16174 * lisp.h (initial_obarray, make_symbol): Remove decls.
16175
8a1414fa
PE
16176 * keyboard.c: Make symbols static if they're not exported.
16177 (single_kboard, recent_keys_index, total_keys, recent_keys):
16178 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
16179 (this_single_command_key_start, echoing, last_auto_save):
16180 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
16181 (command_loop, echo_now, keyboard_init_hook, help_char_p):
16182 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
16183 (Vlispy_mouse_stem, double_click_count):
16184 Now static.
16185 (force_auto_save_soon): Define only if SIGDANGER.
16186 (ignore_mouse_drag_p): Now static if
16187 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
16188 (print_help): Remove; unused.
16189 (stop_character, last_timer_event): Mark as externally visible.
16190 * keyboard.h (ignore_mouse_drag_p): Declare only if
16191 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
16192 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
16193 * lisp.h (echoing): Remove decl.
16194 (force_auto_save_soon): Declare only if SIGDANGER.
16195 * xdisp.c (redisplay_window): Simplify code, to make it more
16196 obvious that ignore_mouse_drag_p is not accessed if !defined
16197 USE_GTK && !defined HAVE_NS.
16198
93ea6e8f
PE
16199 * intervals.c: Make symbols static if they're not exported.
16200 (merge_properties_sticky, merge_interval_right, delete_interval):
16201 Now static.
16202 * intervals.h (merge_interval_right, delete_interval): Remove decls.
16203
77382fcc
PE
16204 * insdel.c: Make symbols static if they're not exported.
16205 However, leave prepare_to_modify_buffer alone. It's never
16206 called from outside this function, but that appears to be a bug.
16207 (combine_after_change_list, combine_after_change_buffer):
4889fc82 16208 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
16209 (adjust_after_replace_noundo): Remove; unused.
16210 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 16211 (signal_before_change): Remove decls.
77382fcc 16212
9306c32e
PE
16213 * indent.c (val_compute_motion, val_vmotion): Now static.
16214
cd44d2eb
PE
16215 * image.c: Make symbols static if they're not exported.
16216 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
16217 if USE_GTK.
16218 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
16219 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
16220
ad9a7a06
PE
16221 * fringe.c (standard_bitmaps): Now static.
16222 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
16223
81626931
PE
16224 * frame.c: Make symbols static if they're not exported.
16225 (x_report_frame_params, make_terminal_frame): Now static.
16226 (get_frame_param): Now static, unless HAVE_NS.
16227 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
16228 (x_get_resource_string): Remove; not used.
16229 * frame.h (make_terminal_frame, x_report_frame_params):
16230 (x_get_resource_string); Remove decls.
16231 (x_fullscreen_adjust): Declare only if WINDOWSNT.
16232 * lisp.h (get_frame_param): Declare only if HAVE_NS.
16233
239f9db9
PE
16234 * font.c, fontset.c: Make symbols static if they're not exported.
16235 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
16236 (FACE_SUITABLE_FOR_CHAR_P): Use it.
16237 * font.c (font_close_object): Now static.
16238 * font.h (font_close_object): Remove.
16239 * fontset.c (FONTSET_OBJLIST): Remove.
16240 (free_realized_fontset) #if-0 the body, which does nothing.
16241 (face_suitable_for_char_p): #if-0, as it's never called.
16242 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
16243 * xfaces.c (face_at_string_position):
16244 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
16245 since 0 is always ASCII.
16246
dfcf3579
PE
16247 * fns.c (weak_hash_tables): Now static.
16248
5045092b
PE
16249 * fileio.c: Make symbols static if they're not exported.
16250 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
16251 (Vwrite_region_annotation_buffers): Now static.
16252
57a96f5c
PE
16253 * eval.c: Make symbols static if they're not exported.
16254 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
16255 * lisp.h (backtrace_list): Remove decl.
16256
35f08c38
PE
16257 * emacs.c: Make symbols static if they're not exported.
16258 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
16259 (fatal_error_code, fatal_error_signal_hook, standard_args):
16260 Now static.
16261 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
16262 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
16263 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
16264 * lisp.h (fatal_error_signal_hook): Remove decl.
16265 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
16266
f44bd759
PE
16267 * editfns.c: Move a (normally-unused) function to its only use.
16268 * editfns.c, lisp.h (get_operating_system_release): Remove.
16269 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
16270 worth the hassle of breaking this out.
16271
b532497d
PE
16272 * xterm.c: Make symbols static if they're not exported.
16273 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
16274 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
16275 (x_destroy_window, x_delete_display):
16276 Now static.
16277 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
16278 (x_mouse_leave): Remove; unused.
16279 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
16280 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
16281 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
16282 Remove decls.
16283 (x_mouse_leave): Declare only if WINDOWSNT.
16284 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
16285 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
16286 USE_X_TOOLKIT.
16287
1675728f
PE
16288 * ftxfont.c: Make symbols static if they're not exported.
16289 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
16290 HAVE_FREETYPE.
16291 * font.h (ftxfont_driver): Likewise.
16292
e4cebfca
PE
16293 * xfns.c: Make symbols static if they're not exported.
16294 (x_last_font_name, x_display_info_for_name):
16295 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
16296 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
16297 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
16298 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
16299 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
16300 (last_show_tip_args): Now static.
16301 (xic_defaut_fontset, xic_create_fontsetname): Define only if
16302 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
16303 (x_screen_planes): Remove; unused.
16304 * dispextern.h (x_screen_planes): Remove decl.
16305
5bf46f05
PE
16306 * dispnew.c: Make symbols static if they're not exported.
16307 * dispextern.h (redraw_garbaged_frames, scrolling):
16308 (increment_row_positions): Remove.
16309 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
16310 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
16311 Now static.
16312 (redraw_garbaged_frames): Remove; unused.
16313
435f4c28
PE
16314 * xfaces.c: Make symbols static if they're not exported.
16315 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
16316 Remove decls.
16317 * xterm.h (defined_color): Remove decls.
16318 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
16319 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
16320 (menu_face_changed_default, defined_color, free_realized_face):
16321 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
16322 (ascii_face_of_lisp_face): Remove; unused.
16323
8524aef3
PE
16324 * xdisp.c: Make symbols static if they're not exported.
16325 * dispextern.h (scratch_glyph_row, window_box_edges):
16326 (glyph_to_pixel_coords, set_cursor_from_row):
16327 (get_next_display_element, set_iterator_to_next):
16328 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
16329 (show_mouse_face): Remove decls
16330 * frame.h (message_buf_print): Likewise.
16331 * lisp.h (pop_message, set_message, check_point_in_composition):
16332 Likewise.
16333 * xterm.h (set_vertical_scroll_bar): Likewise.
16334 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
16335 (message_buf_print, scratch_glyph_row, displayed_buffer):
16336 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
16337 (get_next_display_element, show_mouse_face, window_box_edges):
16338 (frame_to_window_pixel_xy, check_point_in_composition):
16339 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
16340 (glyph_to_pixel_coords): Remove; unused.
16341
16390cd2
PE
16342 * dired.c (file_name_completion): Now static.
16343
16344 * dbusbind.c (xd_in_read_queued_messages): Now static.
16345
a25f4dfa
PE
16346 * lisp.h (circular_list_error, FOREACH): Remove; unused.
16347 * data.c (circular_list_error): Remove.
16348
14a9c8df
PE
16349 * commands.h (last_point_position, last_point_position_buffer):
16350 (last_point_position_window): Remove decls.
16351 * keyboard.c: Make these variables static.
16352
04f2d78b
CB
16353 * coding.h (coding, code_convert_region, encode_coding_gap):
16354 Remove decls.
74ab6df5
PE
16355 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
16356 (iso_code_class, detect_coding, code_convert_region): Now static.
16357 (encode_coding_gap): Remove; unused.
16358
38dfbee1
PE
16359 * chartab.c (chartab_chars, chartab_bits): Now static.
16360
a2cb4e63
PE
16361 * charset.h (charset_iso_8859_1): Remove decl.
16362 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
16363 Now static.
16364
127198fd
PE
16365 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
16366 * ccl.c (Vccl_program_table): Now static.
16367 (check_ccl_update): Remove; unused.
16368
d85b608f
PE
16369 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
16370 * category.h: ... from here.
16371 * category.c (check_category_table, set_category_set): Now static.
16372
31cd66f3
PE
16373 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
16374 * lisp.h: Remove these decls.
16375
c358e587
PE
16376 * buffer.c (buffer_count): Remove unused var.
16377
e78aecca
PE
16378 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
16379 so that it's not optimized away.
16380 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
16381 * dispextern.h (bidi_dump_cached_states): Remove, since it's
16382 exported only to the debugger.
16383
e192d7d3 16384 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 16385 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 16386
92470028
PE
16387 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
16388 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
16389 was inaccessible from Lisp.
16390 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
16391 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
16392
244ed907
PE
16393 alloc.c: Import and export fewer symbols, and remove unused items.
16394 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
16395 is defined.
16396 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
16397 it's not optimized away by whole-program optimization.
16398 (message_enable_multibyte, free_misc): Remove.
16399 (catchlist, handlerlist, mark_backtrace):
16400 Declare only if BYTE_MARK_STACK.
16401 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
16402 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
16403 (message_enable_multibyte): Remove decl.
16404 (free_misc, interval_free_list, float_block, float_block_index):
16405 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16406 (cons_free_list, last_marked_index):
16407 Now static.
16408 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
16409 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
16410 (mark_backtrace): Define only if BYTE_MARK_STACK.
16411 * xdisp.c (message_enable_multibyte): Now static.
16412
61c2b50e 16413 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
16414 This makes it easier for human readers (and static analyzers)
16415 to see whether these variables are used from other modules.
16416 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
16417 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
16418 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
16419 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
16420 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
16421 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
16422 * xmenu.c, xselect.c:
16423 Declare Q* vars static if they are not used in other modules.
16424 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
16425 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
16426 Remove decls of unexported vars.
16427 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
16428
95c82688
PE
16429 * lisp.h (DEFINE_FUNC): Make sname 'static'.
16430
16a97296
PE
16431 Make Emacs functions such as Fatom 'static' by default.
16432 This makes it easier for human readers (and static analyzers)
16433 to see whether these functions can be called from other modules.
16434 DEFUN now defines a static function. To make the function external
16435 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
16436 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
16437 (Finit_image_library):
16a97296
PE
16438 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
16439 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
16440 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
16441 Remove decls, since these functions are now static.
16442 (Funintern, Fget_internal_run_time): New decls, since these functions
16443 were already external.
95c82688 16444
16a97296
PE
16445 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
16446 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
16447 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
16448 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
16449 * keyboard.c, keymap.c, lread.c:
16450 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
16451 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
16452 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
16453 Mark functions with DEFUE instead of DEFUN,
16454 if they are used in other modules.
16455 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
16456 decls for now-static functions.
16457 * buffer.h (Fdelete_overlay): Remove decl.
16458 * callproc.c (Fgetenv_internal): Mark as internal.
16459 * composite.c (Fremove_list_of_text_properties): Remove decl.
16460 (Fcomposition_get_gstring): New forward static decl.
16461 * composite.h (Fcomposite_get_gstring): Remove decl.
16462 * dired.c (Ffile_attributes): New forward static decl.
16463 * doc.c (Fdocumntation_property): New forward static decl.
16464 * eval.c (Ffetch_bytecode): New forward static decl.
16465 (Funintern): Remove extern decl; now in .h file where it belongs.
16466 * fileio.c (Fmake_symbolic_link): New forward static decl.
16467 * image.c (Finit_image_library): New forward static decl.
16468 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
16469 * intervals.h (Fprevious_property_change):
16470 (Fremove_list_of_text_properties): Remove decls.
16471 * keyboard.c (Fthis_command_keys): Remove decl.
16472 (Fcommand_execute): New forward static decl.
16473 * keymap.c (Flookup_key): New forward static decl.
16474 (Fcopy_keymap): Now static.
16475 * keymap.h (Flookup_key): Remove decl.
16476 * process.c (Fget_process): New forward static decl.
16477 (Fprocess_datagram_address): Mark as internal.
16478 * syntax.c (Fsyntax_table_p): New forward static decl.
16479 (skip_chars): Remove duplicate decl.
16480 * textprop.c (Fprevious_property_change): New forward static decl.
16481 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
16482 Now internal.
16483 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
16484 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
16485
785bbd42
PE
16486 * editfns.c (Fformat): Remove unreachable code.
16487
8b913b57
AS
164882011-04-14 Andreas Schwab <schwab@linux-m68k.org>
16489
16490 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
16491 change. (Bug#8496)
16492
a6744a35
EZ
164932011-04-13 Eli Zaretskii <eliz@gnu.org>
16494
16495 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
16496 when at ZV. (Bug#8487)
16497
e7974947
AS
164982011-04-12 Andreas Schwab <schwab@linux-m68k.org>
16499
baad03f0
AS
16500 * charset.c (Fclear_charset_maps): Use xfree instead of free.
16501 (Bug#8437)
16502 * keyboard.c (parse_tool_bar_item): Likewise.
16503 * sound.c (sound_cleanup, alsa_close): Likewise.
16504 * termcap.c (tgetent): Likewise.
16505 * xfns.c (x_default_font_parameter): Likewise.
16506 * xsettings.c (read_and_apply_settings): Likewise.
16507
e7974947
AS
16508 * alloc.c (overrun_check_malloc, overrun_check_realloc)
16509 (overrun_check_free): Protoize.
16510
28272684
PE
165112011-04-12 Paul Eggert <eggert@cs.ucla.edu>
16512
16513 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
16514 since callers should never pass a negative size.
16515 Change the signature to match that of plain 'read' and 'write'; see
16516 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
16517 * lisp.h: Update prototypes of emacs_write and emacs_read.
16518
11997c76
EZ
165192011-04-11 Eli Zaretskii <eliz@gnu.org>
16520
16521 * xdisp.c (redisplay_window): Don't try to determine the character
16522 position of the scroll margin if the window start point w->startp
e896f03c 16523 is outside the buffer's accessible region. (Bug#8468)
11997c76 16524
8a2cbd72
EZ
165252011-04-10 Eli Zaretskii <eliz@gnu.org>
16526
16527 Fix write-region and its subroutines for buffers > 2GB.
16528 * fileio.c (a_write, e_write): Modify declaration of arguments and
16529 local variables to support buffers larger than 2GB.
16530 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
16531
16532 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
16533 argument, local variables, and return value.
16534
16535 * lisp.h: Update prototypes of emacs_write and emacs_read.
16536
16537 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
16538
4073e537 165392011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 16540
1ebfdcb6
PE
16541 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
16542
b2ded58d
PE
16543 Fix more problems found by GCC 4.6.0's static checks.
16544
7d66342c
PE
16545 * xdisp.c (vmessage): Use a better test for character truncation.
16546
bbf47d44
PE
16547 * charset.c (load_charset_map): <, not <=, for optimization,
16548 and to avoid potential problems with integer overflow.
9248994d 16549 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 16550 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 16551 * editfns.c (Fformat): Likewise.
1e69125e 16552 * syntax.c (skip_chars): Likewise.
3befa583 16553
e3019616
PE
16554 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
16555 This also lets GCC 4.6.0 generate slightly better loop code.
16556
becfa255
PE
16557 * callint.c (Fcall_interactively): <, not <=, for optimization.
16558 (Fcall_interactively): Count the number of arguments produced,
16559 not the number of arguments given. This is simpler and lets GCC
16560 4.6.0 generate slightly better code.
16561
dae0cd48
PE
16562 * ftfont.c: Distingish more carefully between FcChar8 and char.
16563 The previous code passed unsigned char * to a functions like
16564 strlen and xstrcasecmp that expect char *, which does not
16565 conform to the C standard.
16566 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
16567 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
16568 char * when the C standard requires it.
16569
76032d70
PE
16570 * keyboard.c (read_char): Remove unused var.
16571
eb3f1cc8
PE
16572 * eval.c: Port to Windows vsnprintf (Bug#8435).
16573 Include <limits.h>.
16574 (SIZE_MAX): Define if the headers do not.
16575 (verror): Do not give up if vsnprintf returns a negative count.
16576 Instead, grow the buffer. This ports to Windows vsnprintf, which
16577 does not conform to C99. Problem reported by Eli Zaretskii.
16578 Also, simplify the allocation scheme, by avoiding the need for
16579 calling realloc, and removing the ALLOCATED variable.
16580
70476b54
PE
16581 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
16582
12020a9e
PE
16583 Remove invocations of doprnt, as Emacs now uses vsnprintf.
16584 But keep the doprint source code for now, as we might revamp it
16585 and use it again (Bug#8435).
ea6c7ae6
PE
16586 * lisp.h (doprnt): Remove.
16587 * Makefile.in (base_obj): Remove doprnt.o.
16588 * deps.mk (doprnt.o): Remove.
16589
5fdb398c
PE
16590 error: Print 32- and 64-bit integers portably (Bug#8435).
16591 Without this change, on typical 64-bit hosts error ("...%d...", N)
16592 was used to print both 32- and 64-bit integers N, which relied on
16593 undefined behavior.
61bdb816 16594 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
16595 * lisp.h (error, verror): Mark as printf-like functions.
16596 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
16597 Report overflow in size calculations when allocating printf buffer.
16598 Do not truncate output string at its first null byte.
16599 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
16600 Truncate the output at a character boundary, since vsnprintf does not
16601 do that.
16602 * charset.c (check_iso_charset_parameter): Convert internal
16603 character to string before calling 'error', since %c now has the
16604 printf meaning.
16605 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
16606 overflow when computing char to be passed to 'error'. Do not
16607 pass Lisp_Object to 'error'; pass the integer instead.
16608 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
16609 formatted with plain %d.
16610
b189fa66
PE
16611 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
16612
bff87ef0
PE
16613 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
16614
7e2cac20
PE
16615 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
16616
ce4d90b5
PE
16617 * xterm.c (x_catch_errors): Remove duplicate declaration.
16618
266c9547
PE
16619 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
16620
79c49ad2
PE
16621 * xdisp.c, lisp.h (message_nolog): Remove; unused.
16622
368f4090
JM
166232011-04-10 Jim Meyering <meyering@redhat.com>
16624
16625 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
16626 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
16627 return ssize_t not "int", and use size_t as the buffer length.
16628 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
16629 * gnutls.h: Update declarations.
16630 * process.c (read_process_output): Use ssize_t, to match.
16631 (send_process): Likewise.
16632
a32d4040
CY
166332011-04-09 Chong Yidong <cyd@stupidchicken.com>
16634
16635 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
16636
8546720e 166372011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 16638
04f2d78b
CB
16639 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
16640 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 16641
8546720e
GM
16642 * xterm.c (handle_one_xevent):
16643 * xmenu.c (create_and_show_popup_menu):
16644 * xselect.c (x_decline_selection_request)
16645 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 16646
0a2f5c1a 166472011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
16648
16649 Fix some uses of `int' instead of EMACS_INT.
16650 * search.c (string_match_1, fast_string_match)
16651 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
16652 (scan_buffer, find_next_newline_no_quit)
16653 (find_before_next_newline, search_command, Freplace_match)
16654 (Fmatch_data): Make some `int' variables be EMACS_INT.
16655
16656 * xdisp.c (display_count_lines): 3rd argument and return value now
16657 EMACS_INT. All callers changed.
16658 (pint2hrstr): Last argument is now EMACS_INT.
16659
16660 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
16661 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
16662 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
16663 (decode_coding_utf_16, decode_coding_emacs_mule)
16664 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
16665 (decode_coding_ccl, decode_coding_charset)
16666 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
16667 (decode_coding_iso_2022, decode_coding_emacs_mule)
16668 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
16669 <char_offset, last_offset>: Declare EMACS_INT.
16670 (encode_coding_utf_8, encode_coding_utf_16)
16671 (encode_coding_emacs_mule, encode_invocation_designation)
16672 (encode_designation_at_bol, encode_coding_iso_2022)
16673 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
16674 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
16675 Declare EMACS_INT.
16676 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
16677 (encode_invocation_designation): Last argument P_NCHARS is now
16678 EMACS_INT.
16679 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
16680 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
16681
16682 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
16683 All users changed.
16684
16685 * ccl.c (Fccl_execute_on_string): Declare some variables
16686 EMACS_INT.
16687
8546720e 166882011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
16689
16690 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
16691
4e19a977
CS
166922011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
16693
16694 * process.c (Fformat_network_address): Doc fix.
16695
87302331
R
166962011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
16697
ee7683eb 16698 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 16699
cbb59342
CY
167002011-04-08 Chong Yidong <cyd@stupidchicken.com>
16701
16702 * keyboard.c (read_char): Call Lisp function help-form-show,
16703 instead of using internal_with_output_to_temp_buffer.
16704 (Qhelp_form_show): New var.
e0d38eeb 16705 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
16706
16707 * print.c (internal_with_output_to_temp_buffer): Function deleted.
16708
16709 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
16710
e67a13ab
CY
167112011-04-06 Chong Yidong <cyd@stupidchicken.com>
16712
04f2d78b
CB
16713 * process.c (Flist_processes): Remove to Lisp.
16714 (list_processes_1): Delete.
e67a13ab 16715
973f782d
EZ
167162011-04-06 Eli Zaretskii <eliz@gnu.org>
16717
7c106b1e
EZ
16718 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
16719
973f782d
EZ
16720 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
16721
41cf7d1a 167222011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 16723
ca23cc88
PE
16724 Fix more problems found by GCC 4.6.0's static checks.
16725
f390e2d5
PE
16726 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
16727
42eea0d0
PE
16728 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16729
b69769da 16730 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 16731
f9541e84
PE
16732 * xdisp.c (vmessage): Mark as a printf-like function.
16733
13841b55
PE
16734 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16735
c136c10f
PE
16736 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16737
5e2d4a30
PE
16738 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16739 printf-like functions.
16740 (tiff_load): Add casts to remove these marks before passing them
16741 to system-supplied API.
16742
583f48b9
PE
16743 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16744
b25d760e
PE
16745 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16746 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
16747 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16748 directly, rather than having caller test rule sign. This avoids
16749 some unnecessary tests.
16750 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16751 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16752 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 16753
bc7b6697 16754 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 16755 (xfont_open): Avoid unnecessary tests.
bc7b6697 16756
27ccc379
PE
16757 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16758
dcd5c89a
PE
16759 * composite.h, composite.c (composition_gstring_put_cache):
16760 Use EMACS_INT, not int, for length.
16761
b13a45c6
PE
16762 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16763 breaking out part of COMPOSITION_DECODE_RULE.
16764 (COMPOSITION_DECODE_RULE): Use it.
16765 * composite.c (get_composition_id): Remove unused local vars,
16766 by using the new macro.
16767
1e792e4d
PE
16768 * textprop.c (set_text_properties_1): Change while to do-while,
16769 since the condition is always true at first.
16770
dc6c6455 16771 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
16772 (interval_deletion_adjustment): Return unsigned value.
16773 All uses changed.
dc6c6455 16774
aba7731a
PE
16775 * process.c (list_processes_1, create_pty, read_process_output):
16776 (exec_sentinel): Remove vars that were set but not used.
afd4052b 16777 (create_pty): Remove unnecessary "volatile"s.
bc57d757 16778 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 16779 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 16780 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 16781
fdfc4bf3
PE
16782 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16783
fca8fe46 16784 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 16785 (update_syntax_table): Use unsigned instead of int.
fca8fe46 16786
06a0259a 16787 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 16788 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 16789 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 16790
e7b9e80f
PE
16791 * print.c (print_error_message): Avoid int overflow.
16792
56201685
PE
16793 * font.c (font_list_entities): Redo for clarity,
16794 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16795
78834453 16796 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 16797 (font_score): Avoid potential overflow in diff calculation.
78834453 16798
0bc0b309 16799 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 16800 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 16801
e610eaca
PE
16802 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16803
b895abce
PE
16804 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16805 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16806 can always succeed if overflow has undefined behavior.
16807
1f1d9321 16808 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 16809 (wordify): Omit three unnecessary tests.
1f1d9321 16810
c59478bc
PE
16811 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16812 All callers changed. This avoids the need for an unused var.
16813
79b73827
PE
16814 * casefiddle.c (casify_region): Remove var that is set but not used.
16815
a4db5dfe
PE
16816 * dired.c (file_name_completion): Remove var that is set but not used.
16817
43aae36e
PE
16818 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16819
2a47c44d 16820 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 16821 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 16822
a37c69bf
PE
16823 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16824 Check for integer overflow on size calculations.
16825
328ab8e7
PE
16826 * buffer.c (Fprevious_overlay_change): Remove var that is set
16827 but not used.
16828
e5a2a5cb
PE
16829 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16830 Remove vars that are set but not used.
8d84a6eb 16831 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 16832 (timer_check_2): Mark vars as initialized.
e5a2a5cb 16833
a60e5f68
PE
16834 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16835
f661cb61 16836 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 16837 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 16838
f0397f5a
PE
16839 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16840 that are set but not used.
16841
8664db06 16842 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 16843 if XCreateBitmapFromData fails (Bug#8410).
8664db06 16844
6abdaa4a
PE
16845 * xselect.c (x_get_local_selection, x_handle_property_notify):
16846 Remove vars that are set but not used.
16847
0ce7538d 16848 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 16849 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 16850
9ae848fc
PE
16851 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16852 Remove var that is set but not used.
0b918413
PE
16853 (scroll_bar_windows_size): Now size_t, not int.
16854 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16855 Check for overflow.
9ae848fc 16856
a5a62657
PE
16857 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16858 (map_tty_color) [!defined MSDOS]: Likewise.
16859
5c5cdd39
PE
16860 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16861
66ebf983
PE
16862 * coding.c: Remove vars that are set but not used.
16863 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16864 All callers changed.
16865 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16866 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16867 (decode_coding_charset): Remove vars that are set but not used.
16868
1be4d761
PE
16869 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16870 that is set but not used.
16871
47553fa8
PE
16872 * print.c (print_object): Remove var that is set but not used.
16873
1f7196bf 16874 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
16875 The gnulib version avoids calling malloc in the usual case,
16876 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16877 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16878 * filelock.c (current_lock_owner): Likewise.
16879 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16880 * sysdep.c: Include allocator.h, careadlinkat.h.
16881 (emacs_no_realloc_allocator): New static constant.
16882 (emacs_readlink): New function.
fdb61804
PE
16883 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16884 ../lib/careadlinkat.h.
d1fdcab7 16885
f84c17c7
SM
168862011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16887
16888 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16889 first non-nil return value).
16890
ef3862ad
JD
168912011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16892
16893 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16894 if not defined (Bug#8403).
16895
376a7006
JB
168962011-04-02 Juanma Barranquero <lekktu@gmail.com>
16897
16898 * xdisp.c (display_count_lines): Remove parameter `start',
16899 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16900 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16901 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16902 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16903 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16904 and thereabouts. All callers changed.
16905 (get_per_char_metric): Remove parameter `f', unused since
16906 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16907
6ca3801d
JM
169082011-04-02 Jim Meyering <meyering@redhat.com>
16909
16910 do not dereference NULL upon failed strdup
16911 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16912 (ns_get_family): Likewise.
16913
d8e2b5ba
JB
169142011-04-02 Juanma Barranquero <lekktu@gmail.com>
16915
16916 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16917
8c74fcbd
JD
169182011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16919
16920 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16921 later (Bug#8403).
16922
7200d79c
SM
169232011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16924
03408648 16925 Add lexical binding.
7200d79c 16926
03408648
SM
16927 * window.c (Ftemp_output_buffer_show): New fun.
16928 (Fsave_window_excursion):
16929 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16930
16931 * lread.c (lisp_file_lexically_bound_p): New function.
16932 (Fload): Bind Qlexical_binding.
16933 (readevalloop): Remove `evalfun' arg.
16934 Bind Qinternal_interpreter_environment.
16935 (Feval_buffer): Bind Qlexical_binding.
16936 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16937 Mark as dynamic.
16938 (syms_of_lread): Declare `lexical-binding'.
16939
16940 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16941
16942 * keyboard.c (eval_dyn): New fun.
16943 (menu_item_eval_property): Use it.
ca105506
SM
16944
16945 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 16946
03408648
SM
16947 * fns.c (concat, mapcar1): Accept byte-code-functions.
16948
16949 * eval.c (Fsetq): Handle lexical vars.
16950 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16951 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16952 (FletX, Flet): Obey lexical binding.
16953 (Fcommandp): Handle closures.
16954 (Feval): New `lexical' arg.
16955 (eval_sub): New function extracted from Feval. Use it almost
16956 everywhere where Feval was used. Look up vars in lexical env.
16957 Handle closures.
16958 (Ffunctionp): Move from subr.el.
16959 (Ffuncall): Handle closures.
16960 (apply_lambda): Remove `eval_flags'.
16961 (funcall_lambda): Handle closures and new byte-code-functions.
16962 (Fspecial_variable_p): New function.
16963 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16964 but without exporting it to Lisp.
23aba0ea 16965
23aba0ea 16966 * doc.c (Fdocumentation, store_function_docstring):
03408648 16967 * data.c (Finteractive_form): Handle closures.
23aba0ea 16968
03408648
SM
16969 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16970 interactive spec.
ba83908c 16971
04f2d78b
CB
16972 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16973 New byte-codes.
03408648
SM
16974 (exec_byte_code): New function extracted from Fbyte_code to handle new
16975 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 16976
03408648 16977 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 16978
03408648 16979 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 16980
e2abce01
JB
169812011-03-31 Juanma Barranquero <lekktu@gmail.com>
16982
16983 * xdisp.c (redisplay_internal): Fix prototype.
16984
63696a73 169852011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 16986
63696a73 16987 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
16988 (try_scrolling): Use it when setting scroll_limit.
16989 Limit scrolling to 100 screen lines.
63696a73
EZ
16990 (redisplay_window): Even when falling back on "recentering",
16991 position point in the window according to scroll-conservatively,
16992 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16993
16994 (try_scrolling): When point is above the window, allow searching
16995 as far as scroll_max, or one screenful, to compute vertical
16996 distance from PT to the scroll margin position. This prevents
16997 try_scrolling from unnecessarily failing when
16998 scroll-conservatively is set to a value slightly larger than the
16999 window height. Clean up the case of PT below the margin at bottom
17000 of window: scroll_max can no longer be INT_MAX. When aggressive
17001 scrolling is in use, don't let point enter the opposite scroll
17002 margin as result of the scroll.
17003 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
17004 threshold of 100 lines for never-recentering scrolling.
17005
e4cc2dfc
JB
170062011-03-31 Juanma Barranquero <lekktu@gmail.com>
17007
17008 * dispextern.h (move_it_by_lines):
17009 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17010 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17011 (message_log_check_duplicate): Remove parameters `prev_bol' and
17012 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17013 (redisplay_internal): Remove parameter `preserve_echo_area',
17014 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17015
17016 * indent.c (Fvertical_motion):
17017 * window.c (window_scroll_pixel_based, Frecenter):
17018 Don't pass `need_y_p' to `move_it_by_lines'.
17019
1c470562
SM
170202011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
17021
44f230aa
SM
17022 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
17023 steal a few bits to be more compact.
17024 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
17025 Remove unneeded casts.
17026
1c470562
SM
17027 * bytecode.c (Fbyte_code): CAR and CDR can GC.
17028
888adce9
ZK
170292011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
17030
17031 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
17032 binding" message (bug#7967).
17033
f838ed7b
PE
170342011-03-30 Paul Eggert <eggert@cs.ucla.edu>
17035
77861b95
PE
17036 Fix more problems found by GCC 4.6.0's static checks.
17037
de6dbc14
PE
17038 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
17039 Remove unused local var.
17040
f838ed7b
PE
17041 * editfns.c (Fmessage_box): Remove unused local var.
17042
792c7b2b
PE
17043 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
17044 (note_mode_line_or_margin_highlight, note_mouse_highlight):
17045 Omit unused local vars.
c499e557 17046 * window.c (shrink_windows): Omit unused local var.
b01a1c29 17047 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
17048 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
17049 Omit unused local var.
17050
ba0165e1
PE
17051 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
17052 Don't assume string length fits in int.
32ad8845 17053 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 17054 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 17055
3c59b4c9
PE
17056 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
17057 instead of alloca (Bug#8344).
17058
a3eed478 17059 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 17060 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 17061
eb4d412d
PE
17062 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
17063
1658b401
PE
17064 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
17065 concerns.
17066
17067 * term.c (produce_glyphless_glyph): Remove unnecessary test.
17068
17069 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 17070
9a2c6e05
PE
17071 * keyboard.c (syms_of_keyboard): Use the same style as later
17072 in this function when indexing through an array. This also
17073 works around GCC bug 48267.
17074
03d0a109
PE
17075 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
17076
44f730c8
PE
17077 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
17078
fe75f926
PE
17079 * chartab.c (sub_char_table_ref_and_range): Redo for slight
17080 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
17081
ffa8c828
PE
17082 * keyboard.c, keyboard.h (num_input_events): Now size_t.
17083 This avoids undefined behavior on integer overflow, and is a bit
17084 more convenient anyway since it is compared to a size_t variable.
17085
c5101a77
PE
17086 Variadic C functions now count arguments with size_t, not int.
17087 This avoids an unnecessary limitation on 64-bit machines, which
17088 caused (substring ...) to crash on large vectors (Bug#8344).
17089 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
17090 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 17091 All variadic functions and their callers changed accordingly.
c5101a77
PE
17092 (struct gcpro.nvars): Now size_t, not int. All uses changed.
17093 * data.c (arith_driver, float_arith_driver): Likewise.
17094 * editfns.c (general_insert_function): Likewise.
17095 * eval.c (struct backtrace.nargs, interactive_p)
17096 (internal_condition_case_n, run_hook_with_args, apply_lambda)
17097 (funcall_lambda, mark_backtrace): Likewise.
17098 * fns.c (concat): Likewise.
17099 * frame.c (x_set_frame_parameters): Likewise.
17100 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
17101 0 if not found, not -1. All callers changed.
17102
dd3f25f7
PE
17103 * alloc.c (garbage_collect): Don't assume stack size fits in int.
17104 (stack_copy_size): Now size_t, not int.
17105 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
17106
461c2ab9
JB
171072011-03-28 Juanma Barranquero <lekktu@gmail.com>
17108
17109 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
17110 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17111 All callers changed.
17112
17113 * lisp.h (multibyte_char_to_unibyte):
17114 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
17115 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
17116 * character.h (CHAR_TO_BYTE8):
17117 * cmds.c (internal_self_insert):
17118 * editfns.c (general_insert_function):
17119 * keymap.c (push_key_description):
17120 * search.c (Freplace_match):
17121 * xdisp.c (message_dolog, set_message_1): All callers changed.
17122
f6d62986
SM
171232011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
17124
17125 * keyboard.c (safe_run_hook_funcall): New function.
17126 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
17127 don't set the hook to nil, but remove the offending function instead.
17128 (Qcommand_hook_internal): Remove, unused.
17129 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
17130 Vcommand_hook_internal.
17131
17132 * eval.c (enum run_hooks_condition): Remove.
17133 (funcall_nil, funcall_not): New functions.
17134 (run_hook_with_args): Call each function through a `funcall' argument.
17135 Remove `cond' argument, now redundant.
17136 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
17137 (Frun_hook_with_args_until_failure): Adjust accordingly.
17138 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
17139
1db5b1ad
JB
171402011-03-28 Juanma Barranquero <lekktu@gmail.com>
17141
17142 * dispextern.h (string_buffer_position): Remove declaration.
17143
17144 * print.c (strout): Remove parameter `multibyte', unused since
17145 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
17146
17147 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
17148 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
17149 All callers changed.
17150
17151 * w32.c (_wsa_errlist): Use braces for struct initializers.
17152
17153 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
17154 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
17155 All callers changed.
17156 (string_buffer_position): Likewise. Also, make static (it's never
17157 used outside xdisp.c).
17158 (cursor_row_p): Remove parameter `w', unused since
17159 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
17160 (decode_mode_spec): Remove parameter `precision', introduced during
17161 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
17162 All callers changed.
17163
5ffb62aa
JD
171642011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17165
17166 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
17167
461c2ab9 171682011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
17169
17170 * nsterm.m (ns_menu_bar_is_hidden): New variable.
17171 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
17172 (ns_update_auto_hide_menu_bar): New functions.
17173 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
17174 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
17175 ns_constrain_all_frames.
17176 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
17177 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
17178
5c380ffb
JD
171792011-03-27 Jan Djärv <jan.h.d@swipnet.se>
17180
17181 * nsmenu.m (runDialogAt): Remove argument to timer_check.
17182
9af30bdf
GM
171832011-03-27 Glenn Morris <rgm@gnu.org>
17184
17185 * syssignal.h: Replace RETSIGTYPE with void.
17186 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
17187 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
17188 Replace SIGTYPE with void everywhere.
17189 * s/usg5-4-common.h (SIGTYPE): Remove definition.
17190 * s/template.h (SIGTYPE): Remove commented out definition.
17191
e2abce01
JB
171922011-03-26 Eli Zaretskii <eliz@gnu.org>
17193
17194 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
17195 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
17196
f868cd8a
JB
171972011-03-26 Juanma Barranquero <lekktu@gmail.com>
17198
59eb0929
JB
17199 * w32.c (read_unc_volume): Use parameter `henum', instead of
17200 global variable `wget_enum_handle'.
17201
17202 * keymap.c (describe_vector): Remove parameters `indices' and
17203 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
17204 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
17205
f868cd8a
JB
17206 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
17207
17208 * keyboard.c (timer_check): Remove parameter `do_it_now',
17209 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
17210 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
17211 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
17212
17213 * keyboard.c (read_char):
17214 * w32menu.c (w32_menu_display_help):
17215 * xmenu.c (show_help_event, menu_help_callback):
17216 Adjust calls to `show_help_echo'.
17217
17218 * gtkutil.c (xg_maybe_add_timer):
17219 * keyboard.c (readable_events):
17220 * process.c (wait_reading_process_output):
17221 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
17222
17223 * insdel.c (adjust_markers_gap_motion):
17224 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
17225 (gap_left, gap_right): Don't call it.
17226
2ecf6fdb
CY
172272011-03-25 Chong Yidong <cyd@stupidchicken.com>
17228
17229 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
17230 incurred during fontification.
17231
6b1f9ba4
JB
172322011-03-25 Juanma Barranquero <lekktu@gmail.com>
17233
17234 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
17235 (DEFVAR_PER_BUFFER): Don't pass it.
17236
17237 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
17238 (scrolling_window): Don't pass it.
17239
0f4a96b5
JB
172402011-03-25 Juanma Barranquero <lekktu@gmail.com>
17241
17242 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
17243
17244 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
17245 and `suffix'.
17246 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
17247 of variables specific to SELinux and computation of `encoded_absname'.
17248
17249 * image.c (XPutPixel): Remove unused variable `height'.
17250
17251 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
17252
17253 * unexw32.c (get_section_info): Remove unused variable `section'.
17254
17255 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
17256 (system_process_attributes): Remove unused variable `sess'.
17257 (sys_read): Remove unused variable `err'.
17258
17259 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
17260 (w32_wnd_proc): Remove unused variable `isdead'.
17261 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
17262 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
17263 (x_create_tip_frame): Remove unused variable `tem'.
17264
17265 * w32inevt.c (w32_console_read_socket):
17266 Remove unused variable `no_events'.
17267
17268 * w32term.c (x_draw_composite_glyph_string_foreground):
17269 Remove unused variable `width'.
17270
1149507c
JB
172712011-03-24 Juanma Barranquero <lekktu@gmail.com>
17272
17273 * w32term.c (x_set_glyph_string_clipping):
17274 Don't pass uninitialized region to CombineRgn.
17275
9c88f339
JB
172762011-03-23 Juanma Barranquero <lekktu@gmail.com>
17277
17278 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
17279 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
17280 (Fx_close_connection): Remove unused variable `i'.
17281
17282 * w32font.c (w32font_draw): Return number of glyphs.
17283 (w32font_open_internal): Remove unused variable `i'.
17284 (w32font_driver): Add missing initializer.
17285
17286 * w32menu.c (utf8to16): Remove unused variable `utf16'.
17287 (fill_in_menu): Remove unused variable `items_added'.
17288
17289 * w32term.c (last_mouse_press_frame): Remove static global variable.
17290 (w32_clip_to_row): Remove unused variable `f'.
17291 (x_delete_terminal): Remove unused variable `i'.
17292
17293 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
17294 (NOTHING): Remove unused static global variable.
17295 (uniscribe_check_otf): Remove unused variable `table'.
17296 (uniscribe_font_driver): Add missing initializers.
17297
dee091a3
JD
172982011-03-23 Julien Danjou <julien@danjou.info>
17299
17300 * term.c (Fsuspend_tty, Fresume_tty):
17301 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
17302 * window.c (temp_output_buffer_show):
17303 * insdel.c (signal_before_change):
17304 * frame.c (Fhandle_switch_frame):
17305 * fileio.c (Fdo_auto_save):
17306 * emacs.c (Fkill_emacs):
17307 * editfns.c (save_excursion_restore):
17308 * cmds.c (internal_self_insert):
17309 * callint.c (Fcall_interactively):
17310 * buffer.c (Fkill_all_local_variables):
17311 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
17312 Use Frun_hooks.
0f4a96b5 17313 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 17314 unconditionally since it does the check itself.
dee091a3 17315
2c520ab5 173162011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 17317
c9c49752
PE
17318 Fix more problems found by GCC 4.5.2's static checks.
17319
8abc3f12
PE
17320 * coding.c (encode_coding_raw_text): Avoid unnecessary test
17321 the first time through the loop, since we know p0 < p1 then.
17322 This also avoids a gcc -Wstrict-overflow warning.
17323
a2d26660
PE
17324 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
17325 leading to a memory leak, possible in functions like
17326 load_charset_map_from_file that can allocate an unbounded number
b12ef411 17327 of objects (Bug#8318).
a2d26660 17328
916c72e9
PE
17329 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
17330 that could (at least in theory) be that large.
17331
19ab8a18
PE
17332 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
17333 This is less likely to overflow, and avoids undefined behavior if
17334 overflow does occur. All callers changed. Use strtoul to scan
17335 for the unsigned long integer.
b7cbbd6f
PE
17336 (pint2hrstr): Simplify and tune code slightly.
17337 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 17338
f0641eff
PE
17339 * scroll.c (do_scrolling): Work around GCC bug 48228.
17340 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
17341
7f650bb9
PE
17342 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
17343 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
17344 (validate_x_resource_name): Simplify count usage.
17345 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 17346
37dd57d1
PE
17347 * fileio.c (Fcopy_file): Report error if fchown or fchmod
17348 fail (Bug#8306).
81e56e61 17349
699979fc 17350 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 17351
401bf9b4
PE
17352 * process.c (Fmake_network_process): Use socklen_t, not int,
17353 where POSIX says socklen_t is required in portable programs.
17354 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 17355 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
17356 (Fmake_network_process, server_accept_connection):
17357 (wait_reading_process_output, read_process_output):
17358 Likewise.
17359
b93aacde
PE
17360 * process.c: Rename or move locals to avoid shadowing.
17361 (list_processes_1, Fmake_network_process):
17362 (read_process_output_error_handler, exec_sentinel_error_handler):
17363 Rename or move locals.
4dc343ee 17364 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 17365 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 17366 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 17367 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 17368 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 17369
af8a867c 17370 Make tparam.h and terminfo.c consistent.
44f230aa
SM
17371 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
17372 Include tparam.h instead, since it declares them.
af8a867c
PE
17373 * cm.h (PC): Remove extern decl; tparam.h now does this.
17374 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
17375 * terminfo.c: Include tparam.h, to check interfaces.
17376 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
17377 (tparam): Adjust signature to match interface in tparam.h;
17378 this removes some undefined behavior. Check that outstring and len
17379 are zero, which they always are with Emacs.
17380 * tparam.h (PC, BC, UP): New extern decls.
17381
0248044d 17382 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 17383 (xftfont_open): Rename locals to avoid shadowing.
0248044d 17384
8ff096c1 17385 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
17386 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
17387 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 17388 (ftfont_list): Remove unused local.
49eaafba
PE
17389 (get_adstyle_property, ftfont_pattern_entity):
17390 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
17391 Rename locals to avoid shadowing.
8ff096c1 17392
e2be39f6
PE
17393 * xfont.c (xfont_list_family): Mark var as initialized.
17394
c9735e30
PE
17395 * xml.c (make_dom): Now static.
17396
8f5201ae
PE
17397 * composite.c (composition_compute_stop_pos): Rename local to
17398 avoid shadowing.
b246f932
PE
17399 (composition_reseat_it): Remove unused locals.
17400 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 17401 (composition_update_it): Mark var as initialized.
11b61122
PE
17402 (find_automatic_composition): Mark vars as initialized,
17403 with a FIXME (Bug#8290).
8f5201ae 17404
760fbc2c
PE
17405 character.h: Rename locals to avoid shadowing.
17406 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
17407 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
17408 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
17409 (BUF_DEC_POS): Be more systematic about renaming local temporaries
17410 to avoid shadowing.
17411
ff08eb85
PE
17412 * textprop.c (property_change_between_p): Remove; unused.
17413
fc7bf025
PE
17414 * intervals.c (interval_start_pos): Now static.
17415
235d7abc
PE
17416 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
17417
44f230aa
SM
17418 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
17419 Rename locals to avoid shadowing.
3e7d6594 17420
50060332
PE
17421 * sound.c (wav_play, au_play, Fplay_sound_internal):
17422 Fix pointer signedness.
d01f234b 17423 (alsa_choose_format): Remove unused local var.
c83b8872
PE
17424 (wav_play): Initialize a variable to 0, to prevent undefined
17425 behavior (Bug#8278).
50060332 17426
c4fc4e30
PE
17427 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
17428
918436ed
PE
17429 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
17430
c939f91b
PE
17431 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
17432 clobbering (Bug#8298).
b9c7f648
PE
17433 * sysdep.c (sys_subshell): Likewise.
17434 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 17435
6bd8c144
PE
17436 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
17437 This should get cleaned up, so that child_setup has the
17438 same signature on all platforms.
17439
7710357c 17440 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 17441 (relocate_fd): Rename locals to avoid shadowing.
7710357c 17442
c59da222
CY
174432011-03-22 Chong Yidong <cyd@stupidchicken.com>
17444
17445 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
17446 not to be necessary, and produces flickering.
17447
66b87493
GM
174482011-03-20 Glenn Morris <rgm@gnu.org>
17449
17450 * config.in: Remove file.
17451
45b6f6d5
JB
174522011-03-20 Juanma Barranquero <lekktu@gmail.com>
17453
17454 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
17455 are now in src/globals.h.
17456 (syms_of_minibuf): Remove spurious & from previous change.
17457
cd394be1 174582011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
17459
17460 * minibuf.c (completing-read-function): New variable.
17461 (completing-read-default): Rename from completing-read.
17462 (completing-read): Call completing-read-function.
17463
b14e3e21
CY
174642011-03-19 Juanma Barranquero <lekktu@gmail.com>
17465
17466 * xfaces.c (Fx_load_color_file):
17467 Read color file from absolute filename (bug#8250).
17468
f2b726e6
JB
174692011-03-19 Juanma Barranquero <lekktu@gmail.com>
17470
17471 * makefile.w32-in: Update dependencies.
17472
09f6ff02
EZ
174732011-03-17 Eli Zaretskii <eliz@gnu.org>
17474
17475 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
17476
29a6015a
PE
174772011-03-17 Paul Eggert <eggert@cs.ucla.edu>
17478
a3a6c54e
PE
17479 Fix more problems found by GCC 4.5.2's static checks.
17480
b766f867
PE
17481 * process.c (make_serial_process_unwind, send_process_trap):
17482 (sigchld_handler): Now static.
17483
be02381c
PE
17484 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
17485 That way, the code declares only the vars that it needs.
17486 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
17487 * s/cygwin.h (PTY_ITERATION): Likewise.
17488 * s/darwin.h (PTY_ITERATION): Likewise.
17489 * s/gnu-linux.h (PTY_ITERATION): Likewise.
17490
57048744
PE
17491 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
17492 * process.c (allocate_pty): Don't declare stb unless it's needed.
17493
7914961c 17494 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
17495 (CONSTANTLIM): Remove; unused.
17496 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
17497 Define only if needed.
7914961c 17498
b3967b18
PE
17499 * unexelf.c (unexec): Name an expression,
17500 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
17501 Use a different way to cause a compilation error if anyone uses
17502 n rather than nn, a way that does not involve shadowing.
73366a00 17503 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 17504
29a6015a
PE
17505 * deps.mk (unexalpha.o): Remove; unused.
17506
43cfc33e 17507 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 17508 * unexec.h: New file.
ce701a33
PE
17509 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
17510 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
17511 Depend on unexec.h.
17512 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
17513 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
17514 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 17515 Change as necessary to match prototype in unexec.h.
ce701a33 17516
01f44d5a
PE
17517 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
17518 shadowing.
4f63c6bb 17519 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 17520
a6670b0b
PE
17521 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
17522 Rename locals to avoid shadowing.
17523
cef2010d 17524 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 17525 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 17526
d4d7173a
PE
17527 * print.c (Fredirect_debugging_output): Fix pointer signedess.
17528
f08b802a
PE
17529 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
17530 warning when compiling print.c.
17531
3ddb0639
PE
17532 * font.c (font_unparse_fcname): Abort in an "impossible" situation
17533 instead of using an uninitialized var.
5ad03b97 17534 (font_sort_entities): Mark var as initialized.
3ddb0639 17535
170a2692
PE
17536 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
17537
e663c700
PE
17538 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
17539 pointers to constants.
89bc529a 17540 (font_parse_fcname): Remove unused vars.
7b81e2d0 17541 (font_delete_unmatched): Now static.
ea838e10 17542 (font_get_spec): Remove; unused.
13a547c6
PE
17543 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
17544 (font_update_drivers, Ffont_get_glyphs, font_add_log):
17545 Rename or move locals to avoid shadowing.
e663c700 17546
2a80c887 17547 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 17548 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 17549
1384fa33 17550 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 17551 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 17552
8b2c52e9
PE
17553 * alloc.c (mark_backtrace): Move decl from here ...
17554 * lisp.h: ... to here, so that it can be checked.
17555
475545b5 17556 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 17557 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
17558 (lisp_indirect_variable): Name an expression,
17559 to avoid gcc -Wbad-function-cast warning.
1faed8ae 17560 (Fdefvar): Rename locals to avoid shadowing.
475545b5 17561
b1349114 17562 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 17563 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 17564 Use const pointer when appropriate.
b1349114 17565
a2928364
PE
17566 * lisp.h (get_system_name, get_operating_system_release):
17567 Move decls here, to check interfaces.
17568 * process.c (get_operating_system_release): Move decl to lisp.h.
17569 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
17570 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
17571 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
17572 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
17573 (Fformat_time_string, Fencode_time, Finsert_char):
17574 (Ftranslate_region_internal, Fformat):
17575 Rename or remove local vars to avoid shadowing.
9710023e 17576 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 17577
a415e694
PE
17578 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
17579 avoid shadowing.
17580
8ef4622d
PE
17581 * lisp.h (eassert): Check that the argument compiles, even if
17582 ENABLE_CHECKING is not defined.
17583
946f9a5b
PE
17584 * data.c (Findirect_variable): Name an expression, to avoid
17585 gcc -Wbad-function-cast warning.
112396d6 17586 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 17587 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
17588 (Fmake_variable_buffer_local, Fmake_local_variable):
17589 Mark variables as initialized.
52746918 17590 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 17591
e5aab7e7 17592 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
17593 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
17594 Rename locals to avoid shadowing.
dff45157
PE
17595 (mark_stack): Move local variables into the #ifdef region where
17596 they're used.
7bc26fdb
PE
17597 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
17598 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
17599 needed otherwise.
17600 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
17601 (GC_STRING_CHARS): Remove; not used.
d40d4be1 17602 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 17603
e5aab7e7
PE
17604 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
17605 avoids undefined behavior in theory.
17606
4da60324
PE
17607 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
17608
88043301
PE
17609 Use functions, not macros, for up- and down-casing (Bug#8254).
17610 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17611 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
17612 to use the following functions instead of these macros.
17613 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
17614 EMACS_INT, since callers assume the returned value fits in int.
17615 (upcase1): Likewise, for UPCASE_TABLE.
17616 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 17617 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 17618 the race-condition problem in the old DOWNCASE.
88043301 17619
19ed5445
PE
17620 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
17621 Rename locals to avoid shadowing.
17622 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
17623 (regex_compile, re_search_2, re_match_2_internal):
17624 Remove unused local vars.
952db0d7
PE
17625 (FREE_VAR): Rewrite so as not to use empty "else",
17626 which gcc can warn about.
da053e48 17627 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
17628 (RETALLOC_IF): Define only if needed.
17629 (WORDCHAR_P): Likewise. This one is never needed, but is used
17630 only in a comment talking about a compiler bug, so put inside
17631 the #if 0 of that comment.
17632 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
17633 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
17634 Remove; unused.
19ed5445 17635
1f3561e4 17636 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
17637 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
17638 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 17639
ded6f8f7
PE
17640 * search.c (simple_search): Remove unused var.
17641
dbd37a95
PE
17642 * dired.c (compile_pattern): Move decl from here ...
17643 * lisp.h: ... to here, so that it can be checked.
17644 (struct re_registers): New forward decl.
17645
7e47afad
PE
17646 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
17647
85f24f61
PE
17648 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
17649 All uses changed.
17650 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
17651 Rename locals to avoid shadowing.
5671df8f 17652 (Fvertical_motion): Mark locals as initialized.
85f24f61 17653
181aa2be 17654 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 17655 (casify_region): Mark local as initialized.
181aa2be 17656
930d429c
PE
17657 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
17658
7082eac6
PE
17659 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
17660 New macros, so that the caller can use some names other than
17661 gcpro1, gcpro2, etc.
17662 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
17663 of the new macros.
17664 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
17665 argument, for consistency with GCPRO2_VAR, etc: it is now the
17666 prefix of the variable, not the variable itself. All uses
17667 changed.
38b2c076
PE
17668 * dired.c (directory_files_internal, file_name_completion):
17669 Rename locals to avoid shadowing.
17670
15206ed9
PE
17671 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
17672 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
17673 dired.c's scmp function, had undefined behavior.
17674 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
17675 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
17676 * buffer.h: ... to here, because these macros use current_buffer,
17677 and the new implementation with inline functions needs to have
17678 current_buffer in scope now, rather than later when the macros
17679 are used.
17680 (downcase, upcase1): New static inline functions.
17681 (DOWNCASE, UPCASE1): Reimplement using these functions.
17682 This avoids undefined behavior in expressions like
17683 DOWNCASE (x) == DOWNCASE (y), which previously suffered
17684 from race conditions in accessing the global variables
17685 case_temp1 and case_temp2.
17686 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
17687 * lisp.h (case_temp1, case_temp2): Remove their decls.
17688 * character.h (ASCII_CHAR_P): Move from here ...
17689 * lisp.h: ... to here, so that the inline functions mentioned
17690 above can use them.
17691
4a6bea26
PE
17692 * dired.c (directory_files_internal_unwind): Now static.
17693
f14b7e14
PE
17694 * fileio.c (file_name_as_directory, directory_file_name):
17695 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
17696 Now static.
2893f146
PE
17697 (file_name_as_directory): Use const pointers when appropriate.
17698 (Fexpand_file_name): Likewise. In particular, newdir might
17699 point at constant storage, so make it a const pointer.
fd4ead52 17700 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
17701 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
17702 signedness issues.
f839df0c
PE
17703 (Fset_file_times, Finsert_file_contents, auto_save_error):
17704 Rename locals to avoid shadowing.
f14b7e14 17705
5716756e 17706 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
17707 (Ftry_completion, Fall_completions): Rename or remove locals
17708 to avoid shadowing.
5716756e 17709
b4c3046a
PE
17710 * marker.c (bytepos_to_charpos): Remove; unused.
17711
b45db522
PE
17712 * lisp.h (verify_bytepos, count_markers): New decls,
17713 so that gcc does not warn that these functions aren't declared.
17714
85876d07
PE
17715 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
17716 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 17717 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 17718 (copy_text): Remove unused local var.
85876d07 17719
03d78a21 17720 * filelock.c (within_one_second): Now static.
b3dd38ab 17721 (lock_file_1): Rename local to avoid shadowing.
03d78a21 17722
5df8f01b
PE
17723 * buffer.c (fix_overlays_before): Mark locals as initialized.
17724 (fix_start_end_in_overlays): Likewise. This function should be
17725 simplified by using pointers-to-pointers, but that's a different
17726 matter.
b1d876f1 17727 (switch_to_buffer_1): Now static.
8f54f30a
PE
17728 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17729 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 17730
a70072c9 17731 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 17732 Fix pointer signedness issue.
edced198
PE
17733 (sys_subshell): Mark local as volatile if checking for lint,
17734 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 17735 (MAXPATHLEN): Define only if needed.
a70072c9 17736
a0977c44
PE
17737 * process.c (serial_open, serial_configure): Move decls from here ...
17738 * systty.h: ... to here, so that they can be checked.
17739
a884fdcc
PE
17740 * fns.c (get_random, seed_random): Move extern decls from here ...
17741 * lisp.h: ... to here, so that they can be checked.
17742
604efe86 17743 * sysdep.c (reset_io): Now static.
b8950c94 17744 (wait_for_termination_signal): Remove; unused.
604efe86 17745
38fc62d9
PE
17746 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17747 (copy_keymap_item, append_key, push_text_char_description):
17748 Now static.
1004a21a 17749 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 17750 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
17751 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17752 (describe_map_tree):
17753 Rename locals to avoid shadowing.
38fc62d9 17754
2f2650da
PE
17755 * keyboard.c: Declare functions static if they are not used elsewhere.
17756 (echo_char, echo_dash, cmd_error, top_level_2):
17757 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
17758 (read_char, kbd_buffer_get_event, make_lispy_position):
17759 (make_lispy_event, make_lispy_movement, apply_modifiers):
17760 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17761 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17762 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 17763 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 17764 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 17765
a053e86c 17766 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
17767 (mark_kboards): Move decl here ...
17768 * alloc.c (mark_kboards): ... from here.
a053e86c 17769
4752793e
PE
17770 * lisp.h (force_auto_save_soon): New decl.
17771
74f10ca7 17772 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
17773 (DEFINE_DUMMY_FUNCTION): New macro.
17774 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17775 Use it.
c03cd23f
PE
17776 (main): Add casts to avoid warnings
17777 if GCC considers string literals to be constants.
74f10ca7 17778
022e70d4
PE
17779 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17780
59d6fe83
PE
17781 * dbusbind.c: Pointer signedness fixes.
17782 (xd_signature, xd_append_arg, xd_initialize):
17783 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17784 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17785 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17786 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17787
78320123
PE
17788 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17789 if GCC considers string literals to be constants.
49cebcca 17790 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 17791
35ac2a97
SM
177922011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17793
fb103ca9
SM
17794 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17795 (print_preprocess, print_object): New macro to fix last change.
17796
35ac2a97
SM
17797 * print.c (print_preprocess): Don't forget font objects.
17798
62973b41
JB
177992011-03-16 Juanma Barranquero <lekktu@gmail.com>
17800
17801 * emacs.c (USAGE3): Doc fixes.
17802
0e48bb22
AS
178032011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17804
17805 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17806 structure.
17807
7684e57b
JB
178082011-03-14 Juanma Barranquero <lekktu@gmail.com>
17809
17810 * lisp.h (VWindow_system, Qfile_name_history):
17811 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17812 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17813 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17814
17815 * w32select.c: Don't #include "keyboard.h".
c96bbc66 17816 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
17817
17818 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17819 * w32console.c (detect_input_pending, read_input_pending)
17820 (encode_terminal_code):
17821 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17822 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17823 (w32_system_caret_y, Qfile_name_history):
17824 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17825 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17826 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17827 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17828 * w32proc.c (Qlocal, report_file_error):
17829 * w32term.c (Vwindow_system, updating_frame):
17830 * w32uniscribe.c (initialized, uniscribe_font_driver):
17831 Remove unneeded extern declarations.
17832
2aa46d6c
CY
178332011-03-14 Chong Yidong <cyd@stupidchicken.com>
17834
c96bbc66 17835 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 17836
cffc6f3b
CY
178372011-03-13 Chong Yidong <cyd@stupidchicken.com>
17838
17839 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17840 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17841 These macros can no longer be used for assignment.
17842
44f230aa
SM
17843 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17844 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
17845 (record_buffer_markers, fetch_buffer_markers): New functions for
17846 recording and fetching special buffer markers.
17847 (set_buffer_internal_1, set_buffer_temp): Use them.
17848
17849 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17850
17851 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17852
17853 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17854 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17855
17856 * xdisp.c (hscroll_window_tree):
17857 (reconsider_clip_changes): Use PT instead of BUF_PT.
17858
d251f04b
EZ
178592011-03-13 Eli Zaretskii <eliz@gnu.org>
17860
17861 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17862 $(EMACS_ROOT)/lib/intprops.h.
17863
f0c77cd1
PE
178642011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17865
3eca4629
PE
17866 Fix more problems found by GCC 4.5.2's static checks.
17867
7c86ee98
PE
17868 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17869 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
17870 (xg_free_frame_widgets): Make it clear that a local variable is
17871 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
17872 (gdk_window_get_screen): Make it clear that this macro is needed
17873 only if USE_GTK_TOOLTIP.
1e5524e7
PE
17874 (int_gtk_range_get_value): New function, which avoids a diagnostic
17875 from gcc -Wbad-function-cast.
17876 (xg_set_toolkit_scroll_bar_thumb): Use it.
17877 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17878 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
17879 (get_utf8_string, xg_get_file_with_chooser):
17880 Rename locals to avoid shadowing.
17881 (create_dialog): Move locals to avoid shadowing.
7c86ee98 17882
41729b81
PE
17883 * xgselect.c (xg_select): Remove unused var.
17884
f0c77cd1
PE
17885 * image.c (four_corners_best): Mark locals as initialized.
17886 (gif_load): Initialize transparent_p to zero (Bug#8238).
17887 Mark another local as initialized.
ec6cf4c6 17888 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 17889
ce0ad53d 17890 * image.c (clear_image_cache): Now static.
d5d5a617 17891 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 17892 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
17893 (x_edge_detection): Remove unnecessary cast that
17894 gcc -Wbad-function-cast diagnoses.
2037898d 17895 (gif_load): Fix pointer signedness.
6ae141d6
PE
17896 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17897 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 17898
33383987 178992011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 17900
d32df629
PE
17901 Improve quality of tests for time stamp overflow.
17902 For example, without this patch (encode-time 0 0 0 1 1
17903 1152921504606846976) returns the obviously-bogus value (-948597
17904 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17905 reports time overflow. See
17906 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
17907 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17908 * editfns.c: Include limits.h and intprops.h.
17909 (TIME_T_MIN, TIME_T_MAX): New macros.
17910 (time_overflow): Move earlier, to before first use.
17911 (hi_time, lo_time): New functions, for an accurate test for
17912 out-of-range times.
17913 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17914 (Fget_internal_run_time): Don't assume time_t fits in int.
17915 (make_time): Use list2 instead of Fcons twice.
17916 (Fdecode_time): More accurate test for out-of-range times.
17917 (check_tm_member): New function.
17918 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
17919 (lisp_time_argument): Don't rely on undefined left-shift and
17920 right-shift behavior when checking for time stamp overflow.
8be6f318 17921
fe31d94c
PE
17922 * editfns.c (time_overflow): New function, refactoring common code.
17923 (Fformat_time_string, Fdecode_time, Fencode_time):
17924 (Fcurrent_time_string): Use it.
17925
8be6f318
PE
17926 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17927 * dired.c (make_time): Move to ...
17928 * editfns.c (make_time): ... here.
17929 * systime.h: Note the move.
17930
09d9db2c 179312011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 17932
126bc0dc
YM
17933 * fringe.c (update_window_fringes): Remove unused variables.
17934
c47cbdfd
YM
17935 * unexmacosx.c (copy_data_segment): Also copy __got section.
17936 (Bug#8223)
17937
7ac80be9
EZ
179382011-03-12 Eli Zaretskii <eliz@gnu.org>
17939
c96bbc66 17940 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
17941 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17942 Constify `char *' arguments and their references according to
17943 prototypes in tparam.h.
17944
ecb0f94d 17945 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 17946
7ac80be9
EZ
17947 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17948 Adapt all references accordingly.
17949
17950 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17951
ef1fd07e
TT
179522011-03-11 Tom Tromey <tromey@redhat.com>
17953
17954 * buffer.c (syms_of_buffer): Remove obsolete comment.
17955
7ef4b50c
EZ
179562011-03-11 Eli Zaretskii <eliz@gnu.org>
17957
17958 * termhooks.h (encode_terminal_code): Declare prototype.
17959
17960 * msdos.c (encode_terminal_code): Don't declare prototype.
17961
17962 * term.c (encode_terminal_code): Now external again, used by
17963 w32console.c and msdos.c.
17964
44f230aa
SM
17965 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17966 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 17967
4b1ec863 179682011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 17969
1714f52b 17970 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 17971
4b1ec863
PE
17972 * fringe.c (update_window_fringes): Mark locals as initialized
17973 (Bug#8227).
17974 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 17975
524c7aa6
PE
17976 * alloc.c (mark_fringe_data): Move decl from here ...
17977 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17978 to check its interface.
17979 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17980
a5c0af81 17981 * fontset.c (free_realized_fontset): Now static.
7519b8cd 17982 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 17983 (fontset_font): Mark local as initialized.
a9a06e0b 17984 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 17985
b4716021
PE
17986 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17987
811e9bac 17988 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 17989 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
17990 (x_own_selection, Fx_disown_selection_internal): Rename locals
17991 to avoid shadowing.
17992 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 17993
7e3ab302
PE
17994 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17995 so that the caller can use some name other than gcpro1.
17996 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
17997 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17998 (Fx_backspace_delete_keys_p):
17999 Use them to avoid shadowing, and rename vars to avoid shadowing.
18000 (x_decode_color, x_set_name, x_window): Now static.
6b437900 18001 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 18002 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
18003 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18004 Remove unused locals.
7e3ab302
PE
18005 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18006 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18007 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18008 macros.
f78faa98 18009
e2b13473
PE
18010 * xterm.h (x_mouse_leave): New decl.
18011
77f23912
PE
18012 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18013 Remove unused functions.
cdf4ba58
PE
18014 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18015 (x_calc_absolute_position): Now static.
7411c686 18016 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 18017 Don't declare local "event" unless it's used.
ed7bf3a5
PE
18018 (x_iconify_frame, x_free_frame_resources): Don't declare locals
18019 unless they are used.
38d0b34a
PE
18020 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
18021 (x_fatal_error_signal): Remove; not used.
a6067996
PE
18022 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
18023 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
18024 (x_error_catcher, x_connection_closed, x_error_handler):
18025 (x_error_quitter, xembed_send_message, x_iconify_frame):
18026 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 18027 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 18028 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 18029
44f230aa
SM
18030 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
18031 Rename or move locals to avoid shadowing.
6b463e58 18032 (tty_defined_color, merge_face_heights): Now static.
5967d051 18033 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
18034 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
18035 does not deduce is never used uninitialized.
73719eba
PE
18036 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
18037 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 18038
426994c3 18039 * terminal.c (store_terminal_param): Now static.
5489860b 18040
032f1620 18041 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 18042 (set_frame_menubar): Remove unused local.
d4323972 18043 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
18044 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
18045 since they might point to immutable storage.
281585b0
PE
18046 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
18047 since it's unused otherwise.
032f1620 18048
367c19e5 18049 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 18050 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
18051 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
18052 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 18053 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
18054 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
18055 does not deduce are never used uninitialized.
70739cbe 18056
07b48fa9
PE
18057 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
18058
8868a238 18059 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
18060 * window.c (window_loop, size_window):
18061 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 18062
7e5cf297 18063 * window.c (display_buffer): Now static.
d6550a9f
PE
18064 (size_window): Mark variables that gcc -Wuninitialized
18065 does not deduce are never used uninitialized.
a586633d
PE
18066 * window.h (check_all_windows): New decl, to forestall
18067 gcc -Wmissing-prototypes diagnostic.
5b555da1 18068 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 18069
f6095868
PE
18070 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
18071 shadowing.
18072 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
18073 Include <limits.h>.
18074 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
18075 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
18076 (load_charset_map): Mark variables that gcc -Wuninitialized
18077 does not deduce are never used uninitialized.
53df7c11 18078 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 18079
f38b440c
PE
18080 * coding.c (coding_set_source, coding_set_destination):
18081 Use "else { /* comment */ }" rather than "else /* comment */;"
18082 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
18083 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
18084 a block, when the outer 'i' will do.
18085 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
18086 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
18087 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
18088 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
18089 (Fdecode_sjis_char, Fdefine_coding_system_internal):
18090 Rename locals to avoid shadowing.
18091 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
18092 * coding.c (emacs_mule_char, encode_invocation_designation):
18093 Now static, since they're not used elsewhere.
413bb2db 18094 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 18095 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
18096 (decode_coding_emacs_mule): Mark variables that gcc
18097 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
18098 (detect_coding_iso_2022): Initialize a local variable that might
18099 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 18100 this initialization is needed. (Bug#8211)
5f58e762
PE
18101 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
18102 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
18103 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
18104 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
18105 Remove unused macros.
f38b440c 18106
232b38b9 18107 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 18108 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 18109 * character.c (string_count_byte8): Likewise.
232b38b9 18110
fb90da1b
PE
18111 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
18112 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
18113
fb93dbc2
PE
18114 * chartab.c (copy_sub_char_table): Now static, since it's not used
18115 elsewhere.
5c156ace
PE
18116 (sub_char_table_ref_and_range, char_table_ref_and_range):
18117 Rename locals to avoid shadowing.
bbcd0949 18118 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 18119
7d3b3862 18120 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 18121 (BIDI_BOB): Remove unused macro.
7d3b3862 18122
6be7d3da
PE
18123 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
18124 deduce are never used uninitialized.
c2ed9c8b 18125 * term.c (encode_terminal_code): Likewise.
6be7d3da 18126
75f8807f 18127 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 18128
50938595
PE
18129 * tparam.h: New file.
18130 * term.c, tparam.h: Include it.
18131 * deps.mk (term.o, tparam.o): Depend on tparam.h.
18132 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
18133 Move these decls to tparam.h, and make them agree with what
18134 is actually in tparam.c. The previous trick of using incompatible
18135 decls in different modules does not conform to the C standard.
18136 All callers of tparam changed to use tparam's actual API.
18137 * tparam.c (tparam1, tparam, tgoto):
18138 Use const pointers where appropriate.
18139
fbceeba2
PE
18140 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
18141 * cm.h (struct cm): Likewise.
18142 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
18143 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
18144 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
18145 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
18146 (turn_on_face, init_tty): Likewise.
18147 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 18148
7f3f1250
PE
18149 * term.c (term_mouse_position): Rename local to avoid shadowing.
18150
e6ca6543
PE
18151 * alloc.c (mark_ttys): Move decl from here ...
18152 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
18153
c40f8d15
AS
181542011-03-11 Andreas Schwab <schwab@linux-m68k.org>
18155
18156 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
18157
cfe0661d
JB
181582011-03-09 Juanma Barranquero <lekktu@gmail.com>
18159
18160 * search.c (compile_pattern_1): Remove argument regp, unused since
18161 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
18162 (compile_pattern): Don't pass it.
18163
0afb4571
J
181642011-03-08 Jan Djärv <jan.h.d@swipnet.se>
18165
18166 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
18167 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
18168 for ! HAVE_GTK3.
18169 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
18170
18171 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
18172
18173 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
18174 gdk_window_get_screen, gdk_window_get_geometry,
18175 gdk_x11_window_lookup_for_display and GDK_KEY_g.
18176 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
18177 (xg_get_pixbuf_from_pixmap): New function.
18178 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
18179 to Pixmap, take frame as parameter, remove GdkColormap parameter.
18180 Call xg_get_pixbuf_from_pixmap instead of
18181 gdk_pixbuf_get_from_drawable.
18182 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
18183 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
18184 (xg_check_special_colors): Use GtkStyleContext and its functions
18185 for HAVE_GTK3.
18186 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
18187 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
18188 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
18189 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
18190 Call gtk_widget_get_preferred_size.
0afb4571
J
18191 (xg_frame_resized): gdk_window_get_geometry only takes 5
18192 parameters.
44f230aa
SM
18193 (xg_win_to_widget, xg_event_is_for_menubar):
18194 Call gdk_x11_window_lookup_for_display.
0afb4571
J
18195 (xg_set_widget_bg): New function.
18196 (delete_cb): New function.
895009e1 18197 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 18198 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
18199 (xg_set_background_color): Call xg_set_widget_bg.
18200 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
18201 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
18202 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
18203 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
18204 if ! HAVE_GTK3.
18205 (update_frame_tool_bar): Call gtk_widget_hide.
18206 (xg_initialize): Use GDK_KEY_g.
18207
18208 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
18209 if ! HAVE_GTK3
18210 (x_session_initialize): Call gdk_x11_set_sm_client_id.
18211
18212 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
18213 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
18214 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
18215
1c2cc4ef
JB
182162011-03-08 Juanma Barranquero <lekktu@gmail.com>
18217
18218 * w32xfns.c (select_palette): Check success of RealizePalette against
18219 GDI_ERROR, not zero.
18220
33383987 18221See ChangeLog.11 for earlier changes.
aac0c6e3
MR
18222
18223;; Local Variables:
18224;; coding: utf-8
aac0c6e3
MR
18225;; End:
18226
2f097256 18227 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
18228
18229 This file is part of GNU Emacs.
18230
18231 GNU Emacs is free software: you can redistribute it and/or modify
18232 it under the terms of the GNU General Public License as published by
18233 the Free Software Foundation, either version 3 of the License, or
18234 (at your option) any later version.
18235
18236 GNU Emacs is distributed in the hope that it will be useful,
18237 but WITHOUT ANY WARRANTY; without even the implied warranty of
18238 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18239 GNU General Public License for more details.
18240
18241 You should have received a copy of the GNU General Public License
18242 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.